diff --git a/api-list.json b/api-list.json index 0929a1d2df6..78974c5999c 100644 --- a/api-list.json +++ b/api-list.json @@ -4116,6 +4116,156 @@ "documentationLink": "https://cloud.google.com/memorystore/", "preferred": true }, + { + "kind": "discovery#directoryItem", + "id": "merchantapi:accounts_v1beta", + "name": "merchantapi", + "version": "accounts_v1beta", + "title": "Merchant API", + "description": "Programmatically manage your Merchant Center Accounts.", + "discoveryRestUrl": "https://merchantapi.googleapis.com/$discovery/rest?version=accounts_v1beta", + "icons": { + "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.devsite.corp.google.com/merchant/api", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "merchantapi:conversions_v1beta", + "name": "merchantapi", + "version": "conversions_v1beta", + "title": "Merchant API", + "description": "Programmatically manage your Merchant Center Accounts.", + "discoveryRestUrl": "https://merchantapi.googleapis.com/$discovery/rest?version=conversions_v1beta", + "icons": { + "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.devsite.corp.google.com/merchant/api", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "merchantapi:datasources_v1beta", + "name": "merchantapi", + "version": "datasources_v1beta", + "title": "Merchant API", + "description": "Programmatically manage your Merchant Center Accounts.", + "discoveryRestUrl": "https://merchantapi.googleapis.com/$discovery/rest?version=datasources_v1beta", + "icons": { + "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.devsite.corp.google.com/merchant/api", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "merchantapi:inventories_v1beta", + "name": "merchantapi", + "version": "inventories_v1beta", + "title": "Merchant API", + "description": "Programmatically manage your Merchant Center Accounts.", + "discoveryRestUrl": "https://merchantapi.googleapis.com/$discovery/rest?version=inventories_v1beta", + "icons": { + "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.devsite.corp.google.com/merchant/api", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "merchantapi:lfp_v1beta", + "name": "merchantapi", + "version": "lfp_v1beta", + "title": "Merchant API", + "description": "Programmatically manage your Merchant Center Accounts.", + "discoveryRestUrl": "https://merchantapi.googleapis.com/$discovery/rest?version=lfp_v1beta", + "icons": { + "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.devsite.corp.google.com/merchant/api", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "merchantapi:notifications_v1beta", + "name": "merchantapi", + "version": "notifications_v1beta", + "title": "Merchant API", + "description": "Programmatically manage your Merchant Center Accounts.", + "discoveryRestUrl": "https://merchantapi.googleapis.com/$discovery/rest?version=notifications_v1beta", + "icons": { + "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.devsite.corp.google.com/merchant/api", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "merchantapi:products_v1beta", + "name": "merchantapi", + "version": "products_v1beta", + "title": "Merchant API", + "description": "Programmatically manage your Merchant Center Accounts.", + "discoveryRestUrl": "https://merchantapi.googleapis.com/$discovery/rest?version=products_v1beta", + "icons": { + "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.devsite.corp.google.com/merchant/api", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "merchantapi:promotions_v1beta", + "name": "merchantapi", + "version": "promotions_v1beta", + "title": "Merchant API", + "description": "Programmatically manage your Merchant Center Accounts.", + "discoveryRestUrl": "https://merchantapi.googleapis.com/$discovery/rest?version=promotions_v1beta", + "icons": { + "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.devsite.corp.google.com/merchant/api", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "merchantapi:quota_v1beta", + "name": "merchantapi", + "version": "quota_v1beta", + "title": "Merchant API", + "description": "Programmatically manage your Merchant Center Accounts.", + "discoveryRestUrl": "https://merchantapi.googleapis.com/$discovery/rest?version=quota_v1beta", + "icons": { + "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.devsite.corp.google.com/merchant/api", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "merchantapi:reports_v1beta", + "name": "merchantapi", + "version": "reports_v1beta", + "title": "Merchant API", + "description": "Programmatically manage your Merchant Center Accounts.", + "discoveryRestUrl": "https://merchantapi.googleapis.com/$discovery/rest?version=reports_v1beta", + "icons": { + "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.devsite.corp.google.com/merchant/api", + "preferred": true + }, { "kind": "discovery#directoryItem", "id": "metastore:v1alpha", diff --git a/bigtableadmin/v2/bigtableadmin-api.json b/bigtableadmin/v2/bigtableadmin-api.json index ec5feafd2f2..077a894686d 100644 --- a/bigtableadmin/v2/bigtableadmin-api.json +++ b/bigtableadmin/v2/bigtableadmin-api.json @@ -2194,7 +2194,7 @@ } } }, - "revision": "20240429", + "revision": "20240522", "rootUrl": "https://bigtableadmin.googleapis.com/", "schemas": { "AppProfile": { @@ -4103,7 +4103,7 @@ "type": "object" }, "Type": { - "description": "`Type` represents the type of data that is written to, read from, or stored in Bigtable. It is heavily based on the GoogleSQL standard to help maintain familiarity and consistency across products and features. For compatibility with Bigtable's existing untyped APIs, each `Type` includes an `Encoding` which describes how to convert to/from the underlying data. This might involve composing a series of steps into an \"encoding chain,\" for example to convert from INT64 -\u003e STRING -\u003e raw bytes. In most cases, a \"link\" in the encoding chain will be based an on existing GoogleSQL conversion function like `CAST`. Each link in the encoding chain also defines the following properties: * Natural sort: Does the encoded value sort consistently with the original typed value? Note that Bigtable will always sort data based on the raw encoded value, *not* the decoded type. - Example: STRING values sort in the same order as their UTF-8 encodings. - Counterexample: Encoding INT64 to a fixed-width STRING does *not* preserve sort order when dealing with negative numbers. INT64(1) \u003e INT64(-1), but STRING(\"-00001\") \u003e STRING(\"00001). - The overall encoding chain sorts naturally if *every* link does. * Self-delimiting: If we concatenate two encoded values, can we always tell where the first one ends and the second one begins? - Example: If we encode INT64s to fixed-width STRINGs, the first value will always contain exactly N digits, possibly preceded by a sign. - Counterexample: If we concatenate two UTF-8 encoded STRINGs, we have no way to tell where the first one ends. - The overall encoding chain is self-delimiting if *any* link is. * Compatibility: Which other systems have matching encoding schemes? For example, does this encoding have a GoogleSQL equivalent? HBase? Java?", + "description": "`Type` represents the type of data that is written to, read from, or stored in Bigtable. It is heavily based on the GoogleSQL standard to help maintain familiarity and consistency across products and features. For compatibility with Bigtable's existing untyped APIs, each `Type` includes an `Encoding` which describes how to convert to/from the underlying data. This might involve composing a series of steps into an \"encoding chain,\" for example to convert from INT64 -\u003e STRING -\u003e raw bytes. In most cases, a \"link\" in the encoding chain will be based an on existing GoogleSQL conversion function like `CAST`. Each link in the encoding chain also defines the following properties: * Natural sort: Does the encoded value sort consistently with the original typed value? Note that Bigtable will always sort data based on the raw encoded value, *not* the decoded type. - Example: BYTES values sort in the same order as their raw encodings. - Counterexample: Encoding INT64 to a fixed-width STRING does *not* preserve sort order when dealing with negative numbers. INT64(1) \u003e INT64(-1), but STRING(\"-00001\") \u003e STRING(\"00001). - The overall encoding chain has this property if *every* link does. * Self-delimiting: If we concatenate two encoded values, can we always tell where the first one ends and the second one begins? - Example: If we encode INT64s to fixed-width STRINGs, the first value will always contain exactly N digits, possibly preceded by a sign. - Counterexample: If we concatenate two UTF-8 encoded STRINGs, we have no way to tell where the first one ends. - The overall encoding chain has this property if *any* link does. * Compatibility: Which other systems have matching encoding schemes? For example, does this encoding have a GoogleSQL equivalent? HBase? Java?", "id": "Type", "properties": { "aggregateType": { diff --git a/bigtableadmin/v2/bigtableadmin-gen.go b/bigtableadmin/v2/bigtableadmin-gen.go index 4dc425568ce..0f8a68d37b1 100644 --- a/bigtableadmin/v2/bigtableadmin-gen.go +++ b/bigtableadmin/v2/bigtableadmin-gen.go @@ -3290,17 +3290,17 @@ func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) { // defines the following properties: * Natural sort: Does the encoded value // sort consistently with the original typed value? Note that Bigtable will // always sort data based on the raw encoded value, *not* the decoded type. - -// Example: STRING values sort in the same order as their UTF-8 encodings. - +// Example: BYTES values sort in the same order as their raw encodings. - // Counterexample: Encoding INT64 to a fixed-width STRING does *not* preserve // sort order when dealing with negative numbers. INT64(1) > INT64(-1), but -// STRING("-00001") > STRING("00001). - The overall encoding chain sorts -// naturally if *every* link does. * Self-delimiting: If we concatenate two +// STRING("-00001") > STRING("00001). - The overall encoding chain has this +// property if *every* link does. * Self-delimiting: If we concatenate two // encoded values, can we always tell where the first one ends and the second // one begins? - Example: If we encode INT64s to fixed-width STRINGs, the first // value will always contain exactly N digits, possibly preceded by a sign. - // Counterexample: If we concatenate two UTF-8 encoded STRINGs, we have no way -// to tell where the first one ends. - The overall encoding chain is -// self-delimiting if *any* link is. * Compatibility: Which other systems have +// to tell where the first one ends. - The overall encoding chain has this +// property if *any* link does. * Compatibility: Which other systems have // matching encoding schemes? For example, does this encoding have a GoogleSQL // equivalent? HBase? Java? type Type struct { diff --git a/binaryauthorization/v1/binaryauthorization-api.json b/binaryauthorization/v1/binaryauthorization-api.json index 0c2cd0d2078..3e4bc0b0bda 100644 --- a/binaryauthorization/v1/binaryauthorization-api.json +++ b/binaryauthorization/v1/binaryauthorization-api.json @@ -742,7 +742,7 @@ } } }, - "revision": "20240524", + "revision": "20240607", "rootUrl": "https://binaryauthorization.googleapis.com/", "schemas": { "AdmissionRule": { @@ -1342,7 +1342,7 @@ "id": "PkixPublicKey", "properties": { "keyId": { - "description": "Optional. The ID of this public key. Signatures verified by Binary Authorization must include the ID of the public key that can be used to verify them, and that ID must match the contents of this field exactly. This may be explicitly provided by the caller, but it MUST be a valid RFC3986 URI. If `key_id` is left blank and this `PkixPublicKey` is not used in the context of a wrapper (see next paragraph), a default key ID will be computed based on the digest of the DER encoding of the public key. If this `PkixPublicKey` is used in the context of a wrapper that has its own notion of key ID (e.g. `AttestorPublicKey`), then this field can either: * Match that value exactly. * Or be left blank, in which case it behaves exactly as though it is equal to that wrapper value.", + "description": "Optional. The ID of this public key. Signatures verified by Binary Authorization must include the ID of the public key that can be used to verify them. The ID must match exactly contents of the `key_id` field exactly. The ID may be explicitly provided by the caller, but it MUST be a valid RFC3986 URI. If `key_id` is left blank and this `PkixPublicKey` is not used in the context of a wrapper (see next paragraph), a default key ID will be computed based on the digest of the DER encoding of the public key. If this `PkixPublicKey` is used in the context of a wrapper that has its own notion of key ID (e.g. `AttestorPublicKey`), then this field can either match that value exactly, or be left blank, in which case it behaves exactly as though it is equal to that wrapper value.", "type": "string" }, "publicKeyPem": { diff --git a/binaryauthorization/v1/binaryauthorization-gen.go b/binaryauthorization/v1/binaryauthorization-gen.go index 93d5f9d99a2..24c93d0db03 100644 --- a/binaryauthorization/v1/binaryauthorization-gen.go +++ b/binaryauthorization/v1/binaryauthorization-gen.go @@ -1280,15 +1280,15 @@ func (s *ListPlatformPoliciesResponse) MarshalJSON() ([]byte, error) { type PkixPublicKey struct { // KeyId: Optional. The ID of this public key. Signatures verified by Binary // Authorization must include the ID of the public key that can be used to - // verify them, and that ID must match the contents of this field exactly. This - // may be explicitly provided by the caller, but it MUST be a valid RFC3986 - // URI. If `key_id` is left blank and this `PkixPublicKey` is not used in the - // context of a wrapper (see next paragraph), a default key ID will be computed - // based on the digest of the DER encoding of the public key. If this - // `PkixPublicKey` is used in the context of a wrapper that has its own notion - // of key ID (e.g. `AttestorPublicKey`), then this field can either: * Match - // that value exactly. * Or be left blank, in which case it behaves exactly as - // though it is equal to that wrapper value. + // verify them. The ID must match exactly contents of the `key_id` field + // exactly. The ID may be explicitly provided by the caller, but it MUST be a + // valid RFC3986 URI. If `key_id` is left blank and this `PkixPublicKey` is not + // used in the context of a wrapper (see next paragraph), a default key ID will + // be computed based on the digest of the DER encoding of the public key. If + // this `PkixPublicKey` is used in the context of a wrapper that has its own + // notion of key ID (e.g. `AttestorPublicKey`), then this field can either + // match that value exactly, or be left blank, in which case it behaves exactly + // as though it is equal to that wrapper value. KeyId string `json:"keyId,omitempty"` // PublicKeyPem: A PEM-encoded public key, as described in // https://tools.ietf.org/html/rfc7468#section-13 diff --git a/contactcenterinsights/v1/contactcenterinsights-api.json b/contactcenterinsights/v1/contactcenterinsights-api.json index 09e488c1392..9a36e5bc160 100644 --- a/contactcenterinsights/v1/contactcenterinsights-api.json +++ b/contactcenterinsights/v1/contactcenterinsights-api.json @@ -260,7 +260,7 @@ }, "create": { "deprecated": true, - "description": "Creates a conversation. DEPRECATED: Use UploadConversation instead. CreateConversation does not support audio transcription or DLP redaction.", + "description": "Creates a conversation. Does not support audio transcription or DLP redaction. Use `conversations.upload` instead.", "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/conversations", "httpMethod": "POST", "id": "contactcenterinsights.projects.locations.conversations.create", @@ -405,7 +405,7 @@ "type": "string" }, "orderBy": { - "description": "Optional. The attribute by which to order conversations in the response. If empty, conversations will be ordered by descending creation time. Supported values are one of the following: * create_time * customer_satisfaction_rating * duration * latest_analysis * start_time * turn_count The default sort order is ascending. To specify order, append `asc` or `desc`, i.e. `create_time desc`. See https://google.aip.dev/132#ordering for more details.", + "description": "Optional. The attribute by which to order conversations in the response. If empty, conversations will be ordered by descending creation time. Supported values are one of the following: * create_time * customer_satisfaction_rating * duration * latest_analysis * start_time * turn_count The default sort order is ascending. To specify order, append `asc` or `desc` (`create_time desc`). For more details, see [Google AIPs Ordering](https://google.aip.dev/132#ordering).", "location": "query", "type": "string" }, @@ -486,7 +486,7 @@ ] }, "upload": { - "description": "Create a longrunning conversation upload operation. This method differs from CreateConversation by allowing audio transcription and optional DLP redaction.", + "description": "Create a long-running conversation upload operation. This method differs from `CreateConversation` by allowing audio transcription and optional DLP redaction.", "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/conversations:upload", "httpMethod": "POST", "id": "contactcenterinsights.projects.locations.conversations.upload", @@ -790,7 +790,7 @@ ], "parameters": { "name": { - "description": "Required. The issue model to export", + "description": "Required. The issue model to export.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/issueModels/[^/]+$", "required": true, @@ -1474,7 +1474,7 @@ } } }, - "revision": "20240610", + "revision": "20240611", "rootUrl": "https://contactcenterinsights.googleapis.com/", "schemas": { "GoogleCloudContactcenterinsightsV1Analysis": { @@ -2866,10 +2866,10 @@ "properties": { "gcsDestination": { "$ref": "GoogleCloudContactcenterinsightsV1ExportIssueModelRequestGcsDestination", - "description": "Google Cloud Storage URI to export the Issue Model to." + "description": "Google Cloud Storage URI to export the issue model to." }, "name": { - "description": "Required. The issue model to export", + "description": "Required. The issue model to export.", "type": "string" } }, @@ -2974,7 +2974,7 @@ "id": "GoogleCloudContactcenterinsightsV1ImportIssueModelRequest", "properties": { "createNewModel": { - "description": "Optional. If set to true, will create a new issue model from the imported file with randomly generated IDs for the issue model and corresponding issues. Otherwise, replaces an existing model with the same ID as the file.", + "description": "Optional. If set to true, will create an issue model from the imported file with randomly generated IDs for the issue model and corresponding issues. Otherwise, replaces an existing model with the same ID as the file.", "type": "boolean" }, "gcsSource": { @@ -3094,7 +3094,7 @@ "description": "Optional. DLP settings for transcript redaction. Optional, will default to the config specified in Settings." }, "sampleSize": { - "description": "Optional. If set, this fields indicates the number of objects to ingest from the Cloud Storage bucket. If empty, the entire bucket will be ingested. Note that conversations produced via sampling will not be ingested by subsequent ingest requests unless they are first deleted.", + "description": "Optional. If set, this fields indicates the number of objects to ingest from the Cloud Storage bucket. If empty, the entire bucket will be ingested. Unless they are first deleted, conversations produced through sampling won't be ingested by subsequent ingest requests.", "format": "int32", "type": "integer" }, @@ -3119,7 +3119,7 @@ "type": "integer" }, "agentId": { - "description": "Optional. An opaque, user-specified string representing a human agent who handled all conversations in the import. Note that this will be overridden if per-conversation metadata is provided via the `metadata_bucket_uri`.", + "description": "Optional. An opaque, user-specified string representing a human agent who handled all conversations in the import. Note that this will be overridden if per-conversation metadata is provided through the `metadata_bucket_uri`.", "type": "string" }, "customerChannel": { @@ -3160,7 +3160,7 @@ "type": "array" }, "metadataBucketUri": { - "description": "Optional. The Cloud Storage path to the source object metadata. Note that: [1] metadata files are expected to be in JSON format [2] metadata and source objects must be in separate buckets [3] a source object's metadata object must share the same name to be properly ingested", + "description": "Optional. The Cloud Storage path to the conversation metadata. Note that: [1] Metadata files are expected to be in JSON format. [2] Metadata and source files (transcripts or audio) must be in separate buckets. [3] A source file and its corresponding metadata file must share the same name to be properly ingested, E.g. `gs://bucket/audio/conversation1.mp3` and `gs://bucket/metadata/conversation1.json`.", "type": "string" } }, @@ -3725,7 +3725,7 @@ "type": "object" }, "GoogleCloudContactcenterinsightsV1RedactionConfig": { - "description": "DLP resources used for redaction while ingesting conversations. DLP settings are applied to conversations ingested from the UploadConversation and IngestConversations endpoints, including conversation coming from CCAI Platform. They are not applied to conversations ingested from the CreateConversation endpoint or the Dialogflow / Agent Assist runtime integrations. When using Dialogflow / Agent Assist runtime integrations redaction should be performed in Dialogflow / Agent Assist.", + "description": "DLP resources used for redaction while ingesting conversations. DLP settings are applied to conversations ingested from the `UploadConversation` and `IngestConversations` endpoints, including conversation coming from CCAI Platform. They are not applied to conversations ingested from the `CreateConversation` endpoint or the Dialogflow / Agent Assist runtime integrations. When using Dialogflow / Agent Assist runtime integrations, redaction should be performed in Dialogflow / Agent Assist.", "id": "GoogleCloudContactcenterinsightsV1RedactionConfig", "properties": { "deidentifyTemplate": { @@ -3828,7 +3828,7 @@ "type": "object" }, "GoogleCloudContactcenterinsightsV1Settings": { - "description": "The settings resource.", + "description": "The CCAI Insights project wide settings. Use these settings to configure the behavior of Insights. View these settings with [`getsettings`](https://cloud.google.com/contact-center/insights/docs/reference/rest/v1/projects.locations/getSettings) and change the settings with [`updateSettings`](https://cloud.google.com/contact-center/insights/docs/reference/rest/v1/projects.locations/updateSettings).", "id": "GoogleCloudContactcenterinsightsV1Settings", "properties": { "analysisConfig": { @@ -3858,16 +3858,16 @@ "additionalProperties": { "type": "string" }, - "description": "A map that maps a notification trigger to a Pub/Sub topic. Each time a specified trigger occurs, Insights will notify the corresponding Pub/Sub topic. Keys are notification triggers. Supported keys are: * \"all-triggers\": Notify each time any of the supported triggers occurs. * \"create-analysis\": Notify each time an analysis is created. * \"create-conversation\": Notify each time a conversation is created. * \"export-insights-data\": Notify each time an export is complete. * \"ingest-conversations\": Notify each time an IngestConversations LRO completes. * \"update-conversation\": Notify each time a conversation is updated via UpdateConversation. * \"upload-conversation\": Notify when an UploadConversation LRO completes. Values are Pub/Sub topics. The format of each Pub/Sub topic is: projects/{project}/topics/{topic}", + "description": "A map that maps a notification trigger to a Pub/Sub topic. Each time a specified trigger occurs, Insights will notify the corresponding Pub/Sub topic. Keys are notification triggers. Supported keys are: * \"all-triggers\": Notify each time any of the supported triggers occurs. * \"create-analysis\": Notify each time an analysis is created. * \"create-conversation\": Notify each time a conversation is created. * \"export-insights-data\": Notify each time an export is complete. * \"ingest-conversations\": Notify each time an IngestConversations LRO is complete. * \"update-conversation\": Notify each time a conversation is updated via UpdateConversation. * \"upload-conversation\": Notify when an UploadConversation LRO is complete. Values are Pub/Sub topics. The format of each Pub/Sub topic is: projects/{project}/topics/{topic}", "type": "object" }, "redactionConfig": { "$ref": "GoogleCloudContactcenterinsightsV1RedactionConfig", - "description": "Default DLP redaction resources to be applied while ingesting conversations. This applies to conversations ingested from the UploadConversation and IngestConversations endpoints, including conversations coming from CCAI Platform." + "description": "Default DLP redaction resources to be applied while ingesting conversations. This applies to conversations ingested from the `UploadConversation` and `IngestConversations` endpoints, including conversations coming from CCAI Platform." }, "speechConfig": { "$ref": "GoogleCloudContactcenterinsightsV1SpeechConfig", - "description": "Optional. Default Speech-to-Text resources to be used while ingesting audio files. Optional, CCAI Insights will create a default if not provided. This applies to conversations ingested from the UploadConversation and IngestConversations endpoints, including conversations coming from CCAI Platform." + "description": "Optional. Default Speech-to-Text resources to use while ingesting audio files. Optional, CCAI Insights will create a default if not provided. This applies to conversations ingested from the `UploadConversation` and `IngestConversations` endpoints, including conversations coming from CCAI Platform." }, "updateTime": { "description": "Output only. The time at which the settings were last updated.", @@ -3960,7 +3960,7 @@ "type": "object" }, "GoogleCloudContactcenterinsightsV1SpeechConfig": { - "description": "Speech-to-Text configuration. Speech-to-Text settings are applied to conversations ingested from the UploadConversation and IngestConversations endpoints, including conversation coming from CCAI Platform. They are not applied to conversations ingested from the CreateConversation endpoint.", + "description": "Speech-to-Text configuration. Speech-to-Text settings are applied to conversations ingested from the `UploadConversation` and `IngestConversations` endpoints, including conversation coming from CCAI Platform. They are not applied to conversations ingested from the `CreateConversation` endpoint.", "id": "GoogleCloudContactcenterinsightsV1SpeechConfig", "properties": { "speechRecognizer": { @@ -4011,7 +4011,7 @@ "type": "object" }, "GoogleCloudContactcenterinsightsV1UploadConversationMetadata": { - "description": "The metadata for an UploadConversation operation.", + "description": "The metadata for an `UploadConversation` operation.", "id": "GoogleCloudContactcenterinsightsV1UploadConversationMetadata", "properties": { "analysisOperation": { @@ -5375,10 +5375,10 @@ "properties": { "gcsDestination": { "$ref": "GoogleCloudContactcenterinsightsV1alpha1ExportIssueModelRequestGcsDestination", - "description": "Google Cloud Storage URI to export the Issue Model to." + "description": "Google Cloud Storage URI to export the issue model to." }, "name": { - "description": "Required. The issue model to export", + "description": "Required. The issue model to export.", "type": "string" } }, @@ -5483,7 +5483,7 @@ "id": "GoogleCloudContactcenterinsightsV1alpha1ImportIssueModelRequest", "properties": { "createNewModel": { - "description": "Optional. If set to true, will create a new issue model from the imported file with randomly generated IDs for the issue model and corresponding issues. Otherwise, replaces an existing model with the same ID as the file.", + "description": "Optional. If set to true, will create an issue model from the imported file with randomly generated IDs for the issue model and corresponding issues. Otherwise, replaces an existing model with the same ID as the file.", "type": "boolean" }, "gcsSource": { @@ -5603,7 +5603,7 @@ "description": "Optional. DLP settings for transcript redaction. Optional, will default to the config specified in Settings." }, "sampleSize": { - "description": "Optional. If set, this fields indicates the number of objects to ingest from the Cloud Storage bucket. If empty, the entire bucket will be ingested. Note that conversations produced via sampling will not be ingested by subsequent ingest requests unless they are first deleted.", + "description": "Optional. If set, this fields indicates the number of objects to ingest from the Cloud Storage bucket. If empty, the entire bucket will be ingested. Unless they are first deleted, conversations produced through sampling won't be ingested by subsequent ingest requests.", "format": "int32", "type": "integer" }, @@ -5628,7 +5628,7 @@ "type": "integer" }, "agentId": { - "description": "Optional. An opaque, user-specified string representing a human agent who handled all conversations in the import. Note that this will be overridden if per-conversation metadata is provided via the `metadata_bucket_uri`.", + "description": "Optional. An opaque, user-specified string representing a human agent who handled all conversations in the import. Note that this will be overridden if per-conversation metadata is provided through the `metadata_bucket_uri`.", "type": "string" }, "customerChannel": { @@ -5669,7 +5669,7 @@ "type": "array" }, "metadataBucketUri": { - "description": "Optional. The Cloud Storage path to the source object metadata. Note that: [1] metadata files are expected to be in JSON format [2] metadata and source objects must be in separate buckets [3] a source object's metadata object must share the same name to be properly ingested", + "description": "Optional. The Cloud Storage path to the conversation metadata. Note that: [1] Metadata files are expected to be in JSON format. [2] Metadata and source files (transcripts or audio) must be in separate buckets. [3] A source file and its corresponding metadata file must share the same name to be properly ingested, E.g. `gs://bucket/audio/conversation1.mp3` and `gs://bucket/metadata/conversation1.json`.", "type": "string" } }, @@ -5956,7 +5956,7 @@ "type": "object" }, "GoogleCloudContactcenterinsightsV1alpha1RedactionConfig": { - "description": "DLP resources used for redaction while ingesting conversations. DLP settings are applied to conversations ingested from the UploadConversation and IngestConversations endpoints, including conversation coming from CCAI Platform. They are not applied to conversations ingested from the CreateConversation endpoint or the Dialogflow / Agent Assist runtime integrations. When using Dialogflow / Agent Assist runtime integrations redaction should be performed in Dialogflow / Agent Assist.", + "description": "DLP resources used for redaction while ingesting conversations. DLP settings are applied to conversations ingested from the `UploadConversation` and `IngestConversations` endpoints, including conversation coming from CCAI Platform. They are not applied to conversations ingested from the `CreateConversation` endpoint or the Dialogflow / Agent Assist runtime integrations. When using Dialogflow / Agent Assist runtime integrations, redaction should be performed in Dialogflow / Agent Assist.", "id": "GoogleCloudContactcenterinsightsV1alpha1RedactionConfig", "properties": { "deidentifyTemplate": { @@ -6119,7 +6119,7 @@ "type": "object" }, "GoogleCloudContactcenterinsightsV1alpha1SpeechConfig": { - "description": "Speech-to-Text configuration. Speech-to-Text settings are applied to conversations ingested from the UploadConversation and IngestConversations endpoints, including conversation coming from CCAI Platform. They are not applied to conversations ingested from the CreateConversation endpoint.", + "description": "Speech-to-Text configuration. Speech-to-Text settings are applied to conversations ingested from the `UploadConversation` and `IngestConversations` endpoints, including conversation coming from CCAI Platform. They are not applied to conversations ingested from the `CreateConversation` endpoint.", "id": "GoogleCloudContactcenterinsightsV1alpha1SpeechConfig", "properties": { "speechRecognizer": { @@ -6170,7 +6170,7 @@ "type": "object" }, "GoogleCloudContactcenterinsightsV1alpha1UploadConversationMetadata": { - "description": "The metadata for an UploadConversation operation.", + "description": "The metadata for an `UploadConversation` operation.", "id": "GoogleCloudContactcenterinsightsV1alpha1UploadConversationMetadata", "properties": { "analysisOperation": { diff --git a/contactcenterinsights/v1/contactcenterinsights-gen.go b/contactcenterinsights/v1/contactcenterinsights-gen.go index cfe6cd14ef5..29ceed420bd 100644 --- a/contactcenterinsights/v1/contactcenterinsights-gen.go +++ b/contactcenterinsights/v1/contactcenterinsights-gen.go @@ -1998,9 +1998,9 @@ func (s *GoogleCloudContactcenterinsightsV1ExportIssueModelMetadata) MarshalJSON // GoogleCloudContactcenterinsightsV1ExportIssueModelRequest: Request to export // an issue model. type GoogleCloudContactcenterinsightsV1ExportIssueModelRequest struct { - // GcsDestination: Google Cloud Storage URI to export the Issue Model to. + // GcsDestination: Google Cloud Storage URI to export the issue model to. GcsDestination *GoogleCloudContactcenterinsightsV1ExportIssueModelRequestGcsDestination `json:"gcsDestination,omitempty"` - // Name: Required. The issue model to export + // Name: Required. The issue model to export. Name string `json:"name,omitempty"` // ForceSendFields is a list of field names (e.g. "GcsDestination") to // unconditionally include in API requests. By default, fields with empty or @@ -2161,7 +2161,7 @@ func (s *GoogleCloudContactcenterinsightsV1ImportIssueModelMetadata) MarshalJSON // GoogleCloudContactcenterinsightsV1ImportIssueModelRequest: Request to import // an issue model. type GoogleCloudContactcenterinsightsV1ImportIssueModelRequest struct { - // CreateNewModel: Optional. If set to true, will create a new issue model from + // CreateNewModel: Optional. If set to true, will create an issue model from // the imported file with randomly generated IDs for the issue model and // corresponding issues. Otherwise, replaces an existing model with the same ID // as the file. @@ -2298,8 +2298,8 @@ type GoogleCloudContactcenterinsightsV1IngestConversationsRequest struct { RedactionConfig *GoogleCloudContactcenterinsightsV1RedactionConfig `json:"redactionConfig,omitempty"` // SampleSize: Optional. If set, this fields indicates the number of objects to // ingest from the Cloud Storage bucket. If empty, the entire bucket will be - // ingested. Note that conversations produced via sampling will not be ingested - // by subsequent ingest requests unless they are first deleted. + // ingested. Unless they are first deleted, conversations produced through + // sampling won't be ingested by subsequent ingest requests. SampleSize int64 `json:"sampleSize,omitempty"` // SpeechConfig: Optional. Default Speech-to-Text configuration. Optional, will // default to the config specified in Settings. @@ -2334,7 +2334,7 @@ type GoogleCloudContactcenterinsightsV1IngestConversationsRequestConversationCon AgentChannel int64 `json:"agentChannel,omitempty"` // AgentId: Optional. An opaque, user-specified string representing a human // agent who handled all conversations in the import. Note that this will be - // overridden if per-conversation metadata is provided via the + // overridden if per-conversation metadata is provided through the // `metadata_bucket_uri`. AgentId string `json:"agentId,omitempty"` // CustomerChannel: Optional. Indicates which of the channels, 1 or 2, contains @@ -2378,10 +2378,13 @@ type GoogleCloudContactcenterinsightsV1IngestConversationsRequestGcsSource struc // field will be ignored. Note that there is a limit of 20 labels per // conversation. CustomMetadataKeys []string `json:"customMetadataKeys,omitempty"` - // MetadataBucketUri: Optional. The Cloud Storage path to the source object - // metadata. Note that: [1] metadata files are expected to be in JSON format - // [2] metadata and source objects must be in separate buckets [3] a source - // object's metadata object must share the same name to be properly ingested + // MetadataBucketUri: Optional. The Cloud Storage path to the conversation + // metadata. Note that: [1] Metadata files are expected to be in JSON format. + // [2] Metadata and source files (transcripts or audio) must be in separate + // buckets. [3] A source file and its corresponding metadata file must share + // the same name to be properly ingested, E.g. + // `gs://bucket/audio/conversation1.mp3` and + // `gs://bucket/metadata/conversation1.json`. MetadataBucketUri string `json:"metadataBucketUri,omitempty"` // ForceSendFields is a list of field names (e.g. "BucketObjectType") to // unconditionally include in API requests. By default, fields with empty or @@ -3130,12 +3133,12 @@ func (s *GoogleCloudContactcenterinsightsV1PhraseMatcher) MarshalJSON() ([]byte, // GoogleCloudContactcenterinsightsV1RedactionConfig: DLP resources used for // redaction while ingesting conversations. DLP settings are applied to -// conversations ingested from the UploadConversation and IngestConversations -// endpoints, including conversation coming from CCAI Platform. They are not -// applied to conversations ingested from the CreateConversation endpoint or -// the Dialogflow / Agent Assist runtime integrations. When using Dialogflow / -// Agent Assist runtime integrations redaction should be performed in -// Dialogflow / Agent Assist. +// conversations ingested from the `UploadConversation` and +// `IngestConversations` endpoints, including conversation coming from CCAI +// Platform. They are not applied to conversations ingested from the +// `CreateConversation` endpoint or the Dialogflow / Agent Assist runtime +// integrations. When using Dialogflow / Agent Assist runtime integrations, +// redaction should be performed in Dialogflow / Agent Assist. type GoogleCloudContactcenterinsightsV1RedactionConfig struct { // DeidentifyTemplate: The fully-qualified DLP deidentify template resource // name. Format: `projects/{project}/deidentifyTemplates/{template}` @@ -3282,7 +3285,12 @@ func (s *GoogleCloudContactcenterinsightsV1SentimentData) UnmarshalJSON(data []b return nil } -// GoogleCloudContactcenterinsightsV1Settings: The settings resource. +// GoogleCloudContactcenterinsightsV1Settings: The CCAI Insights project wide +// settings. Use these settings to configure the behavior of Insights. View +// these settings with `getsettings` +// (https://cloud.google.com/contact-center/insights/docs/reference/rest/v1/projects.locations/getSettings) +// and change the settings with `updateSettings` +// (https://cloud.google.com/contact-center/insights/docs/reference/rest/v1/projects.locations/updateSettings). type GoogleCloudContactcenterinsightsV1Settings struct { // AnalysisConfig: Default analysis settings. AnalysisConfig *GoogleCloudContactcenterinsightsV1SettingsAnalysisConfig `json:"analysisConfig,omitempty"` @@ -3308,22 +3316,22 @@ type GoogleCloudContactcenterinsightsV1Settings struct { // occurs. * "create-analysis": Notify each time an analysis is created. * // "create-conversation": Notify each time a conversation is created. * // "export-insights-data": Notify each time an export is complete. * - // "ingest-conversations": Notify each time an IngestConversations LRO - // completes. * "update-conversation": Notify each time a conversation is + // "ingest-conversations": Notify each time an IngestConversations LRO is + // complete. * "update-conversation": Notify each time a conversation is // updated via UpdateConversation. * "upload-conversation": Notify when an - // UploadConversation LRO completes. Values are Pub/Sub topics. The format of + // UploadConversation LRO is complete. Values are Pub/Sub topics. The format of // each Pub/Sub topic is: projects/{project}/topics/{topic} PubsubNotificationSettings map[string]string `json:"pubsubNotificationSettings,omitempty"` // RedactionConfig: Default DLP redaction resources to be applied while // ingesting conversations. This applies to conversations ingested from the - // UploadConversation and IngestConversations endpoints, including + // `UploadConversation` and `IngestConversations` endpoints, including // conversations coming from CCAI Platform. RedactionConfig *GoogleCloudContactcenterinsightsV1RedactionConfig `json:"redactionConfig,omitempty"` - // SpeechConfig: Optional. Default Speech-to-Text resources to be used while + // SpeechConfig: Optional. Default Speech-to-Text resources to use while // ingesting audio files. Optional, CCAI Insights will create a default if not - // provided. This applies to conversations ingested from the UploadConversation - // and IngestConversations endpoints, including conversations coming from CCAI - // Platform. + // provided. This applies to conversations ingested from the + // `UploadConversation` and `IngestConversations` endpoints, including + // conversations coming from CCAI Platform. SpeechConfig *GoogleCloudContactcenterinsightsV1SpeechConfig `json:"speechConfig,omitempty"` // UpdateTime: Output only. The time at which the settings were last updated. UpdateTime string `json:"updateTime,omitempty"` @@ -3497,9 +3505,9 @@ func (s *GoogleCloudContactcenterinsightsV1SmartReplyData) UnmarshalJSON(data [] // GoogleCloudContactcenterinsightsV1SpeechConfig: Speech-to-Text // configuration. Speech-to-Text settings are applied to conversations ingested -// from the UploadConversation and IngestConversations endpoints, including +// from the `UploadConversation` and `IngestConversations` endpoints, including // conversation coming from CCAI Platform. They are not applied to -// conversations ingested from the CreateConversation endpoint. +// conversations ingested from the `CreateConversation` endpoint. type GoogleCloudContactcenterinsightsV1SpeechConfig struct { // SpeechRecognizer: The fully-qualified Speech Recognizer resource name. // Format: `projects/{project_id}/locations/{location}/recognizer/{recognizer}` @@ -3578,7 +3586,7 @@ type GoogleCloudContactcenterinsightsV1UndeployIssueModelResponse struct { } // GoogleCloudContactcenterinsightsV1UploadConversationMetadata: The metadata -// for an UploadConversation operation. +// for an `UploadConversation` operation. type GoogleCloudContactcenterinsightsV1UploadConversationMetadata struct { // AnalysisOperation: Output only. The operation name for a successfully // created analysis operation, if any. @@ -5254,9 +5262,9 @@ func (s *GoogleCloudContactcenterinsightsV1alpha1ExportIssueModelMetadata) Marsh // GoogleCloudContactcenterinsightsV1alpha1ExportIssueModelRequest: Request to // export an issue model. type GoogleCloudContactcenterinsightsV1alpha1ExportIssueModelRequest struct { - // GcsDestination: Google Cloud Storage URI to export the Issue Model to. + // GcsDestination: Google Cloud Storage URI to export the issue model to. GcsDestination *GoogleCloudContactcenterinsightsV1alpha1ExportIssueModelRequestGcsDestination `json:"gcsDestination,omitempty"` - // Name: Required. The issue model to export + // Name: Required. The issue model to export. Name string `json:"name,omitempty"` // ForceSendFields is a list of field names (e.g. "GcsDestination") to // unconditionally include in API requests. By default, fields with empty or @@ -5418,7 +5426,7 @@ func (s *GoogleCloudContactcenterinsightsV1alpha1ImportIssueModelMetadata) Marsh // GoogleCloudContactcenterinsightsV1alpha1ImportIssueModelRequest: Request to // import an issue model. type GoogleCloudContactcenterinsightsV1alpha1ImportIssueModelRequest struct { - // CreateNewModel: Optional. If set to true, will create a new issue model from + // CreateNewModel: Optional. If set to true, will create an issue model from // the imported file with randomly generated IDs for the issue model and // corresponding issues. Otherwise, replaces an existing model with the same ID // as the file. @@ -5555,8 +5563,8 @@ type GoogleCloudContactcenterinsightsV1alpha1IngestConversationsRequest struct { RedactionConfig *GoogleCloudContactcenterinsightsV1alpha1RedactionConfig `json:"redactionConfig,omitempty"` // SampleSize: Optional. If set, this fields indicates the number of objects to // ingest from the Cloud Storage bucket. If empty, the entire bucket will be - // ingested. Note that conversations produced via sampling will not be ingested - // by subsequent ingest requests unless they are first deleted. + // ingested. Unless they are first deleted, conversations produced through + // sampling won't be ingested by subsequent ingest requests. SampleSize int64 `json:"sampleSize,omitempty"` // SpeechConfig: Optional. Default Speech-to-Text configuration. Optional, will // default to the config specified in Settings. @@ -5591,7 +5599,7 @@ type GoogleCloudContactcenterinsightsV1alpha1IngestConversationsRequestConversat AgentChannel int64 `json:"agentChannel,omitempty"` // AgentId: Optional. An opaque, user-specified string representing a human // agent who handled all conversations in the import. Note that this will be - // overridden if per-conversation metadata is provided via the + // overridden if per-conversation metadata is provided through the // `metadata_bucket_uri`. AgentId string `json:"agentId,omitempty"` // CustomerChannel: Optional. Indicates which of the channels, 1 or 2, contains @@ -5635,10 +5643,13 @@ type GoogleCloudContactcenterinsightsV1alpha1IngestConversationsRequestGcsSource // field will be ignored. Note that there is a limit of 20 labels per // conversation. CustomMetadataKeys []string `json:"customMetadataKeys,omitempty"` - // MetadataBucketUri: Optional. The Cloud Storage path to the source object - // metadata. Note that: [1] metadata files are expected to be in JSON format - // [2] metadata and source objects must be in separate buckets [3] a source - // object's metadata object must share the same name to be properly ingested + // MetadataBucketUri: Optional. The Cloud Storage path to the conversation + // metadata. Note that: [1] Metadata files are expected to be in JSON format. + // [2] Metadata and source files (transcripts or audio) must be in separate + // buckets. [3] A source file and its corresponding metadata file must share + // the same name to be properly ingested, E.g. + // `gs://bucket/audio/conversation1.mp3` and + // `gs://bucket/metadata/conversation1.json`. MetadataBucketUri string `json:"metadataBucketUri,omitempty"` // ForceSendFields is a list of field names (e.g. "BucketObjectType") to // unconditionally include in API requests. By default, fields with empty or @@ -6026,12 +6037,12 @@ func (s *GoogleCloudContactcenterinsightsV1alpha1PhraseMatchData) MarshalJSON() // GoogleCloudContactcenterinsightsV1alpha1RedactionConfig: DLP resources used // for redaction while ingesting conversations. DLP settings are applied to -// conversations ingested from the UploadConversation and IngestConversations -// endpoints, including conversation coming from CCAI Platform. They are not -// applied to conversations ingested from the CreateConversation endpoint or -// the Dialogflow / Agent Assist runtime integrations. When using Dialogflow / -// Agent Assist runtime integrations redaction should be performed in -// Dialogflow / Agent Assist. +// conversations ingested from the `UploadConversation` and +// `IngestConversations` endpoints, including conversation coming from CCAI +// Platform. They are not applied to conversations ingested from the +// `CreateConversation` endpoint or the Dialogflow / Agent Assist runtime +// integrations. When using Dialogflow / Agent Assist runtime integrations, +// redaction should be performed in Dialogflow / Agent Assist. type GoogleCloudContactcenterinsightsV1alpha1RedactionConfig struct { // DeidentifyTemplate: The fully-qualified DLP deidentify template resource // name. Format: `projects/{project}/deidentifyTemplates/{template}` @@ -6279,9 +6290,9 @@ func (s *GoogleCloudContactcenterinsightsV1alpha1SmartReplyData) UnmarshalJSON(d // GoogleCloudContactcenterinsightsV1alpha1SpeechConfig: Speech-to-Text // configuration. Speech-to-Text settings are applied to conversations ingested -// from the UploadConversation and IngestConversations endpoints, including +// from the `UploadConversation` and `IngestConversations` endpoints, including // conversation coming from CCAI Platform. They are not applied to -// conversations ingested from the CreateConversation endpoint. +// conversations ingested from the `CreateConversation` endpoint. type GoogleCloudContactcenterinsightsV1alpha1SpeechConfig struct { // SpeechRecognizer: The fully-qualified Speech Recognizer resource name. // Format: `projects/{project_id}/locations/{location}/recognizer/{recognizer}` @@ -6360,7 +6371,7 @@ type GoogleCloudContactcenterinsightsV1alpha1UndeployIssueModelResponse struct { } // GoogleCloudContactcenterinsightsV1alpha1UploadConversationMetadata: The -// metadata for an UploadConversation operation. +// metadata for an `UploadConversation` operation. type GoogleCloudContactcenterinsightsV1alpha1UploadConversationMetadata struct { // AnalysisOperation: Output only. The operation name for a successfully // created analysis operation, if any. @@ -7097,8 +7108,8 @@ type ProjectsLocationsConversationsCreateCall struct { header_ http.Header } -// Create: Creates a conversation. DEPRECATED: Use UploadConversation instead. -// CreateConversation does not support audio transcription or DLP redaction. +// Create: Creates a conversation. Does not support audio transcription or DLP +// redaction. Use `conversations.upload` instead. // // - parent: The parent resource of the conversation. func (r *ProjectsLocationsConversationsService) Create(parent string, googlecloudcontactcenterinsightsv1conversation *GoogleCloudContactcenterinsightsV1Conversation) *ProjectsLocationsConversationsCreateCall { @@ -7563,8 +7574,8 @@ func (c *ProjectsLocationsConversationsListCall) Filter(filter string) *Projects // by descending creation time. Supported values are one of the following: * // create_time * customer_satisfaction_rating * duration * latest_analysis * // start_time * turn_count The default sort order is ascending. To specify -// order, append `asc` or `desc`, i.e. `create_time desc`. See -// https://google.aip.dev/132#ordering for more details. +// order, append `asc` or `desc` (`create_time desc`). For more details, see +// Google AIPs Ordering (https://google.aip.dev/132#ordering). func (c *ProjectsLocationsConversationsListCall) OrderBy(orderBy string) *ProjectsLocationsConversationsListCall { c.urlParams_.Set("orderBy", orderBy) return c @@ -7841,9 +7852,9 @@ type ProjectsLocationsConversationsUploadCall struct { header_ http.Header } -// Upload: Create a longrunning conversation upload operation. This method -// differs from CreateConversation by allowing audio transcription and optional -// DLP redaction. +// Upload: Create a long-running conversation upload operation. This method +// differs from `CreateConversation` by allowing audio transcription and +// optional DLP redaction. // // - parent: The parent resource of the conversation. func (r *ProjectsLocationsConversationsService) Upload(parent string, googlecloudcontactcenterinsightsv1uploadconversationrequest *GoogleCloudContactcenterinsightsV1UploadConversationRequest) *ProjectsLocationsConversationsUploadCall { diff --git a/discoveryengine/v1/discoveryengine-api.json b/discoveryengine/v1/discoveryengine-api.json index 50e6ef3bda8..58e343b2e07 100644 --- a/discoveryengine/v1/discoveryengine-api.json +++ b/discoveryengine/v1/discoveryengine-api.json @@ -5591,7 +5591,7 @@ } } }, - "revision": "20240607", + "revision": "20240612", "rootUrl": "https://discoveryengine.googleapis.com/", "schemas": { "GoogleApiHttpBody": { @@ -9336,6 +9336,10 @@ "$ref": "GoogleCloudDiscoveryengineV1SearchRequestImageQuery", "description": "Raw image query." }, + "languageCode": { + "description": "The BCP-47 language code, such as \"en-US\" or \"sr-Latn\". For more information, see [Standard fields](https://cloud.google.com/apis/design/standard_fields). This field helps to better interpret the query. If a value isn't specified, the query language code is automatically detected, which may not be accurate.", + "type": "string" + }, "offset": { "description": "A 0-indexed integer that specifies the current offset (that is, starting result location, amongst the Documents deemed by the API as relevant) in search results. This field is only considered if page_token is unset. If this field is negative, an `INVALID_ARGUMENT` is returned.", "format": "int32", @@ -11349,6 +11353,10 @@ ], "type": "string" }, + "languageInfo": { + "$ref": "GoogleCloudDiscoveryengineV1alphaLanguageInfo", + "description": "Language info for DataStore." + }, "name": { "description": "Immutable. The full resource name of the data store. Format: `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", "type": "string" @@ -12270,6 +12278,32 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1alphaLanguageInfo": { + "description": "Language info for DataStore.", + "id": "GoogleCloudDiscoveryengineV1alphaLanguageInfo", + "properties": { + "language": { + "description": "Output only. Language part of normalized_language_code. E.g.: `en-US` -\u003e `en`, `zh-Hans-HK` -\u003e `zh`, `en` -\u003e `en`.", + "readOnly": true, + "type": "string" + }, + "languageCode": { + "description": "The language code for the DataStore.", + "type": "string" + }, + "normalizedLanguageCode": { + "description": "Output only. This is the normalized form of language_code. E.g.: language_code of `en-GB`, `en_GB`, `en-UK` or `en-gb` will have normalized_language_code of `en-GB`.", + "readOnly": true, + "type": "string" + }, + "region": { + "description": "Output only. Region part of normalized_language_code, if present. E.g.: `en-US` -\u003e `US`, `zh-Hans-HK` -\u003e `HK`, `en` -\u003e ``.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1alphaListCustomModelsResponse": { "description": "Response message for SearchTuningService.ListCustomModels method.", "id": "GoogleCloudDiscoveryengineV1alphaListCustomModelsResponse", @@ -13334,6 +13368,10 @@ ], "type": "string" }, + "languageInfo": { + "$ref": "GoogleCloudDiscoveryengineV1betaLanguageInfo", + "description": "Language info for DataStore." + }, "name": { "description": "Immutable. The full resource name of the data store. Format: `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", "type": "string" @@ -13921,6 +13959,32 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1betaLanguageInfo": { + "description": "Language info for DataStore.", + "id": "GoogleCloudDiscoveryengineV1betaLanguageInfo", + "properties": { + "language": { + "description": "Output only. Language part of normalized_language_code. E.g.: `en-US` -\u003e `en`, `zh-Hans-HK` -\u003e `zh`, `en` -\u003e `en`.", + "readOnly": true, + "type": "string" + }, + "languageCode": { + "description": "The language code for the DataStore.", + "type": "string" + }, + "normalizedLanguageCode": { + "description": "Output only. This is the normalized form of language_code. E.g.: language_code of `en-GB`, `en_GB`, `en-UK` or `en-gb` will have normalized_language_code of `en-GB`.", + "readOnly": true, + "type": "string" + }, + "region": { + "description": "Output only. Region part of normalized_language_code, if present. E.g.: `en-US` -\u003e `US`, `zh-Hans-HK` -\u003e `HK`, `en` -\u003e ``.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1betaListCustomModelsResponse": { "description": "Response message for SearchTuningService.ListCustomModels method.", "id": "GoogleCloudDiscoveryengineV1betaListCustomModelsResponse", diff --git a/discoveryengine/v1/discoveryengine-gen.go b/discoveryengine/v1/discoveryengine-gen.go index 4e279843e2e..b7d4169a64c 100644 --- a/discoveryengine/v1/discoveryengine-gen.go +++ b/discoveryengine/v1/discoveryengine-gen.go @@ -6164,6 +6164,12 @@ type GoogleCloudDiscoveryengineV1SearchRequest struct { Filter string `json:"filter,omitempty"` // ImageQuery: Raw image query. ImageQuery *GoogleCloudDiscoveryengineV1SearchRequestImageQuery `json:"imageQuery,omitempty"` + // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". For + // more information, see Standard fields + // (https://cloud.google.com/apis/design/standard_fields). This field helps to + // better interpret the query. If a value isn't specified, the query language + // code is automatically detected, which may not be accurate. + LanguageCode string `json:"languageCode,omitempty"` // Offset: A 0-indexed integer that specifies the current offset (that is, // starting result location, amongst the Documents deemed by the API as // relevant) in search results. This field is only considered if page_token is @@ -9010,6 +9016,8 @@ type GoogleCloudDiscoveryengineV1alphaDataStore struct { // "MEDIA" - The media industry vertical. // "HEALTHCARE_FHIR" - The healthcare FHIR vertical. IndustryVertical string `json:"industryVertical,omitempty"` + // LanguageInfo: Language info for DataStore. + LanguageInfo *GoogleCloudDiscoveryengineV1alphaLanguageInfo `json:"languageInfo,omitempty"` // Name: Immutable. The full resource name of the data store. Format: // `projects/{project}/locations/{location}/collections/{collection_id}/dataStor // es/{data_store_id}`. This field must be a UTF-8 encoded string with a length @@ -10274,6 +10282,38 @@ func (s *GoogleCloudDiscoveryengineV1alphaImportUserEventsResponse) MarshalJSON( return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// GoogleCloudDiscoveryengineV1alphaLanguageInfo: Language info for DataStore. +type GoogleCloudDiscoveryengineV1alphaLanguageInfo struct { + // Language: Output only. Language part of normalized_language_code. E.g.: + // `en-US` -> `en`, `zh-Hans-HK` -> `zh`, `en` -> `en`. + Language string `json:"language,omitempty"` + // LanguageCode: The language code for the DataStore. + LanguageCode string `json:"languageCode,omitempty"` + // NormalizedLanguageCode: Output only. This is the normalized form of + // language_code. E.g.: language_code of `en-GB`, `en_GB`, `en-UK` or `en-gb` + // will have normalized_language_code of `en-GB`. + NormalizedLanguageCode string `json:"normalizedLanguageCode,omitempty"` + // Region: Output only. Region part of normalized_language_code, if present. + // E.g.: `en-US` -> `US`, `zh-Hans-HK` -> `HK`, `en` -> ``. + Region string `json:"region,omitempty"` + // ForceSendFields is a list of field names (e.g. "Language") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Language") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaLanguageInfo) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaLanguageInfo + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // GoogleCloudDiscoveryengineV1alphaListCustomModelsResponse: Response message // for SearchTuningService.ListCustomModels method. type GoogleCloudDiscoveryengineV1alphaListCustomModelsResponse struct { @@ -11619,6 +11659,8 @@ type GoogleCloudDiscoveryengineV1betaDataStore struct { // "MEDIA" - The media industry vertical. // "HEALTHCARE_FHIR" - The healthcare FHIR vertical. IndustryVertical string `json:"industryVertical,omitempty"` + // LanguageInfo: Language info for DataStore. + LanguageInfo *GoogleCloudDiscoveryengineV1betaLanguageInfo `json:"languageInfo,omitempty"` // Name: Immutable. The full resource name of the data store. Format: // `projects/{project}/locations/{location}/collections/{collection_id}/dataStor // es/{data_store_id}`. This field must be a UTF-8 encoded string with a length @@ -12448,6 +12490,38 @@ func (s *GoogleCloudDiscoveryengineV1betaImportUserEventsResponse) MarshalJSON() return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// GoogleCloudDiscoveryengineV1betaLanguageInfo: Language info for DataStore. +type GoogleCloudDiscoveryengineV1betaLanguageInfo struct { + // Language: Output only. Language part of normalized_language_code. E.g.: + // `en-US` -> `en`, `zh-Hans-HK` -> `zh`, `en` -> `en`. + Language string `json:"language,omitempty"` + // LanguageCode: The language code for the DataStore. + LanguageCode string `json:"languageCode,omitempty"` + // NormalizedLanguageCode: Output only. This is the normalized form of + // language_code. E.g.: language_code of `en-GB`, `en_GB`, `en-UK` or `en-gb` + // will have normalized_language_code of `en-GB`. + NormalizedLanguageCode string `json:"normalizedLanguageCode,omitempty"` + // Region: Output only. Region part of normalized_language_code, if present. + // E.g.: `en-US` -> `US`, `zh-Hans-HK` -> `HK`, `en` -> ``. + Region string `json:"region,omitempty"` + // ForceSendFields is a list of field names (e.g. "Language") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Language") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaLanguageInfo) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaLanguageInfo + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // GoogleCloudDiscoveryengineV1betaListCustomModelsResponse: Response message // for SearchTuningService.ListCustomModels method. type GoogleCloudDiscoveryengineV1betaListCustomModelsResponse struct { diff --git a/discoveryengine/v1alpha/discoveryengine-api.json b/discoveryengine/v1alpha/discoveryengine-api.json index 1120a86053b..b47789b6240 100644 --- a/discoveryengine/v1alpha/discoveryengine-api.json +++ b/discoveryengine/v1alpha/discoveryengine-api.json @@ -6641,7 +6641,7 @@ } } }, - "revision": "20240607", + "revision": "20240612", "rootUrl": "https://discoveryengine.googleapis.com/", "schemas": { "GoogleApiDistribution": { @@ -10335,6 +10335,10 @@ ], "type": "string" }, + "languageInfo": { + "$ref": "GoogleCloudDiscoveryengineV1alphaLanguageInfo", + "description": "Language info for DataStore." + }, "name": { "description": "Immutable. The full resource name of the data store. Format: `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", "type": "string" @@ -11819,6 +11823,32 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1alphaLanguageInfo": { + "description": "Language info for DataStore.", + "id": "GoogleCloudDiscoveryengineV1alphaLanguageInfo", + "properties": { + "language": { + "description": "Output only. Language part of normalized_language_code. E.g.: `en-US` -\u003e `en`, `zh-Hans-HK` -\u003e `zh`, `en` -\u003e `en`.", + "readOnly": true, + "type": "string" + }, + "languageCode": { + "description": "The language code for the DataStore.", + "type": "string" + }, + "normalizedLanguageCode": { + "description": "Output only. This is the normalized form of language_code. E.g.: language_code of `en-GB`, `en_GB`, `en-UK` or `en-gb` will have normalized_language_code of `en-GB`.", + "readOnly": true, + "type": "string" + }, + "region": { + "description": "Output only. Region part of normalized_language_code, if present. E.g.: `en-US` -\u003e `US`, `zh-Hans-HK` -\u003e `HK`, `en` -\u003e ``.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1alphaListChunksResponse": { "description": "Response message for ChunkService.ListChunks method.", "id": "GoogleCloudDiscoveryengineV1alphaListChunksResponse", @@ -12995,6 +13025,10 @@ "$ref": "GoogleCloudDiscoveryengineV1alphaSearchRequestImageQuery", "description": "Raw image query." }, + "languageCode": { + "description": "The BCP-47 language code, such as \"en-US\" or \"sr-Latn\". For more information, see [Standard fields](https://cloud.google.com/apis/design/standard_fields). This field helps to better interpret the query. If a value isn't specified, the query language code is automatically detected, which may not be accurate.", + "type": "string" + }, "offset": { "description": "A 0-indexed integer that specifies the current offset (that is, starting result location, amongst the Documents deemed by the API as relevant) in search results. This field is only considered if page_token is unset. If this field is negative, an `INVALID_ARGUMENT` is returned.", "format": "int32", @@ -13032,6 +13066,10 @@ "description": "The ranking expression controls the customized ranking on retrieval documents. This overrides ServingConfig.ranking_expression. The ranking expression is a single function or multiple functions that are joint by \"+\". * ranking_expression = function, { \" + \", function }; Supported functions: * double * relevance_score * double * dotProduct(embedding_field_path) Function variables: `relevance_score`: pre-defined keywords, used for measure relevance between query and document. `embedding_field_path`: the document embedding field used with query embedding vector. `dotProduct`: embedding function between embedding_field_path and query embedding vector. Example ranking expression: If document has an embedding field doc_embedding, the ranking expression could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.", "type": "string" }, + "regionCode": { + "description": "The Unicode country/region code (CLDR) of a location, such as \"US\" and \"419\". For more information, see [Standard fields](https://cloud.google.com/apis/design/standard_fields). If set, then results will be boosted based on the region_code provided.", + "type": "string" + }, "safeSearch": { "description": "Whether to turn on safe search. This is only supported for website search.", "type": "boolean" @@ -15016,6 +15054,10 @@ ], "type": "string" }, + "languageInfo": { + "$ref": "GoogleCloudDiscoveryengineV1betaLanguageInfo", + "description": "Language info for DataStore." + }, "name": { "description": "Immutable. The full resource name of the data store. Format: `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", "type": "string" @@ -15603,6 +15645,32 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1betaLanguageInfo": { + "description": "Language info for DataStore.", + "id": "GoogleCloudDiscoveryengineV1betaLanguageInfo", + "properties": { + "language": { + "description": "Output only. Language part of normalized_language_code. E.g.: `en-US` -\u003e `en`, `zh-Hans-HK` -\u003e `zh`, `en` -\u003e `en`.", + "readOnly": true, + "type": "string" + }, + "languageCode": { + "description": "The language code for the DataStore.", + "type": "string" + }, + "normalizedLanguageCode": { + "description": "Output only. This is the normalized form of language_code. E.g.: language_code of `en-GB`, `en_GB`, `en-UK` or `en-gb` will have normalized_language_code of `en-GB`.", + "readOnly": true, + "type": "string" + }, + "region": { + "description": "Output only. Region part of normalized_language_code, if present. E.g.: `en-US` -\u003e `US`, `zh-Hans-HK` -\u003e `HK`, `en` -\u003e ``.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1betaListCustomModelsResponse": { "description": "Response message for SearchTuningService.ListCustomModels method.", "id": "GoogleCloudDiscoveryengineV1betaListCustomModelsResponse", diff --git a/discoveryengine/v1alpha/discoveryengine-gen.go b/discoveryengine/v1alpha/discoveryengine-gen.go index eab29e0c8fa..fbf51dffb4a 100644 --- a/discoveryengine/v1alpha/discoveryengine-gen.go +++ b/discoveryengine/v1alpha/discoveryengine-gen.go @@ -6087,6 +6087,8 @@ type GoogleCloudDiscoveryengineV1alphaDataStore struct { // "MEDIA" - The media industry vertical. // "HEALTHCARE_FHIR" - The healthcare FHIR vertical. IndustryVertical string `json:"industryVertical,omitempty"` + // LanguageInfo: Language info for DataStore. + LanguageInfo *GoogleCloudDiscoveryengineV1alphaLanguageInfo `json:"languageInfo,omitempty"` // Name: Immutable. The full resource name of the data store. Format: // `projects/{project}/locations/{location}/collections/{collection_id}/dataStor // es/{data_store_id}`. This field must be a UTF-8 encoded string with a length @@ -8223,6 +8225,38 @@ func (s *GoogleCloudDiscoveryengineV1alphaInterval) UnmarshalJSON(data []byte) e return nil } +// GoogleCloudDiscoveryengineV1alphaLanguageInfo: Language info for DataStore. +type GoogleCloudDiscoveryengineV1alphaLanguageInfo struct { + // Language: Output only. Language part of normalized_language_code. E.g.: + // `en-US` -> `en`, `zh-Hans-HK` -> `zh`, `en` -> `en`. + Language string `json:"language,omitempty"` + // LanguageCode: The language code for the DataStore. + LanguageCode string `json:"languageCode,omitempty"` + // NormalizedLanguageCode: Output only. This is the normalized form of + // language_code. E.g.: language_code of `en-GB`, `en_GB`, `en-UK` or `en-gb` + // will have normalized_language_code of `en-GB`. + NormalizedLanguageCode string `json:"normalizedLanguageCode,omitempty"` + // Region: Output only. Region part of normalized_language_code, if present. + // E.g.: `en-US` -> `US`, `zh-Hans-HK` -> `HK`, `en` -> ``. + Region string `json:"region,omitempty"` + // ForceSendFields is a list of field names (e.g. "Language") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Language") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaLanguageInfo) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaLanguageInfo + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // GoogleCloudDiscoveryengineV1alphaListChunksResponse: Response message for // ChunkService.ListChunks method. type GoogleCloudDiscoveryengineV1alphaListChunksResponse struct { @@ -9961,6 +9995,12 @@ type GoogleCloudDiscoveryengineV1alphaSearchRequest struct { Filter string `json:"filter,omitempty"` // ImageQuery: Raw image query. ImageQuery *GoogleCloudDiscoveryengineV1alphaSearchRequestImageQuery `json:"imageQuery,omitempty"` + // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". For + // more information, see Standard fields + // (https://cloud.google.com/apis/design/standard_fields). This field helps to + // better interpret the query. If a value isn't specified, the query language + // code is automatically detected, which may not be accurate. + LanguageCode string `json:"languageCode,omitempty"` // Offset: A 0-indexed integer that specifies the current offset (that is, // starting result location, amongst the Documents deemed by the API as // relevant) in search results. This field is only considered if page_token is @@ -10013,6 +10053,11 @@ type GoogleCloudDiscoveryengineV1alphaSearchRequest struct { // If document has an embedding field doc_embedding, the ranking expression // could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`. RankingExpression string `json:"rankingExpression,omitempty"` + // RegionCode: The Unicode country/region code (CLDR) of a location, such as + // "US" and "419". For more information, see Standard fields + // (https://cloud.google.com/apis/design/standard_fields). If set, then results + // will be boosted based on the region_code provided. + RegionCode string `json:"regionCode,omitempty"` // SafeSearch: Whether to turn on safe search. This is only supported for // website search. SafeSearch bool `json:"safeSearch,omitempty"` @@ -12917,6 +12962,8 @@ type GoogleCloudDiscoveryengineV1betaDataStore struct { // "MEDIA" - The media industry vertical. // "HEALTHCARE_FHIR" - The healthcare FHIR vertical. IndustryVertical string `json:"industryVertical,omitempty"` + // LanguageInfo: Language info for DataStore. + LanguageInfo *GoogleCloudDiscoveryengineV1betaLanguageInfo `json:"languageInfo,omitempty"` // Name: Immutable. The full resource name of the data store. Format: // `projects/{project}/locations/{location}/collections/{collection_id}/dataStor // es/{data_store_id}`. This field must be a UTF-8 encoded string with a length @@ -13746,6 +13793,38 @@ func (s *GoogleCloudDiscoveryengineV1betaImportUserEventsResponse) MarshalJSON() return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// GoogleCloudDiscoveryengineV1betaLanguageInfo: Language info for DataStore. +type GoogleCloudDiscoveryengineV1betaLanguageInfo struct { + // Language: Output only. Language part of normalized_language_code. E.g.: + // `en-US` -> `en`, `zh-Hans-HK` -> `zh`, `en` -> `en`. + Language string `json:"language,omitempty"` + // LanguageCode: The language code for the DataStore. + LanguageCode string `json:"languageCode,omitempty"` + // NormalizedLanguageCode: Output only. This is the normalized form of + // language_code. E.g.: language_code of `en-GB`, `en_GB`, `en-UK` or `en-gb` + // will have normalized_language_code of `en-GB`. + NormalizedLanguageCode string `json:"normalizedLanguageCode,omitempty"` + // Region: Output only. Region part of normalized_language_code, if present. + // E.g.: `en-US` -> `US`, `zh-Hans-HK` -> `HK`, `en` -> ``. + Region string `json:"region,omitempty"` + // ForceSendFields is a list of field names (e.g. "Language") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Language") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaLanguageInfo) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaLanguageInfo + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // GoogleCloudDiscoveryengineV1betaListCustomModelsResponse: Response message // for SearchTuningService.ListCustomModels method. type GoogleCloudDiscoveryengineV1betaListCustomModelsResponse struct { diff --git a/discoveryengine/v1beta/discoveryengine-api.json b/discoveryengine/v1beta/discoveryengine-api.json index 01710703664..337a28801ef 100644 --- a/discoveryengine/v1beta/discoveryengine-api.json +++ b/discoveryengine/v1beta/discoveryengine-api.json @@ -5989,7 +5989,7 @@ } } }, - "revision": "20240607", + "revision": "20240612", "rootUrl": "https://discoveryengine.googleapis.com/", "schemas": { "GoogleApiHttpBody": { @@ -8282,6 +8282,10 @@ ], "type": "string" }, + "languageInfo": { + "$ref": "GoogleCloudDiscoveryengineV1alphaLanguageInfo", + "description": "Language info for DataStore." + }, "name": { "description": "Immutable. The full resource name of the data store. Format: `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", "type": "string" @@ -9203,6 +9207,32 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1alphaLanguageInfo": { + "description": "Language info for DataStore.", + "id": "GoogleCloudDiscoveryengineV1alphaLanguageInfo", + "properties": { + "language": { + "description": "Output only. Language part of normalized_language_code. E.g.: `en-US` -\u003e `en`, `zh-Hans-HK` -\u003e `zh`, `en` -\u003e `en`.", + "readOnly": true, + "type": "string" + }, + "languageCode": { + "description": "The language code for the DataStore.", + "type": "string" + }, + "normalizedLanguageCode": { + "description": "Output only. This is the normalized form of language_code. E.g.: language_code of `en-GB`, `en_GB`, `en-UK` or `en-gb` will have normalized_language_code of `en-GB`.", + "readOnly": true, + "type": "string" + }, + "region": { + "description": "Output only. Region part of normalized_language_code, if present. E.g.: `en-US` -\u003e `US`, `zh-Hans-HK` -\u003e `HK`, `en` -\u003e ``.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1alphaListCustomModelsResponse": { "description": "Response message for SearchTuningService.ListCustomModels method.", "id": "GoogleCloudDiscoveryengineV1alphaListCustomModelsResponse", @@ -11812,6 +11842,10 @@ ], "type": "string" }, + "languageInfo": { + "$ref": "GoogleCloudDiscoveryengineV1betaLanguageInfo", + "description": "Language info for DataStore." + }, "name": { "description": "Immutable. The full resource name of the data store. Format: `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.", "type": "string" @@ -12847,6 +12881,32 @@ }, "type": "object" }, + "GoogleCloudDiscoveryengineV1betaLanguageInfo": { + "description": "Language info for DataStore.", + "id": "GoogleCloudDiscoveryengineV1betaLanguageInfo", + "properties": { + "language": { + "description": "Output only. Language part of normalized_language_code. E.g.: `en-US` -\u003e `en`, `zh-Hans-HK` -\u003e `zh`, `en` -\u003e `en`.", + "readOnly": true, + "type": "string" + }, + "languageCode": { + "description": "The language code for the DataStore.", + "type": "string" + }, + "normalizedLanguageCode": { + "description": "Output only. This is the normalized form of language_code. E.g.: language_code of `en-GB`, `en_GB`, `en-UK` or `en-gb` will have normalized_language_code of `en-GB`.", + "readOnly": true, + "type": "string" + }, + "region": { + "description": "Output only. Region part of normalized_language_code, if present. E.g.: `en-US` -\u003e `US`, `zh-Hans-HK` -\u003e `HK`, `en` -\u003e ``.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDiscoveryengineV1betaListControlsResponse": { "description": "Response for ListControls method.", "id": "GoogleCloudDiscoveryengineV1betaListControlsResponse", @@ -13640,6 +13700,10 @@ "$ref": "GoogleCloudDiscoveryengineV1betaSearchRequestImageQuery", "description": "Raw image query." }, + "languageCode": { + "description": "The BCP-47 language code, such as \"en-US\" or \"sr-Latn\". For more information, see [Standard fields](https://cloud.google.com/apis/design/standard_fields). This field helps to better interpret the query. If a value isn't specified, the query language code is automatically detected, which may not be accurate.", + "type": "string" + }, "offset": { "description": "A 0-indexed integer that specifies the current offset (that is, starting result location, amongst the Documents deemed by the API as relevant) in search results. This field is only considered if page_token is unset. If this field is negative, an `INVALID_ARGUMENT` is returned.", "format": "int32", @@ -13677,6 +13741,10 @@ "description": "The ranking expression controls the customized ranking on retrieval documents. This overrides ServingConfig.ranking_expression. The ranking expression is a single function or multiple functions that are joint by \"+\". * ranking_expression = function, { \" + \", function }; Supported functions: * double * relevance_score * double * dotProduct(embedding_field_path) Function variables: `relevance_score`: pre-defined keywords, used for measure relevance between query and document. `embedding_field_path`: the document embedding field used with query embedding vector. `dotProduct`: embedding function between embedding_field_path and query embedding vector. Example ranking expression: If document has an embedding field doc_embedding, the ranking expression could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.", "type": "string" }, + "regionCode": { + "description": "The Unicode country/region code (CLDR) of a location, such as \"US\" and \"419\". For more information, see [Standard fields](https://cloud.google.com/apis/design/standard_fields). If set, then results will be boosted based on the region_code provided.", + "type": "string" + }, "safeSearch": { "description": "Whether to turn on safe search. This is only supported for website search.", "type": "boolean" diff --git a/discoveryengine/v1beta/discoveryengine-gen.go b/discoveryengine/v1beta/discoveryengine-gen.go index 4f97cdad0eb..a24d0462572 100644 --- a/discoveryengine/v1beta/discoveryengine-gen.go +++ b/discoveryengine/v1beta/discoveryengine-gen.go @@ -3862,6 +3862,8 @@ type GoogleCloudDiscoveryengineV1alphaDataStore struct { // "MEDIA" - The media industry vertical. // "HEALTHCARE_FHIR" - The healthcare FHIR vertical. IndustryVertical string `json:"industryVertical,omitempty"` + // LanguageInfo: Language info for DataStore. + LanguageInfo *GoogleCloudDiscoveryengineV1alphaLanguageInfo `json:"languageInfo,omitempty"` // Name: Immutable. The full resource name of the data store. Format: // `projects/{project}/locations/{location}/collections/{collection_id}/dataStor // es/{data_store_id}`. This field must be a UTF-8 encoded string with a length @@ -5126,6 +5128,38 @@ func (s *GoogleCloudDiscoveryengineV1alphaImportUserEventsResponse) MarshalJSON( return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// GoogleCloudDiscoveryengineV1alphaLanguageInfo: Language info for DataStore. +type GoogleCloudDiscoveryengineV1alphaLanguageInfo struct { + // Language: Output only. Language part of normalized_language_code. E.g.: + // `en-US` -> `en`, `zh-Hans-HK` -> `zh`, `en` -> `en`. + Language string `json:"language,omitempty"` + // LanguageCode: The language code for the DataStore. + LanguageCode string `json:"languageCode,omitempty"` + // NormalizedLanguageCode: Output only. This is the normalized form of + // language_code. E.g.: language_code of `en-GB`, `en_GB`, `en-UK` or `en-gb` + // will have normalized_language_code of `en-GB`. + NormalizedLanguageCode string `json:"normalizedLanguageCode,omitempty"` + // Region: Output only. Region part of normalized_language_code, if present. + // E.g.: `en-US` -> `US`, `zh-Hans-HK` -> `HK`, `en` -> ``. + Region string `json:"region,omitempty"` + // ForceSendFields is a list of field names (e.g. "Language") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Language") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1alphaLanguageInfo) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1alphaLanguageInfo + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // GoogleCloudDiscoveryengineV1alphaListCustomModelsResponse: Response message // for SearchTuningService.ListCustomModels method. type GoogleCloudDiscoveryengineV1alphaListCustomModelsResponse struct { @@ -8608,6 +8642,8 @@ type GoogleCloudDiscoveryengineV1betaDataStore struct { // "MEDIA" - The media industry vertical. // "HEALTHCARE_FHIR" - The healthcare FHIR vertical. IndustryVertical string `json:"industryVertical,omitempty"` + // LanguageInfo: Language info for DataStore. + LanguageInfo *GoogleCloudDiscoveryengineV1betaLanguageInfo `json:"languageInfo,omitempty"` // Name: Immutable. The full resource name of the data store. Format: // `projects/{project}/locations/{location}/collections/{collection_id}/dataStor // es/{data_store_id}`. This field must be a UTF-8 encoded string with a length @@ -10112,6 +10148,38 @@ func (s *GoogleCloudDiscoveryengineV1betaInterval) UnmarshalJSON(data []byte) er return nil } +// GoogleCloudDiscoveryengineV1betaLanguageInfo: Language info for DataStore. +type GoogleCloudDiscoveryengineV1betaLanguageInfo struct { + // Language: Output only. Language part of normalized_language_code. E.g.: + // `en-US` -> `en`, `zh-Hans-HK` -> `zh`, `en` -> `en`. + Language string `json:"language,omitempty"` + // LanguageCode: The language code for the DataStore. + LanguageCode string `json:"languageCode,omitempty"` + // NormalizedLanguageCode: Output only. This is the normalized form of + // language_code. E.g.: language_code of `en-GB`, `en_GB`, `en-UK` or `en-gb` + // will have normalized_language_code of `en-GB`. + NormalizedLanguageCode string `json:"normalizedLanguageCode,omitempty"` + // Region: Output only. Region part of normalized_language_code, if present. + // E.g.: `en-US` -> `US`, `zh-Hans-HK` -> `HK`, `en` -> ``. + Region string `json:"region,omitempty"` + // ForceSendFields is a list of field names (e.g. "Language") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Language") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDiscoveryengineV1betaLanguageInfo) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDiscoveryengineV1betaLanguageInfo + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // GoogleCloudDiscoveryengineV1betaListControlsResponse: Response for // ListControls method. type GoogleCloudDiscoveryengineV1betaListControlsResponse struct { @@ -11302,6 +11370,12 @@ type GoogleCloudDiscoveryengineV1betaSearchRequest struct { Filter string `json:"filter,omitempty"` // ImageQuery: Raw image query. ImageQuery *GoogleCloudDiscoveryengineV1betaSearchRequestImageQuery `json:"imageQuery,omitempty"` + // LanguageCode: The BCP-47 language code, such as "en-US" or "sr-Latn". For + // more information, see Standard fields + // (https://cloud.google.com/apis/design/standard_fields). This field helps to + // better interpret the query. If a value isn't specified, the query language + // code is automatically detected, which may not be accurate. + LanguageCode string `json:"languageCode,omitempty"` // Offset: A 0-indexed integer that specifies the current offset (that is, // starting result location, amongst the Documents deemed by the API as // relevant) in search results. This field is only considered if page_token is @@ -11354,6 +11428,11 @@ type GoogleCloudDiscoveryengineV1betaSearchRequest struct { // If document has an embedding field doc_embedding, the ranking expression // could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`. RankingExpression string `json:"rankingExpression,omitempty"` + // RegionCode: The Unicode country/region code (CLDR) of a location, such as + // "US" and "419". For more information, see Standard fields + // (https://cloud.google.com/apis/design/standard_fields). If set, then results + // will be boosted based on the region_code provided. + RegionCode string `json:"regionCode,omitempty"` // SafeSearch: Whether to turn on safe search. This is only supported for // website search. SafeSearch bool `json:"safeSearch,omitempty"` diff --git a/displayvideo/v3/displayvideo-api.json b/displayvideo/v3/displayvideo-api.json index d1af2c371c4..9b10bb2a2a3 100644 --- a/displayvideo/v3/displayvideo-api.json +++ b/displayvideo/v3/displayvideo-api.json @@ -9222,7 +9222,7 @@ } } }, - "revision": "20240530", + "revision": "20240613", "rootUrl": "https://displayvideo.googleapis.com/", "schemas": { "ActiveViewVideoViewabilityMetricConfig": { @@ -16875,6 +16875,26 @@ "readOnly": true, "type": "string" }, + "optimizationObjective": { + "description": "Optional. The optimization objective of the insertion order.", + "enum": [ + "OPTIMIZATION_OBJECTIVE_UNSPECIFIED", + "CONVERSION", + "CLICK", + "BRAND_AWARENESS", + "CUSTOM", + "NO_OBJECTIVE" + ], + "enumDescriptions": [ + "Type value is not specified or is unknown in this version.", + "Prioritize impressions that increase sales and conversions.", + "Prioritize impressions that increase website traffic, apps, app stores.", + "Prioritize impressions of specific quality.", + "Objective is defined by the assigned custom bidding algorithm.", + "Objective is not defined. Any KPI or bidding strategy can be used." + ], + "type": "string" + }, "pacing": { "$ref": "Pacing", "description": "Required. The budget spending speed setting of the insertion order." diff --git a/displayvideo/v3/displayvideo-gen.go b/displayvideo/v3/displayvideo-gen.go index 8ab2a097fd2..05c7052f845 100644 --- a/displayvideo/v3/displayvideo-gen.go +++ b/displayvideo/v3/displayvideo-gen.go @@ -9354,6 +9354,20 @@ type InsertionOrder struct { Kpi *Kpi `json:"kpi,omitempty"` // Name: Output only. The resource name of the insertion order. Name string `json:"name,omitempty"` + // OptimizationObjective: Optional. The optimization objective of the insertion + // order. + // + // Possible values: + // "OPTIMIZATION_OBJECTIVE_UNSPECIFIED" - Type value is not specified or is + // unknown in this version. + // "CONVERSION" - Prioritize impressions that increase sales and conversions. + // "CLICK" - Prioritize impressions that increase website traffic, apps, app + // stores. + // "BRAND_AWARENESS" - Prioritize impressions of specific quality. + // "CUSTOM" - Objective is defined by the assigned custom bidding algorithm. + // "NO_OBJECTIVE" - Objective is not defined. Any KPI or bidding strategy can + // be used. + OptimizationObjective string `json:"optimizationObjective,omitempty"` // Pacing: Required. The budget spending speed setting of the insertion order. Pacing *Pacing `json:"pacing,omitempty"` // PartnerCosts: The partner costs associated with the insertion order. If diff --git a/dlp/v2/dlp-api.json b/dlp/v2/dlp-api.json index 40489de1e2a..1fbbc4b5203 100644 --- a/dlp/v2/dlp-api.json +++ b/dlp/v2/dlp-api.json @@ -207,7 +207,7 @@ ], "parameters": { "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^organizations/[^/]+$", "required": true, @@ -306,7 +306,7 @@ "type": "string" }, "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^organizations/[^/]+$", "required": true, @@ -363,7 +363,7 @@ ], "parameters": { "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^organizations/[^/]+$", "required": true, @@ -462,7 +462,7 @@ "type": "string" }, "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^organizations/[^/]+$", "required": true, @@ -586,6 +586,112 @@ }, "connections": { "methods": { + "create": { + "description": "Create a Connection to an external data source.", + "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/connections", + "httpMethod": "POST", + "id": "dlp.organizations.locations.connections.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization): + Projects scope: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Organizations scope: `organizations/`ORG_ID`/locations/`LOCATION_ID", + "location": "path", + "pattern": "^organizations/[^/]+/locations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+parent}/connections", + "request": { + "$ref": "GooglePrivacyDlpV2CreateConnectionRequest" + }, + "response": { + "$ref": "GooglePrivacyDlpV2Connection" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "description": "Delete a Connection.", + "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/connections/{connectionsId}", + "httpMethod": "DELETE", + "id": "dlp.organizations.locations.connections.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Resource name of the Connection to be deleted, in the format: `projects/{project}/locations/{location}/connections/{connection}`.", + "location": "path", + "pattern": "^organizations/[^/]+/locations/[^/]+/connections/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "GoogleProtobufEmpty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Get a Connection by name.", + "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/connections/{connectionsId}", + "httpMethod": "GET", + "id": "dlp.organizations.locations.connections.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Resource name in the format: `projects/{project}/locations/{location}/connections/{connection}`.", + "location": "path", + "pattern": "^organizations/[^/]+/locations/[^/]+/connections/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "GooglePrivacyDlpV2Connection" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "patch": { + "description": "Update a Connection.", + "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/connections/{connectionsId}", + "httpMethod": "PATCH", + "id": "dlp.organizations.locations.connections.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Resource name in the format: `projects/{project}/locations/{location}/connections/{connection}`.", + "location": "path", + "pattern": "^organizations/[^/]+/locations/[^/]+/connections/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "request": { + "$ref": "GooglePrivacyDlpV2UpdateConnectionRequest" + }, + "response": { + "$ref": "GooglePrivacyDlpV2Connection" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "search": { "description": "Searches for Connections in a parent.", "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/connections:search", @@ -641,7 +747,7 @@ ], "parameters": { "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^organizations/[^/]+/locations/[^/]+$", "required": true, @@ -740,7 +846,7 @@ "type": "string" }, "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^organizations/[^/]+/locations/[^/]+$", "required": true, @@ -797,7 +903,7 @@ ], "parameters": { "parent": { - "description": "Required. Parent resource name. The format of this value is as follows: `projects/`PROJECT_ID`/locations/`LOCATION_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization): + Projects scope: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Organizations scope: `organizations/`ORG_ID`/locations/`LOCATION_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^organizations/[^/]+/locations/[^/]+$", "required": true, @@ -974,7 +1080,7 @@ "type": "string" }, "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^organizations/[^/]+/locations/[^/]+$", "required": true, @@ -1018,7 +1124,7 @@ ], "parameters": { "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^organizations/[^/]+/locations/[^/]+$", "required": true, @@ -1117,7 +1223,7 @@ "type": "string" }, "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^organizations/[^/]+/locations/[^/]+$", "required": true, @@ -1174,7 +1280,7 @@ ], "parameters": { "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^organizations/[^/]+/locations/[^/]+$", "required": true, @@ -1278,7 +1384,7 @@ "type": "string" }, "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^organizations/[^/]+/locations/[^/]+$", "required": true, @@ -1425,7 +1531,7 @@ ], "parameters": { "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^organizations/[^/]+/locations/[^/]+$", "required": true, @@ -1524,7 +1630,7 @@ "type": "string" }, "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^organizations/[^/]+/locations/[^/]+$", "required": true, @@ -1683,7 +1789,7 @@ ], "parameters": { "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^organizations/[^/]+$", "required": true, @@ -1782,7 +1888,7 @@ "type": "string" }, "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^organizations/[^/]+$", "required": true, @@ -1843,7 +1949,7 @@ ], "parameters": { "parent": { - "description": "Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^projects/[^/]+$", "required": true, @@ -1871,7 +1977,7 @@ ], "parameters": { "parent": { - "description": "Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^projects/[^/]+$", "required": true, @@ -1899,7 +2005,7 @@ ], "parameters": { "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^projects/[^/]+$", "required": true, @@ -1931,7 +2037,7 @@ ], "parameters": { "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^projects/[^/]+$", "required": true, @@ -2030,7 +2136,7 @@ "type": "string" }, "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^projects/[^/]+$", "required": true, @@ -2115,7 +2221,7 @@ ], "parameters": { "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^projects/[^/]+$", "required": true, @@ -2219,7 +2325,7 @@ "type": "string" }, "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^projects/[^/]+$", "required": true, @@ -2263,7 +2369,7 @@ ], "parameters": { "parent": { - "description": "Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^projects/[^/]+$", "required": true, @@ -2295,7 +2401,7 @@ ], "parameters": { "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^projects/[^/]+$", "required": true, @@ -2394,7 +2500,7 @@ "type": "string" }, "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^projects/[^/]+$", "required": true, @@ -2479,7 +2585,7 @@ ], "parameters": { "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^projects/[^/]+$", "required": true, @@ -2583,7 +2689,7 @@ "type": "string" }, "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^projects/[^/]+$", "required": true, @@ -2732,7 +2838,7 @@ ], "parameters": { "parent": { - "description": "Required. Parent resource name in the format: `projects/{project}/locations/{location}`.", + "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization): + Projects scope: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Organizations scope: `organizations/`ORG_ID`/locations/`LOCATION_ID", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+$", "required": true, @@ -2924,7 +3030,7 @@ ], "parameters": { "parent": { - "description": "Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+$", "required": true, @@ -2952,7 +3058,7 @@ ], "parameters": { "parent": { - "description": "Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+$", "required": true, @@ -2980,7 +3086,7 @@ ], "parameters": { "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+$", "required": true, @@ -3012,7 +3118,7 @@ ], "parameters": { "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+$", "required": true, @@ -3111,7 +3217,7 @@ "type": "string" }, "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+$", "required": true, @@ -3168,7 +3274,7 @@ ], "parameters": { "parent": { - "description": "Required. Parent resource name. The format of this value is as follows: `projects/`PROJECT_ID`/locations/`LOCATION_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization): + Projects scope: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Organizations scope: `organizations/`ORG_ID`/locations/`LOCATION_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+$", "required": true, @@ -3347,7 +3453,7 @@ ], "parameters": { "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+$", "required": true, @@ -3507,7 +3613,7 @@ "type": "string" }, "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+$", "required": true, @@ -3551,7 +3657,7 @@ ], "parameters": { "parent": { - "description": "Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+$", "required": true, @@ -3583,7 +3689,7 @@ ], "parameters": { "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+$", "required": true, @@ -3682,7 +3788,7 @@ "type": "string" }, "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+$", "required": true, @@ -3767,7 +3873,7 @@ ], "parameters": { "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+$", "required": true, @@ -3899,7 +4005,7 @@ "type": "string" }, "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+$", "required": true, @@ -4046,7 +4152,7 @@ ], "parameters": { "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+$", "required": true, @@ -4145,7 +4251,7 @@ "type": "string" }, "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+$", "required": true, @@ -4304,7 +4410,7 @@ ], "parameters": { "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID + Organizations scope, location specified: `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no location specified (defaults to global): `organizations/`ORG_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^projects/[^/]+$", "required": true, @@ -4403,7 +4509,7 @@ "type": "string" }, "parent": { - "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", + "description": "Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have [specified a processing location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): + Projects scope, location specified: `projects/`PROJECT_ID`/locations/` LOCATION_ID + Projects scope, no location specified (defaults to global): `projects/`PROJECT_ID The following example `parent` string specifies a parent project with the identifier `example-project`, and specifies the `europe-west3` location for processing data: parent=projects/example-project/locations/europe-west3", "location": "path", "pattern": "^projects/[^/]+$", "required": true, @@ -4451,7 +4557,7 @@ } } }, - "revision": "20240526", + "revision": "20240609", "rootUrl": "https://dlp.googleapis.com/", "schemas": { "GooglePrivacyDlpV2Action": { @@ -4839,7 +4945,7 @@ "type": "object" }, "GooglePrivacyDlpV2BucketingConfig": { - "description": "Generalization function that buckets values based on ranges. The ranges and replacement values are dynamically provided by the user for custom behavior, such as 1-30 -\u003e LOW 31-65 -\u003e MEDIUM 66-100 -\u003e HIGH This can be used on data of type: number, long, string, timestamp. If the bound `Value` type differs from the type of data being transformed, we will first attempt converting the type of the data to be transformed to match the type of the bound before comparing. See https://cloud.google.com/sensitive-data-protection/docs/concepts-bucketing to learn more.", + "description": "Generalization function that buckets values based on ranges. The ranges and replacement values are dynamically provided by the user for custom behavior, such as 1-30 -\u003e LOW, 31-65 -\u003e MEDIUM, 66-100 -\u003e HIGH. This can be used on data of type: number, long, string, timestamp. If the bound `Value` type differs from the type of data being transformed, we will first attempt converting the type of the data to be transformed to match the type of the bound before comparing. See https://cloud.google.com/sensitive-data-protection/docs/concepts-bucketing to learn more.", "id": "GooglePrivacyDlpV2BucketingConfig", "properties": { "buckets": { @@ -7579,6 +7685,7 @@ "ARGENTINA", "AUSTRALIA", "AZERBAIJAN", + "BELARUS", "BELGIUM", "BRAZIL", "CANADA", @@ -7630,6 +7737,7 @@ "The infoType is typically used in Argentina.", "The infoType is typically used in Australia.", "The infoType is typically used in Azerbaijan.", + "The infoType is typically used in Belarus.", "The infoType is typically used in Belgium.", "The infoType is typically used in Brazil.", "The infoType is typically used in Canada.", diff --git a/dlp/v2/dlp-gen.go b/dlp/v2/dlp-gen.go index f442f6a8fbe..a53c04e6657 100644 --- a/dlp/v2/dlp-gen.go +++ b/dlp/v2/dlp-gen.go @@ -1126,8 +1126,8 @@ func (s *GooglePrivacyDlpV2Bucket) MarshalJSON() ([]byte, error) { // GooglePrivacyDlpV2BucketingConfig: Generalization function that buckets // values based on ranges. The ranges and replacement values are dynamically -// provided by the user for custom behavior, such as 1-30 -> LOW 31-65 -> -// MEDIUM 66-100 -> HIGH This can be used on data of type: number, long, +// provided by the user for custom behavior, such as 1-30 -> LOW, 31-65 -> +// MEDIUM, 66-100 -> HIGH. This can be used on data of type: number, long, // string, timestamp. If the bound `Value` type differs from the type of data // being transformed, we will first attempt converting the type of the data to // be transformed to match the type of the bound before comparing. See @@ -5036,6 +5036,7 @@ type GooglePrivacyDlpV2InfoTypeCategory struct { // "ARGENTINA" - The infoType is typically used in Argentina. // "AUSTRALIA" - The infoType is typically used in Australia. // "AZERBAIJAN" - The infoType is typically used in Azerbaijan. + // "BELARUS" - The infoType is typically used in Belarus. // "BELGIUM" - The infoType is typically used in Belgium. // "BRAZIL" - The infoType is typically used in Brazil. // "CANADA" - The infoType is typically used in Canada. @@ -9965,10 +9966,9 @@ type OrganizationsDeidentifyTemplatesCreateCall struct { // the scope of the request (project or organization) and whether you have // specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID + -// Organizations scope, location specified: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID + Organizations scope, location specified: // `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no // location specified (defaults to global): `organizations/`ORG_ID The // following example `parent` string specifies a parent project with the @@ -10295,10 +10295,9 @@ type OrganizationsDeidentifyTemplatesListCall struct { // the scope of the request (project or organization) and whether you have // specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID + -// Organizations scope, location specified: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID + Organizations scope, location specified: // `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no // location specified (defaults to global): `organizations/`ORG_ID The // following example `parent` string specifies a parent project with the @@ -10581,10 +10580,9 @@ type OrganizationsInspectTemplatesCreateCall struct { // the scope of the request (project or organization) and whether you have // specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID + -// Organizations scope, location specified: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID + Organizations scope, location specified: // `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no // location specified (defaults to global): `organizations/`ORG_ID The // following example `parent` string specifies a parent project with the @@ -10910,10 +10908,9 @@ type OrganizationsInspectTemplatesListCall struct { // the scope of the request (project or organization) and whether you have // specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID + -// Organizations scope, location specified: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID + Organizations scope, location specified: // `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no // location specified (defaults to global): `organizations/`ORG_ID The // following example `parent` string specifies a parent project with the @@ -11472,6 +11469,420 @@ func (c *OrganizationsLocationsColumnDataProfilesListCall) Pages(ctx context.Con } } +type OrganizationsLocationsConnectionsCreateCall struct { + s *Service + parent string + googleprivacydlpv2createconnectionrequest *GooglePrivacyDlpV2CreateConnectionRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Create a Connection to an external data source. +// +// - parent: Parent resource name. The format of this value varies depending on +// the scope of the request (project or organization): + Projects scope: +// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Organizations scope: +// `organizations/`ORG_ID`/locations/`LOCATION_ID. +func (r *OrganizationsLocationsConnectionsService) Create(parent string, googleprivacydlpv2createconnectionrequest *GooglePrivacyDlpV2CreateConnectionRequest) *OrganizationsLocationsConnectionsCreateCall { + c := &OrganizationsLocationsConnectionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.googleprivacydlpv2createconnectionrequest = googleprivacydlpv2createconnectionrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *OrganizationsLocationsConnectionsCreateCall) Fields(s ...googleapi.Field) *OrganizationsLocationsConnectionsCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *OrganizationsLocationsConnectionsCreateCall) Context(ctx context.Context) *OrganizationsLocationsConnectionsCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *OrganizationsLocationsConnectionsCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsLocationsConnectionsCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createconnectionrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/connections") + 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 "dlp.organizations.locations.connections.create" call. +// Any non-2xx status code is an error. Response headers are in either +// *GooglePrivacyDlpV2Connection.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 *OrganizationsLocationsConnectionsCreateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2Connection, 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 := &GooglePrivacyDlpV2Connection{ + 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 +} + +type OrganizationsLocationsConnectionsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Delete a Connection. +// +// - name: Resource name of the Connection to be deleted, in the format: +// `projects/{project}/locations/{location}/connections/{connection}`. +func (r *OrganizationsLocationsConnectionsService) Delete(name string) *OrganizationsLocationsConnectionsDeleteCall { + c := &OrganizationsLocationsConnectionsDeleteCall{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 +// details. +func (c *OrganizationsLocationsConnectionsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsConnectionsDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *OrganizationsLocationsConnectionsDeleteCall) Context(ctx context.Context) *OrganizationsLocationsConnectionsDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *OrganizationsLocationsConnectionsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsLocationsConnectionsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+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 "dlp.organizations.locations.connections.delete" call. +// Any non-2xx status code is an error. Response headers are in either +// *GoogleProtobufEmpty.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 *OrganizationsLocationsConnectionsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, 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 := &GoogleProtobufEmpty{ + 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 +} + +type OrganizationsLocationsConnectionsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Get a Connection by name. +// +// - name: Resource name in the format: +// `projects/{project}/locations/{location}/connections/{connection}`. +func (r *OrganizationsLocationsConnectionsService) Get(name string) *OrganizationsLocationsConnectionsGetCall { + c := &OrganizationsLocationsConnectionsGetCall{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 +// details. +func (c *OrganizationsLocationsConnectionsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsConnectionsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *OrganizationsLocationsConnectionsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsConnectionsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *OrganizationsLocationsConnectionsGetCall) Context(ctx context.Context) *OrganizationsLocationsConnectionsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *OrganizationsLocationsConnectionsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsLocationsConnectionsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "v2/{+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 "dlp.organizations.locations.connections.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *GooglePrivacyDlpV2Connection.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 *OrganizationsLocationsConnectionsGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2Connection, 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 := &GooglePrivacyDlpV2Connection{ + 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 +} + +type OrganizationsLocationsConnectionsPatchCall struct { + s *Service + name string + googleprivacydlpv2updateconnectionrequest *GooglePrivacyDlpV2UpdateConnectionRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Update a Connection. +// +// - name: Resource name in the format: +// `projects/{project}/locations/{location}/connections/{connection}`. +func (r *OrganizationsLocationsConnectionsService) Patch(name string, googleprivacydlpv2updateconnectionrequest *GooglePrivacyDlpV2UpdateConnectionRequest) *OrganizationsLocationsConnectionsPatchCall { + c := &OrganizationsLocationsConnectionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.googleprivacydlpv2updateconnectionrequest = googleprivacydlpv2updateconnectionrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *OrganizationsLocationsConnectionsPatchCall) Fields(s ...googleapi.Field) *OrganizationsLocationsConnectionsPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *OrganizationsLocationsConnectionsPatchCall) Context(ctx context.Context) *OrganizationsLocationsConnectionsPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *OrganizationsLocationsConnectionsPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *OrganizationsLocationsConnectionsPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updateconnectionrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+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 "dlp.organizations.locations.connections.patch" call. +// Any non-2xx status code is an error. Response headers are in either +// *GooglePrivacyDlpV2Connection.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 *OrganizationsLocationsConnectionsPatchCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2Connection, 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 := &GooglePrivacyDlpV2Connection{ + 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 +} + type OrganizationsLocationsConnectionsSearchCall struct { s *Service parent string @@ -11642,10 +12053,9 @@ type OrganizationsLocationsDeidentifyTemplatesCreateCall struct { // the scope of the request (project or organization) and whether you have // specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID + -// Organizations scope, location specified: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID + Organizations scope, location specified: // `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no // location specified (defaults to global): `organizations/`ORG_ID The // following example `parent` string specifies a parent project with the @@ -11972,10 +12382,9 @@ type OrganizationsLocationsDeidentifyTemplatesListCall struct { // the scope of the request (project or organization) and whether you have // specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID + -// Organizations scope, location specified: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID + Organizations scope, location specified: // `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no // location specified (defaults to global): `organizations/`ORG_ID The // following example `parent` string specifies a parent project with the @@ -12251,8 +12660,10 @@ type OrganizationsLocationsDiscoveryConfigsCreateCall struct { // Create: Creates a config for discovery to scan and profile storage. // -// - parent: Parent resource name. The format of this value is as follows: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID The following example +// - parent: Parent resource name. The format of this value varies depending on +// the scope of the request (project or organization): + Projects scope: +// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Organizations scope: +// `organizations/`ORG_ID`/locations/`LOCATION_ID The following example // `parent` string specifies a parent project with the identifier // `example-project`, and specifies the `europe-west3` location for // processing data: parent=projects/example-project/locations/europe-west3. @@ -12833,12 +13244,11 @@ type OrganizationsLocationsDlpJobsListCall struct { // - parent: Parent resource name. The format of this value varies depending on // whether you have specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID The -// following example `parent` string specifies a parent project with the -// identifier `example-project`, and specifies the `europe-west3` location -// for processing data: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: // parent=projects/example-project/locations/europe-west3. func (r *OrganizationsLocationsDlpJobsService) List(parentid string) *OrganizationsLocationsDlpJobsListCall { c := &OrganizationsLocationsDlpJobsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -13043,10 +13453,9 @@ type OrganizationsLocationsInspectTemplatesCreateCall struct { // the scope of the request (project or organization) and whether you have // specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID + -// Organizations scope, location specified: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID + Organizations scope, location specified: // `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no // location specified (defaults to global): `organizations/`ORG_ID The // following example `parent` string specifies a parent project with the @@ -13372,10 +13781,9 @@ type OrganizationsLocationsInspectTemplatesListCall struct { // the scope of the request (project or organization) and whether you have // specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID + -// Organizations scope, location specified: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID + Organizations scope, location specified: // `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no // location specified (defaults to global): `organizations/`ORG_ID The // following example `parent` string specifies a parent project with the @@ -13657,12 +14065,11 @@ type OrganizationsLocationsJobTriggersCreateCall struct { // - parent: Parent resource name. The format of this value varies depending on // whether you have specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID The -// following example `parent` string specifies a parent project with the -// identifier `example-project`, and specifies the `europe-west3` location -// for processing data: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: // parent=projects/example-project/locations/europe-west3. func (r *OrganizationsLocationsJobTriggersService) Create(parentid string, googleprivacydlpv2createjobtriggerrequest *GooglePrivacyDlpV2CreateJobTriggerRequest) *OrganizationsLocationsJobTriggersCreateCall { c := &OrganizationsLocationsJobTriggersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -13980,12 +14387,11 @@ type OrganizationsLocationsJobTriggersListCall struct { // - parent: Parent resource name. The format of this value varies depending on // whether you have specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID The -// following example `parent` string specifies a parent project with the -// identifier `example-project`, and specifies the `europe-west3` location -// for processing data: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: // parent=projects/example-project/locations/europe-west3. func (r *OrganizationsLocationsJobTriggersService) List(parentid string) *OrganizationsLocationsJobTriggersListCall { c := &OrganizationsLocationsJobTriggersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -14579,10 +14985,9 @@ type OrganizationsLocationsStoredInfoTypesCreateCall struct { // the scope of the request (project or organization) and whether you have // specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID + -// Organizations scope, location specified: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID + Organizations scope, location specified: // `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no // location specified (defaults to global): `organizations/`ORG_ID The // following example `parent` string specifies a parent project with the @@ -14908,12 +15313,11 @@ type OrganizationsLocationsStoredInfoTypesListCall struct { // the scope of the request (project or organization) and whether you have // specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID The -// following example `parent` string specifies a parent project with the -// identifier `example-project`, and specifies the `europe-west3` location -// for processing data: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: // parent=projects/example-project/locations/europe-west3. func (r *OrganizationsLocationsStoredInfoTypesService) List(parentid string) *OrganizationsLocationsStoredInfoTypesListCall { c := &OrganizationsLocationsStoredInfoTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -15581,10 +15985,9 @@ type OrganizationsStoredInfoTypesCreateCall struct { // the scope of the request (project or organization) and whether you have // specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID + -// Organizations scope, location specified: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID + Organizations scope, location specified: // `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no // location specified (defaults to global): `organizations/`ORG_ID The // following example `parent` string specifies a parent project with the @@ -15910,12 +16313,11 @@ type OrganizationsStoredInfoTypesListCall struct { // the scope of the request (project or organization) and whether you have // specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID The -// following example `parent` string specifies a parent project with the -// identifier `example-project`, and specifies the `europe-west3` location -// for processing data: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: // parent=projects/example-project/locations/europe-west3. func (r *OrganizationsStoredInfoTypesService) List(parentid string) *OrganizationsStoredInfoTypesListCall { c := &OrganizationsStoredInfoTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -16196,12 +16598,11 @@ type ProjectsContentDeidentifyCall struct { // - parent: Parent resource name. The format of this value varies depending on // whether you have specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID The -// following example `parent` string specifies a parent project with the -// identifier `example-project`, and specifies the `europe-west3` location -// for processing data: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: // parent=projects/example-project/locations/europe-west3. func (r *ProjectsContentService) Deidentify(parentid string, googleprivacydlpv2deidentifycontentrequest *GooglePrivacyDlpV2DeidentifyContentRequest) *ProjectsContentDeidentifyCall { c := &ProjectsContentDeidentifyCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -16313,12 +16714,11 @@ type ProjectsContentInspectCall struct { // - parent: Parent resource name. The format of this value varies depending on // whether you have specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID The -// following example `parent` string specifies a parent project with the -// identifier `example-project`, and specifies the `europe-west3` location -// for processing data: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: // parent=projects/example-project/locations/europe-west3. func (r *ProjectsContentService) Inspect(parentid string, googleprivacydlpv2inspectcontentrequest *GooglePrivacyDlpV2InspectContentRequest) *ProjectsContentInspectCall { c := &ProjectsContentInspectCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -16426,12 +16826,11 @@ type ProjectsContentReidentifyCall struct { // - parent: Parent resource name. The format of this value varies depending on // whether you have specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID The -// following example `parent` string specifies a parent project with the -// identifier `example-project`, and specifies the `europe-west3` location -// for processing data: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: // parent=projects/example-project/locations/europe-west3. func (r *ProjectsContentService) Reidentify(parentid string, googleprivacydlpv2reidentifycontentrequest *GooglePrivacyDlpV2ReidentifyContentRequest) *ProjectsContentReidentifyCall { c := &ProjectsContentReidentifyCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -16541,10 +16940,9 @@ type ProjectsDeidentifyTemplatesCreateCall struct { // the scope of the request (project or organization) and whether you have // specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID + -// Organizations scope, location specified: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID + Organizations scope, location specified: // `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no // location specified (defaults to global): `organizations/`ORG_ID The // following example `parent` string specifies a parent project with the @@ -16871,10 +17269,9 @@ type ProjectsDeidentifyTemplatesListCall struct { // the scope of the request (project or organization) and whether you have // specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID + -// Organizations scope, location specified: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID + Organizations scope, location specified: // `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no // location specified (defaults to global): `organizations/`ORG_ID The // following example `parent` string specifies a parent project with the @@ -17267,12 +17664,11 @@ type ProjectsDlpJobsCreateCall struct { // - parent: Parent resource name. The format of this value varies depending on // whether you have specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID The -// following example `parent` string specifies a parent project with the -// identifier `example-project`, and specifies the `europe-west3` location -// for processing data: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: // parent=projects/example-project/locations/europe-west3. func (r *ProjectsDlpJobsService) Create(parentid string, googleprivacydlpv2createdlpjobrequest *GooglePrivacyDlpV2CreateDlpJobRequest) *ProjectsDlpJobsCreateCall { c := &ProjectsDlpJobsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -17596,12 +17992,11 @@ type ProjectsDlpJobsListCall struct { // - parent: Parent resource name. The format of this value varies depending on // whether you have specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID The -// following example `parent` string specifies a parent project with the -// identifier `example-project`, and specifies the `europe-west3` location -// for processing data: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: // parent=projects/example-project/locations/europe-west3. func (r *ProjectsDlpJobsService) List(parentid string) *ProjectsDlpJobsListCall { c := &ProjectsDlpJobsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -17808,12 +18203,11 @@ type ProjectsImageRedactCall struct { // - parent: Parent resource name. The format of this value varies depending on // whether you have specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID The -// following example `parent` string specifies a parent project with the -// identifier `example-project`, and specifies the `europe-west3` location -// for processing data: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: // parent=projects/example-project/locations/europe-west3. func (r *ProjectsImageService) Redact(parentid string, googleprivacydlpv2redactimagerequest *GooglePrivacyDlpV2RedactImageRequest) *ProjectsImageRedactCall { c := &ProjectsImageRedactCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -17923,10 +18317,9 @@ type ProjectsInspectTemplatesCreateCall struct { // the scope of the request (project or organization) and whether you have // specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID + -// Organizations scope, location specified: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID + Organizations scope, location specified: // `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no // location specified (defaults to global): `organizations/`ORG_ID The // following example `parent` string specifies a parent project with the @@ -18252,10 +18645,9 @@ type ProjectsInspectTemplatesListCall struct { // the scope of the request (project or organization) and whether you have // specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID + -// Organizations scope, location specified: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID + Organizations scope, location specified: // `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no // location specified (defaults to global): `organizations/`ORG_ID The // following example `parent` string specifies a parent project with the @@ -18641,12 +19033,11 @@ type ProjectsJobTriggersCreateCall struct { // - parent: Parent resource name. The format of this value varies depending on // whether you have specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID The -// following example `parent` string specifies a parent project with the -// identifier `example-project`, and specifies the `europe-west3` location -// for processing data: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: // parent=projects/example-project/locations/europe-west3. func (r *ProjectsJobTriggersService) Create(parentid string, googleprivacydlpv2createjobtriggerrequest *GooglePrivacyDlpV2CreateJobTriggerRequest) *ProjectsJobTriggersCreateCall { c := &ProjectsJobTriggersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -18964,12 +19355,11 @@ type ProjectsJobTriggersListCall struct { // - parent: Parent resource name. The format of this value varies depending on // whether you have specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID The -// following example `parent` string specifies a parent project with the -// identifier `example-project`, and specifies the `europe-west3` location -// for processing data: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: // parent=projects/example-project/locations/europe-west3. func (r *ProjectsJobTriggersService) List(parentid string) *ProjectsJobTriggersListCall { c := &ProjectsJobTriggersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -19568,8 +19958,10 @@ type ProjectsLocationsConnectionsCreateCall struct { // Create: Create a Connection to an external data source. // -// - parent: Parent resource name in the format: -// `projects/{project}/locations/{location}`. +// - parent: Parent resource name. The format of this value varies depending on +// the scope of the request (project or organization): + Projects scope: +// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Organizations scope: +// `organizations/`ORG_ID`/locations/`LOCATION_ID. func (r *ProjectsLocationsConnectionsService) Create(parent string, googleprivacydlpv2createconnectionrequest *GooglePrivacyDlpV2CreateConnectionRequest) *ProjectsLocationsConnectionsCreateCall { c := &ProjectsLocationsConnectionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.parent = parent @@ -20292,12 +20684,11 @@ type ProjectsLocationsContentDeidentifyCall struct { // - parent: Parent resource name. The format of this value varies depending on // whether you have specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID The -// following example `parent` string specifies a parent project with the -// identifier `example-project`, and specifies the `europe-west3` location -// for processing data: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: // parent=projects/example-project/locations/europe-west3. func (r *ProjectsLocationsContentService) Deidentify(parentid string, googleprivacydlpv2deidentifycontentrequest *GooglePrivacyDlpV2DeidentifyContentRequest) *ProjectsLocationsContentDeidentifyCall { c := &ProjectsLocationsContentDeidentifyCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -20409,12 +20800,11 @@ type ProjectsLocationsContentInspectCall struct { // - parent: Parent resource name. The format of this value varies depending on // whether you have specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID The -// following example `parent` string specifies a parent project with the -// identifier `example-project`, and specifies the `europe-west3` location -// for processing data: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: // parent=projects/example-project/locations/europe-west3. func (r *ProjectsLocationsContentService) Inspect(parentid string, googleprivacydlpv2inspectcontentrequest *GooglePrivacyDlpV2InspectContentRequest) *ProjectsLocationsContentInspectCall { c := &ProjectsLocationsContentInspectCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -20522,12 +20912,11 @@ type ProjectsLocationsContentReidentifyCall struct { // - parent: Parent resource name. The format of this value varies depending on // whether you have specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID The -// following example `parent` string specifies a parent project with the -// identifier `example-project`, and specifies the `europe-west3` location -// for processing data: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: // parent=projects/example-project/locations/europe-west3. func (r *ProjectsLocationsContentService) Reidentify(parentid string, googleprivacydlpv2reidentifycontentrequest *GooglePrivacyDlpV2ReidentifyContentRequest) *ProjectsLocationsContentReidentifyCall { c := &ProjectsLocationsContentReidentifyCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -20637,10 +21026,9 @@ type ProjectsLocationsDeidentifyTemplatesCreateCall struct { // the scope of the request (project or organization) and whether you have // specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID + -// Organizations scope, location specified: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID + Organizations scope, location specified: // `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no // location specified (defaults to global): `organizations/`ORG_ID The // following example `parent` string specifies a parent project with the @@ -20967,10 +21355,9 @@ type ProjectsLocationsDeidentifyTemplatesListCall struct { // the scope of the request (project or organization) and whether you have // specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID + -// Organizations scope, location specified: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID + Organizations scope, location specified: // `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no // location specified (defaults to global): `organizations/`ORG_ID The // following example `parent` string specifies a parent project with the @@ -21246,8 +21633,10 @@ type ProjectsLocationsDiscoveryConfigsCreateCall struct { // Create: Creates a config for discovery to scan and profile storage. // -// - parent: Parent resource name. The format of this value is as follows: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID The following example +// - parent: Parent resource name. The format of this value varies depending on +// the scope of the request (project or organization): + Projects scope: +// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Organizations scope: +// `organizations/`ORG_ID`/locations/`LOCATION_ID The following example // `parent` string specifies a parent project with the identifier // `example-project`, and specifies the `europe-west3` location for // processing data: parent=projects/example-project/locations/europe-west3. @@ -21938,12 +22327,11 @@ type ProjectsLocationsDlpJobsCreateCall struct { // - parent: Parent resource name. The format of this value varies depending on // whether you have specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID The -// following example `parent` string specifies a parent project with the -// identifier `example-project`, and specifies the `europe-west3` location -// for processing data: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: // parent=projects/example-project/locations/europe-west3. func (r *ProjectsLocationsDlpJobsService) Create(parentid string, googleprivacydlpv2createdlpjobrequest *GooglePrivacyDlpV2CreateDlpJobRequest) *ProjectsLocationsDlpJobsCreateCall { c := &ProjectsLocationsDlpJobsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -22474,12 +22862,11 @@ type ProjectsLocationsDlpJobsListCall struct { // - parent: Parent resource name. The format of this value varies depending on // whether you have specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID The -// following example `parent` string specifies a parent project with the -// identifier `example-project`, and specifies the `europe-west3` location -// for processing data: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: // parent=projects/example-project/locations/europe-west3. func (r *ProjectsLocationsDlpJobsService) List(parentid string) *ProjectsLocationsDlpJobsListCall { c := &ProjectsLocationsDlpJobsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -22686,12 +23073,11 @@ type ProjectsLocationsImageRedactCall struct { // - parent: Parent resource name. The format of this value varies depending on // whether you have specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID The -// following example `parent` string specifies a parent project with the -// identifier `example-project`, and specifies the `europe-west3` location -// for processing data: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: // parent=projects/example-project/locations/europe-west3. func (r *ProjectsLocationsImageService) Redact(parentid string, googleprivacydlpv2redactimagerequest *GooglePrivacyDlpV2RedactImageRequest) *ProjectsLocationsImageRedactCall { c := &ProjectsLocationsImageRedactCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -22801,10 +23187,9 @@ type ProjectsLocationsInspectTemplatesCreateCall struct { // the scope of the request (project or organization) and whether you have // specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID + -// Organizations scope, location specified: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID + Organizations scope, location specified: // `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no // location specified (defaults to global): `organizations/`ORG_ID The // following example `parent` string specifies a parent project with the @@ -23130,10 +23515,9 @@ type ProjectsLocationsInspectTemplatesListCall struct { // the scope of the request (project or organization) and whether you have // specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID + -// Organizations scope, location specified: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID + Organizations scope, location specified: // `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no // location specified (defaults to global): `organizations/`ORG_ID The // following example `parent` string specifies a parent project with the @@ -23519,12 +23903,11 @@ type ProjectsLocationsJobTriggersCreateCall struct { // - parent: Parent resource name. The format of this value varies depending on // whether you have specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID The -// following example `parent` string specifies a parent project with the -// identifier `example-project`, and specifies the `europe-west3` location -// for processing data: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: // parent=projects/example-project/locations/europe-west3. func (r *ProjectsLocationsJobTriggersService) Create(parentid string, googleprivacydlpv2createjobtriggerrequest *GooglePrivacyDlpV2CreateJobTriggerRequest) *ProjectsLocationsJobTriggersCreateCall { c := &ProjectsLocationsJobTriggersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -23947,12 +24330,11 @@ type ProjectsLocationsJobTriggersListCall struct { // - parent: Parent resource name. The format of this value varies depending on // whether you have specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID The -// following example `parent` string specifies a parent project with the -// identifier `example-project`, and specifies the `europe-west3` location -// for processing data: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: // parent=projects/example-project/locations/europe-west3. func (r *ProjectsLocationsJobTriggersService) List(parentid string) *ProjectsLocationsJobTriggersListCall { c := &ProjectsLocationsJobTriggersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -24546,10 +24928,9 @@ type ProjectsLocationsStoredInfoTypesCreateCall struct { // the scope of the request (project or organization) and whether you have // specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID + -// Organizations scope, location specified: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID + Organizations scope, location specified: // `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no // location specified (defaults to global): `organizations/`ORG_ID The // following example `parent` string specifies a parent project with the @@ -24875,12 +25256,11 @@ type ProjectsLocationsStoredInfoTypesListCall struct { // the scope of the request (project or organization) and whether you have // specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID The -// following example `parent` string specifies a parent project with the -// identifier `example-project`, and specifies the `europe-west3` location -// for processing data: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: // parent=projects/example-project/locations/europe-west3. func (r *ProjectsLocationsStoredInfoTypesService) List(parentid string) *ProjectsLocationsStoredInfoTypesListCall { c := &ProjectsLocationsStoredInfoTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} @@ -25548,10 +25928,9 @@ type ProjectsStoredInfoTypesCreateCall struct { // the scope of the request (project or organization) and whether you have // specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID + -// Organizations scope, location specified: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID + Organizations scope, location specified: // `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no // location specified (defaults to global): `organizations/`ORG_ID The // following example `parent` string specifies a parent project with the @@ -25877,12 +26256,11 @@ type ProjectsStoredInfoTypesListCall struct { // the scope of the request (project or organization) and whether you have // specified a processing location // (https://cloud.google.com/sensitive-data-protection/docs/specifying-location): -// - Projects scope, location specified: -// `projects/`PROJECT_ID`/locations/`LOCATION_ID + Projects scope, no -// location specified (defaults to global): `projects/`PROJECT_ID The -// following example `parent` string specifies a parent project with the -// identifier `example-project`, and specifies the `europe-west3` location -// for processing data: +// - Projects scope, location specified: `projects/`PROJECT_ID`/locations/` +// LOCATION_ID + Projects scope, no location specified (defaults to global): +// `projects/`PROJECT_ID The following example `parent` string specifies a +// parent project with the identifier `example-project`, and specifies the +// `europe-west3` location for processing data: // parent=projects/example-project/locations/europe-west3. func (r *ProjectsStoredInfoTypesService) List(parentid string) *ProjectsStoredInfoTypesListCall { c := &ProjectsStoredInfoTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} diff --git a/firestore/v1/firestore-api.json b/firestore/v1/firestore-api.json index 94652016217..545c12a0bf2 100644 --- a/firestore/v1/firestore-api.json +++ b/firestore/v1/firestore-api.json @@ -586,7 +586,7 @@ ], "parameters": { "name": { - "description": "Required. A field name of the form `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` A field path may be a simple field name, e.g. `address` or a path to fields within map_value , e.g. `address.city`, or a special field path. The only valid special field is `*`, which represents any field. Field paths may be quoted using ` (backtick). The only character that needs to be escaped within a quoted field path is the backtick character itself, escaped using a backslash. Special characters in field paths that must be quoted include: `*`, `.`, ``` (backtick), `[`, `]`, as well as any ascii symbolic characters. Examples: (Note: Comments here are written in markdown syntax, so there is an additional layer of backticks to represent a code block) `\\`address.city\\`` represents a field named `address.city`, not the map key `city` in the field `address`. `\\`*\\`` represents a field named `*`, not any field. A special `Field` contains the default indexing settings for all fields. This field's resource name is: `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*` Indexes defined on this `Field` will be applied to all fields which do not have their own `Field` index configuration.", + "description": "Required. A field name of the form: `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` A field path can be a simple field name, e.g. `address` or a path to fields within `map_value` , e.g. `address.city`, or a special field path. The only valid special field is `*`, which represents any field. Field paths can be quoted using `` ` `` (backtick). The only character that must be escaped within a quoted field path is the backtick character itself, escaped using a backslash. Special characters in field paths that must be quoted include: `*`, `.`, `` ` `` (backtick), `[`, `]`, as well as any ascii symbolic characters. Examples: `` `address.city` `` represents a field named `address.city`, not the map key `city` in the field `address`. `` `*` `` represents a field named `*`, not any field. A special `Field` contains the default indexing settings for all fields. This field's resource name is: `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*` Indexes defined on this `Field` will be applied to all fields which do not have their own `Field` index configuration.", "location": "path", "pattern": "^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+/fields/[^/]+$", "required": true, @@ -1677,7 +1677,7 @@ } } }, - "revision": "20240521", + "revision": "20240610", "rootUrl": "https://firestore.googleapis.com/", "schemas": { "Aggregation": { @@ -2807,7 +2807,7 @@ "description": "The index configuration for this field. If unset, field indexing will revert to the configuration defined by the `ancestor_field`. To explicitly remove all indexes for this field, specify an index config with an empty list of indexes." }, "name": { - "description": "Required. A field name of the form `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` A field path may be a simple field name, e.g. `address` or a path to fields within map_value , e.g. `address.city`, or a special field path. The only valid special field is `*`, which represents any field. Field paths may be quoted using ` (backtick). The only character that needs to be escaped within a quoted field path is the backtick character itself, escaped using a backslash. Special characters in field paths that must be quoted include: `*`, `.`, ``` (backtick), `[`, `]`, as well as any ascii symbolic characters. Examples: (Note: Comments here are written in markdown syntax, so there is an additional layer of backticks to represent a code block) `\\`address.city\\`` represents a field named `address.city`, not the map key `city` in the field `address`. `\\`*\\`` represents a field named `*`, not any field. A special `Field` contains the default indexing settings for all fields. This field's resource name is: `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*` Indexes defined on this `Field` will be applied to all fields which do not have their own `Field` index configuration.", + "description": "Required. A field name of the form: `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` A field path can be a simple field name, e.g. `address` or a path to fields within `map_value` , e.g. `address.city`, or a special field path. The only valid special field is `*`, which represents any field. Field paths can be quoted using `` ` `` (backtick). The only character that must be escaped within a quoted field path is the backtick character itself, escaped using a backslash. Special characters in field paths that must be quoted include: `*`, `.`, `` ` `` (backtick), `[`, `]`, as well as any ascii symbolic characters. Examples: `` `address.city` `` represents a field named `address.city`, not the map key `city` in the field `address`. `` `*` `` represents a field named `*`, not any field. A special `Field` contains the default indexing settings for all fields. This field's resource name is: `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*` Indexes defined on this `Field` will be applied to all fields which do not have their own `Field` index configuration.", "type": "string" }, "ttlConfig": { @@ -3369,6 +3369,18 @@ "databaseSnapshot": { "$ref": "GoogleFirestoreAdminV1DatabaseSnapshot", "description": "Database snapshot to restore from. The source database must exist and have enabled PITR. The restored database will be created in the same location as the source database." + }, + "kmsKeyName": { + "description": "Use Customer Managed Encryption Keys (CMEK) for encryption. Only keys in the same location as this database are allowed to be used for encryption. For Firestore's nam5 multi-region, this corresponds to Cloud KMS multi-region us. For Firestore's eur3 multi-region, this corresponds to Cloud KMS multi-region europe. See https://cloud.google.com/kms/docs/locations. The expected format is `projects/{project_id}/locations/{kms_location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.", + "type": "string" + }, + "useBackupEncryption": { + "$ref": "Empty", + "description": "The restored database will use the same encryption configuration as the backup. This is the default option when no `encryption_config` is specified." + }, + "useGoogleDefaultEncryption": { + "$ref": "Empty", + "description": "Use Google default encryption." } }, "type": "object" diff --git a/firestore/v1/firestore-gen.go b/firestore/v1/firestore-gen.go index 48f0f29390e..b259a3a1a82 100644 --- a/firestore/v1/firestore-gen.go +++ b/firestore/v1/firestore-gen.go @@ -1860,21 +1860,20 @@ type GoogleFirestoreAdminV1Field struct { // To explicitly remove all indexes for this field, specify an index config // with an empty list of indexes. IndexConfig *GoogleFirestoreAdminV1IndexConfig `json:"indexConfig,omitempty"` - // Name: Required. A field name of the form + // Name: Required. A field name of the form: // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_i - // d}/fields/{field_path}` A field path may be a simple field name, e.g. - // `address` or a path to fields within map_value , e.g. `address.city`, or a + // d}/fields/{field_path}` A field path can be a simple field name, e.g. + // `address` or a path to fields within `map_value` , e.g. `address.city`, or a // special field path. The only valid special field is `*`, which represents - // any field. Field paths may be quoted using ` (backtick). The only character - // that needs to be escaped within a quoted field path is the backtick + // any field. Field paths can be quoted using `` ` `` (backtick). The only + // character that must be escaped within a quoted field path is the backtick // character itself, escaped using a backslash. Special characters in field - // paths that must be quoted include: `*`, `.`, ``` (backtick), `[`, `]`, as - // well as any ascii symbolic characters. Examples: (Note: Comments here are - // written in markdown syntax, so there is an additional layer of backticks to - // represent a code block) `\`address.city\`` represents a field named - // `address.city`, not the map key `city` in the field `address`. `\`*\`` - // represents a field named `*`, not any field. A special `Field` contains the - // default indexing settings for all fields. This field's resource name is: + // paths that must be quoted include: `*`, `.`, `` ` `` (backtick), `[`, `]`, + // as well as any ascii symbolic characters. Examples: `` `address.city` `` + // represents a field named `address.city`, not the map key `city` in the field + // `address`. `` `*` `` represents a field named `*`, not any field. A special + // `Field` contains the default indexing settings for all fields. This field's + // resource name is: // `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/f // ields/*` Indexes defined on this `Field` will be applied to all fields which // do not have their own `Field` index configuration. @@ -2542,6 +2541,21 @@ type GoogleFirestoreAdminV1RestoreDatabaseRequest struct { // must exist and have enabled PITR. The restored database will be created in // the same location as the source database. DatabaseSnapshot *GoogleFirestoreAdminV1DatabaseSnapshot `json:"databaseSnapshot,omitempty"` + // KmsKeyName: Use Customer Managed Encryption Keys (CMEK) for encryption. Only + // keys in the same location as this database are allowed to be used for + // encryption. For Firestore's nam5 multi-region, this corresponds to Cloud KMS + // multi-region us. For Firestore's eur3 multi-region, this corresponds to + // Cloud KMS multi-region europe. See + // https://cloud.google.com/kms/docs/locations. The expected format is + // `projects/{project_id}/locations/{kms_location}/keyRings/{key_ring}/cryptoKey + // s/{crypto_key}`. + KmsKeyName string `json:"kmsKeyName,omitempty"` + // UseBackupEncryption: The restored database will use the same encryption + // configuration as the backup. This is the default option when no + // `encryption_config` is specified. + UseBackupEncryption *Empty `json:"useBackupEncryption,omitempty"` + // UseGoogleDefaultEncryption: Use Google default encryption. + UseGoogleDefaultEncryption *Empty `json:"useGoogleDefaultEncryption,omitempty"` // ForceSendFields is a list of field names (e.g. "Backup") to unconditionally // include in API requests. By default, fields with empty or default values are // omitted from API requests. See @@ -5833,22 +5847,20 @@ type ProjectsDatabasesCollectionGroupsFieldsPatchCall struct { // `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/f // ields/*`. // -// - name: A field name of the form +// - name: A field name of the form: // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection -// _id}/fields/{field_path}` A field path may be a simple field name, e.g. -// `address` or a path to fields within map_value , e.g. `address.city`, or a -// special field path. The only valid special field is `*`, which represents -// any field. Field paths may be quoted using ` (backtick). The only -// character that needs to be escaped within a quoted field path is the +// _id}/fields/{field_path}` A field path can be a simple field name, e.g. +// `address` or a path to fields within `map_value` , e.g. `address.city`, or +// a special field path. The only valid special field is `*`, which +// represents any field. Field paths can be quoted using “ ` “ (backtick). +// The only character that must be escaped within a quoted field path is the // backtick character itself, escaped using a backslash. Special characters -// in field paths that must be quoted include: `*`, `.`, ``` (backtick), `[`, -// `]`, as well as any ascii symbolic characters. Examples: (Note: Comments -// here are written in markdown syntax, so there is an additional layer of -// backticks to represent a code block) `\`address.city\“ represents a field -// named `address.city`, not the map key `city` in the field `address`. -// `\`*\“ represents a field named `*`, not any field. A special `Field` -// contains the default indexing settings for all fields. This field's -// resource name is: +// in field paths that must be quoted include: `*`, `.`, “ ` “ (backtick), +// `[`, `]`, as well as any ascii symbolic characters. Examples: “ +// `address.city` “ represents a field named `address.city`, not the map key +// `city` in the field `address`. “ `*` “ represents a field named `*`, not +// any field. A special `Field` contains the default indexing settings for +// all fields. This field's resource name is: // `projects/{project_id}/databases/{database_id}/collectionGroups/__default__ // /fields/*` Indexes defined on this `Field` will be applied to all fields // which do not have their own `Field` index configuration. diff --git a/merchantapi/accounts_v1beta/merchantapi-api.json b/merchantapi/accounts_v1beta/merchantapi-api.json new file mode 100644 index 00000000000..cbaa5a48e21 --- /dev/null +++ b/merchantapi/accounts_v1beta/merchantapi-api.json @@ -0,0 +1,3622 @@ +{ + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/content": { + "description": "Manage your product listings and accounts for Google Shopping" + } + } + } + }, + "basePath": "", + "baseUrl": "https://merchantapi.googleapis.com/", + "batchPath": "batch", + "canonicalName": "Merchant", + "description": "Programmatically manage your Merchant Center Accounts.", + "discoveryVersion": "v1", + "documentationLink": "https://developers.devsite.corp.google.com/merchant/api", + "fullyEncodeReservedExpansion": true, + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "id": "merchantapi:accounts_v1beta", + "kind": "discovery#restDescription", + "mtlsRootUrl": "https://merchantapi.mtls.googleapis.com/", + "name": "merchantapi", + "ownerDomain": "google.com", + "ownerName": "Google", + "parameters": { + "$.xgafv": { + "description": "V1 error format.", + "enum": [ + "1", + "2" + ], + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "type": "string" + }, + "access_token": { + "description": "OAuth access token.", + "location": "query", + "type": "string" + }, + "alt": { + "default": "json", + "description": "Data format for response.", + "enum": [ + "json", + "media", + "proto" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query", + "type": "string" + }, + "callback": { + "description": "JSONP", + "location": "query", + "type": "string" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "location": "query", + "type": "string" + }, + "key": { + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query", + "type": "string" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "location": "query", + "type": "string" + }, + "prettyPrint": { + "default": "true", + "description": "Returns response with indentations and line breaks.", + "location": "query", + "type": "boolean" + }, + "quotaUser": { + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query", + "type": "string" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query", + "type": "string" + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query", + "type": "string" + } + }, + "protocol": "rest", + "resources": { + "accounts": { + "methods": { + "createAndConfigure": { + "description": "Creates a standalone Merchant Center account with additional configuration. Adds the user that makes the request as an admin for the new account.", + "flatPath": "accounts/v1beta/accounts:createAndConfigure", + "httpMethod": "POST", + "id": "merchantapi.accounts.createAndConfigure", + "parameterOrder": [], + "parameters": {}, + "path": "accounts/v1beta/accounts:createAndConfigure", + "request": { + "$ref": "CreateAndConfigureAccountRequest" + }, + "response": { + "$ref": "Account" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "delete": { + "description": "Deletes the specified account regardless of its type: standalone, MCA or sub-account. Deleting an MCA leads to the deletion of all of its sub-accounts. Executing this method requires admin access.", + "flatPath": "accounts/v1beta/accounts/{accountsId}", + "httpMethod": "DELETE", + "id": "merchantapi.accounts.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the account to delete. Format: `accounts/{account}`", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1beta/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "get": { + "description": "Retrieves an account from your Merchant Center account. After inserting, updating, or deleting an account, it may take several minutes before changes take effect.", + "flatPath": "accounts/v1beta/accounts/{accountsId}", + "httpMethod": "GET", + "id": "merchantapi.accounts.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the account to retrieve. Format: `accounts/{account}`", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1beta/{+name}", + "response": { + "$ref": "Account" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "getBusinessIdentity": { + "description": "Retrieves the business identity of an account.", + "flatPath": "accounts/v1beta/accounts/{accountsId}/businessIdentity", + "httpMethod": "GET", + "id": "merchantapi.accounts.getBusinessIdentity", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the business identity. Format: `accounts/{account}/businessIdentity`", + "location": "path", + "pattern": "^accounts/[^/]+/businessIdentity$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1beta/{+name}", + "response": { + "$ref": "BusinessIdentity" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "getBusinessInfo": { + "description": "Retrieves the business info of an account.", + "flatPath": "accounts/v1beta/accounts/{accountsId}/businessInfo", + "httpMethod": "GET", + "id": "merchantapi.accounts.getBusinessInfo", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the business info. Format: `accounts/{account}/businessInfo`", + "location": "path", + "pattern": "^accounts/[^/]+/businessInfo$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1beta/{+name}", + "response": { + "$ref": "BusinessInfo" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "getHomepage": { + "description": "Retrieves a store's homepage.", + "flatPath": "accounts/v1beta/accounts/{accountsId}/homepage", + "httpMethod": "GET", + "id": "merchantapi.accounts.getHomepage", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the homepage to retrieve. Format: `accounts/{account}/homepage`", + "location": "path", + "pattern": "^accounts/[^/]+/homepage$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1beta/{+name}", + "response": { + "$ref": "Homepage" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "getShippingSettings": { + "description": "Retrieve shipping setting information.", + "flatPath": "accounts/v1beta/accounts/{accountsId}/shippingSettings", + "httpMethod": "GET", + "id": "merchantapi.accounts.getShippingSettings", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the shipping setting to retrieve. Format: `accounts/{account}/shippingsetting`", + "location": "path", + "pattern": "^accounts/[^/]+/shippingSettings$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1beta/{+name}", + "response": { + "$ref": "ShippingSettings" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "description": "Lists accounts accessible to the calling user and matching the constraints of the request such as page size or filters. This is not just listing the sub-accounts of an MCA, but all accounts the calling user has access to including other MCAs, linked accounts, standalone accounts and so on.", + "flatPath": "accounts/v1beta/accounts", + "httpMethod": "GET", + "id": "merchantapi.accounts.list", + "parameterOrder": [], + "parameters": { + "filter": { + "description": "Optional. Returns only accounts that match the [filter](/merchant/api/guides/accounts/filter). For more details, see the [filter syntax reference](/merchant/api/guides/accounts/filter-syntax).", + "location": "query", + "type": "string" + }, + "pageSize": { + "description": "Optional. The maximum number of accounts to return. The service may return fewer than this value. If unspecified, at most 250 accounts are returned. The maximum value is 500; values above 500 are coerced to 500.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. A page token, received from a previous `ListAccounts` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListAccounts` must match the call that provided the page token.", + "location": "query", + "type": "string" + } + }, + "path": "accounts/v1beta/accounts", + "response": { + "$ref": "ListAccountsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "listSubaccounts": { + "description": "List all sub-accounts for a given multi client account. This is a convenience wrapper for the more powerful `ListAccounts` method. This method will produce the same results as calling `ListsAccounts` with the following filter: `relationship(providerId={parent} AND service(type=\"ACCOUNT_AGGREGATION\"))`", + "flatPath": "accounts/v1beta/accounts/{accountsId}:listSubaccounts", + "httpMethod": "GET", + "id": "merchantapi.accounts.listSubaccounts", + "parameterOrder": [ + "provider" + ], + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of accounts to return. The service may return fewer than this value. If unspecified, at most 250 accounts are returned. The maximum value is 500; values above 500 are coerced to 500.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. A page token, received from a previous `ListAccounts` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListAccounts` must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "provider": { + "description": "Required. The parent account. Format: `accounts/{account}`", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1beta/{+provider}:listSubaccounts", + "response": { + "$ref": "ListSubAccountsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "patch": { + "description": "Updates an account regardless of its type: standalone, MCA or sub-account. Executing this method requires admin access.", + "flatPath": "accounts/v1beta/accounts/{accountsId}", + "httpMethod": "PATCH", + "id": "merchantapi.accounts.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Identifier. The resource name of the account. Format: `accounts/{account}`", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Required. List of fields being updated.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "accounts/v1beta/{+name}", + "request": { + "$ref": "Account" + }, + "response": { + "$ref": "Account" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "updateBusinessIdentity": { + "description": "Updates the business identity of an account. Executing this method requires admin access.", + "flatPath": "accounts/v1beta/accounts/{accountsId}/businessIdentity", + "httpMethod": "PATCH", + "id": "merchantapi.accounts.updateBusinessIdentity", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Identifier. The resource name of the business identity. Format: `accounts/{account}/businessIdentity`", + "location": "path", + "pattern": "^accounts/[^/]+/businessIdentity$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Required. List of fields being updated.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "accounts/v1beta/{+name}", + "request": { + "$ref": "BusinessIdentity" + }, + "response": { + "$ref": "BusinessIdentity" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "updateBusinessInfo": { + "description": "Updates the business info of an account. Executing this method requires admin access.", + "flatPath": "accounts/v1beta/accounts/{accountsId}/businessInfo", + "httpMethod": "PATCH", + "id": "merchantapi.accounts.updateBusinessInfo", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Identifier. The resource name of the business info. Format: `accounts/{account}/businessInfo`", + "location": "path", + "pattern": "^accounts/[^/]+/businessInfo$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Required. List of fields being updated.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "accounts/v1beta/{+name}", + "request": { + "$ref": "BusinessInfo" + }, + "response": { + "$ref": "BusinessInfo" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "updateHomepage": { + "description": "Updates a store's homepage. Executing this method requires admin access.", + "flatPath": "accounts/v1beta/accounts/{accountsId}/homepage", + "httpMethod": "PATCH", + "id": "merchantapi.accounts.updateHomepage", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Identifier. The resource name of the store's homepage. Format: `accounts/{account}/homepage`", + "location": "path", + "pattern": "^accounts/[^/]+/homepage$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Required. List of fields being updated.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "accounts/v1beta/{+name}", + "request": { + "$ref": "Homepage" + }, + "response": { + "$ref": "Homepage" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + }, + "resources": { + "accounttax": { + "methods": { + "get": { + "description": "Returns the tax rules that match the conditions of GetAccountTaxRequest", + "flatPath": "accounts/v1beta/accounts/{accountsId}/accounttax/{accounttaxId}", + "httpMethod": "GET", + "id": "merchantapi.accounts.accounttax.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name from which tax settings will be retrieved", + "location": "path", + "pattern": "^accounts/[^/]+/accounttax/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1beta/{+name}", + "response": { + "$ref": "AccountTax" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "description": "Lists the tax settings of the sub-accounts only in your Merchant Center account. This method can only be called on a multi-client account, otherwise it'll return an error.", + "flatPath": "accounts/v1beta/accounts/{accountsId}/accounttax", + "httpMethod": "GET", + "id": "merchantapi.accounts.accounttax.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "The maximum number of tax settings to return in the response, used for paging.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "The token returned by the previous request.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The parent, which owns this collection of account tax. Format: accounts/{account}", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1beta/{+parent}/accounttax", + "response": { + "$ref": "ListAccountTaxResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "patch": { + "description": "Updates the tax settings of the account.", + "flatPath": "accounts/v1beta/accounts/{accountsId}/accounttax/{accounttaxId}", + "httpMethod": "PATCH", + "id": "merchantapi.accounts.accounttax.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Identifier. The name of the tax setting. Format: \"{account_tax.name=accounts/{account}}\"", + "location": "path", + "pattern": "^accounts/[^/]+/accounttax/[^/]+$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "The list of fields to be updated", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "accounts/v1beta/{+name}", + "request": { + "$ref": "AccountTax" + }, + "response": { + "$ref": "AccountTax" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + }, + "homepage": { + "methods": { + "claim": { + "description": "Claims a store's homepage. Executing this method requires admin access. If the homepage is already claimed, this will recheck the verification (unless the merchant is exempted from claiming, which also exempts from verification) and return a successful response. If ownership can no longer be verified, it will return an error, but it won't clear the claim. In case of failure, a canonical error message will be returned: * PERMISSION_DENIED: user doesn't have the necessary permissions on this MC account; * FAILED_PRECONDITION: - The account is not a Merchant Center account; - MC account doesn't have a homepage; - claiming failed (in this case the error message will contain more details).", + "flatPath": "accounts/v1beta/accounts/{accountsId}/homepage:claim", + "httpMethod": "POST", + "id": "merchantapi.accounts.homepage.claim", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the homepage to claim. Format: `accounts/{account}/homepage`", + "location": "path", + "pattern": "^accounts/[^/]+/homepage$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1beta/{+name}:claim", + "request": { + "$ref": "ClaimHomepageRequest" + }, + "response": { + "$ref": "Homepage" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "unclaim": { + "description": "Unclaims a store's homepage. Executing this method requires admin access.", + "flatPath": "accounts/v1beta/accounts/{accountsId}/homepage:unclaim", + "httpMethod": "POST", + "id": "merchantapi.accounts.homepage.unclaim", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the homepage to unclaim. Format: `accounts/{account}/homepage`", + "location": "path", + "pattern": "^accounts/[^/]+/homepage$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1beta/{+name}:unclaim", + "request": { + "$ref": "UnclaimHomepageRequest" + }, + "response": { + "$ref": "Homepage" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + }, + "issues": { + "methods": { + "list": { + "description": "Lists all account issues of a Merchant Center account.", + "flatPath": "accounts/v1beta/accounts/{accountsId}/issues", + "httpMethod": "GET", + "id": "merchantapi.accounts.issues.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "languageCode": { + "description": "Optional. The issues in the response will have human-readable fields in the given language. The format is [BCP-47](https://tools.ietf.org/html/bcp47), such as `en-US` or `sr-Latn`. If not value is provided, `en-US` will be used.", + "location": "query", + "type": "string" + }, + "pageSize": { + "description": "Optional. The maximum number of issues to return. The service may return fewer than this value. If unspecified, at most 50 users will be returned. The maximum value is 100; values above 100 will be coerced to 100", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. A page token, received from a previous `ListAccountIssues` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListAccountIssues` must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The parent, which owns this collection of issues. Format: `accounts/{account}`", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + }, + "timeZone.id": { + "description": "IANA Time Zone Database time zone, e.g. \"America/New_York\".", + "location": "query", + "type": "string" + }, + "timeZone.version": { + "description": "Optional. IANA Time Zone Database version number, e.g. \"2019a\".", + "location": "query", + "type": "string" + } + }, + "path": "accounts/v1beta/{+parent}/issues", + "response": { + "$ref": "ListAccountIssuesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + }, + "onlineReturnPolicies": { + "methods": { + "get": { + "description": "Gets an existing return policy.", + "flatPath": "accounts/v1beta/accounts/{accountsId}/onlineReturnPolicies/{onlineReturnPoliciesId}", + "httpMethod": "GET", + "id": "merchantapi.accounts.onlineReturnPolicies.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the return policy to retrieve. Format: `accounts/{account}/onlineReturnPolicies/{return_policy}`", + "location": "path", + "pattern": "^accounts/[^/]+/onlineReturnPolicies/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1beta/{+name}", + "response": { + "$ref": "OnlineReturnPolicy" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "description": "Lists all existing return policies.", + "flatPath": "accounts/v1beta/accounts/{accountsId}/onlineReturnPolicies", + "httpMethod": "GET", + "id": "merchantapi.accounts.onlineReturnPolicies.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of `OnlineReturnPolicy` resources to return. The service returns fewer than this value if the number of return policies for the given merchant is less that than the `pageSize`. The default value is 10. The maximum value is 100; If a value higher than the maximum is specified, then the `pageSize` will default to the maximum", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. A page token, received from a previous `ListOnlineReturnPolicies` call. Provide the page token to retrieve the subsequent page. When paginating, all other parameters provided to `ListOnlineReturnPolicies` must match the call that provided the page token. The token returned as nextPageToken in the response to the previous request.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The merchant account for which to list return policies. Format: `accounts/{account}`", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1beta/{+parent}/onlineReturnPolicies", + "response": { + "$ref": "ListOnlineReturnPoliciesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + }, + "programs": { + "methods": { + "disable": { + "description": "Disable participation in the specified program for the account. Executing this method requires admin access.", + "flatPath": "accounts/v1beta/accounts/{accountsId}/programs/{programsId}:disable", + "httpMethod": "POST", + "id": "merchantapi.accounts.programs.disable", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the program for which to disable participation for the given account. Format: `accounts/{account}/programs/{program}`", + "location": "path", + "pattern": "^accounts/[^/]+/programs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1beta/{+name}:disable", + "request": { + "$ref": "DisableProgramRequest" + }, + "response": { + "$ref": "Program" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "enable": { + "description": "Enable participation in the specified program for the account. Executing this method requires admin access.", + "flatPath": "accounts/v1beta/accounts/{accountsId}/programs/{programsId}:enable", + "httpMethod": "POST", + "id": "merchantapi.accounts.programs.enable", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the program for which to enable participation for the given account. Format: `accounts/{account}/programs/{program}`", + "location": "path", + "pattern": "^accounts/[^/]+/programs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1beta/{+name}:enable", + "request": { + "$ref": "EnableProgramRequest" + }, + "response": { + "$ref": "Program" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "get": { + "description": "Retrieves the specified program for the account.", + "flatPath": "accounts/v1beta/accounts/{accountsId}/programs/{programsId}", + "httpMethod": "GET", + "id": "merchantapi.accounts.programs.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the program to retrieve. Format: `accounts/{account}/programs/{program}`", + "location": "path", + "pattern": "^accounts/[^/]+/programs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1beta/{+name}", + "response": { + "$ref": "Program" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "description": "Retrieves all programs for the account.", + "flatPath": "accounts/v1beta/accounts/{accountsId}/programs", + "httpMethod": "GET", + "id": "merchantapi.accounts.programs.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of programs to return in a single response. If unspecified (or 0), a default size of 1000 is used. The maximum value is 1000; values above 1000 will be coerced to 1000.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. A continuation token, received from a previous `ListPrograms` call. Provide this to retrieve the next page.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The name of the account for which to retrieve all programs. Format: `accounts/{account}`", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1beta/{+parent}/programs", + "response": { + "$ref": "ListProgramsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + }, + "regions": { + "methods": { + "create": { + "description": "Creates a region definition in your Merchant Center account. Executing this method requires admin access.", + "flatPath": "accounts/v1beta/accounts/{accountsId}/regions", + "httpMethod": "POST", + "id": "merchantapi.accounts.regions.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The account to create a region for. Format: `accounts/{account}`", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + }, + "regionId": { + "description": "Required. The identifier for the region, unique over all regions of the same account.", + "location": "query", + "type": "string" + } + }, + "path": "accounts/v1beta/{+parent}/regions", + "request": { + "$ref": "Region" + }, + "response": { + "$ref": "Region" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "delete": { + "description": "Deletes a region definition from your Merchant Center account. Executing this method requires admin access.", + "flatPath": "accounts/v1beta/accounts/{accountsId}/regions/{regionsId}", + "httpMethod": "DELETE", + "id": "merchantapi.accounts.regions.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the region to delete. Format: `accounts/{account}/regions/{region}`", + "location": "path", + "pattern": "^accounts/[^/]+/regions/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1beta/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "get": { + "description": "Retrieves a region defined in your Merchant Center account.", + "flatPath": "accounts/v1beta/accounts/{accountsId}/regions/{regionsId}", + "httpMethod": "GET", + "id": "merchantapi.accounts.regions.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the region to retrieve. Format: `accounts/{account}/regions/{region}`", + "location": "path", + "pattern": "^accounts/[^/]+/regions/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1beta/{+name}", + "response": { + "$ref": "Region" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "description": "Lists the regions in your Merchant Center account.", + "flatPath": "accounts/v1beta/accounts/{accountsId}/regions", + "httpMethod": "GET", + "id": "merchantapi.accounts.regions.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of regions to return. The service may return fewer than this value. If unspecified, at most 50 regions will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. A page token, received from a previous `ListRegions` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListRegions` must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The account to list regions for. Format: `accounts/{account}`", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1beta/{+parent}/regions", + "response": { + "$ref": "ListRegionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "patch": { + "description": "Updates a region definition in your Merchant Center account. Executing this method requires admin access.", + "flatPath": "accounts/v1beta/accounts/{accountsId}/regions/{regionsId}", + "httpMethod": "PATCH", + "id": "merchantapi.accounts.regions.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Identifier. The resource name of the region. Format: `accounts/{account}/regions/{region}`", + "location": "path", + "pattern": "^accounts/[^/]+/regions/[^/]+$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Optional. The comma-separated field mask indicating the fields to update. Example: `\"displayName,postalCodeArea.regionCode\"`.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "accounts/v1beta/{+name}", + "request": { + "$ref": "Region" + }, + "response": { + "$ref": "Region" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + }, + "shippingSettings": { + "methods": { + "insert": { + "description": "Replace the shipping setting of a merchant with the request shipping setting. Executing this method requires admin access.", + "flatPath": "accounts/v1beta/accounts/{accountsId}/shippingSettings:insert", + "httpMethod": "POST", + "id": "merchantapi.accounts.shippingSettings.insert", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The account where this product will be inserted. Format: accounts/{account}", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1beta/{+parent}/shippingSettings:insert", + "request": { + "$ref": "ShippingSettings" + }, + "response": { + "$ref": "ShippingSettings" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + }, + "termsOfServiceAgreementStates": { + "methods": { + "get": { + "description": "Returns the state of a terms of service agreement.", + "flatPath": "accounts/v1beta/accounts/{accountsId}/termsOfServiceAgreementStates/{termsOfServiceAgreementStatesId}", + "httpMethod": "GET", + "id": "merchantapi.accounts.termsOfServiceAgreementStates.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the terms of service version. Format: `accounts/{account}/termsOfServiceAgreementState/{identifier}`", + "location": "path", + "pattern": "^accounts/[^/]+/termsOfServiceAgreementStates/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1beta/{+name}", + "response": { + "$ref": "TermsOfServiceAgreementState" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "retrieveForApplication": { + "description": "Retrieves the state of the agreement for the application terms of service.", + "flatPath": "accounts/v1beta/accounts/{accountsId}/termsOfServiceAgreementStates:retrieveForApplication", + "httpMethod": "GET", + "id": "merchantapi.accounts.termsOfServiceAgreementStates.retrieveForApplication", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The account for which to get a TermsOfServiceAgreementState Format: `accounts/{account}`", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1beta/{+parent}/termsOfServiceAgreementStates:retrieveForApplication", + "response": { + "$ref": "TermsOfServiceAgreementState" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + }, + "users": { + "methods": { + "create": { + "description": "Creates a Merchant Center account user. Executing this method requires admin access.", + "flatPath": "accounts/v1beta/accounts/{accountsId}/users", + "httpMethod": "POST", + "id": "merchantapi.accounts.users.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The resource name of the account for which a user will be created. Format: `accounts/{account}`", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + }, + "userId": { + "description": "Required. The email address of the user (for example, `john.doe@gmail.com`).", + "location": "query", + "type": "string" + } + }, + "path": "accounts/v1beta/{+parent}/users", + "request": { + "$ref": "User" + }, + "response": { + "$ref": "User" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "delete": { + "description": "Deletes a Merchant Center account user. Executing this method requires admin access.", + "flatPath": "accounts/v1beta/accounts/{accountsId}/users/{usersId}", + "httpMethod": "DELETE", + "id": "merchantapi.accounts.users.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the user to delete. Format: `accounts/{account}/users/{email}` It is also possible to delete the user corresponding to the caller by using `me` rather than an email address as in `accounts/{account}/users/me`.", + "location": "path", + "pattern": "^accounts/[^/]+/users/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1beta/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "get": { + "description": "Retrieves a Merchant Center account user.", + "flatPath": "accounts/v1beta/accounts/{accountsId}/users/{usersId}", + "httpMethod": "GET", + "id": "merchantapi.accounts.users.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the user to retrieve. Format: `accounts/{account}/users/{email}` It is also possible to retrieve the user corresponding to the caller by using `me` rather than an email address as in `accounts/{account}/users/me`.", + "location": "path", + "pattern": "^accounts/[^/]+/users/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1beta/{+name}", + "response": { + "$ref": "User" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "getEmailPreferences": { + "description": "Returns the email preferences for a Merchant Center account user. Use the name=accounts/*/users/me/emailPreferences alias to get preferences for the authenticated user.", + "flatPath": "accounts/v1beta/accounts/{accountsId}/users/{usersId}/emailPreferences", + "httpMethod": "GET", + "id": "merchantapi.accounts.users.getEmailPreferences", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the `EmailPreferences` resource. Format: `accounts/{account}/users/{email}/emailPreferences`", + "location": "path", + "pattern": "^accounts/[^/]+/users/[^/]+/emailPreferences$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1beta/{+name}", + "response": { + "$ref": "EmailPreferences" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "description": "Lists all users of a Merchant Center account.", + "flatPath": "accounts/v1beta/accounts/{accountsId}/users", + "httpMethod": "GET", + "id": "merchantapi.accounts.users.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of users to return. The service may return fewer than this value. If unspecified, at most 50 users will be returned. The maximum value is 100; values above 100 will be coerced to 100", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. A page token, received from a previous `ListUsers` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListUsers` must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The parent, which owns this collection of users. Format: `accounts/{account}`", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1beta/{+parent}/users", + "response": { + "$ref": "ListUsersResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "patch": { + "description": "Updates a Merchant Center account user. Executing this method requires admin access.", + "flatPath": "accounts/v1beta/accounts/{accountsId}/users/{usersId}", + "httpMethod": "PATCH", + "id": "merchantapi.accounts.users.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Identifier. The resource name of the user. Format: `accounts/{account}/user/{email}` Use `me` to refer to your own email address, for example `accounts/{account}/users/me`.", + "location": "path", + "pattern": "^accounts/[^/]+/users/[^/]+$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Required. List of fields being updated.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "accounts/v1beta/{+name}", + "request": { + "$ref": "User" + }, + "response": { + "$ref": "User" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "updateEmailPreferences": { + "description": "Updates the email preferences for a Merchant Center account user. MCA users should specify the MCA account rather than a sub-account of the MCA. Preferences which are not explicitly selected in the update mask will not be updated. It is invalid for updates to specify an UNCONFIRMED opt-in status value. Use the name=accounts/*/users/me/emailPreferences alias to update preferences for the authenticated user.", + "flatPath": "accounts/v1beta/accounts/{accountsId}/users/{usersId}/emailPreferences", + "httpMethod": "PATCH", + "id": "merchantapi.accounts.users.updateEmailPreferences", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Identifier. The name of the EmailPreferences. The endpoint is only supported for the authenticated user.", + "location": "path", + "pattern": "^accounts/[^/]+/users/[^/]+/emailPreferences$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Required. List of fields being updated.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "accounts/v1beta/{+name}", + "request": { + "$ref": "EmailPreferences" + }, + "response": { + "$ref": "EmailPreferences" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + } + } + }, + "termsOfService": { + "methods": { + "accept": { + "description": "Accepts a `TermsOfService`. Executing this method requires admin access.", + "flatPath": "accounts/v1beta/termsOfService/{termsOfServiceId}:accept", + "httpMethod": "GET", + "id": "merchantapi.termsOfService.accept", + "parameterOrder": [ + "name" + ], + "parameters": { + "account": { + "description": "Required. The account for which to accept the ToS.", + "location": "query", + "type": "string" + }, + "name": { + "description": "Required. The resource name of the terms of service version. Format: `termsOfService/{version}`", + "location": "path", + "pattern": "^termsOfService/[^/]+$", + "required": true, + "type": "string" + }, + "regionCode": { + "description": "Required. Region code as defined by [CLDR](https://cldr.unicode.org/). This is either a country when the ToS applies specifically to that country or 001 when it applies globally.", + "location": "query", + "type": "string" + } + }, + "path": "accounts/v1beta/{+name}:accept", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "get": { + "description": "Retrieves the `TermsOfService` associated with the provided version.", + "flatPath": "accounts/v1beta/termsOfService/{termsOfServiceId}", + "httpMethod": "GET", + "id": "merchantapi.termsOfService.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the terms of service version. Format: `termsOfService/{version}`", + "location": "path", + "pattern": "^termsOfService/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1beta/{+name}", + "response": { + "$ref": "TermsOfService" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "retrieveLatest": { + "description": "Retrieves the latest version of the `TermsOfService` for a given `kind` and `region_code`.", + "flatPath": "accounts/v1beta/termsOfService:retrieveLatest", + "httpMethod": "GET", + "id": "merchantapi.termsOfService.retrieveLatest", + "parameterOrder": [], + "parameters": { + "kind": { + "description": "The Kind this terms of service version applies to.", + "enum": [ + "TERMS_OF_SERVICE_KIND_UNSPECIFIED", + "MERCHANT_CENTER" + ], + "enumDescriptions": [ + "Default value. This value is unused.", + "Merchant Center application." + ], + "location": "query", + "type": "string" + }, + "regionCode": { + "description": "Region code as defined by [CLDR](https://cldr.unicode.org/). This is either a country when the ToS applies specifically to that country or 001 when it applies globally.", + "location": "query", + "type": "string" + } + }, + "path": "accounts/v1beta/termsOfService:retrieveLatest", + "response": { + "$ref": "TermsOfService" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + } + }, + "revision": "20240613", + "rootUrl": "https://merchantapi.googleapis.com/", + "schemas": { + "AcceptTermsOfService": { + "description": "Reference to a Terms of Service resource.", + "id": "AcceptTermsOfService", + "properties": { + "name": { + "description": "Required. The resource name of the terms of service version.", + "type": "string" + }, + "regionCode": { + "description": "Required. Region code as defined by [CLDR](https://cldr.unicode.org/). This is either a country when the ToS applies specifically to that country or `001` when it applies globally.", + "type": "string" + } + }, + "type": "object" + }, + "Accepted": { + "description": "Describes the accepted terms of service.", + "id": "Accepted", + "properties": { + "acceptedBy": { + "description": "The account where the acceptance was recorded. This can be the account itself or, in the case of subaccounts, the MCA account.", + "type": "string" + }, + "termsOfService": { + "description": "The accepted [termsOfService](google.shopping.merchant.accounts.v1main.TermsOfService).", + "type": "string" + }, + "validUntil": { + "$ref": "Date", + "description": "When set, it states that the accepted [TermsOfService](google.shopping.merchant.accounts.v1main.TermsOfService) is only valid until the end of this date (in UTC). A new one must be accepted before then. The information of the required [TermsOfService](google.shopping.merchant.accounts.v1main.TermsOfService) is found in the [Required](Required) message." + } + }, + "type": "object" + }, + "Account": { + "description": "An account.", + "id": "Account", + "properties": { + "accountId": { + "description": "Output only. The ID of the account.", + "format": "int64", + "readOnly": true, + "type": "string" + }, + "accountName": { + "description": "Required. A human-readable name of the account. See [store name](https://support.google.com/merchants/answer/160556) and [business name](https://support.google.com/merchants/answer/12159159) for more information.", + "type": "string" + }, + "adultContent": { + "description": "Whether this account contains adult content.", + "type": "boolean" + }, + "languageCode": { + "description": "Required. The account's [BCP-47 language code](https://tools.ietf.org/html/bcp47), such as `en-US` or `sr-Latn`.", + "type": "string" + }, + "name": { + "description": "Identifier. The resource name of the account. Format: `accounts/{account}`", + "type": "string" + }, + "testAccount": { + "description": "Output only. Whether this is a test account.", + "readOnly": true, + "type": "boolean" + }, + "timeZone": { + "$ref": "TimeZone", + "description": "Required. The time zone of the account. On writes, `time_zone` sets both the `reporting_time_zone` and the `display_time_zone`. For reads, `time_zone` always returns the `display_time_zone`. If `display_time_zone` doesn't exist for your account, `time_zone` is empty." + } + }, + "type": "object" + }, + "AccountIssue": { + "description": "An [`AccountIssue`](https://support.google.com/merchants/answer/12153802?sjid=17798438912526418908-EU#account).", + "id": "AccountIssue", + "properties": { + "detail": { + "description": "Further localized details about the issue.", + "type": "string" + }, + "documentationUri": { + "description": "Link to Merchant Center Help Center providing further information about the issue and how to fix it.", + "type": "string" + }, + "impactedDestinations": { + "description": "The impact this issue has on various destinations.", + "items": { + "$ref": "ImpactedDestination" + }, + "type": "array" + }, + "name": { + "description": "Identifier. The resource name of the account issue. Format: `accounts/{account}/issues/{id}`", + "type": "string" + }, + "severity": { + "description": "The overall severity of the issue.", + "enum": [ + "SEVERITY_UNSPECIFIED", + "CRITICAL", + "ERROR", + "SUGGESTION" + ], + "enumDescriptions": [ + "The severity is unknown.", + "The issue causes offers to not serve.", + "The issue might affect offers (in the future) or might be an indicator of issues with offers.", + "The issue is a suggestion for improvement." + ], + "type": "string" + }, + "title": { + "description": "The localized title of the issue.", + "type": "string" + } + }, + "type": "object" + }, + "AccountTax": { + "description": "The tax settings of a merchant account. All methods require the admin role.", + "id": "AccountTax", + "properties": { + "account": { + "description": "Output only. The ID of the account to which these account tax settings belong.", + "format": "int64", + "readOnly": true, + "type": "string" + }, + "name": { + "description": "Identifier. The name of the tax setting. Format: \"{account_tax.name=accounts/{account}}\"", + "type": "string" + }, + "taxRules": { + "description": "Tax rules. \"Define the tax rules in each region. No tax will be presented if a region has no rule.\"", + "items": { + "$ref": "TaxRule" + }, + "type": "array" + } + }, + "type": "object" + }, + "AddAccountService": { + "description": "Additional instructions to add account services during creation of the account.", + "id": "AddAccountService", + "properties": { + "accountAggregation": { + "$ref": "Empty", + "description": "The provider is an aggregator for the account." + }, + "provider": { + "description": "Optional. The provider of the service. Format: `accounts/{account}`", + "type": "string" + } + }, + "type": "object" + }, + "Address": { + "description": "Shipping address of the warehouse.", + "id": "Address", + "properties": { + "administrativeArea": { + "description": "Required. Top-level administrative subdivision of the country. For example, a state like California (\"CA\") or a province like Quebec (\"QC\").", + "type": "string" + }, + "city": { + "description": "Required. City, town or commune. May also include dependent localities or sublocalities (For example neighborhoods or suburbs).", + "type": "string" + }, + "postalCode": { + "description": "Required. Postal code or ZIP (For example \"94043\").", + "type": "string" + }, + "regionCode": { + "description": "Required. [CLDR country code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) (For example \"US\").", + "type": "string" + }, + "streetAddress": { + "description": "Street-level part of the address. For example: `111w 31st Street`.", + "type": "string" + } + }, + "type": "object" + }, + "BusinessDayConfig": { + "description": "Business days of the warehouse.", + "id": "BusinessDayConfig", + "properties": { + "businessDays": { + "description": "Required. Regular business days. May not be empty.", + "items": { + "enum": [ + "WEEKDAY_UNSPECIFIED", + "MONDAY", + "TUESDAY", + "WEDNESDAY", + "THURSDAY", + "FRIDAY", + "SATURDAY", + "SUNDAY" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ], + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "BusinessIdentity": { + "description": "Collection of information related to the [identity of a business](https://support.google.com/merchants/answer/12564247).", + "id": "BusinessIdentity", + "properties": { + "blackOwned": { + "$ref": "IdentityAttribute", + "description": "Optional. Specifies whether the business identifies itself as being black-owned. This optional field will only be available for merchants with a business country set to `US`. It is also not applicable for marketplaces or marketplace sellers." + }, + "latinoOwned": { + "$ref": "IdentityAttribute", + "description": "Optional. Specifies whether the business identifies itself as being latino-owned. This optional field will only be available for merchants with a business country set to `US`. It is also not applicable for marketplaces or marketplace sellers." + }, + "name": { + "description": "Identifier. The resource name of the business identity. Format: `accounts/{account}/businessIdentity`", + "type": "string" + }, + "promotionsConsent": { + "description": "Optional. Whether the identity attributes may be used for promotions.", + "enum": [ + "PROMOTIONS_CONSENT_UNSPECIFIED", + "PROMOTIONS_CONSENT_GIVEN", + "PROMOTIONS_CONSENT_DENIED" + ], + "enumDescriptions": [ + "Default value indicating that no selection was made.", + "Indicates that the account consented to having their business identity used for promotions.", + "Indicates that the account did not consent to having their business identity used for promotions." + ], + "type": "string" + }, + "smallBusiness": { + "$ref": "IdentityAttribute", + "description": "Optional. Specifies whether the business identifies itself as a small business. This optional field will only be available for merchants with a business country set to `US`. It is also not applicable for marketplaces." + }, + "veteranOwned": { + "$ref": "IdentityAttribute", + "description": "Optional. Specifies whether the business identifies itself as being veteran-owned. This optional field will only be available for merchants with a business country set to `US`. It is also not applicable for marketplaces or marketplace sellers." + }, + "womenOwned": { + "$ref": "IdentityAttribute", + "description": "Optional. Specifies whether the business identifies itself as being women-owned. This optional field will only be available for merchants with a business country set to `US`. It is also not applicable for marketplaces or marketplace sellers." + } + }, + "type": "object" + }, + "BusinessInfo": { + "description": "Collection of information related to a business.", + "id": "BusinessInfo", + "properties": { + "address": { + "$ref": "PostalAddress", + "description": "Optional. The address of the business." + }, + "customerService": { + "$ref": "CustomerService", + "description": "Optional. The customer service of the business." + }, + "name": { + "description": "Identifier. The resource name of the business info. Format: `accounts/{account}/businessInfo`", + "type": "string" + }, + "phone": { + "$ref": "PhoneNumber", + "description": "Output only. The phone number of the business.", + "readOnly": true + }, + "phoneVerificationState": { + "description": "Output only. The phone verification state of the business.", + "enum": [ + "PHONE_VERIFICATION_STATE_UNSPECIFIED", + "PHONE_VERIFICATION_STATE_VERIFIED", + "PHONE_VERIFICATION_STATE_UNVERIFIED" + ], + "enumDescriptions": [ + "Default value. This value is unused.", + "The phone is verified.", + "The phone is unverified" + ], + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "CarrierRate": { + "description": "A list of carrier rates that can be referred to by `main_table` or `single_value`.", + "id": "CarrierRate", + "properties": { + "carrier": { + "description": "Required. Carrier service, such as `\"UPS\"` or `\"Fedex\"`.", + "type": "string" + }, + "carrierService": { + "description": "Required. Carrier service, such as `\"ground\"` or `\"2 days\"`.", + "type": "string" + }, + "flatAdjustment": { + "$ref": "Price", + "description": "Optional. Additive shipping rate modifier. Can be negative. For example `{ \"amount_micros\": 1, \"currency_code\" : \"USD\" }` adds $1 to the rate, `{ \"amount_micros\": -3, \"currency_code\" : \"USD\" }` removes $3 from the rate." + }, + "name": { + "description": "Required. Name of the carrier rate. Must be unique per rate group.", + "type": "string" + }, + "originPostalCode": { + "description": "Required. Shipping origin for this carrier rate.", + "type": "string" + }, + "percentageAdjustment": { + "description": "Optional. Multiplicative shipping rate modifier as a number in decimal notation. Can be negative. For example `\"5.4\"` increases the rate by 5.4%, `\"-3\"` decreases the rate by 3%.", + "type": "string" + } + }, + "type": "object" + }, + "ClaimHomepageRequest": { + "description": "Request message for the `ClaimHomepage` method.", + "id": "ClaimHomepageRequest", + "properties": {}, + "type": "object" + }, + "CreateAndConfigureAccountRequest": { + "description": "Request message for the `CreateAndConfigureAccount` method.", + "id": "CreateAndConfigureAccountRequest", + "properties": { + "acceptTermsOfService": { + "$ref": "AcceptTermsOfService", + "description": "Optional. The Terms of Service (ToS) to be accepted immediately upon account creation." + }, + "account": { + "$ref": "Account", + "description": "Required. The account to be created." + }, + "service": { + "description": "Optional. If specified, an account service between the account to be created and the provider account is initialized as part of the creation.", + "items": { + "$ref": "AddAccountService" + }, + "type": "array" + }, + "users": { + "description": "Optional. Users to be added to the account.", + "items": { + "$ref": "CreateUserRequest" + }, + "type": "array" + } + }, + "type": "object" + }, + "CreateUserRequest": { + "description": "Request message for the `CreateUser` method.", + "id": "CreateUserRequest", + "properties": { + "parent": { + "description": "Required. The resource name of the account for which a user will be created. Format: `accounts/{account}`", + "type": "string" + }, + "user": { + "$ref": "User", + "description": "Required. The user to create." + }, + "userId": { + "description": "Required. The email address of the user (for example, `john.doe@gmail.com`).", + "type": "string" + } + }, + "type": "object" + }, + "CustomerService": { + "description": "Customer service information.", + "id": "CustomerService", + "properties": { + "email": { + "description": "Optional. The email address where customer service may be reached.", + "type": "string" + }, + "phone": { + "$ref": "PhoneNumber", + "description": "Optional. The phone number where customer service may be called." + }, + "uri": { + "description": "Optional. The URI where customer service may be found.", + "type": "string" + } + }, + "type": "object" + }, + "CutoffConfig": { + "description": "Configs related to local delivery ends for the day.", + "id": "CutoffConfig", + "properties": { + "localCutoffTime": { + "$ref": "LocalCutoffTime", + "description": "Time that local delivery ends for the day." + }, + "noDeliveryPostCutoff": { + "description": "Merchants can opt-out of showing n+1 day local delivery when they have a shipping service configured to n day local delivery. For example, if the shipping service defines same-day delivery, and it's past the cut-off, setting this field to `true` results in the calculated shipping service rate returning `NO_DELIVERY_POST_CUTOFF`. In the same example, setting this field to `false` results in the calculated shipping time being one day. This is only for local delivery.", + "type": "boolean" + }, + "storeCloseOffsetHours": { + "description": "Only valid with local delivery fulfillment. Represents cutoff time as the number of hours before store closing. Mutually exclusive with `local_cutoff_time`.", + "format": "int64", + "type": "string" + } + }, + "type": "object" + }, + "CutoffTime": { + "description": "Business days cutoff time definition.", + "id": "CutoffTime", + "properties": { + "hour": { + "description": "Required. Hour of the cutoff time until which an order has to be placed to be processed in the same day.", + "format": "int32", + "type": "integer" + }, + "minute": { + "description": "Required. Minute of the cutoff time until which an order has to be placed to be processed in the same day.", + "format": "int32", + "type": "integer" + }, + "timeZone": { + "description": "Required. [Timezone identifier](https://developers.google.com/adwords/api/docs/appendix/codes-formats#timezone-ids) For example \"Europe/Zurich\".", + "type": "string" + } + }, + "type": "object" + }, + "Date": { + "description": "Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp", + "id": "Date", + "properties": { + "day": { + "description": "Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.", + "format": "int32", + "type": "integer" + }, + "month": { + "description": "Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.", + "format": "int32", + "type": "integer" + }, + "year": { + "description": "Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.", + "format": "int32", + "type": "integer" + } + }, + "type": "object" + }, + "DeliveryTime": { + "description": "Time spent in various aspects from order to the delivery of the product.", + "id": "DeliveryTime", + "properties": { + "cutoffTime": { + "$ref": "CutoffTime", + "description": "Business days cutoff time definition. If not configured the cutoff time will be defaulted to 8AM PST." + }, + "handlingBusinessDayConfig": { + "$ref": "BusinessDayConfig", + "description": "The business days during which orders can be handled. If not provided, Monday to Friday business days will be assumed." + }, + "maxHandlingDays": { + "description": "Maximum number of business days spent before an order is shipped. 0 means same day shipped, 1 means next day shipped. Must be greater than or equal to `min_handling_days`.", + "format": "int32", + "type": "integer" + }, + "maxTransitDays": { + "description": "Maximum number of business days that is spent in transit. 0 means same day delivery, 1 means next day delivery. Must be greater than or equal to `min_transit_days`.", + "format": "int32", + "type": "integer" + }, + "minHandlingDays": { + "description": "Minimum number of business days spent before an order is shipped. 0 means same day shipped, 1 means next day shipped.", + "format": "int32", + "type": "integer" + }, + "minTransitDays": { + "description": "Minimum number of business days that is spent in transit. 0 means same day delivery, 1 means next day delivery. Either `min_transit_days`, `max_transit_days` or `transit_time_table` must be set, but not both.", + "format": "int32", + "type": "integer" + }, + "transitBusinessDayConfig": { + "$ref": "BusinessDayConfig", + "description": "The business days during which orders can be in-transit. If not provided, Monday to Friday business days will be assumed." + }, + "transitTimeTable": { + "$ref": "TransitTable", + "description": "Transit time table, number of business days spent in transit based on row and column dimensions. Either `min_transit_days`, `max_transit_days` or `transit_time_table` can be set, but not both." + }, + "warehouseBasedDeliveryTimes": { + "description": "Optional. Indicates that the delivery time should be calculated per warehouse (shipping origin location) based on the settings of the selected carrier. When set, no other transit time related field in delivery time should be set.", + "items": { + "$ref": "WarehouseBasedDeliveryTime" + }, + "type": "array" + } + }, + "type": "object" + }, + "DisableProgramRequest": { + "description": "Request message for the DisableProgram method.", + "id": "DisableProgramRequest", + "properties": {}, + "type": "object" + }, + "Distance": { + "description": "Maximum delivery radius. This is only required for the local delivery shipment type.", + "id": "Distance", + "properties": { + "unit": { + "description": "Unit can differ based on country, it is parameterized to include miles and kilometers.", + "enum": [ + "UNIT_UNSPECIFIED", + "MILES", + "KILOMETERS" + ], + "enumDescriptions": [ + "Unit unspecified", + "Unit in miles", + "Unit in kilometers" + ], + "type": "string" + }, + "value": { + "description": "Integer value of distance.", + "format": "int64", + "type": "string" + } + }, + "type": "object" + }, + "EmailPreferences": { + "description": "The categories of notifications the user opted into / opted out of. The email preferences do not include mandatory announcements as users can't opt out of them.", + "id": "EmailPreferences", + "properties": { + "name": { + "description": "Identifier. The name of the EmailPreferences. The endpoint is only supported for the authenticated user.", + "type": "string" + }, + "newsAndTips": { + "description": "Optional. Updates on new features, tips and best practices.", + "enum": [ + "OPT_IN_STATE_UNSPECIFIED", + "OPTED_OUT", + "OPTED_IN", + "UNCONFIRMED" + ], + "enumDescriptions": [ + "Opt-in status is not specified.", + "User has opted out of receiving this type of email.", + "User has opted in to receiving this type of email.", + "User has opted in to receiving this type of email and the confirmation email has been sent, but user has not yet confirmed the opt in (applies only to certain countries)." + ], + "type": "string" + } + }, + "type": "object" + }, + "Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }", + "id": "Empty", + "properties": {}, + "type": "object" + }, + "EnableProgramRequest": { + "description": "Request message for the EnableProgram method.", + "id": "EnableProgramRequest", + "properties": {}, + "type": "object" + }, + "GeoTargetArea": { + "description": "A list of geotargets that defines the region area.", + "id": "GeoTargetArea", + "properties": { + "geotargetCriteriaIds": { + "description": "Required. A non-empty list of [location IDs](https://developers.google.com/adwords/api/docs/appendix/geotargeting). They must all be of the same location type (for example, state).", + "items": { + "format": "int64", + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "Headers": { + "description": "A non-empty list of row or column headers for a table. Exactly one of `prices`, `weights`, `num_items`, `postal_code_group_names`, or `location` must be set.", + "id": "Headers", + "properties": { + "locations": { + "description": "Required. A list of location ID sets. Must be non-empty. Can only be set if all other fields are not set.", + "items": { + "$ref": "LocationIdSet" + }, + "type": "array" + }, + "numberOfItems": { + "description": "Required. A list of inclusive number of items upper bounds. The last value can be `\"infinity\"`. For example `[\"10\", \"50\", \"infinity\"]` represents the headers \"\u003c= 10 items\", \"\u003c= 50 items\", and \"\u003e 50 items\". Must be non-empty. Can only be set if all other fields are not set.", + "items": { + "type": "string" + }, + "type": "array" + }, + "postalCodeGroupNames": { + "description": "Required. A list of postal group names. The last value can be `\"all other locations\"`. Example: `[\"zone 1\", \"zone 2\", \"all other locations\"]`. The referred postal code groups must match the delivery country of the service. Must be non-empty. Can only be set if all other fields are not set.", + "items": { + "type": "string" + }, + "type": "array" + }, + "prices": { + "description": "Required. A list of inclusive order price upper bounds. The last price's value can be infinity by setting price amount_micros = -1. For example `[{\"amount_micros\": 10000000, \"currency_code\": \"USD\"}, {\"amount_micros\": 500000000, \"currency_code\": \"USD\"}, {\"amount_micros\": -1, \"currency_code\": \"USD\"}]` represents the headers \"\u003c= $10\", \"\u003c= $500\", and \"\u003e $500\". All prices within a service must have the same currency. Must be non-empty. Must be positive except -1. Can only be set if all other fields are not set.", + "items": { + "$ref": "Price" + }, + "type": "array" + }, + "weights": { + "description": "Required. A list of inclusive order weight upper bounds. The last weight's value can be infinity by setting price amount_micros = -1. For example `[{\"amount_micros\": 10000000, \"unit\": \"kg\"}, {\"amount_micros\": 50000000, \"unit\": \"kg\"}, {\"amount_micros\": -1, \"unit\": \"kg\"}]` represents the headers \"\u003c= 10kg\", \"\u003c= 50kg\", and \"\u003e 50kg\". All weights within a service must have the same unit. Must be non-empty. Must be positive except -1. Can only be set if all other fields are not set.", + "items": { + "$ref": "Weight" + }, + "type": "array" + } + }, + "type": "object" + }, + "Homepage": { + "description": "A store's homepage.", + "id": "Homepage", + "properties": { + "claimed": { + "description": "Output only. Whether the homepage is claimed. See https://support.google.com/merchants/answer/176793.", + "readOnly": true, + "type": "boolean" + }, + "name": { + "description": "Identifier. The resource name of the store's homepage. Format: `accounts/{account}/homepage`", + "type": "string" + }, + "uri": { + "description": "Required. The URI (typically a URL) of the store's homepage.", + "type": "string" + } + }, + "type": "object" + }, + "IdentityAttribute": { + "description": "All information related to an identity attribute.", + "id": "IdentityAttribute", + "properties": { + "identityDeclaration": { + "description": "Required. The declaration of identity for this attribute.", + "enum": [ + "IDENTITY_DECLARATION_UNSPECIFIED", + "SELF_IDENTIFIES_AS", + "DOES_NOT_SELF_IDENTIFY_AS" + ], + "enumDescriptions": [ + "Default value indicating that no selection was made.", + "Indicates that the account identifies with the attribute.", + "Indicates that the account does not identify with the attribute." + ], + "type": "string" + } + }, + "type": "object" + }, + "Impact": { + "description": "The impact of the issue on a region.", + "id": "Impact", + "properties": { + "regionCode": { + "description": "The [CLDR region code](https://cldr.unicode.org/) where this issue applies.", + "type": "string" + }, + "severity": { + "description": "The severity of the issue on the destination and region.", + "enum": [ + "SEVERITY_UNSPECIFIED", + "CRITICAL", + "ERROR", + "SUGGESTION" + ], + "enumDescriptions": [ + "The severity is unknown.", + "The issue causes offers to not serve.", + "The issue might affect offers (in the future) or might be an indicator of issues with offers.", + "The issue is a suggestion for improvement." + ], + "type": "string" + } + }, + "type": "object" + }, + "ImpactedDestination": { + "description": "The impact of the issue on a destination.", + "id": "ImpactedDestination", + "properties": { + "impacts": { + "description": "The (negative) impact for various regions on the given destination.", + "items": { + "$ref": "Impact" + }, + "type": "array" + }, + "reportingContext": { + "description": "The impacted reporting context.", + "enum": [ + "REPORTING_CONTEXT_ENUM_UNSPECIFIED", + "SHOPPING_ADS", + "DISCOVERY_ADS", + "DEMAND_GEN_ADS", + "DEMAND_GEN_ADS_DISCOVER_SURFACE", + "VIDEO_ADS", + "DISPLAY_ADS", + "LOCAL_INVENTORY_ADS", + "VEHICLE_INVENTORY_ADS", + "FREE_LISTINGS", + "FREE_LOCAL_LISTINGS", + "FREE_LOCAL_VEHICLE_LISTINGS", + "YOUTUBE_SHOPPING", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL" + ], + "enumDeprecated": [ + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false + ], + "enumDescriptions": [ + "Not specified.", + "[Shopping ads](https://support.google.com/merchants/answer/6149970).", + "Deprecated: Use `DEMAND_GEN_ADS` instead. [Discovery and Demand Gen ads](https://support.google.com/merchants/answer/13389785).", + "[Demand Gen ads](https://support.google.com/merchants/answer/13389785).", + "[Demand Gen ads on Discover surface](https://support.google.com/merchants/answer/13389785).", + "[Video ads](https://support.google.com/google-ads/answer/6340491).", + "[Display ads](https://support.google.com/merchants/answer/6069387).", + "[Local inventory ads](https://support.google.com/merchants/answer/3271956).", + "[Vehicle inventory ads](https://support.google.com/merchants/answer/11544533).", + "[Free product listings](https://support.google.com/merchants/answer/9199328).", + "[Free local product listings](https://support.google.com/merchants/answer/9825611).", + "[Free local vehicle listings](https://support.google.com/merchants/answer/11544533).", + "[YouTube Shopping](https://support.google.com/merchants/answer/13478370).", + "[Cloud retail](https://cloud.google.com/solutions/retail).", + "[Local cloud retail](https://cloud.google.com/solutions/retail)." + ], + "type": "string" + } + }, + "type": "object" + }, + "Interval": { + "description": "Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive). The start must be less than or equal to the end. When the start equals the end, the interval is empty (matches no time). When both start and end are unspecified, the interval matches any time.", + "id": "Interval", + "properties": { + "endTime": { + "description": "Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end.", + "format": "google-datetime", + "type": "string" + }, + "startTime": { + "description": "Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, + "ListAccountIssuesResponse": { + "description": "Response message for the `ListAccountIssues` method.", + "id": "ListAccountIssuesResponse", + "properties": { + "accountIssues": { + "description": "The issues from the specified account.", + "items": { + "$ref": "AccountIssue" + }, + "type": "array" + }, + "nextPageToken": { + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "type": "string" + } + }, + "type": "object" + }, + "ListAccountTaxResponse": { + "description": "Response to account tax list request This method can only be called on a multi-client account, otherwise it'll return an error.", + "id": "ListAccountTaxResponse", + "properties": { + "accountTaxes": { + "description": "Page of accounttax settings", + "items": { + "$ref": "AccountTax" + }, + "type": "array" + }, + "nextPageToken": { + "description": "The token for the retrieval of the next page of account tax settings.", + "type": "string" + } + }, + "type": "object" + }, + "ListAccountsResponse": { + "description": "Response message for the `ListAccounts` method.", + "id": "ListAccountsResponse", + "properties": { + "accounts": { + "description": "The accounts matching the `ListAccountsRequest`.", + "items": { + "$ref": "Account" + }, + "type": "array" + }, + "nextPageToken": { + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "type": "string" + } + }, + "type": "object" + }, + "ListOnlineReturnPoliciesResponse": { + "description": "Response message for the `ListOnlineReturnPolicies` method.", + "id": "ListOnlineReturnPoliciesResponse", + "properties": { + "nextPageToken": { + "description": "A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "type": "string" + }, + "onlineReturnPolicies": { + "description": "The retrieved return policies.", + "items": { + "$ref": "OnlineReturnPolicy" + }, + "type": "array" + } + }, + "type": "object" + }, + "ListProgramsResponse": { + "description": "Response message for the ListPrograms method.", + "id": "ListProgramsResponse", + "properties": { + "nextPageToken": { + "description": "A token that can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "type": "string" + }, + "programs": { + "description": "The programs for the given account.", + "items": { + "$ref": "Program" + }, + "type": "array" + } + }, + "type": "object" + }, + "ListRegionsResponse": { + "description": "Response message for the `ListRegions` method.", + "id": "ListRegionsResponse", + "properties": { + "nextPageToken": { + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "type": "string" + }, + "regions": { + "description": "The regions from the specified merchant.", + "items": { + "$ref": "Region" + }, + "type": "array" + } + }, + "type": "object" + }, + "ListSubAccountsResponse": { + "description": "Response message for the `ListSubAccounts` method.", + "id": "ListSubAccountsResponse", + "properties": { + "accounts": { + "description": "The accounts for which the given parent account is an aggregator.", + "items": { + "$ref": "Account" + }, + "type": "array" + }, + "nextPageToken": { + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "type": "string" + } + }, + "type": "object" + }, + "ListUsersResponse": { + "description": "Response message for the `ListUsers` method.", + "id": "ListUsersResponse", + "properties": { + "nextPageToken": { + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "type": "string" + }, + "users": { + "description": "The users from the specified account.", + "items": { + "$ref": "User" + }, + "type": "array" + } + }, + "type": "object" + }, + "LocalCutoffTime": { + "description": "Time that local delivery ends for the day.", + "id": "LocalCutoffTime", + "properties": { + "hour": { + "description": "Hour local delivery orders must be placed by to process the same day.", + "format": "int64", + "type": "string" + }, + "minute": { + "description": "Minute local delivery orders must be placed by to process the same day.", + "format": "int64", + "type": "string" + } + }, + "type": "object" + }, + "LocationIdSet": { + "description": "A list of location ID sets. Must be non-empty. Can only be set if all other fields are not set.", + "id": "LocationIdSet", + "properties": { + "locationIds": { + "description": "Required. A non-empty list of [location IDs](https://developers.google.com/adwords/api/docs/appendix/geotargeting). They must all be of the same location type (For example, state).", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "LoyaltyProgram": { + "description": "[Loyalty program](https://support.google.com/merchants/answer/12922446) provided by a merchant.", + "id": "LoyaltyProgram", + "properties": { + "loyaltyProgramTiers": { + "description": "Optional. Loyalty program tier of this shipping service.", + "items": { + "$ref": "LoyaltyProgramTiers" + }, + "type": "array" + }, + "programLabel": { + "description": "This is the loyalty program label set in your loyalty program settings in Merchant Center. This sub-attribute allows Google to map your loyalty program to eligible offers.", + "type": "string" + } + }, + "type": "object" + }, + "LoyaltyProgramTiers": { + "description": "Subset of a merchants loyalty program.", + "id": "LoyaltyProgramTiers", + "properties": { + "tierLabel": { + "description": "The tier label [tier_label] sub-attribute differentiates offer level benefits between each tier. This value is also set in your program settings in Merchant Center, and is required for data source changes even if your loyalty program only has 1 tier.", + "type": "string" + } + }, + "type": "object" + }, + "MinimumOrderValueTable": { + "description": "Table of per store minimum order values for the pickup fulfillment type.", + "id": "MinimumOrderValueTable", + "properties": { + "storeCodeSetWithMovs": { + "description": "Required. A list of store code sets sharing the same minimum order value (MOV). At least two sets are required and the last one must be empty, which signifies 'MOV for all other stores'. Each store code can only appear once across all the sets. All prices within a service must have the same currency.", + "items": { + "$ref": "StoreCodeSetWithMov" + }, + "type": "array" + } + }, + "type": "object" + }, + "OnlineReturnPolicy": { + "description": "[Online return policy](https://support.google.com/merchants/answer/10220642) object. This is currently used to represent return policies for ads and free listings programs.", + "id": "OnlineReturnPolicy", + "properties": { + "acceptDefectiveOnly": { + "description": "This field specifies if merchant only accepts defective products for returns, and this field is required.", + "type": "boolean" + }, + "acceptExchange": { + "description": "This field specifies if merchant allows customers to exchange products, this field is required.", + "type": "boolean" + }, + "countries": { + "description": "The countries of sale where the return policy applies. The values must be a valid 2 letter ISO 3166 code.", + "items": { + "type": "string" + }, + "type": "array" + }, + "itemConditions": { + "description": "The item conditions accepted for returns must not be empty unless the type of return policy is 'noReturns'.", + "items": { + "enum": [ + "ITEM_CONDITION_UNSPECIFIED", + "NEW", + "USED" + ], + "enumDescriptions": [ + "Default value. This value is unused.", + "New.", + "Used." + ], + "type": "string" + }, + "type": "array" + }, + "label": { + "description": "This field represents the unique user-defined label of the return policy. It is important to note that the same label cannot be used in different return policies for the same country. Unless a product specifies a specific label attribute, policies will be automatically labeled as 'default'. To assign a custom return policy to certain product groups, follow the instructions provided in the [Return policy label] (https://support.google.com/merchants/answer/9445425). The label can contain up to 50 characters.", + "type": "string" + }, + "name": { + "description": "Identifier. The name of the `OnlineReturnPolicy` resource. Format: `accounts/{account}/onlineReturnPolicies/{return_policy}`", + "type": "string" + }, + "policy": { + "$ref": "Policy", + "description": "The return policy." + }, + "processRefundDays": { + "description": "The field specifies the number of days it takes for merchants to process refunds, field is optional.", + "format": "int32", + "type": "integer" + }, + "restockingFee": { + "$ref": "RestockingFee", + "description": "The restocking fee that applies to all return reason categories. This would be treated as a free restocking fee if the value is not set." + }, + "returnMethods": { + "description": "The return methods of how customers can return an item. This value is required to not be empty unless the type of return policy is noReturns.", + "items": { + "enum": [ + "RETURN_METHOD_UNSPECIFIED", + "BY_MAIL", + "IN_STORE", + "AT_A_KIOSK" + ], + "enumDescriptions": [ + "Default value. This value is unused.", + "Return by mail.", + "Return in store.", + "Return at a kiosk." + ], + "type": "string" + }, + "type": "array" + }, + "returnPolicyId": { + "description": "Output only. Return policy ID generated by Google.", + "readOnly": true, + "type": "string" + }, + "returnPolicyUri": { + "description": "The return policy uri. This can used by Google to do a sanity check for the policy. It must be a valid URL.", + "type": "string" + }, + "returnShippingFee": { + "$ref": "ReturnShippingFee", + "description": "The return shipping fee. Should be set only when customer need to download and print the return label." + } + }, + "type": "object" + }, + "PhoneNumber": { + "description": "An object representing a phone number, suitable as an API wire format. This representation: - should not be used for locale-specific formatting of a phone number, such as \"+1 (650) 253-0000 ext. 123\" - is not designed for efficient storage - may not be suitable for dialing - specialized libraries (see references) should be used to parse the number for that purpose To do something meaningful with this number, such as format it for various use-cases, convert it to an `i18n.phonenumbers.PhoneNumber` object first. For instance, in Java this would be: com.google.type.PhoneNumber wireProto = com.google.type.PhoneNumber.newBuilder().build(); com.google.i18n.phonenumbers.Phonenumber.PhoneNumber phoneNumber = PhoneNumberUtil.getInstance().parse(wireProto.getE164Number(), \"ZZ\"); if (!wireProto.getExtension().isEmpty()) { phoneNumber.setExtension(wireProto.getExtension()); } Reference(s): - https://github.com/google/libphonenumber", + "id": "PhoneNumber", + "properties": { + "e164Number": { + "description": "The phone number, represented as a leading plus sign ('+'), followed by a phone number that uses a relaxed ITU E.164 format consisting of the country calling code (1 to 3 digits) and the subscriber number, with no additional spaces or formatting, e.g.: - correct: \"+15552220123\" - incorrect: \"+1 (555) 222-01234 x123\". The ITU E.164 format limits the latter to 12 digits, but in practice not all countries respect that, so we relax that restriction here. National-only numbers are not allowed. References: - https://www.itu.int/rec/T-REC-E.164-201011-I - https://en.wikipedia.org/wiki/E.164. - https://en.wikipedia.org/wiki/List_of_country_calling_codes", + "type": "string" + }, + "extension": { + "description": "The phone number's extension. The extension is not standardized in ITU recommendations, except for being defined as a series of numbers with a maximum length of 40 digits. Other than digits, some other dialing characters such as ',' (indicating a wait) or '#' may be stored here. Note that no regions currently use extensions with short codes, so this field is normally only set in conjunction with an E.164 number. It is held separately from the E.164 number to allow for short code extensions in the future.", + "type": "string" + }, + "shortCode": { + "$ref": "ShortCode", + "description": "A short code. Reference(s): - https://en.wikipedia.org/wiki/Short_code" + } + }, + "type": "object" + }, + "Policy": { + "description": "The available policies.", + "id": "Policy", + "properties": { + "days": { + "description": "The number of days items can be returned after delivery, where one day is defined as 24 hours after the delivery timestamp. Required for `NUMBER_OF_DAYS_AFTER_DELIVERY` returns.", + "format": "int64", + "type": "string" + }, + "type": { + "description": "Policy type.", + "enum": [ + "TYPE_UNSPECIFIED", + "NUMBER_OF_DAYS_AFTER_DELIVERY", + "NO_RETURNS", + "LIFETIME_RETURNS" + ], + "enumDescriptions": [ + "Default value. This value is unused.", + "The number of days within which a return is valid after delivery.", + "No returns.", + "Life time returns." + ], + "type": "string" + } + }, + "type": "object" + }, + "PostalAddress": { + "description": "Represents a postal address, e.g. for postal delivery or payments addresses. Given a postal address, a postal service can deliver items to a premise, P.O. Box or similar. It is not intended to model geographical locations (roads, towns, mountains). In typical usage an address would be created via user input or from importing existing data, depending on the type of process. Advice on address input / editing: - Use an internationalization-ready address widget such as https://github.com/google/libaddressinput) - Users should not be presented with UI elements for input or editing of fields outside countries where that field is used. For more guidance on how to use this schema, please see: https://support.google.com/business/answer/6397478", + "id": "PostalAddress", + "properties": { + "addressLines": { + "description": "Unstructured address lines describing the lower levels of an address. Because values in address_lines do not have type information and may sometimes contain multiple values in a single field (e.g. \"Austin, TX\"), it is important that the line order is clear. The order of address lines should be \"envelope order\" for the country/region of the address. In places where this can vary (e.g. Japan), address_language is used to make it explicit (e.g. \"ja\" for large-to-small ordering and \"ja-Latn\" or \"en\" for small-to-large). This way, the most specific line of an address can be selected based on the language. The minimum permitted structural representation of an address consists of a region_code with all remaining information placed in the address_lines. It would be possible to format such an address very approximately without geocoding, but no semantic reasoning could be made about any of the address components until it was at least partially resolved. Creating an address only containing a region_code and address_lines, and then geocoding is the recommended way to handle completely unstructured addresses (as opposed to guessing which parts of the address should be localities or administrative areas).", + "items": { + "type": "string" + }, + "type": "array" + }, + "administrativeArea": { + "description": "Optional. Highest administrative subdivision which is used for postal addresses of a country or region. For example, this can be a state, a province, an oblast, or a prefecture. Specifically, for Spain this is the province and not the autonomous community (e.g. \"Barcelona\" and not \"Catalonia\"). Many countries don't use an administrative area in postal addresses. E.g. in Switzerland this should be left unpopulated.", + "type": "string" + }, + "languageCode": { + "description": "Optional. BCP-47 language code of the contents of this address (if known). This is often the UI language of the input form or is expected to match one of the languages used in the address' country/region, or their transliterated equivalents. This can affect formatting in certain countries, but is not critical to the correctness of the data and will never affect any validation or other non-formatting related operations. If this value is not known, it should be omitted (rather than specifying a possibly incorrect default). Examples: \"zh-Hant\", \"ja\", \"ja-Latn\", \"en\".", + "type": "string" + }, + "locality": { + "description": "Optional. Generally refers to the city/town portion of the address. Examples: US city, IT comune, UK post town. In regions of the world where localities are not well defined or do not fit into this structure well, leave locality empty and use address_lines.", + "type": "string" + }, + "organization": { + "description": "Optional. The name of the organization at the address.", + "type": "string" + }, + "postalCode": { + "description": "Optional. Postal code of the address. Not all countries use or require postal codes to be present, but where they are used, they may trigger additional validation with other parts of the address (e.g. state/zip validation in the U.S.A.).", + "type": "string" + }, + "recipients": { + "description": "Optional. The recipient at the address. This field may, under certain circumstances, contain multiline information. For example, it might contain \"care of\" information.", + "items": { + "type": "string" + }, + "type": "array" + }, + "regionCode": { + "description": "Required. CLDR region code of the country/region of the address. This is never inferred and it is up to the user to ensure the value is correct. See https://cldr.unicode.org/ and https://www.unicode.org/cldr/charts/30/supplemental/territory_information.html for details. Example: \"CH\" for Switzerland.", + "type": "string" + }, + "revision": { + "description": "The schema revision of the `PostalAddress`. This must be set to 0, which is the latest revision. All new revisions **must** be backward compatible with old revisions.", + "format": "int32", + "type": "integer" + }, + "sortingCode": { + "description": "Optional. Additional, country-specific, sorting code. This is not used in most regions. Where it is used, the value is either a string like \"CEDEX\", optionally followed by a number (e.g. \"CEDEX 7\"), or just a number alone, representing the \"sector code\" (Jamaica), \"delivery area indicator\" (Malawi) or \"post office indicator\" (e.g. Côte d'Ivoire).", + "type": "string" + }, + "sublocality": { + "description": "Optional. Sublocality of the address. For example, this can be neighborhoods, boroughs, districts.", + "type": "string" + } + }, + "type": "object" + }, + "PostalCodeArea": { + "description": "A list of postal codes that defines the region area. Note: All regions defined using postal codes are accessible through the account's `ShippingSettings.postalCodeGroups` resource.", + "id": "PostalCodeArea", + "properties": { + "postalCodes": { + "description": "Required. A range of postal codes.", + "items": { + "$ref": "PostalCodeRange" + }, + "type": "array" + }, + "regionCode": { + "description": "Required. [CLDR territory code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) or the country the postal code group applies to.", + "type": "string" + } + }, + "type": "object" + }, + "PostalCodeRange": { + "description": "A range of postal codes that defines the region area.", + "id": "PostalCodeRange", + "properties": { + "begin": { + "description": "Required. A postal code or a pattern of the form prefix* denoting the inclusive lower bound of the range defining the area. Examples values: `94108`, `9410*`, `9*`.", + "type": "string" + }, + "end": { + "description": "Optional. A postal code or a pattern of the form `prefix*` denoting the inclusive upper bound of the range defining the area. It must have the same length as postalCodeRangeBegin: if postalCodeRangeBegin is a postal code then postalCodeRangeEnd must be a postal code too; if postalCodeRangeBegin is a pattern then postalCodeRangeEnd must be a pattern with the same prefix length. Optional: if not set, then the area is defined as being all the postal codes matching postalCodeRangeBegin.", + "type": "string" + } + }, + "type": "object" + }, + "Price": { + "description": "The price represented as a number and currency.", + "id": "Price", + "properties": { + "amountMicros": { + "description": "The price represented as a number in micros (1 million micros is an equivalent to one's currency standard unit, for example, 1 USD = 1000000 micros).", + "format": "int64", + "type": "string" + }, + "currencyCode": { + "description": "The currency of the price using three-letter acronyms according to [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217).", + "type": "string" + } + }, + "type": "object" + }, + "ProductChange": { + "description": "The change that happened to the product including old value, new value, country code as the region code and reporting context.", + "id": "ProductChange", + "properties": { + "newValue": { + "description": "The new value of the changed resource or attribute.", + "type": "string" + }, + "oldValue": { + "description": "The old value of the changed resource or attribute.", + "type": "string" + }, + "regionCode": { + "description": "Countries that have the change (if applicable)", + "type": "string" + }, + "reportingContext": { + "description": "Reporting contexts that have the change (if applicable)", + "enum": [ + "REPORTING_CONTEXT_ENUM_UNSPECIFIED", + "SHOPPING_ADS", + "DISCOVERY_ADS", + "DEMAND_GEN_ADS", + "DEMAND_GEN_ADS_DISCOVER_SURFACE", + "VIDEO_ADS", + "DISPLAY_ADS", + "LOCAL_INVENTORY_ADS", + "VEHICLE_INVENTORY_ADS", + "FREE_LISTINGS", + "FREE_LOCAL_LISTINGS", + "FREE_LOCAL_VEHICLE_LISTINGS", + "YOUTUBE_SHOPPING", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL" + ], + "enumDeprecated": [ + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false + ], + "enumDescriptions": [ + "Not specified.", + "[Shopping ads](https://support.google.com/merchants/answer/6149970).", + "Deprecated: Use `DEMAND_GEN_ADS` instead. [Discovery and Demand Gen ads](https://support.google.com/merchants/answer/13389785).", + "[Demand Gen ads](https://support.google.com/merchants/answer/13389785).", + "[Demand Gen ads on Discover surface](https://support.google.com/merchants/answer/13389785).", + "[Video ads](https://support.google.com/google-ads/answer/6340491).", + "[Display ads](https://support.google.com/merchants/answer/6069387).", + "[Local inventory ads](https://support.google.com/merchants/answer/3271956).", + "[Vehicle inventory ads](https://support.google.com/merchants/answer/11544533).", + "[Free product listings](https://support.google.com/merchants/answer/9199328).", + "[Free local product listings](https://support.google.com/merchants/answer/9825611).", + "[Free local vehicle listings](https://support.google.com/merchants/answer/11544533).", + "[YouTube Shopping](https://support.google.com/merchants/answer/13478370).", + "[Cloud retail](https://cloud.google.com/solutions/retail).", + "[Local cloud retail](https://cloud.google.com/solutions/retail)." + ], + "type": "string" + } + }, + "type": "object" + }, + "ProductStatusChangeMessage": { + "description": "The message that the merchant will receive to notify about product status change event", + "id": "ProductStatusChangeMessage", + "properties": { + "account": { + "description": "The target account that owns the entity that changed. Format : `accounts/{merchant_id}`", + "type": "string" + }, + "attribute": { + "description": "The attribute in the resource that changed, in this case it will be always `Status`.", + "enum": [ + "ATTRIBUTE_UNSPECIFIED", + "STATUS" + ], + "enumDescriptions": [ + "Unspecified attribute", + "Status of the changed entity" + ], + "type": "string" + }, + "changes": { + "description": "A message to describe the change that happened to the product", + "items": { + "$ref": "ProductChange" + }, + "type": "array" + }, + "managingAccount": { + "description": "The account that manages the merchant's account. can be the same as merchant id if it is standalone account. Format : `accounts/{service_provider_id}`", + "type": "string" + }, + "resource": { + "description": "The product name. Format: `{product.name=accounts/{account}/products/{product}}`", + "type": "string" + }, + "resourceId": { + "description": "The product id.", + "type": "string" + }, + "resourceType": { + "description": "The resource that changed, in this case it will always be `Product`.", + "enum": [ + "RESOURCE_UNSPECIFIED", + "PRODUCT" + ], + "enumDescriptions": [ + "Unspecified resource", + "Resource type : product" + ], + "type": "string" + } + }, + "type": "object" + }, + "Program": { + "description": "Defines participation in a given program for the specified account. Programs provide a mechanism for adding functionality to merchant accounts. A typical example of this is the [Free product listings](https://support.google.com/merchants/topic/9240261?ref_topic=7257954,7259405,\u0026sjid=796648681813264022-EU) program, which enables products from a merchant's store to be shown across Google for free.", + "id": "Program", + "properties": { + "activeRegionCodes": { + "description": "Output only. The regions in which the account is actively participating in the program. Active regions are defined as those where all program requirements affecting the regions have been met. Region codes are defined by [CLDR](https://cldr.unicode.org/). This is either a country where the program applies specifically to that country or `001` when the program applies globally.", + "items": { + "type": "string" + }, + "readOnly": true, + "type": "array" + }, + "documentationUri": { + "description": "Output only. The URL of a Merchant Center help page describing the program.", + "readOnly": true, + "type": "string" + }, + "name": { + "description": "Identifier. The resource name of the program. Format: `accounts/{account}/programs/{program}`", + "type": "string" + }, + "state": { + "description": "Output only. The participation state of the account in the program.", + "enum": [ + "STATE_UNSPECIFIED", + "NOT_ELIGIBLE", + "ELIGIBLE", + "ENABLED" + ], + "enumDescriptions": [ + "Default value. This value is unused.", + "The account is not eligible to participate in the program.", + "The account is eligible to participate in the program.", + "The program is enabled for the account." + ], + "readOnly": true, + "type": "string" + }, + "unmetRequirements": { + "description": "Output only. The requirements that the account has not yet satisfied that are affecting participation in the program.", + "items": { + "$ref": "Requirement" + }, + "readOnly": true, + "type": "array" + } + }, + "type": "object" + }, + "RateGroup": { + "description": "Shipping rate group definitions. Only the last one is allowed to have an empty `applicable_shipping_labels`, which means \"everything else\". The other `applicable_shipping_labels` must not overlap.", + "id": "RateGroup", + "properties": { + "applicableShippingLabels": { + "description": "Required. A list of [shipping labels](https://support.google.com/merchants/answer/6324504) defining the products to which this rate group applies to. This is a disjunction: only one of the labels has to match for the rate group to apply. May only be empty for the last rate group of a service.", + "items": { + "type": "string" + }, + "type": "array" + }, + "carrierRates": { + "description": "Optional. A list of carrier rates that can be referred to by `main_table` or `single_value`.", + "items": { + "$ref": "CarrierRate" + }, + "type": "array" + }, + "mainTable": { + "$ref": "Table", + "description": "A table defining the rate group, when `single_value` is not expressive enough. Can only be set if `single_value` is not set." + }, + "name": { + "description": "Optional. Name of the rate group. If set has to be unique within shipping service.", + "type": "string" + }, + "singleValue": { + "$ref": "Value", + "description": "The value of the rate group (For example flat rate $10). Can only be set if `main_table` and `subtables` are not set." + }, + "subtables": { + "description": "Optional. A list of subtables referred to by `main_table`. Can only be set if `main_table` is set.", + "items": { + "$ref": "Table" + }, + "type": "array" + } + }, + "type": "object" + }, + "Region": { + "description": "Represents a geographic region that you can use as a target with both the `RegionalInventory` and `ShippingSettings` services. You can define regions as collections of either postal codes or, in some countries, using predefined geotargets. For more information, see [Set up regions ](https://support.google.com/merchants/answer/7410946#zippy=%2Ccreate-a-new-region) for more information.", + "id": "Region", + "properties": { + "displayName": { + "description": "Optional. The display name of the region.", + "type": "string" + }, + "geotargetArea": { + "$ref": "GeoTargetArea", + "description": "Optional. A list of geotargets that defines the region area." + }, + "name": { + "description": "Identifier. The resource name of the region. Format: `accounts/{account}/regions/{region}`", + "type": "string" + }, + "postalCodeArea": { + "$ref": "PostalCodeArea", + "description": "Optional. A list of postal codes that defines the region area." + }, + "regionalInventoryEligible": { + "description": "Output only. Indicates if the region is eligible for use in the Regional Inventory configuration.", + "readOnly": true, + "type": "boolean" + }, + "shippingEligible": { + "description": "Output only. Indicates if the region is eligible for use in the Shipping Services configuration.", + "readOnly": true, + "type": "boolean" + } + }, + "type": "object" + }, + "Required": { + "description": "Describes the terms of service which are required to be accepted.", + "id": "Required", + "properties": { + "termsOfService": { + "description": "The [termsOfService](google.shopping.merchant.accounts.v1main.TermsOfService) that need to be accepted.", + "type": "string" + }, + "tosFileUri": { + "description": "Full URL to the terms of service file. This field is the same as [TermsOfService.file_uri](TermsOfService.file_uri), it is added here for convenience only.", + "type": "string" + } + }, + "type": "object" + }, + "Requirement": { + "description": "Defines a requirement specified for participation in the program.", + "id": "Requirement", + "properties": { + "affectedRegionCodes": { + "description": "Output only. The regions that are currently affected by this requirement not being met. Region codes are defined by [CLDR](https://cldr.unicode.org/). This is either a country where the program applies specifically to that country or `001` when the program applies globally.", + "items": { + "type": "string" + }, + "readOnly": true, + "type": "array" + }, + "documentationUri": { + "description": "Output only. The URL of a help page describing the requirement.", + "readOnly": true, + "type": "string" + }, + "title": { + "description": "Output only. Name of the requirement.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "RestockingFee": { + "description": "The restocking fee. This can be a flat fee or a micro percent.", + "id": "RestockingFee", + "properties": { + "fixedFee": { + "$ref": "Price", + "description": "Fixed restocking fee." + }, + "microPercent": { + "description": "Percent of total price in micros. 15,000,000 means 15% of the total price would be charged.", + "format": "int32", + "type": "integer" + } + }, + "type": "object" + }, + "ReturnShippingFee": { + "description": "The return shipping fee. This can either be a fixed fee or a boolean to indicate that the customer pays the actual shipping cost.", + "id": "ReturnShippingFee", + "properties": { + "fixedFee": { + "$ref": "Price", + "description": "Fixed return shipping fee amount. This value is only applicable when type is `FIXED`. We will treat the return shipping fee as free if type is `FIXED` and this value is not set." + }, + "type": { + "description": "Type of return shipping fee.", + "enum": [ + "TYPE_UNSPECIFIED", + "FIXED", + "CUSTOMER_PAYING_ACTUAL_FEE" + ], + "enumDescriptions": [ + "Default value. This value is unused.", + "The return shipping fee is a fixed value.", + "Customers will pay the actual return shipping fee." + ], + "type": "string" + } + }, + "type": "object" + }, + "Row": { + "description": "Include a list of cells.", + "id": "Row", + "properties": { + "cells": { + "description": "Required. The list of cells that constitute the row. Must have the same length as `columnHeaders` for two-dimensional tables, a length of 1 for one-dimensional tables.", + "items": { + "$ref": "Value" + }, + "type": "array" + } + }, + "type": "object" + }, + "Service": { + "description": "Shipping service.", + "id": "Service", + "properties": { + "active": { + "description": "Required. A boolean exposing the active status of the shipping service.", + "type": "boolean" + }, + "currencyCode": { + "description": "The CLDR code of the currency to which this service applies. Must match that of the prices in rate groups.", + "type": "string" + }, + "deliveryCountries": { + "description": "Required. The CLDR territory code of the countries to which the service applies.", + "items": { + "type": "string" + }, + "type": "array" + }, + "deliveryTime": { + "$ref": "DeliveryTime", + "description": "Required. Time spent in various aspects from order to the delivery of the product." + }, + "loyaltyPrograms": { + "description": "Optional. Loyalty programs that this shipping service is limited to.", + "items": { + "$ref": "LoyaltyProgram" + }, + "type": "array" + }, + "minimumOrderValue": { + "$ref": "Price", + "description": "Minimum order value for this service. If set, indicates that customers will have to spend at least this amount. All prices within a service must have the same currency. Cannot be set together with minimum_order_value_table." + }, + "minimumOrderValueTable": { + "$ref": "MinimumOrderValueTable", + "description": "Table of per store minimum order values for the pickup fulfillment type. Cannot be set together with minimum_order_value." + }, + "rateGroups": { + "description": "Optional. Shipping rate group definitions. Only the last one is allowed to have an empty `applicable_shipping_labels`, which means \"everything else\". The other `applicable_shipping_labels` must not overlap.", + "items": { + "$ref": "RateGroup" + }, + "type": "array" + }, + "serviceName": { + "description": "Required. Free-form name of the service. Must be unique within target account.", + "type": "string" + }, + "shipmentType": { + "description": "Type of locations this service ships orders to.", + "enum": [ + "SHIPMENT_TYPE_UNSPECIFIED", + "DELIVERY", + "LOCAL_DELIVERY", + "COLLECTION_POINT" + ], + "enumDescriptions": [ + "This service did not specify shipment type.", + "This service ships orders to an address chosen by the customer.", + "This service ships orders to an address chosen by the customer. The order is shipped from a local store near by.", + "This service ships orders to an address chosen by the customer. The order is shipped from a collection point." + ], + "type": "string" + }, + "storeConfig": { + "$ref": "StoreConfig", + "description": "A list of stores your products are delivered from. This is only valid for the local delivery shipment type." + } + }, + "type": "object" + }, + "ShippingSettings": { + "description": "The merchant account's [shipping setting]((https://support.google.com/merchants/answer/6069284).", + "id": "ShippingSettings", + "properties": { + "etag": { + "description": "Required. This field is used for avoid async issue. Make sure shipping setting data didn't change between get call and insert call. The user should do following steps: 1. Set etag field as empty string for initial shipping setting creation. 2. After initial creation, call get method to obtain an etag and current shipping setting data before call insert. 3. Modify to wanted shipping setting information. 4. Call insert method with the wanted shipping setting information with the etag obtained from step 2. 5. If shipping setting data changed between step 2 and step 4. Insert request will fail because the etag changes every time the shipping setting data changes. User should repeate step 2-4 with the new etag.", + "type": "string" + }, + "name": { + "description": "Identifier. The resource name of the shipping setting. Format: `accounts/{account}/shippingSetting`", + "type": "string" + }, + "services": { + "description": "Optional. The target account's list of services.", + "items": { + "$ref": "Service" + }, + "type": "array" + }, + "warehouses": { + "description": "Optional. A list of warehouses which can be referred to in `services`.", + "items": { + "$ref": "Warehouse" + }, + "type": "array" + } + }, + "type": "object" + }, + "ShortCode": { + "description": "An object representing a short code, which is a phone number that is typically much shorter than regular phone numbers and can be used to address messages in MMS and SMS systems, as well as for abbreviated dialing (e.g. \"Text 611 to see how many minutes you have remaining on your plan.\"). Short codes are restricted to a region and are not internationally dialable, which means the same short code can exist in different regions, with different usage and pricing, even if those regions share the same country calling code (e.g. US and CA).", + "id": "ShortCode", + "properties": { + "number": { + "description": "Required. The short code digits, without a leading plus ('+') or country calling code, e.g. \"611\".", + "type": "string" + }, + "regionCode": { + "description": "Required. The BCP-47 region code of the location where calls to this short code can be made, such as \"US\" and \"BB\". Reference(s): - http://www.unicode.org/reports/tr35/#unicode_region_subtag", + "type": "string" + } + }, + "type": "object" + }, + "StoreCodeSetWithMov": { + "description": "A list of store code sets sharing the same minimum order value. At least two sets are required and the last one must be empty, which signifies 'MOV for all other stores'. Each store code can only appear once across all the sets. All prices within a service must have the same currency.", + "id": "StoreCodeSetWithMov", + "properties": { + "storeCodes": { + "description": "Optional. A list of unique store codes or empty for the catch all.", + "items": { + "type": "string" + }, + "type": "array" + }, + "value": { + "$ref": "Price", + "description": "The minimum order value for the given stores." + } + }, + "type": "object" + }, + "StoreConfig": { + "description": "A list of stores your products are delivered from. This is only valid for the local delivery shipment type.", + "id": "StoreConfig", + "properties": { + "cutoffConfig": { + "$ref": "CutoffConfig", + "description": "Configs related to local delivery ends for the day." + }, + "serviceRadius": { + "$ref": "Distance", + "description": "Maximum delivery radius. This is only required for the local delivery shipment type." + }, + "storeCodes": { + "description": "Optional. A list of store codes that provide local delivery. If empty, then `all_stores` must be true.", + "items": { + "type": "string" + }, + "type": "array" + }, + "storeServiceType": { + "description": "Indicates whether all stores, or selected stores, listed by this merchant provide local delivery.", + "enum": [ + "STORE_SERVICE_TYPE_UNSPECIFIED", + "ALL_STORES", + "SELECTED_STORES" + ], + "enumDescriptions": [ + "Did not specify store service type.", + "Indicates whether all stores, current and future, listed by this merchant provide local delivery.", + "Indicates that only the stores listed in `store_codes` are eligible for local delivery." + ], + "type": "string" + } + }, + "type": "object" + }, + "Table": { + "description": "A table defining the rate group, when `single_value` is not expressive enough.", + "id": "Table", + "properties": { + "columnHeaders": { + "$ref": "Headers", + "description": "Headers of the table's columns. Optional: if not set then the table has only one dimension." + }, + "name": { + "description": "Name of the table. Required for subtables, ignored for the main table.", + "type": "string" + }, + "rowHeaders": { + "$ref": "Headers", + "description": "Required. Headers of the table's rows." + }, + "rows": { + "description": "Required. The list of rows that constitute the table. Must have the same length as `row_headers`.", + "items": { + "$ref": "Row" + }, + "type": "array" + } + }, + "type": "object" + }, + "TaxPostalCodeRange": { + "description": "A range of postal codes that defines the area.", + "id": "TaxPostalCodeRange", + "properties": { + "end": { + "description": "The end of the postal code range. Will be the same as start if not specified.", + "type": "string" + }, + "start": { + "description": "Required. The start of the postal code range, which is also the smallest in the range.", + "type": "string" + } + }, + "type": "object" + }, + "TaxRule": { + "description": "Primary type convension percent micro : 100% = 1 000 000 and 1% = 10 000 cannot be negative. Information about tax nexus and related parameters applicable to orders delivered to the area covered by a single tax admin. Nexus is created when a merchant is doing business in an area administered by tax admin (only US states are supported for nexus configuration). If merchant has nexus in a US state, merchant needs to pay tax to all tax authorities associated with the shipping destination. Next Id : 8", + "id": "TaxRule", + "properties": { + "effectiveTimePeriod": { + "$ref": "Interval", + "description": "Required. Time period when this rule is effective. If the duration is missing from effective_time listed, then it is open ended to the future. The start of this time period is inclusive, and the end is exclusive." + }, + "locationId": { + "description": "The admin_id or criteria_id of the region in which this rule is applicable.", + "format": "int64", + "type": "string" + }, + "postCodeRange": { + "$ref": "TaxPostalCodeRange", + "description": "The range of postal codes in which this rule is applicable." + }, + "regionCode": { + "description": "Region code in which this rule is applicable", + "type": "string" + }, + "selfSpecifiedRateMicros": { + "description": "A fixed rate specified in micros, where 100% = 1_000_000. Suitable for origin-based states.", + "format": "int64", + "type": "string" + }, + "shippingTaxed": { + "description": "If set, shipping charge is taxed (at the same rate as product) when delivering to this admin's area. Can only be set on US states without category.", + "type": "boolean" + }, + "useGoogleRate": { + "description": "Rate that depends on delivery location: if merchant has a nexus in corresponding US state, rates from authorities with jurisdiction over delivery area are added up.", + "type": "boolean" + } + }, + "type": "object" + }, + "TermsOfService": { + "description": "A `TermsOfService`.", + "id": "TermsOfService", + "properties": { + "external": { + "description": "Whether this terms of service version is external. External terms of service versions can only be agreed through external processes and not directly by the merchant through UI or API.", + "type": "boolean" + }, + "fileUri": { + "description": "URI for terms of service file that needs to be displayed to signing users.", + "type": "string" + }, + "kind": { + "description": "The Kind this terms of service version applies to.", + "enum": [ + "TERMS_OF_SERVICE_KIND_UNSPECIFIED", + "MERCHANT_CENTER" + ], + "enumDescriptions": [ + "Default value. This value is unused.", + "Merchant Center application." + ], + "type": "string" + }, + "name": { + "description": "Identifier. The resource name of the terms of service version. Format: `termsOfService/{version}`", + "type": "string" + }, + "regionCode": { + "description": "Region code as defined by [CLDR](https://cldr.unicode.org/). This is either a country where the ToS applies specifically to that country or `001` when the same `TermsOfService` can be signed in any country. However note that when signing a ToS that applies globally we still expect that a specific country is provided (this should be merchant business country or program country of participation).", + "type": "string" + } + }, + "type": "object" + }, + "TermsOfServiceAgreementState": { + "description": "This resource represents the agreement state for a given account and terms of service kind. The state is as follows: * If the merchant has accepted a terms of service: [accepted](TermsOfServiceAggrementState.accepted) will be populated, otherwise it will be empty * If the merchant must sign a terms of service: [required](TermsOfServiceAggrementState.required) will be populated, otherwise it will be empty. Note that both [required](TermsOfServiceAggrementState.required) and [accepted](TermsOfServiceAggrementState.accepted) can be present. In this case the `accepted` terms of services will have an expiration date set in the [valid_until](Accepted.valid_until) field. The `required` terms of services need to be accepted before `valid_until` in order for the account to continue having a valid agreement. When accepting new terms of services we expect 3Ps to display the text associated with the given terms of service agreement (the url to the file containing the text is added in the Required message below as [tos_file_uri](Accepted.tos_file_uri). The actual acceptance of the terms of service is done by calling accept on the [TermsOfService](TermsOfService) resource.", + "id": "TermsOfServiceAgreementState", + "properties": { + "accepted": { + "$ref": "Accepted", + "description": "The accepted terms of service of this kind and for the associated region_code" + }, + "name": { + "description": "Identifier. The resource name of the terms of service version. Format: `accounts/{account}/termsOfServiceAgreementState/{identifier}`", + "type": "string" + }, + "regionCode": { + "description": "Region code as defined by https://cldr.unicode.org/. This is the country the current state applies to.", + "type": "string" + }, + "required": { + "$ref": "Required", + "description": "The required terms of service" + }, + "termsOfServiceKind": { + "description": "Terms of Service kind associated with the particular version.", + "enum": [ + "TERMS_OF_SERVICE_KIND_UNSPECIFIED", + "MERCHANT_CENTER" + ], + "enumDescriptions": [ + "Default value. This value is unused.", + "Merchant Center application." + ], + "type": "string" + } + }, + "type": "object" + }, + "TimeZone": { + "description": "Represents a time zone from the [IANA Time Zone Database](https://www.iana.org/time-zones).", + "id": "TimeZone", + "properties": { + "id": { + "description": "IANA Time Zone Database time zone, e.g. \"America/New_York\".", + "type": "string" + }, + "version": { + "description": "Optional. IANA Time Zone Database version number, e.g. \"2019a\".", + "type": "string" + } + }, + "type": "object" + }, + "TransitTable": { + "description": "Transit time table, number of business days spent in transit based on row and column dimensions. Either `min_transit_days`, `max_transit_days` or `transit_time_table` can be set, but not both.", + "id": "TransitTable", + "properties": { + "postalCodeGroupNames": { + "description": "Required. A list of region names Region.name . The last value can be `\"all other locations\"`. Example: `[\"zone 1\", \"zone 2\", \"all other locations\"]`. The referred postal code groups must match the delivery country of the service.", + "items": { + "type": "string" + }, + "type": "array" + }, + "rows": { + "description": "Required. If there's only one dimension set of `postal_code_group_names` or `transit_time_labels`, there are multiple rows each with one value for that dimension. If there are two dimensions, each row corresponds to a `postal_code_group_names`, and columns (values) to a `transit_time_labels`.", + "items": { + "$ref": "TransitTimeRow" + }, + "type": "array" + }, + "transitTimeLabels": { + "description": "Required. A list of transit time labels. The last value can be `\"all other labels\"`. Example: `[\"food\", \"electronics\", \"all other labels\"]`.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "TransitTimeRow": { + "description": "If there's only one dimension set of `postal_code_group_names` or `transit_time_labels`, there are multiple rows each with one value for that dimension. If there are two dimensions, each row corresponds to a `postal_code_group_names`, and columns (values) to a `transit_time_labels`.", + "id": "TransitTimeRow", + "properties": { + "values": { + "description": "Required. Transit time range (min-max) in business days.", + "items": { + "$ref": "TransitTimeValue" + }, + "type": "array" + } + }, + "type": "object" + }, + "TransitTimeValue": { + "description": "Transit time range (min-max) in business days.", + "id": "TransitTimeValue", + "properties": { + "maxTransitDays": { + "description": "Must be greater than or equal to `min_transit_days`.", + "format": "int32", + "type": "integer" + }, + "minTransitDays": { + "description": "Minimum transit time range in business days. 0 means same day delivery, 1 means next day delivery.", + "format": "int32", + "type": "integer" + } + }, + "type": "object" + }, + "UnclaimHomepageRequest": { + "description": "Request message for the `UnclaimHomepage` method.", + "id": "UnclaimHomepageRequest", + "properties": {}, + "type": "object" + }, + "User": { + "description": "A [user](https://support.google.com/merchants/answer/12160472).", + "id": "User", + "properties": { + "accessRights": { + "description": "Optional. The [access rights](https://support.google.com/merchants/answer/12160472?sjid=6789834943175119429-EU#accesstypes) the user has.", + "items": { + "enum": [ + "ACCESS_RIGHT_UNSPECIFIED", + "STANDARD", + "ADMIN", + "PERFORMANCE_REPORTING" + ], + "enumDescriptions": [ + "Default value. This value is unused.", + "Standard access rights.", + "Admin access rights.", + "Users with this right have access to performance and insights." + ], + "type": "string" + }, + "type": "array" + }, + "name": { + "description": "Identifier. The resource name of the user. Format: `accounts/{account}/user/{email}` Use `me` to refer to your own email address, for example `accounts/{account}/users/me`.", + "type": "string" + }, + "state": { + "description": "Output only. The state of the user.", + "enum": [ + "STATE_UNSPECIFIED", + "PENDING", + "VERIFIED" + ], + "enumDescriptions": [ + "Default value. This value is unused.", + "The user is pending confirmation. In this state, the user first needs to accept the invitation before performing other actions.", + "The user is verified." + ], + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "Value": { + "description": "The single value of a rate group or the value of a rate group table's cell. Exactly one of `no_shipping`, `flat_rate`, `price_percentage`, `carrier_rateName`, `subtable_name` must be set.", + "id": "Value", + "properties": { + "carrierRate": { + "description": "The name of a carrier rate referring to a carrier rate defined in the same rate group. Can only be set if all other fields are not set.", + "type": "string" + }, + "flatRate": { + "$ref": "Price", + "description": "A flat rate. Can only be set if all other fields are not set." + }, + "noShipping": { + "description": "If true, then the product can't be shipped. Must be true when set, can only be set if all other fields are not set.", + "type": "boolean" + }, + "pricePercentage": { + "description": "A percentage of the price represented as a number in decimal notation (For example, `\"5.4\"`). Can only be set if all other fields are not set.", + "type": "string" + }, + "subtable": { + "description": "The name of a subtable. Can only be set in table cells (For example, not for single values), and only if all other fields are not set.", + "type": "string" + } + }, + "type": "object" + }, + "Warehouse": { + "description": "A fulfillment warehouse, which stores and handles inventory. Next tag: 7", + "id": "Warehouse", + "properties": { + "businessDayConfig": { + "$ref": "BusinessDayConfig", + "description": "Business days of the warehouse. If not set, will be Monday to Friday by default." + }, + "cutoffTime": { + "$ref": "WarehouseCutoffTime", + "description": "Required. The latest time of day that an order can be accepted and begin processing. Later orders will be processed in the next day. The time is based on the warehouse postal code." + }, + "handlingDays": { + "description": "Required. The number of days it takes for this warehouse to pack up and ship an item. This is on the warehouse level, but can be overridden on the offer level based on the attributes of an item.", + "format": "int64", + "type": "string" + }, + "name": { + "description": "Required. The name of the warehouse. Must be unique within account.", + "type": "string" + }, + "shippingAddress": { + "$ref": "Address", + "description": "Required. Shipping address of the warehouse." + } + }, + "type": "object" + }, + "WarehouseBasedDeliveryTime": { + "description": "Indicates that the delivery time should be calculated per warehouse (shipping origin location) based on the settings of the selected carrier. When set, no other transit time related field in `delivery_time` should be set.", + "id": "WarehouseBasedDeliveryTime", + "properties": { + "carrier": { + "description": "Required. Carrier, such as `\"UPS\"` or `\"Fedex\"`.", + "type": "string" + }, + "carrierService": { + "description": "Required. Carrier service, such as `\"ground\"` or `\"2 days\"`. The name of the service must be in the eddSupportedServices list.", + "type": "string" + }, + "warehouse": { + "description": "Required. Warehouse name. This should match warehouse", + "type": "string" + } + }, + "type": "object" + }, + "WarehouseCutoffTime": { + "description": "The latest time of day that an order can be accepted and begin processing. Later orders will be processed in the next day. The time is based on the warehouse postal code.", + "id": "WarehouseCutoffTime", + "properties": { + "hour": { + "description": "Required. Hour of the cutoff time until which an order has to be placed to be processed in the same day by the warehouse. Hour is based on the timezone of warehouse.", + "format": "int32", + "type": "integer" + }, + "minute": { + "description": "Required. Minute of the cutoff time until which an order has to be placed to be processed in the same day by the warehouse. Minute is based on the timezone of warehouse.", + "format": "int32", + "type": "integer" + } + }, + "type": "object" + }, + "Weight": { + "description": "The weight represented as the value in string and the unit.", + "id": "Weight", + "properties": { + "amountMicros": { + "description": "Required. The weight represented as a number in micros (1 million micros is an equivalent to one's currency standard unit, for example, 1 kg = 1000000 micros). This field can also be set as infinity by setting to -1. This field only support -1 and positive value.", + "format": "int64", + "type": "string" + }, + "unit": { + "description": "Required. The weight unit. Acceptable values are: kg and lb", + "enum": [ + "WEIGHT_UNIT_UNSPECIFIED", + "POUND", + "KILOGRAM" + ], + "enumDescriptions": [ + "unit unspecified", + "lb unit.", + "kg unit." + ], + "type": "string" + } + }, + "type": "object" + } + }, + "servicePath": "", + "title": "Merchant API", + "version": "accounts_v1beta", + "version_module": true +} \ No newline at end of file diff --git a/merchantapi/accounts_v1beta/merchantapi-gen.go b/merchantapi/accounts_v1beta/merchantapi-gen.go new file mode 100644 index 00000000000..07074d61d29 --- /dev/null +++ b/merchantapi/accounts_v1beta/merchantapi-gen.go @@ -0,0 +1,8144 @@ +// Copyright 2024 Google LLC. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Code generated file. DO NOT EDIT. + +// Package merchantapi provides access to the Merchant API. +// +// For product documentation, see: https://developers.devsite.corp.google.com/merchant/api +// +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// +// # Creating a client +// +// Usage example: +// +// import "google.golang.org/api/merchantapi/accounts_v1beta" +// ... +// ctx := context.Background() +// merchantapiService, err := merchantapi.NewService(ctx) +// +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// +// # Other authentication options +// +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: +// +// merchantapiService, err := merchantapi.NewService(ctx, option.WithAPIKey("AIza...")) +// +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: +// +// config := &oauth2.Config{...} +// // ... +// token, err := config.Exchange(ctx, ...) +// merchantapiService, err := merchantapi.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) +// +// See [google.golang.org/api/option.ClientOption] for details on options. +package merchantapi // import "google.golang.org/api/merchantapi/accounts_v1beta" + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strconv" + "strings" + + googleapi "google.golang.org/api/googleapi" + internal "google.golang.org/api/internal" + gensupport "google.golang.org/api/internal/gensupport" + option "google.golang.org/api/option" + internaloption "google.golang.org/api/option/internaloption" + htransport "google.golang.org/api/transport/http" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = gensupport.MarshalJSON +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = context.Canceled +var _ = internaloption.WithDefaultEndpoint +var _ = internal.Version + +const apiId = "merchantapi:accounts_v1beta" +const apiName = "merchantapi" +const apiVersion = "accounts_v1beta" +const basePath = "https://merchantapi.googleapis.com/" +const basePathTemplate = "https://merchantapi.UNIVERSE_DOMAIN/" +const mtlsBasePath = "https://merchantapi.mtls.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // Manage your product listings and accounts for Google Shopping + ContentScope = "https://www.googleapis.com/auth/content" +) + +// NewService creates a new APIService. +func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, error) { + scopesOption := internaloption.WithDefaultScopes( + "https://www.googleapis.com/auth/content", + ) + // NOTE: prepend, so we don't override user-specified scopes. + opts = append([]option.ClientOption{scopesOption}, opts...) + opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) + opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) + opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) + opts = append(opts, internaloption.EnableNewAuthLibrary()) + client, endpoint, err := htransport.NewClient(ctx, opts...) + if err != nil { + return nil, err + } + s, err := New(client) + if err != nil { + return nil, err + } + if endpoint != "" { + s.BasePath = endpoint + } + return s, nil +} + +// New creates a new APIService. It uses the provided http.Client for requests. +// +// Deprecated: please use NewService instead. +// To provide a custom HTTP client, use option.WithHTTPClient. +// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. +func New(client *http.Client) (*APIService, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &APIService{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) + s.TermsOfService = NewTermsOfServiceService(s) + return s, nil +} + +type APIService struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Accounts *AccountsService + + TermsOfService *TermsOfServiceService +} + +func (s *APIService) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewAccountsService(s *APIService) *AccountsService { + rs := &AccountsService{s: s} + rs.Accounttax = NewAccountsAccounttaxService(s) + rs.Homepage = NewAccountsHomepageService(s) + rs.Issues = NewAccountsIssuesService(s) + rs.OnlineReturnPolicies = NewAccountsOnlineReturnPoliciesService(s) + rs.Programs = NewAccountsProgramsService(s) + rs.Regions = NewAccountsRegionsService(s) + rs.ShippingSettings = NewAccountsShippingSettingsService(s) + rs.TermsOfServiceAgreementStates = NewAccountsTermsOfServiceAgreementStatesService(s) + rs.Users = NewAccountsUsersService(s) + return rs +} + +type AccountsService struct { + s *APIService + + Accounttax *AccountsAccounttaxService + + Homepage *AccountsHomepageService + + Issues *AccountsIssuesService + + OnlineReturnPolicies *AccountsOnlineReturnPoliciesService + + Programs *AccountsProgramsService + + Regions *AccountsRegionsService + + ShippingSettings *AccountsShippingSettingsService + + TermsOfServiceAgreementStates *AccountsTermsOfServiceAgreementStatesService + + Users *AccountsUsersService +} + +func NewAccountsAccounttaxService(s *APIService) *AccountsAccounttaxService { + rs := &AccountsAccounttaxService{s: s} + return rs +} + +type AccountsAccounttaxService struct { + s *APIService +} + +func NewAccountsHomepageService(s *APIService) *AccountsHomepageService { + rs := &AccountsHomepageService{s: s} + return rs +} + +type AccountsHomepageService struct { + s *APIService +} + +func NewAccountsIssuesService(s *APIService) *AccountsIssuesService { + rs := &AccountsIssuesService{s: s} + return rs +} + +type AccountsIssuesService struct { + s *APIService +} + +func NewAccountsOnlineReturnPoliciesService(s *APIService) *AccountsOnlineReturnPoliciesService { + rs := &AccountsOnlineReturnPoliciesService{s: s} + return rs +} + +type AccountsOnlineReturnPoliciesService struct { + s *APIService +} + +func NewAccountsProgramsService(s *APIService) *AccountsProgramsService { + rs := &AccountsProgramsService{s: s} + return rs +} + +type AccountsProgramsService struct { + s *APIService +} + +func NewAccountsRegionsService(s *APIService) *AccountsRegionsService { + rs := &AccountsRegionsService{s: s} + return rs +} + +type AccountsRegionsService struct { + s *APIService +} + +func NewAccountsShippingSettingsService(s *APIService) *AccountsShippingSettingsService { + rs := &AccountsShippingSettingsService{s: s} + return rs +} + +type AccountsShippingSettingsService struct { + s *APIService +} + +func NewAccountsTermsOfServiceAgreementStatesService(s *APIService) *AccountsTermsOfServiceAgreementStatesService { + rs := &AccountsTermsOfServiceAgreementStatesService{s: s} + return rs +} + +type AccountsTermsOfServiceAgreementStatesService struct { + s *APIService +} + +func NewAccountsUsersService(s *APIService) *AccountsUsersService { + rs := &AccountsUsersService{s: s} + return rs +} + +type AccountsUsersService struct { + s *APIService +} + +func NewTermsOfServiceService(s *APIService) *TermsOfServiceService { + rs := &TermsOfServiceService{s: s} + return rs +} + +type TermsOfServiceService struct { + s *APIService +} + +// AcceptTermsOfService: Reference to a Terms of Service resource. +type AcceptTermsOfService struct { + // Name: Required. The resource name of the terms of service version. + Name string `json:"name,omitempty"` + // RegionCode: Required. Region code as defined by CLDR + // (https://cldr.unicode.org/). This is either a country when the ToS applies + // specifically to that country or `001` when it applies globally. + RegionCode string `json:"regionCode,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. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + 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. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *AcceptTermsOfService) MarshalJSON() ([]byte, error) { + type NoMethod AcceptTermsOfService + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Accepted: Describes the accepted terms of service. +type Accepted struct { + // AcceptedBy: The account where the acceptance was recorded. This can be the + // account itself or, in the case of subaccounts, the MCA account. + AcceptedBy string `json:"acceptedBy,omitempty"` + // TermsOfService: The accepted termsOfService + // (google.shopping.merchant.accounts.v1main.TermsOfService). + TermsOfService string `json:"termsOfService,omitempty"` + // ValidUntil: When set, it states that the accepted TermsOfService + // (google.shopping.merchant.accounts.v1main.TermsOfService) is only valid + // until the end of this date (in UTC). A new one must be accepted before then. + // The information of the required TermsOfService + // (google.shopping.merchant.accounts.v1main.TermsOfService) is found in the + // Required (Required) message. + ValidUntil *Date `json:"validUntil,omitempty"` + // ForceSendFields is a list of field names (e.g. "AcceptedBy") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AcceptedBy") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Accepted) MarshalJSON() ([]byte, error) { + type NoMethod Accepted + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Account: An account. +type Account struct { + // AccountId: Output only. The ID of the account. + AccountId int64 `json:"accountId,omitempty,string"` + // AccountName: Required. A human-readable name of the account. See store name + // (https://support.google.com/merchants/answer/160556) and business name + // (https://support.google.com/merchants/answer/12159159) for more information. + AccountName string `json:"accountName,omitempty"` + // AdultContent: Whether this account contains adult content. + AdultContent bool `json:"adultContent,omitempty"` + // LanguageCode: Required. The account's BCP-47 language code + // (https://tools.ietf.org/html/bcp47), such as `en-US` or `sr-Latn`. + LanguageCode string `json:"languageCode,omitempty"` + // Name: Identifier. The resource name of the account. Format: + // `accounts/{account}` + Name string `json:"name,omitempty"` + // TestAccount: Output only. Whether this is a test account. + TestAccount bool `json:"testAccount,omitempty"` + // TimeZone: Required. The time zone of the account. On writes, `time_zone` + // sets both the `reporting_time_zone` and the `display_time_zone`. For reads, + // `time_zone` always returns the `display_time_zone`. If `display_time_zone` + // doesn't exist for your account, `time_zone` is empty. + TimeZone *TimeZone `json:"timeZone,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AccountId") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Account) MarshalJSON() ([]byte, error) { + type NoMethod Account + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// AccountIssue: An `AccountIssue` +// (https://support.google.com/merchants/answer/12153802?sjid=17798438912526418908-EU#account). +type AccountIssue struct { + // Detail: Further localized details about the issue. + Detail string `json:"detail,omitempty"` + // DocumentationUri: Link to Merchant Center Help Center providing further + // information about the issue and how to fix it. + DocumentationUri string `json:"documentationUri,omitempty"` + // ImpactedDestinations: The impact this issue has on various destinations. + ImpactedDestinations []*ImpactedDestination `json:"impactedDestinations,omitempty"` + // Name: Identifier. The resource name of the account issue. Format: + // `accounts/{account}/issues/{id}` + Name string `json:"name,omitempty"` + // Severity: The overall severity of the issue. + // + // Possible values: + // "SEVERITY_UNSPECIFIED" - The severity is unknown. + // "CRITICAL" - The issue causes offers to not serve. + // "ERROR" - The issue might affect offers (in the future) or might be an + // indicator of issues with offers. + // "SUGGESTION" - The issue is a suggestion for improvement. + Severity string `json:"severity,omitempty"` + // Title: The localized title of the issue. + Title string `json:"title,omitempty"` + // ForceSendFields is a list of field names (e.g. "Detail") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Detail") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *AccountIssue) MarshalJSON() ([]byte, error) { + type NoMethod AccountIssue + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// AccountTax: The tax settings of a merchant account. All methods require the +// admin role. +type AccountTax struct { + // Account: Output only. The ID of the account to which these account tax + // settings belong. + Account int64 `json:"account,omitempty,string"` + // Name: Identifier. The name of the tax setting. Format: + // "{account_tax.name=accounts/{account}}" + Name string `json:"name,omitempty"` + // TaxRules: Tax rules. "Define the tax rules in each region. No tax will be + // presented if a region has no rule." + TaxRules []*TaxRule `json:"taxRules,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "Account") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Account") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *AccountTax) MarshalJSON() ([]byte, error) { + type NoMethod AccountTax + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// AddAccountService: Additional instructions to add account services during +// creation of the account. +type AddAccountService struct { + // AccountAggregation: The provider is an aggregator for the account. + AccountAggregation *Empty `json:"accountAggregation,omitempty"` + // Provider: Optional. The provider of the service. Format: + // `accounts/{account}` + Provider string `json:"provider,omitempty"` + // ForceSendFields is a list of field names (e.g. "AccountAggregation") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AccountAggregation") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *AddAccountService) MarshalJSON() ([]byte, error) { + type NoMethod AddAccountService + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Address: Shipping address of the warehouse. +type Address struct { + // AdministrativeArea: Required. Top-level administrative subdivision of the + // country. For example, a state like California ("CA") or a province like + // Quebec ("QC"). + AdministrativeArea string `json:"administrativeArea,omitempty"` + // City: Required. City, town or commune. May also include dependent localities + // or sublocalities (For example neighborhoods or suburbs). + City string `json:"city,omitempty"` + // PostalCode: Required. Postal code or ZIP (For example "94043"). + PostalCode string `json:"postalCode,omitempty"` + // RegionCode: Required. CLDR country code + // (http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) (For + // example "US"). + RegionCode string `json:"regionCode,omitempty"` + // StreetAddress: Street-level part of the address. For example: `111w 31st + // Street`. + StreetAddress string `json:"streetAddress,omitempty"` + // ForceSendFields is a list of field names (e.g. "AdministrativeArea") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AdministrativeArea") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Address) MarshalJSON() ([]byte, error) { + type NoMethod Address + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// BusinessDayConfig: Business days of the warehouse. +type BusinessDayConfig struct { + // BusinessDays: Required. Regular business days. May not be empty. + // + // Possible values: + // "WEEKDAY_UNSPECIFIED" + // "MONDAY" + // "TUESDAY" + // "WEDNESDAY" + // "THURSDAY" + // "FRIDAY" + // "SATURDAY" + // "SUNDAY" + BusinessDays []string `json:"businessDays,omitempty"` + // ForceSendFields is a list of field names (e.g. "BusinessDays") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "BusinessDays") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *BusinessDayConfig) MarshalJSON() ([]byte, error) { + type NoMethod BusinessDayConfig + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// BusinessIdentity: Collection of information related to the identity of a +// business (https://support.google.com/merchants/answer/12564247). +type BusinessIdentity struct { + // BlackOwned: Optional. Specifies whether the business identifies itself as + // being black-owned. This optional field will only be available for merchants + // with a business country set to `US`. It is also not applicable for + // marketplaces or marketplace sellers. + BlackOwned *IdentityAttribute `json:"blackOwned,omitempty"` + // LatinoOwned: Optional. Specifies whether the business identifies itself as + // being latino-owned. This optional field will only be available for merchants + // with a business country set to `US`. It is also not applicable for + // marketplaces or marketplace sellers. + LatinoOwned *IdentityAttribute `json:"latinoOwned,omitempty"` + // Name: Identifier. The resource name of the business identity. Format: + // `accounts/{account}/businessIdentity` + Name string `json:"name,omitempty"` + // PromotionsConsent: Optional. Whether the identity attributes may be used for + // promotions. + // + // Possible values: + // "PROMOTIONS_CONSENT_UNSPECIFIED" - Default value indicating that no + // selection was made. + // "PROMOTIONS_CONSENT_GIVEN" - Indicates that the account consented to + // having their business identity used for promotions. + // "PROMOTIONS_CONSENT_DENIED" - Indicates that the account did not consent + // to having their business identity used for promotions. + PromotionsConsent string `json:"promotionsConsent,omitempty"` + // SmallBusiness: Optional. Specifies whether the business identifies itself as + // a small business. This optional field will only be available for merchants + // with a business country set to `US`. It is also not applicable for + // marketplaces. + SmallBusiness *IdentityAttribute `json:"smallBusiness,omitempty"` + // VeteranOwned: Optional. Specifies whether the business identifies itself as + // being veteran-owned. This optional field will only be available for + // merchants with a business country set to `US`. It is also not applicable for + // marketplaces or marketplace sellers. + VeteranOwned *IdentityAttribute `json:"veteranOwned,omitempty"` + // WomenOwned: Optional. Specifies whether the business identifies itself as + // being women-owned. This optional field will only be available for merchants + // with a business country set to `US`. It is also not applicable for + // marketplaces or marketplace sellers. + WomenOwned *IdentityAttribute `json:"womenOwned,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "BlackOwned") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "BlackOwned") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *BusinessIdentity) MarshalJSON() ([]byte, error) { + type NoMethod BusinessIdentity + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// BusinessInfo: Collection of information related to a business. +type BusinessInfo struct { + // Address: Optional. The address of the business. + Address *PostalAddress `json:"address,omitempty"` + // CustomerService: Optional. The customer service of the business. + CustomerService *CustomerService `json:"customerService,omitempty"` + // Name: Identifier. The resource name of the business info. Format: + // `accounts/{account}/businessInfo` + Name string `json:"name,omitempty"` + // Phone: Output only. The phone number of the business. + Phone *PhoneNumber `json:"phone,omitempty"` + // PhoneVerificationState: Output only. The phone verification state of the + // business. + // + // Possible values: + // "PHONE_VERIFICATION_STATE_UNSPECIFIED" - Default value. This value is + // unused. + // "PHONE_VERIFICATION_STATE_VERIFIED" - The phone is verified. + // "PHONE_VERIFICATION_STATE_UNVERIFIED" - The phone is unverified + PhoneVerificationState string `json:"phoneVerificationState,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "Address") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Address") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *BusinessInfo) MarshalJSON() ([]byte, error) { + type NoMethod BusinessInfo + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// CarrierRate: A list of carrier rates that can be referred to by `main_table` +// or `single_value`. +type CarrierRate struct { + // Carrier: Required. Carrier service, such as "UPS" or "Fedex". + Carrier string `json:"carrier,omitempty"` + // CarrierService: Required. Carrier service, such as "ground" or "2 days". + CarrierService string `json:"carrierService,omitempty"` + // FlatAdjustment: Optional. Additive shipping rate modifier. Can be negative. + // For example `{ "amount_micros": 1, "currency_code" : "USD" }` adds $1 to the + // rate, `{ "amount_micros": -3, "currency_code" : "USD" }` removes $3 from the + // rate. + FlatAdjustment *Price `json:"flatAdjustment,omitempty"` + // Name: Required. Name of the carrier rate. Must be unique per rate group. + Name string `json:"name,omitempty"` + // OriginPostalCode: Required. Shipping origin for this carrier rate. + OriginPostalCode string `json:"originPostalCode,omitempty"` + // PercentageAdjustment: Optional. Multiplicative shipping rate modifier as a + // number in decimal notation. Can be negative. For example "5.4" increases + // the rate by 5.4%, "-3" decreases the rate by 3%. + PercentageAdjustment string `json:"percentageAdjustment,omitempty"` + // ForceSendFields is a list of field names (e.g. "Carrier") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Carrier") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *CarrierRate) MarshalJSON() ([]byte, error) { + type NoMethod CarrierRate + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ClaimHomepageRequest: Request message for the `ClaimHomepage` method. +type ClaimHomepageRequest struct { +} + +// CreateAndConfigureAccountRequest: Request message for the +// `CreateAndConfigureAccount` method. +type CreateAndConfigureAccountRequest struct { + // AcceptTermsOfService: Optional. The Terms of Service (ToS) to be accepted + // immediately upon account creation. + AcceptTermsOfService *AcceptTermsOfService `json:"acceptTermsOfService,omitempty"` + // Account: Required. The account to be created. + Account *Account `json:"account,omitempty"` + // Service: Optional. If specified, an account service between the account to + // be created and the provider account is initialized as part of the creation. + Service []*AddAccountService `json:"service,omitempty"` + // Users: Optional. Users to be added to the account. + Users []*CreateUserRequest `json:"users,omitempty"` + // ForceSendFields is a list of field names (e.g. "AcceptTermsOfService") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AcceptTermsOfService") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *CreateAndConfigureAccountRequest) MarshalJSON() ([]byte, error) { + type NoMethod CreateAndConfigureAccountRequest + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// CreateUserRequest: Request message for the `CreateUser` method. +type CreateUserRequest struct { + // Parent: Required. The resource name of the account for which a user will be + // created. Format: `accounts/{account}` + Parent string `json:"parent,omitempty"` + // User: Required. The user to create. + User *User `json:"user,omitempty"` + // UserId: Required. The email address of the user (for example, + // `john.doe@gmail.com`). + UserId string `json:"userId,omitempty"` + // ForceSendFields is a list of field names (e.g. "Parent") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Parent") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *CreateUserRequest) MarshalJSON() ([]byte, error) { + type NoMethod CreateUserRequest + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// CustomerService: Customer service information. +type CustomerService struct { + // Email: Optional. The email address where customer service may be reached. + Email string `json:"email,omitempty"` + // Phone: Optional. The phone number where customer service may be called. + Phone *PhoneNumber `json:"phone,omitempty"` + // Uri: Optional. The URI where customer service may be found. + Uri string `json:"uri,omitempty"` + // ForceSendFields is a list of field names (e.g. "Email") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Email") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *CustomerService) MarshalJSON() ([]byte, error) { + type NoMethod CustomerService + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// CutoffConfig: Configs related to local delivery ends for the day. +type CutoffConfig struct { + // LocalCutoffTime: Time that local delivery ends for the day. + LocalCutoffTime *LocalCutoffTime `json:"localCutoffTime,omitempty"` + // NoDeliveryPostCutoff: Merchants can opt-out of showing n+1 day local + // delivery when they have a shipping service configured to n day local + // delivery. For example, if the shipping service defines same-day delivery, + // and it's past the cut-off, setting this field to `true` results in the + // calculated shipping service rate returning `NO_DELIVERY_POST_CUTOFF`. In the + // same example, setting this field to `false` results in the calculated + // shipping time being one day. This is only for local delivery. + NoDeliveryPostCutoff bool `json:"noDeliveryPostCutoff,omitempty"` + // StoreCloseOffsetHours: Only valid with local delivery fulfillment. + // Represents cutoff time as the number of hours before store closing. Mutually + // exclusive with `local_cutoff_time`. + StoreCloseOffsetHours int64 `json:"storeCloseOffsetHours,omitempty,string"` + // ForceSendFields is a list of field names (e.g. "LocalCutoffTime") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "LocalCutoffTime") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *CutoffConfig) MarshalJSON() ([]byte, error) { + type NoMethod CutoffConfig + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// CutoffTime: Business days cutoff time definition. +type CutoffTime struct { + // Hour: Required. Hour of the cutoff time until which an order has to be + // placed to be processed in the same day. + Hour int64 `json:"hour,omitempty"` + // Minute: Required. Minute of the cutoff time until which an order has to be + // placed to be processed in the same day. + Minute int64 `json:"minute,omitempty"` + // TimeZone: Required. Timezone identifier + // (https://developers.google.com/adwords/api/docs/appendix/codes-formats#timezone-ids) + // For example "Europe/Zurich". + TimeZone string `json:"timeZone,omitempty"` + // ForceSendFields is a list of field names (e.g. "Hour") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Hour") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *CutoffTime) MarshalJSON() ([]byte, error) { + type NoMethod CutoffTime + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Date: Represents a whole or partial calendar date, such as a birthday. The +// time of day and time zone are either specified elsewhere or are +// insignificant. The date is relative to the Gregorian Calendar. This can +// represent one of the following: * A full date, with non-zero year, month, +// and day values. * A month and day, with a zero year (for example, an +// anniversary). * A year on its own, with a zero month and a zero day. * A +// year and month, with a zero day (for example, a credit card expiration +// date). Related types: * google.type.TimeOfDay * google.type.DateTime * +// google.protobuf.Timestamp +type Date struct { + // Day: Day of a month. Must be from 1 to 31 and valid for the year and month, + // or 0 to specify a year by itself or a year and month where the day isn't + // significant. + Day int64 `json:"day,omitempty"` + // Month: Month of a year. Must be from 1 to 12, or 0 to specify a year without + // a month and day. + Month int64 `json:"month,omitempty"` + // Year: Year of the date. Must be from 1 to 9999, or 0 to specify a date + // without a year. + Year int64 `json:"year,omitempty"` + // ForceSendFields is a list of field names (e.g. "Day") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Day") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Date) MarshalJSON() ([]byte, error) { + type NoMethod Date + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// DeliveryTime: Time spent in various aspects from order to the delivery of +// the product. +type DeliveryTime struct { + // CutoffTime: Business days cutoff time definition. If not configured the + // cutoff time will be defaulted to 8AM PST. + CutoffTime *CutoffTime `json:"cutoffTime,omitempty"` + // HandlingBusinessDayConfig: The business days during which orders can be + // handled. If not provided, Monday to Friday business days will be assumed. + HandlingBusinessDayConfig *BusinessDayConfig `json:"handlingBusinessDayConfig,omitempty"` + // MaxHandlingDays: Maximum number of business days spent before an order is + // shipped. 0 means same day shipped, 1 means next day shipped. Must be greater + // than or equal to `min_handling_days`. + MaxHandlingDays int64 `json:"maxHandlingDays,omitempty"` + // MaxTransitDays: Maximum number of business days that is spent in transit. 0 + // means same day delivery, 1 means next day delivery. Must be greater than or + // equal to `min_transit_days`. + MaxTransitDays int64 `json:"maxTransitDays,omitempty"` + // MinHandlingDays: Minimum number of business days spent before an order is + // shipped. 0 means same day shipped, 1 means next day shipped. + MinHandlingDays int64 `json:"minHandlingDays,omitempty"` + // MinTransitDays: Minimum number of business days that is spent in transit. 0 + // means same day delivery, 1 means next day delivery. Either + // `min_transit_days`, `max_transit_days` or `transit_time_table` must be set, + // but not both. + MinTransitDays int64 `json:"minTransitDays,omitempty"` + // TransitBusinessDayConfig: The business days during which orders can be + // in-transit. If not provided, Monday to Friday business days will be assumed. + TransitBusinessDayConfig *BusinessDayConfig `json:"transitBusinessDayConfig,omitempty"` + // TransitTimeTable: Transit time table, number of business days spent in + // transit based on row and column dimensions. Either `min_transit_days`, + // `max_transit_days` or `transit_time_table` can be set, but not both. + TransitTimeTable *TransitTable `json:"transitTimeTable,omitempty"` + // WarehouseBasedDeliveryTimes: Optional. Indicates that the delivery time + // should be calculated per warehouse (shipping origin location) based on the + // settings of the selected carrier. When set, no other transit time related + // field in delivery time should be set. + WarehouseBasedDeliveryTimes []*WarehouseBasedDeliveryTime `json:"warehouseBasedDeliveryTimes,omitempty"` + // ForceSendFields is a list of field names (e.g. "CutoffTime") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "CutoffTime") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *DeliveryTime) MarshalJSON() ([]byte, error) { + type NoMethod DeliveryTime + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// DisableProgramRequest: Request message for the DisableProgram method. +type DisableProgramRequest struct { +} + +// Distance: Maximum delivery radius. This is only required for the local +// delivery shipment type. +type Distance struct { + // Unit: Unit can differ based on country, it is parameterized to include miles + // and kilometers. + // + // Possible values: + // "UNIT_UNSPECIFIED" - Unit unspecified + // "MILES" - Unit in miles + // "KILOMETERS" - Unit in kilometers + Unit string `json:"unit,omitempty"` + // Value: Integer value of distance. + Value int64 `json:"value,omitempty,string"` + // ForceSendFields is a list of field names (e.g. "Unit") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Unit") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Distance) MarshalJSON() ([]byte, error) { + type NoMethod Distance + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// EmailPreferences: The categories of notifications the user opted into / +// opted out of. The email preferences do not include mandatory announcements +// as users can't opt out of them. +type EmailPreferences struct { + // Name: Identifier. The name of the EmailPreferences. The endpoint is only + // supported for the authenticated user. + Name string `json:"name,omitempty"` + // NewsAndTips: Optional. Updates on new features, tips and best practices. + // + // Possible values: + // "OPT_IN_STATE_UNSPECIFIED" - Opt-in status is not specified. + // "OPTED_OUT" - User has opted out of receiving this type of email. + // "OPTED_IN" - User has opted in to receiving this type of email. + // "UNCONFIRMED" - User has opted in to receiving this type of email and the + // confirmation email has been sent, but user has not yet confirmed the opt in + // (applies only to certain countries). + NewsAndTips string `json:"newsAndTips,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // 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. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + 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. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *EmailPreferences) MarshalJSON() ([]byte, error) { + type NoMethod EmailPreferences + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Empty: A generic empty message that you can re-use to avoid defining +// duplicated empty messages in your APIs. A typical example is to use it as +// the request or the response type of an API method. For instance: service Foo +// { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } +type Empty struct { + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` +} + +// EnableProgramRequest: Request message for the EnableProgram method. +type EnableProgramRequest struct { +} + +// GeoTargetArea: A list of geotargets that defines the region area. +type GeoTargetArea struct { + // GeotargetCriteriaIds: Required. A non-empty list of location IDs + // (https://developers.google.com/adwords/api/docs/appendix/geotargeting). They + // must all be of the same location type (for example, state). + GeotargetCriteriaIds googleapi.Int64s `json:"geotargetCriteriaIds,omitempty"` + // ForceSendFields is a list of field names (e.g. "GeotargetCriteriaIds") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "GeotargetCriteriaIds") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GeoTargetArea) MarshalJSON() ([]byte, error) { + type NoMethod GeoTargetArea + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Headers: A non-empty list of row or column headers for a table. Exactly one +// of `prices`, `weights`, `num_items`, `postal_code_group_names`, or +// `location` must be set. +type Headers struct { + // Locations: Required. A list of location ID sets. Must be non-empty. Can only + // be set if all other fields are not set. + Locations []*LocationIdSet `json:"locations,omitempty"` + // NumberOfItems: Required. A list of inclusive number of items upper bounds. + // The last value can be "infinity". For example `["10", "50", "infinity"]` + // represents the headers "<= 10 items", "<= 50 items", and "> 50 items". Must + // be non-empty. Can only be set if all other fields are not set. + NumberOfItems []string `json:"numberOfItems,omitempty"` + // PostalCodeGroupNames: Required. A list of postal group names. The last value + // can be "all other locations". Example: `["zone 1", "zone 2", "all other + // locations"]`. The referred postal code groups must match the delivery + // country of the service. Must be non-empty. Can only be set if all other + // fields are not set. + PostalCodeGroupNames []string `json:"postalCodeGroupNames,omitempty"` + // Prices: Required. A list of inclusive order price upper bounds. The last + // price's value can be infinity by setting price amount_micros = -1. For + // example `[{"amount_micros": 10000000, "currency_code": "USD"}, + // {"amount_micros": 500000000, "currency_code": "USD"}, {"amount_micros": -1, + // "currency_code": "USD"}]` represents the headers "<= $10", "<= $500", and "> + // $500". All prices within a service must have the same currency. Must be + // non-empty. Must be positive except -1. Can only be set if all other fields + // are not set. + Prices []*Price `json:"prices,omitempty"` + // Weights: Required. A list of inclusive order weight upper bounds. The last + // weight's value can be infinity by setting price amount_micros = -1. For + // example `[{"amount_micros": 10000000, "unit": "kg"}, {"amount_micros": + // 50000000, "unit": "kg"}, {"amount_micros": -1, "unit": "kg"}]` represents + // the headers "<= 10kg", "<= 50kg", and "> 50kg". All weights within a service + // must have the same unit. Must be non-empty. Must be positive except -1. Can + // only be set if all other fields are not set. + Weights []*Weight `json:"weights,omitempty"` + // ForceSendFields is a list of field names (e.g. "Locations") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Locations") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Headers) MarshalJSON() ([]byte, error) { + type NoMethod Headers + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Homepage: A store's homepage. +type Homepage struct { + // Claimed: Output only. Whether the homepage is claimed. See + // https://support.google.com/merchants/answer/176793. + Claimed bool `json:"claimed,omitempty"` + // Name: Identifier. The resource name of the store's homepage. Format: + // `accounts/{account}/homepage` + Name string `json:"name,omitempty"` + // Uri: Required. The URI (typically a URL) of the store's homepage. + Uri string `json:"uri,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "Claimed") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Claimed") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Homepage) MarshalJSON() ([]byte, error) { + type NoMethod Homepage + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// IdentityAttribute: All information related to an identity attribute. +type IdentityAttribute struct { + // IdentityDeclaration: Required. The declaration of identity for this + // attribute. + // + // Possible values: + // "IDENTITY_DECLARATION_UNSPECIFIED" - Default value indicating that no + // selection was made. + // "SELF_IDENTIFIES_AS" - Indicates that the account identifies with the + // attribute. + // "DOES_NOT_SELF_IDENTIFY_AS" - Indicates that the account does not identify + // with the attribute. + IdentityDeclaration string `json:"identityDeclaration,omitempty"` + // ForceSendFields is a list of field names (e.g. "IdentityDeclaration") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "IdentityDeclaration") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *IdentityAttribute) MarshalJSON() ([]byte, error) { + type NoMethod IdentityAttribute + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Impact: The impact of the issue on a region. +type Impact struct { + // RegionCode: The CLDR region code (https://cldr.unicode.org/) where this + // issue applies. + RegionCode string `json:"regionCode,omitempty"` + // Severity: The severity of the issue on the destination and region. + // + // Possible values: + // "SEVERITY_UNSPECIFIED" - The severity is unknown. + // "CRITICAL" - The issue causes offers to not serve. + // "ERROR" - The issue might affect offers (in the future) or might be an + // indicator of issues with offers. + // "SUGGESTION" - The issue is a suggestion for improvement. + Severity string `json:"severity,omitempty"` + // ForceSendFields is a list of field names (e.g. "RegionCode") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "RegionCode") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Impact) MarshalJSON() ([]byte, error) { + type NoMethod Impact + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ImpactedDestination: The impact of the issue on a destination. +type ImpactedDestination struct { + // Impacts: The (negative) impact for various regions on the given destination. + Impacts []*Impact `json:"impacts,omitempty"` + // ReportingContext: The impacted reporting context. + // + // Possible values: + // "REPORTING_CONTEXT_ENUM_UNSPECIFIED" - Not specified. + // "SHOPPING_ADS" - [Shopping + // ads](https://support.google.com/merchants/answer/6149970). + // "DISCOVERY_ADS" - Deprecated: Use `DEMAND_GEN_ADS` instead. [Discovery and + // Demand Gen ads](https://support.google.com/merchants/answer/13389785). + // "DEMAND_GEN_ADS" - [Demand Gen + // ads](https://support.google.com/merchants/answer/13389785). + // "DEMAND_GEN_ADS_DISCOVER_SURFACE" - [Demand Gen ads on Discover + // surface](https://support.google.com/merchants/answer/13389785). + // "VIDEO_ADS" - [Video + // ads](https://support.google.com/google-ads/answer/6340491). + // "DISPLAY_ADS" - [Display + // ads](https://support.google.com/merchants/answer/6069387). + // "LOCAL_INVENTORY_ADS" - [Local inventory + // ads](https://support.google.com/merchants/answer/3271956). + // "VEHICLE_INVENTORY_ADS" - [Vehicle inventory + // ads](https://support.google.com/merchants/answer/11544533). + // "FREE_LISTINGS" - [Free product + // listings](https://support.google.com/merchants/answer/9199328). + // "FREE_LOCAL_LISTINGS" - [Free local product + // listings](https://support.google.com/merchants/answer/9825611). + // "FREE_LOCAL_VEHICLE_LISTINGS" - [Free local vehicle + // listings](https://support.google.com/merchants/answer/11544533). + // "YOUTUBE_SHOPPING" - [YouTube + // Shopping](https://support.google.com/merchants/answer/13478370). + // "CLOUD_RETAIL" - [Cloud + // retail](https://cloud.google.com/solutions/retail). + // "LOCAL_CLOUD_RETAIL" - [Local cloud + // retail](https://cloud.google.com/solutions/retail). + ReportingContext string `json:"reportingContext,omitempty"` + // ForceSendFields is a list of field names (e.g. "Impacts") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Impacts") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ImpactedDestination) MarshalJSON() ([]byte, error) { + type NoMethod ImpactedDestination + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Interval: Represents a time interval, encoded as a Timestamp start +// (inclusive) and a Timestamp end (exclusive). The start must be less than or +// equal to the end. When the start equals the end, the interval is empty +// (matches no time). When both start and end are unspecified, the interval +// matches any time. +type Interval struct { + // EndTime: Optional. Exclusive end of the interval. If specified, a Timestamp + // matching this interval will have to be before the end. + EndTime string `json:"endTime,omitempty"` + // StartTime: Optional. Inclusive start of the interval. If specified, a + // Timestamp matching this interval will have to be the same or after the + // start. + StartTime string `json:"startTime,omitempty"` + // ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "EndTime") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Interval) MarshalJSON() ([]byte, error) { + type NoMethod Interval + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ListAccountIssuesResponse: Response message for the `ListAccountIssues` +// method. +type ListAccountIssuesResponse struct { + // AccountIssues: The issues from the specified account. + AccountIssues []*AccountIssue `json:"accountIssues,omitempty"` + // NextPageToken: A token, which can be sent as `page_token` to retrieve the + // next page. If this field is omitted, there are no subsequent pages. + 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. "AccountIssues") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AccountIssues") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ListAccountIssuesResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListAccountIssuesResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ListAccountTaxResponse: Response to account tax list request This method can +// only be called on a multi-client account, otherwise it'll return an error. +type ListAccountTaxResponse struct { + // AccountTaxes: Page of accounttax settings + AccountTaxes []*AccountTax `json:"accountTaxes,omitempty"` + // NextPageToken: The token for the retrieval of the next page of account tax + // settings. + 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. "AccountTaxes") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AccountTaxes") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ListAccountTaxResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListAccountTaxResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ListAccountsResponse: Response message for the `ListAccounts` method. +type ListAccountsResponse struct { + // Accounts: The accounts matching the `ListAccountsRequest`. + Accounts []*Account `json:"accounts,omitempty"` + // NextPageToken: A token, which can be sent as `page_token` to retrieve the + // next page. If this field is omitted, there are no subsequent pages. + 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. "Accounts") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Accounts") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ListAccountsResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListAccountsResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ListOnlineReturnPoliciesResponse: Response message for the +// `ListOnlineReturnPolicies` method. +type ListOnlineReturnPoliciesResponse struct { + // NextPageToken: A token, which can be sent as `pageToken` to retrieve the + // next page. If this field is omitted, there are no subsequent pages. + NextPageToken string `json:"nextPageToken,omitempty"` + // OnlineReturnPolicies: The retrieved return policies. + OnlineReturnPolicies []*OnlineReturnPolicy `json:"onlineReturnPolicies,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "NextPageToken") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ListOnlineReturnPoliciesResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListOnlineReturnPoliciesResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ListProgramsResponse: Response message for the ListPrograms method. +type ListProgramsResponse struct { + // NextPageToken: A token that can be sent as `page_token` to retrieve the next + // page. If this field is omitted, there are no subsequent pages. + NextPageToken string `json:"nextPageToken,omitempty"` + // Programs: The programs for the given account. + Programs []*Program `json:"programs,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "NextPageToken") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ListProgramsResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListProgramsResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ListRegionsResponse: Response message for the `ListRegions` method. +type ListRegionsResponse struct { + // NextPageToken: A token, which can be sent as `page_token` to retrieve the + // next page. If this field is omitted, there are no subsequent pages. + NextPageToken string `json:"nextPageToken,omitempty"` + // Regions: The regions from the specified merchant. + Regions []*Region `json:"regions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "NextPageToken") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ListRegionsResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListRegionsResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ListSubAccountsResponse: Response message for the `ListSubAccounts` method. +type ListSubAccountsResponse struct { + // Accounts: The accounts for which the given parent account is an aggregator. + Accounts []*Account `json:"accounts,omitempty"` + // NextPageToken: A token, which can be sent as `page_token` to retrieve the + // next page. If this field is omitted, there are no subsequent pages. + 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. "Accounts") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Accounts") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ListSubAccountsResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListSubAccountsResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ListUsersResponse: Response message for the `ListUsers` method. +type ListUsersResponse struct { + // NextPageToken: A token, which can be sent as `page_token` to retrieve the + // next page. If this field is omitted, there are no subsequent pages. + NextPageToken string `json:"nextPageToken,omitempty"` + // Users: The users from the specified account. + Users []*User `json:"users,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "NextPageToken") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ListUsersResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListUsersResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// LocalCutoffTime: Time that local delivery ends for the day. +type LocalCutoffTime struct { + // Hour: Hour local delivery orders must be placed by to process the same day. + Hour int64 `json:"hour,omitempty,string"` + // Minute: Minute local delivery orders must be placed by to process the same + // day. + Minute int64 `json:"minute,omitempty,string"` + // ForceSendFields is a list of field names (e.g. "Hour") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Hour") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *LocalCutoffTime) MarshalJSON() ([]byte, error) { + type NoMethod LocalCutoffTime + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// LocationIdSet: A list of location ID sets. Must be non-empty. Can only be +// set if all other fields are not set. +type LocationIdSet struct { + // LocationIds: Required. A non-empty list of location IDs + // (https://developers.google.com/adwords/api/docs/appendix/geotargeting). They + // must all be of the same location type (For example, state). + LocationIds []string `json:"locationIds,omitempty"` + // ForceSendFields is a list of field names (e.g. "LocationIds") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "LocationIds") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *LocationIdSet) MarshalJSON() ([]byte, error) { + type NoMethod LocationIdSet + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// LoyaltyProgram: Loyalty program +// (https://support.google.com/merchants/answer/12922446) provided by a +// merchant. +type LoyaltyProgram struct { + // LoyaltyProgramTiers: Optional. Loyalty program tier of this shipping + // service. + LoyaltyProgramTiers []*LoyaltyProgramTiers `json:"loyaltyProgramTiers,omitempty"` + // ProgramLabel: This is the loyalty program label set in your loyalty program + // settings in Merchant Center. This sub-attribute allows Google to map your + // loyalty program to eligible offers. + ProgramLabel string `json:"programLabel,omitempty"` + // ForceSendFields is a list of field names (e.g. "LoyaltyProgramTiers") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "LoyaltyProgramTiers") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *LoyaltyProgram) MarshalJSON() ([]byte, error) { + type NoMethod LoyaltyProgram + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// LoyaltyProgramTiers: Subset of a merchants loyalty program. +type LoyaltyProgramTiers struct { + // TierLabel: The tier label [tier_label] sub-attribute differentiates offer + // level benefits between each tier. This value is also set in your program + // settings in Merchant Center, and is required for data source changes even if + // your loyalty program only has 1 tier. + TierLabel string `json:"tierLabel,omitempty"` + // ForceSendFields is a list of field names (e.g. "TierLabel") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "TierLabel") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *LoyaltyProgramTiers) MarshalJSON() ([]byte, error) { + type NoMethod LoyaltyProgramTiers + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// MinimumOrderValueTable: Table of per store minimum order values for the +// pickup fulfillment type. +type MinimumOrderValueTable struct { + // StoreCodeSetWithMovs: Required. A list of store code sets sharing the same + // minimum order value (MOV). At least two sets are required and the last one + // must be empty, which signifies 'MOV for all other stores'. Each store code + // can only appear once across all the sets. All prices within a service must + // have the same currency. + StoreCodeSetWithMovs []*StoreCodeSetWithMov `json:"storeCodeSetWithMovs,omitempty"` + // ForceSendFields is a list of field names (e.g. "StoreCodeSetWithMovs") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "StoreCodeSetWithMovs") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *MinimumOrderValueTable) MarshalJSON() ([]byte, error) { + type NoMethod MinimumOrderValueTable + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// OnlineReturnPolicy: Online return policy +// (https://support.google.com/merchants/answer/10220642) object. This is +// currently used to represent return policies for ads and free listings +// programs. +type OnlineReturnPolicy struct { + // AcceptDefectiveOnly: This field specifies if merchant only accepts defective + // products for returns, and this field is required. + AcceptDefectiveOnly bool `json:"acceptDefectiveOnly,omitempty"` + // AcceptExchange: This field specifies if merchant allows customers to + // exchange products, this field is required. + AcceptExchange bool `json:"acceptExchange,omitempty"` + // Countries: The countries of sale where the return policy applies. The values + // must be a valid 2 letter ISO 3166 code. + Countries []string `json:"countries,omitempty"` + // ItemConditions: The item conditions accepted for returns must not be empty + // unless the type of return policy is 'noReturns'. + // + // Possible values: + // "ITEM_CONDITION_UNSPECIFIED" - Default value. This value is unused. + // "NEW" - New. + // "USED" - Used. + ItemConditions []string `json:"itemConditions,omitempty"` + // Label: This field represents the unique user-defined label of the return + // policy. It is important to note that the same label cannot be used in + // different return policies for the same country. Unless a product specifies a + // specific label attribute, policies will be automatically labeled as + // 'default'. To assign a custom return policy to certain product groups, + // follow the instructions provided in the [Return policy label] + // (https://support.google.com/merchants/answer/9445425). The label can contain + // up to 50 characters. + Label string `json:"label,omitempty"` + // Name: Identifier. The name of the `OnlineReturnPolicy` resource. Format: + // `accounts/{account}/onlineReturnPolicies/{return_policy}` + Name string `json:"name,omitempty"` + // Policy: The return policy. + Policy *Policy `json:"policy,omitempty"` + // ProcessRefundDays: The field specifies the number of days it takes for + // merchants to process refunds, field is optional. + ProcessRefundDays int64 `json:"processRefundDays,omitempty"` + // RestockingFee: The restocking fee that applies to all return reason + // categories. This would be treated as a free restocking fee if the value is + // not set. + RestockingFee *RestockingFee `json:"restockingFee,omitempty"` + // ReturnMethods: The return methods of how customers can return an item. This + // value is required to not be empty unless the type of return policy is + // noReturns. + // + // Possible values: + // "RETURN_METHOD_UNSPECIFIED" - Default value. This value is unused. + // "BY_MAIL" - Return by mail. + // "IN_STORE" - Return in store. + // "AT_A_KIOSK" - Return at a kiosk. + ReturnMethods []string `json:"returnMethods,omitempty"` + // ReturnPolicyId: Output only. Return policy ID generated by Google. + ReturnPolicyId string `json:"returnPolicyId,omitempty"` + // ReturnPolicyUri: The return policy uri. This can used by Google to do a + // sanity check for the policy. It must be a valid URL. + ReturnPolicyUri string `json:"returnPolicyUri,omitempty"` + // ReturnShippingFee: The return shipping fee. Should be set only when customer + // need to download and print the return label. + ReturnShippingFee *ReturnShippingFee `json:"returnShippingFee,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "AcceptDefectiveOnly") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AcceptDefectiveOnly") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *OnlineReturnPolicy) MarshalJSON() ([]byte, error) { + type NoMethod OnlineReturnPolicy + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// PhoneNumber: An object representing a phone number, suitable as an API wire +// format. This representation: - should not be used for locale-specific +// formatting of a phone number, such as "+1 (650) 253-0000 ext. 123" - is not +// designed for efficient storage - may not be suitable for dialing - +// specialized libraries (see references) should be used to parse the number +// for that purpose To do something meaningful with this number, such as format +// it for various use-cases, convert it to an `i18n.phonenumbers.PhoneNumber` +// object first. For instance, in Java this would be: +// com.google.type.PhoneNumber wireProto = +// com.google.type.PhoneNumber.newBuilder().build(); +// com.google.i18n.phonenumbers.Phonenumber.PhoneNumber phoneNumber = +// PhoneNumberUtil.getInstance().parse(wireProto.getE164Number(), "ZZ"); if +// (!wireProto.getExtension().isEmpty()) { +// phoneNumber.setExtension(wireProto.getExtension()); } Reference(s): - +// https://github.com/google/libphonenumber +type PhoneNumber struct { + // E164Number: The phone number, represented as a leading plus sign ('+'), + // followed by a phone number that uses a relaxed ITU E.164 format consisting + // of the country calling code (1 to 3 digits) and the subscriber number, with + // no additional spaces or formatting, e.g.: - correct: "+15552220123" - + // incorrect: "+1 (555) 222-01234 x123". The ITU E.164 format limits the latter + // to 12 digits, but in practice not all countries respect that, so we relax + // that restriction here. National-only numbers are not allowed. References: - + // https://www.itu.int/rec/T-REC-E.164-201011-I - + // https://en.wikipedia.org/wiki/E.164. - + // https://en.wikipedia.org/wiki/List_of_country_calling_codes + E164Number string `json:"e164Number,omitempty"` + // Extension: The phone number's extension. The extension is not standardized + // in ITU recommendations, except for being defined as a series of numbers with + // a maximum length of 40 digits. Other than digits, some other dialing + // characters such as ',' (indicating a wait) or '#' may be stored here. Note + // that no regions currently use extensions with short codes, so this field is + // normally only set in conjunction with an E.164 number. It is held separately + // from the E.164 number to allow for short code extensions in the future. + Extension string `json:"extension,omitempty"` + // ShortCode: A short code. Reference(s): - + // https://en.wikipedia.org/wiki/Short_code + ShortCode *ShortCode `json:"shortCode,omitempty"` + // ForceSendFields is a list of field names (e.g. "E164Number") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "E164Number") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *PhoneNumber) MarshalJSON() ([]byte, error) { + type NoMethod PhoneNumber + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Policy: The available policies. +type Policy struct { + // Days: The number of days items can be returned after delivery, where one day + // is defined as 24 hours after the delivery timestamp. Required for + // `NUMBER_OF_DAYS_AFTER_DELIVERY` returns. + Days int64 `json:"days,omitempty,string"` + // Type: Policy type. + // + // Possible values: + // "TYPE_UNSPECIFIED" - Default value. This value is unused. + // "NUMBER_OF_DAYS_AFTER_DELIVERY" - The number of days within which a return + // is valid after delivery. + // "NO_RETURNS" - No returns. + // "LIFETIME_RETURNS" - Life time returns. + Type string `json:"type,omitempty"` + // ForceSendFields is a list of field names (e.g. "Days") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Days") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Policy) MarshalJSON() ([]byte, error) { + type NoMethod Policy + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// PostalAddress: Represents a postal address, e.g. for postal delivery or +// payments addresses. Given a postal address, a postal service can deliver +// items to a premise, P.O. Box or similar. It is not intended to model +// geographical locations (roads, towns, mountains). In typical usage an +// address would be created via user input or from importing existing data, +// depending on the type of process. Advice on address input / editing: - Use +// an internationalization-ready address widget such as +// https://github.com/google/libaddressinput) - Users should not be presented +// with UI elements for input or editing of fields outside countries where that +// field is used. For more guidance on how to use this schema, please see: +// https://support.google.com/business/answer/6397478 +type PostalAddress struct { + // AddressLines: Unstructured address lines describing the lower levels of an + // address. Because values in address_lines do not have type information and + // may sometimes contain multiple values in a single field (e.g. "Austin, TX"), + // it is important that the line order is clear. The order of address lines + // should be "envelope order" for the country/region of the address. In places + // where this can vary (e.g. Japan), address_language is used to make it + // explicit (e.g. "ja" for large-to-small ordering and "ja-Latn" or "en" for + // small-to-large). This way, the most specific line of an address can be + // selected based on the language. The minimum permitted structural + // representation of an address consists of a region_code with all remaining + // information placed in the address_lines. It would be possible to format such + // an address very approximately without geocoding, but no semantic reasoning + // could be made about any of the address components until it was at least + // partially resolved. Creating an address only containing a region_code and + // address_lines, and then geocoding is the recommended way to handle + // completely unstructured addresses (as opposed to guessing which parts of the + // address should be localities or administrative areas). + AddressLines []string `json:"addressLines,omitempty"` + // AdministrativeArea: Optional. Highest administrative subdivision which is + // used for postal addresses of a country or region. For example, this can be a + // state, a province, an oblast, or a prefecture. Specifically, for Spain this + // is the province and not the autonomous community (e.g. "Barcelona" and not + // "Catalonia"). Many countries don't use an administrative area in postal + // addresses. E.g. in Switzerland this should be left unpopulated. + AdministrativeArea string `json:"administrativeArea,omitempty"` + // LanguageCode: Optional. BCP-47 language code of the contents of this address + // (if known). This is often the UI language of the input form or is expected + // to match one of the languages used in the address' country/region, or their + // transliterated equivalents. This can affect formatting in certain countries, + // but is not critical to the correctness of the data and will never affect any + // validation or other non-formatting related operations. If this value is not + // known, it should be omitted (rather than specifying a possibly incorrect + // default). Examples: "zh-Hant", "ja", "ja-Latn", "en". + LanguageCode string `json:"languageCode,omitempty"` + // Locality: Optional. Generally refers to the city/town portion of the + // address. Examples: US city, IT comune, UK post town. In regions of the world + // where localities are not well defined or do not fit into this structure + // well, leave locality empty and use address_lines. + Locality string `json:"locality,omitempty"` + // Organization: Optional. The name of the organization at the address. + Organization string `json:"organization,omitempty"` + // PostalCode: Optional. Postal code of the address. Not all countries use or + // require postal codes to be present, but where they are used, they may + // trigger additional validation with other parts of the address (e.g. + // state/zip validation in the U.S.A.). + PostalCode string `json:"postalCode,omitempty"` + // Recipients: Optional. The recipient at the address. This field may, under + // certain circumstances, contain multiline information. For example, it might + // contain "care of" information. + Recipients []string `json:"recipients,omitempty"` + // RegionCode: Required. CLDR region code of the country/region of the address. + // This is never inferred and it is up to the user to ensure the value is + // correct. See https://cldr.unicode.org/ and + // https://www.unicode.org/cldr/charts/30/supplemental/territory_information.html + // for details. Example: "CH" for Switzerland. + RegionCode string `json:"regionCode,omitempty"` + // Revision: The schema revision of the `PostalAddress`. This must be set to 0, + // which is the latest revision. All new revisions **must** be backward + // compatible with old revisions. + Revision int64 `json:"revision,omitempty"` + // SortingCode: Optional. Additional, country-specific, sorting code. This is + // not used in most regions. Where it is used, the value is either a string + // like "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a + // number alone, representing the "sector code" (Jamaica), "delivery area + // indicator" (Malawi) or "post office indicator" (e.g. Côte d'Ivoire). + SortingCode string `json:"sortingCode,omitempty"` + // Sublocality: Optional. Sublocality of the address. For example, this can be + // neighborhoods, boroughs, districts. + Sublocality string `json:"sublocality,omitempty"` + // ForceSendFields is a list of field names (e.g. "AddressLines") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AddressLines") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *PostalAddress) MarshalJSON() ([]byte, error) { + type NoMethod PostalAddress + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// PostalCodeArea: A list of postal codes that defines the region area. Note: +// All regions defined using postal codes are accessible through the account's +// `ShippingSettings.postalCodeGroups` resource. +type PostalCodeArea struct { + // PostalCodes: Required. A range of postal codes. + PostalCodes []*PostalCodeRange `json:"postalCodes,omitempty"` + // RegionCode: Required. CLDR territory code + // (http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) or the + // country the postal code group applies to. + RegionCode string `json:"regionCode,omitempty"` + // ForceSendFields is a list of field names (e.g. "PostalCodes") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "PostalCodes") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *PostalCodeArea) MarshalJSON() ([]byte, error) { + type NoMethod PostalCodeArea + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// PostalCodeRange: A range of postal codes that defines the region area. +type PostalCodeRange struct { + // Begin: Required. A postal code or a pattern of the form prefix* denoting the + // inclusive lower bound of the range defining the area. Examples values: + // `94108`, `9410*`, `9*`. + Begin string `json:"begin,omitempty"` + // End: Optional. A postal code or a pattern of the form `prefix*` denoting the + // inclusive upper bound of the range defining the area. It must have the same + // length as postalCodeRangeBegin: if postalCodeRangeBegin is a postal code + // then postalCodeRangeEnd must be a postal code too; if postalCodeRangeBegin + // is a pattern then postalCodeRangeEnd must be a pattern with the same prefix + // length. Optional: if not set, then the area is defined as being all the + // postal codes matching postalCodeRangeBegin. + End string `json:"end,omitempty"` + // ForceSendFields is a list of field names (e.g. "Begin") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Begin") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *PostalCodeRange) MarshalJSON() ([]byte, error) { + type NoMethod PostalCodeRange + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Price: The price represented as a number and currency. +type Price struct { + // AmountMicros: The price represented as a number in micros (1 million micros + // is an equivalent to one's currency standard unit, for example, 1 USD = + // 1000000 micros). + AmountMicros int64 `json:"amountMicros,omitempty,string"` + // CurrencyCode: The currency of the price using three-letter acronyms + // according to ISO 4217 (http://en.wikipedia.org/wiki/ISO_4217). + CurrencyCode string `json:"currencyCode,omitempty"` + // ForceSendFields is a list of field names (e.g. "AmountMicros") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AmountMicros") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Price) MarshalJSON() ([]byte, error) { + type NoMethod Price + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ProductChange: The change that happened to the product including old value, +// new value, country code as the region code and reporting context. +type ProductChange struct { + // NewValue: The new value of the changed resource or attribute. + NewValue string `json:"newValue,omitempty"` + // OldValue: The old value of the changed resource or attribute. + OldValue string `json:"oldValue,omitempty"` + // RegionCode: Countries that have the change (if applicable) + RegionCode string `json:"regionCode,omitempty"` + // ReportingContext: Reporting contexts that have the change (if applicable) + // + // Possible values: + // "REPORTING_CONTEXT_ENUM_UNSPECIFIED" - Not specified. + // "SHOPPING_ADS" - [Shopping + // ads](https://support.google.com/merchants/answer/6149970). + // "DISCOVERY_ADS" - Deprecated: Use `DEMAND_GEN_ADS` instead. [Discovery and + // Demand Gen ads](https://support.google.com/merchants/answer/13389785). + // "DEMAND_GEN_ADS" - [Demand Gen + // ads](https://support.google.com/merchants/answer/13389785). + // "DEMAND_GEN_ADS_DISCOVER_SURFACE" - [Demand Gen ads on Discover + // surface](https://support.google.com/merchants/answer/13389785). + // "VIDEO_ADS" - [Video + // ads](https://support.google.com/google-ads/answer/6340491). + // "DISPLAY_ADS" - [Display + // ads](https://support.google.com/merchants/answer/6069387). + // "LOCAL_INVENTORY_ADS" - [Local inventory + // ads](https://support.google.com/merchants/answer/3271956). + // "VEHICLE_INVENTORY_ADS" - [Vehicle inventory + // ads](https://support.google.com/merchants/answer/11544533). + // "FREE_LISTINGS" - [Free product + // listings](https://support.google.com/merchants/answer/9199328). + // "FREE_LOCAL_LISTINGS" - [Free local product + // listings](https://support.google.com/merchants/answer/9825611). + // "FREE_LOCAL_VEHICLE_LISTINGS" - [Free local vehicle + // listings](https://support.google.com/merchants/answer/11544533). + // "YOUTUBE_SHOPPING" - [YouTube + // Shopping](https://support.google.com/merchants/answer/13478370). + // "CLOUD_RETAIL" - [Cloud + // retail](https://cloud.google.com/solutions/retail). + // "LOCAL_CLOUD_RETAIL" - [Local cloud + // retail](https://cloud.google.com/solutions/retail). + ReportingContext string `json:"reportingContext,omitempty"` + // ForceSendFields is a list of field names (e.g. "NewValue") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "NewValue") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ProductChange) MarshalJSON() ([]byte, error) { + type NoMethod ProductChange + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ProductStatusChangeMessage: The message that the merchant will receive to +// notify about product status change event +type ProductStatusChangeMessage struct { + // Account: The target account that owns the entity that changed. Format : + // `accounts/{merchant_id}` + Account string `json:"account,omitempty"` + // Attribute: The attribute in the resource that changed, in this case it will + // be always `Status`. + // + // Possible values: + // "ATTRIBUTE_UNSPECIFIED" - Unspecified attribute + // "STATUS" - Status of the changed entity + Attribute string `json:"attribute,omitempty"` + // Changes: A message to describe the change that happened to the product + Changes []*ProductChange `json:"changes,omitempty"` + // ManagingAccount: The account that manages the merchant's account. can be the + // same as merchant id if it is standalone account. Format : + // `accounts/{service_provider_id}` + ManagingAccount string `json:"managingAccount,omitempty"` + // Resource: The product name. Format: + // `{product.name=accounts/{account}/products/{product}}` + Resource string `json:"resource,omitempty"` + // ResourceId: The product id. + ResourceId string `json:"resourceId,omitempty"` + // ResourceType: The resource that changed, in this case it will always be + // `Product`. + // + // Possible values: + // "RESOURCE_UNSPECIFIED" - Unspecified resource + // "PRODUCT" - Resource type : product + ResourceType string `json:"resourceType,omitempty"` + // ForceSendFields is a list of field names (e.g. "Account") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Account") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ProductStatusChangeMessage) MarshalJSON() ([]byte, error) { + type NoMethod ProductStatusChangeMessage + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Program: Defines participation in a given program for the specified account. +// Programs provide a mechanism for adding functionality to merchant accounts. +// A typical example of this is the Free product listings +// (https://support.google.com/merchants/topic/9240261?ref_topic=7257954,7259405,&sjid=796648681813264022-EU) +// program, which enables products from a merchant's store to be shown across +// Google for free. +type Program struct { + // ActiveRegionCodes: Output only. The regions in which the account is actively + // participating in the program. Active regions are defined as those where all + // program requirements affecting the regions have been met. Region codes are + // defined by CLDR (https://cldr.unicode.org/). This is either a country where + // the program applies specifically to that country or `001` when the program + // applies globally. + ActiveRegionCodes []string `json:"activeRegionCodes,omitempty"` + // DocumentationUri: Output only. The URL of a Merchant Center help page + // describing the program. + DocumentationUri string `json:"documentationUri,omitempty"` + // Name: Identifier. The resource name of the program. Format: + // `accounts/{account}/programs/{program}` + Name string `json:"name,omitempty"` + // State: Output only. The participation state of the account in the program. + // + // Possible values: + // "STATE_UNSPECIFIED" - Default value. This value is unused. + // "NOT_ELIGIBLE" - The account is not eligible to participate in the + // program. + // "ELIGIBLE" - The account is eligible to participate in the program. + // "ENABLED" - The program is enabled for the account. + State string `json:"state,omitempty"` + // UnmetRequirements: Output only. The requirements that the account has not + // yet satisfied that are affecting participation in the program. + UnmetRequirements []*Requirement `json:"unmetRequirements,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "ActiveRegionCodes") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ActiveRegionCodes") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Program) MarshalJSON() ([]byte, error) { + type NoMethod Program + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// RateGroup: Shipping rate group definitions. Only the last one is allowed to +// have an empty `applicable_shipping_labels`, which means "everything else". +// The other `applicable_shipping_labels` must not overlap. +type RateGroup struct { + // ApplicableShippingLabels: Required. A list of shipping labels + // (https://support.google.com/merchants/answer/6324504) defining the products + // to which this rate group applies to. This is a disjunction: only one of the + // labels has to match for the rate group to apply. May only be empty for the + // last rate group of a service. + ApplicableShippingLabels []string `json:"applicableShippingLabels,omitempty"` + // CarrierRates: Optional. A list of carrier rates that can be referred to by + // `main_table` or `single_value`. + CarrierRates []*CarrierRate `json:"carrierRates,omitempty"` + // MainTable: A table defining the rate group, when `single_value` is not + // expressive enough. Can only be set if `single_value` is not set. + MainTable *Table `json:"mainTable,omitempty"` + // Name: Optional. Name of the rate group. If set has to be unique within + // shipping service. + Name string `json:"name,omitempty"` + // SingleValue: The value of the rate group (For example flat rate $10). Can + // only be set if `main_table` and `subtables` are not set. + SingleValue *Value `json:"singleValue,omitempty"` + // Subtables: Optional. A list of subtables referred to by `main_table`. Can + // only be set if `main_table` is set. + Subtables []*Table `json:"subtables,omitempty"` + // ForceSendFields is a list of field names (e.g. "ApplicableShippingLabels") + // to unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ApplicableShippingLabels") to + // include in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *RateGroup) MarshalJSON() ([]byte, error) { + type NoMethod RateGroup + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Region: Represents a geographic region that you can use as a target with +// both the `RegionalInventory` and `ShippingSettings` services. You can define +// regions as collections of either postal codes or, in some countries, using +// predefined geotargets. For more information, see Set up regions +// (https://support.google.com/merchants/answer/7410946#zippy=%2Ccreate-a-new-region) +// for more information. +type Region struct { + // DisplayName: Optional. The display name of the region. + DisplayName string `json:"displayName,omitempty"` + // GeotargetArea: Optional. A list of geotargets that defines the region area. + GeotargetArea *GeoTargetArea `json:"geotargetArea,omitempty"` + // Name: Identifier. The resource name of the region. Format: + // `accounts/{account}/regions/{region}` + Name string `json:"name,omitempty"` + // PostalCodeArea: Optional. A list of postal codes that defines the region + // area. + PostalCodeArea *PostalCodeArea `json:"postalCodeArea,omitempty"` + // RegionalInventoryEligible: Output only. Indicates if the region is eligible + // for use in the Regional Inventory configuration. + RegionalInventoryEligible bool `json:"regionalInventoryEligible,omitempty"` + // ShippingEligible: Output only. Indicates if the region is eligible for use + // in the Shipping Services configuration. + ShippingEligible bool `json:"shippingEligible,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "DisplayName") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Region) MarshalJSON() ([]byte, error) { + type NoMethod Region + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Required: Describes the terms of service which are required to be accepted. +type Required struct { + // TermsOfService: The termsOfService + // (google.shopping.merchant.accounts.v1main.TermsOfService) that need to be + // accepted. + TermsOfService string `json:"termsOfService,omitempty"` + // TosFileUri: Full URL to the terms of service file. This field is the same as + // TermsOfService.file_uri (TermsOfService.file_uri), it is added here for + // convenience only. + TosFileUri string `json:"tosFileUri,omitempty"` + // ForceSendFields is a list of field names (e.g. "TermsOfService") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "TermsOfService") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Required) MarshalJSON() ([]byte, error) { + type NoMethod Required + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Requirement: Defines a requirement specified for participation in the +// program. +type Requirement struct { + // AffectedRegionCodes: Output only. The regions that are currently affected by + // this requirement not being met. Region codes are defined by CLDR + // (https://cldr.unicode.org/). This is either a country where the program + // applies specifically to that country or `001` when the program applies + // globally. + AffectedRegionCodes []string `json:"affectedRegionCodes,omitempty"` + // DocumentationUri: Output only. The URL of a help page describing the + // requirement. + DocumentationUri string `json:"documentationUri,omitempty"` + // Title: Output only. Name of the requirement. + Title string `json:"title,omitempty"` + // ForceSendFields is a list of field names (e.g. "AffectedRegionCodes") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AffectedRegionCodes") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Requirement) MarshalJSON() ([]byte, error) { + type NoMethod Requirement + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// RestockingFee: The restocking fee. This can be a flat fee or a micro +// percent. +type RestockingFee struct { + // FixedFee: Fixed restocking fee. + FixedFee *Price `json:"fixedFee,omitempty"` + // MicroPercent: Percent of total price in micros. 15,000,000 means 15% of the + // total price would be charged. + MicroPercent int64 `json:"microPercent,omitempty"` + // ForceSendFields is a list of field names (e.g. "FixedFee") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "FixedFee") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *RestockingFee) MarshalJSON() ([]byte, error) { + type NoMethod RestockingFee + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ReturnShippingFee: The return shipping fee. This can either be a fixed fee +// or a boolean to indicate that the customer pays the actual shipping cost. +type ReturnShippingFee struct { + // FixedFee: Fixed return shipping fee amount. This value is only applicable + // when type is `FIXED`. We will treat the return shipping fee as free if type + // is `FIXED` and this value is not set. + FixedFee *Price `json:"fixedFee,omitempty"` + // Type: Type of return shipping fee. + // + // Possible values: + // "TYPE_UNSPECIFIED" - Default value. This value is unused. + // "FIXED" - The return shipping fee is a fixed value. + // "CUSTOMER_PAYING_ACTUAL_FEE" - Customers will pay the actual return + // shipping fee. + Type string `json:"type,omitempty"` + // ForceSendFields is a list of field names (e.g. "FixedFee") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "FixedFee") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ReturnShippingFee) MarshalJSON() ([]byte, error) { + type NoMethod ReturnShippingFee + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Row: Include a list of cells. +type Row struct { + // Cells: Required. The list of cells that constitute the row. Must have the + // same length as `columnHeaders` for two-dimensional tables, a length of 1 for + // one-dimensional tables. + Cells []*Value `json:"cells,omitempty"` + // ForceSendFields is a list of field names (e.g. "Cells") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Cells") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Row) MarshalJSON() ([]byte, error) { + type NoMethod Row + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Service: Shipping service. +type Service struct { + // Active: Required. A boolean exposing the active status of the shipping + // service. + Active bool `json:"active,omitempty"` + // CurrencyCode: The CLDR code of the currency to which this service applies. + // Must match that of the prices in rate groups. + CurrencyCode string `json:"currencyCode,omitempty"` + // DeliveryCountries: Required. The CLDR territory code of the countries to + // which the service applies. + DeliveryCountries []string `json:"deliveryCountries,omitempty"` + // DeliveryTime: Required. Time spent in various aspects from order to the + // delivery of the product. + DeliveryTime *DeliveryTime `json:"deliveryTime,omitempty"` + // LoyaltyPrograms: Optional. Loyalty programs that this shipping service is + // limited to. + LoyaltyPrograms []*LoyaltyProgram `json:"loyaltyPrograms,omitempty"` + // MinimumOrderValue: Minimum order value for this service. If set, indicates + // that customers will have to spend at least this amount. All prices within a + // service must have the same currency. Cannot be set together with + // minimum_order_value_table. + MinimumOrderValue *Price `json:"minimumOrderValue,omitempty"` + // MinimumOrderValueTable: Table of per store minimum order values for the + // pickup fulfillment type. Cannot be set together with minimum_order_value. + MinimumOrderValueTable *MinimumOrderValueTable `json:"minimumOrderValueTable,omitempty"` + // RateGroups: Optional. Shipping rate group definitions. Only the last one is + // allowed to have an empty `applicable_shipping_labels`, which means + // "everything else". The other `applicable_shipping_labels` must not overlap. + RateGroups []*RateGroup `json:"rateGroups,omitempty"` + // ServiceName: Required. Free-form name of the service. Must be unique within + // target account. + ServiceName string `json:"serviceName,omitempty"` + // ShipmentType: Type of locations this service ships orders to. + // + // Possible values: + // "SHIPMENT_TYPE_UNSPECIFIED" - This service did not specify shipment type. + // "DELIVERY" - This service ships orders to an address chosen by the + // customer. + // "LOCAL_DELIVERY" - This service ships orders to an address chosen by the + // customer. The order is shipped from a local store near by. + // "COLLECTION_POINT" - This service ships orders to an address chosen by the + // customer. The order is shipped from a collection point. + ShipmentType string `json:"shipmentType,omitempty"` + // StoreConfig: A list of stores your products are delivered from. This is only + // valid for the local delivery shipment type. + StoreConfig *StoreConfig `json:"storeConfig,omitempty"` + // ForceSendFields is a list of field names (e.g. "Active") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Active") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Service) MarshalJSON() ([]byte, error) { + type NoMethod Service + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ShippingSettings: The merchant account's shipping setting +// ((https://support.google.com/merchants/answer/6069284). +type ShippingSettings struct { + // Etag: Required. This field is used for avoid async issue. Make sure shipping + // setting data didn't change between get call and insert call. The user should + // do following steps: 1. Set etag field as empty string for initial shipping + // setting creation. 2. After initial creation, call get method to obtain an + // etag and current shipping setting data before call insert. 3. Modify to + // wanted shipping setting information. 4. Call insert method with the wanted + // shipping setting information with the etag obtained from step 2. 5. If + // shipping setting data changed between step 2 and step 4. Insert request will + // fail because the etag changes every time the shipping setting data changes. + // User should repeate step 2-4 with the new etag. + Etag string `json:"etag,omitempty"` + // Name: Identifier. The resource name of the shipping setting. Format: + // `accounts/{account}/shippingSetting` + Name string `json:"name,omitempty"` + // Services: Optional. The target account's list of services. + Services []*Service `json:"services,omitempty"` + // Warehouses: Optional. A list of warehouses which can be referred to in + // `services`. + Warehouses []*Warehouse `json:"warehouses,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // 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. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + 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. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ShippingSettings) MarshalJSON() ([]byte, error) { + type NoMethod ShippingSettings + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ShortCode: An object representing a short code, which is a phone number that +// is typically much shorter than regular phone numbers and can be used to +// address messages in MMS and SMS systems, as well as for abbreviated dialing +// (e.g. "Text 611 to see how many minutes you have remaining on your plan."). +// Short codes are restricted to a region and are not internationally dialable, +// which means the same short code can exist in different regions, with +// different usage and pricing, even if those regions share the same country +// calling code (e.g. US and CA). +type ShortCode struct { + // Number: Required. The short code digits, without a leading plus ('+') or + // country calling code, e.g. "611". + Number string `json:"number,omitempty"` + // RegionCode: Required. The BCP-47 region code of the location where calls to + // this short code can be made, such as "US" and "BB". Reference(s): - + // http://www.unicode.org/reports/tr35/#unicode_region_subtag + RegionCode string `json:"regionCode,omitempty"` + // ForceSendFields is a list of field names (e.g. "Number") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Number") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ShortCode) MarshalJSON() ([]byte, error) { + type NoMethod ShortCode + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// StoreCodeSetWithMov: A list of store code sets sharing the same minimum +// order value. At least two sets are required and the last one must be empty, +// which signifies 'MOV for all other stores'. Each store code can only appear +// once across all the sets. All prices within a service must have the same +// currency. +type StoreCodeSetWithMov struct { + // StoreCodes: Optional. A list of unique store codes or empty for the catch + // all. + StoreCodes []string `json:"storeCodes,omitempty"` + // Value: The minimum order value for the given stores. + Value *Price `json:"value,omitempty"` + // ForceSendFields is a list of field names (e.g. "StoreCodes") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "StoreCodes") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *StoreCodeSetWithMov) MarshalJSON() ([]byte, error) { + type NoMethod StoreCodeSetWithMov + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// StoreConfig: A list of stores your products are delivered from. This is only +// valid for the local delivery shipment type. +type StoreConfig struct { + // CutoffConfig: Configs related to local delivery ends for the day. + CutoffConfig *CutoffConfig `json:"cutoffConfig,omitempty"` + // ServiceRadius: Maximum delivery radius. This is only required for the local + // delivery shipment type. + ServiceRadius *Distance `json:"serviceRadius,omitempty"` + // StoreCodes: Optional. A list of store codes that provide local delivery. If + // empty, then `all_stores` must be true. + StoreCodes []string `json:"storeCodes,omitempty"` + // StoreServiceType: Indicates whether all stores, or selected stores, listed + // by this merchant provide local delivery. + // + // Possible values: + // "STORE_SERVICE_TYPE_UNSPECIFIED" - Did not specify store service type. + // "ALL_STORES" - Indicates whether all stores, current and future, listed by + // this merchant provide local delivery. + // "SELECTED_STORES" - Indicates that only the stores listed in `store_codes` + // are eligible for local delivery. + StoreServiceType string `json:"storeServiceType,omitempty"` + // ForceSendFields is a list of field names (e.g. "CutoffConfig") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "CutoffConfig") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *StoreConfig) MarshalJSON() ([]byte, error) { + type NoMethod StoreConfig + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Table: A table defining the rate group, when `single_value` is not +// expressive enough. +type Table struct { + // ColumnHeaders: Headers of the table's columns. Optional: if not set then the + // table has only one dimension. + ColumnHeaders *Headers `json:"columnHeaders,omitempty"` + // Name: Name of the table. Required for subtables, ignored for the main table. + Name string `json:"name,omitempty"` + // RowHeaders: Required. Headers of the table's rows. + RowHeaders *Headers `json:"rowHeaders,omitempty"` + // Rows: Required. The list of rows that constitute the table. Must have the + // same length as `row_headers`. + Rows []*Row `json:"rows,omitempty"` + // ForceSendFields is a list of field names (e.g. "ColumnHeaders") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ColumnHeaders") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Table) MarshalJSON() ([]byte, error) { + type NoMethod Table + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// TaxPostalCodeRange: A range of postal codes that defines the area. +type TaxPostalCodeRange struct { + // End: The end of the postal code range. Will be the same as start if not + // specified. + End string `json:"end,omitempty"` + // Start: Required. The start of the postal code range, which is also the + // smallest in the range. + Start string `json:"start,omitempty"` + // ForceSendFields is a list of field names (e.g. "End") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "End") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *TaxPostalCodeRange) MarshalJSON() ([]byte, error) { + type NoMethod TaxPostalCodeRange + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// TaxRule: Primary type convension percent micro : 100% = 1 000 000 and 1% = +// 10 000 cannot be negative. Information about tax nexus and related +// parameters applicable to orders delivered to the area covered by a single +// tax admin. Nexus is created when a merchant is doing business in an area +// administered by tax admin (only US states are supported for nexus +// configuration). If merchant has nexus in a US state, merchant needs to pay +// tax to all tax authorities associated with the shipping destination. Next Id +// : 8 +type TaxRule struct { + // EffectiveTimePeriod: Required. Time period when this rule is effective. If + // the duration is missing from effective_time listed, then it is open ended to + // the future. The start of this time period is inclusive, and the end is + // exclusive. + EffectiveTimePeriod *Interval `json:"effectiveTimePeriod,omitempty"` + // LocationId: The admin_id or criteria_id of the region in which this rule is + // applicable. + LocationId int64 `json:"locationId,omitempty,string"` + // PostCodeRange: The range of postal codes in which this rule is applicable. + PostCodeRange *TaxPostalCodeRange `json:"postCodeRange,omitempty"` + // RegionCode: Region code in which this rule is applicable + RegionCode string `json:"regionCode,omitempty"` + // SelfSpecifiedRateMicros: A fixed rate specified in micros, where 100% = + // 1_000_000. Suitable for origin-based states. + SelfSpecifiedRateMicros int64 `json:"selfSpecifiedRateMicros,omitempty,string"` + // ShippingTaxed: If set, shipping charge is taxed (at the same rate as + // product) when delivering to this admin's area. Can only be set on US states + // without category. + ShippingTaxed bool `json:"shippingTaxed,omitempty"` + // UseGoogleRate: Rate that depends on delivery location: if merchant has a + // nexus in corresponding US state, rates from authorities with jurisdiction + // over delivery area are added up. + UseGoogleRate bool `json:"useGoogleRate,omitempty"` + // ForceSendFields is a list of field names (e.g. "EffectiveTimePeriod") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "EffectiveTimePeriod") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *TaxRule) MarshalJSON() ([]byte, error) { + type NoMethod TaxRule + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// TermsOfService: A `TermsOfService`. +type TermsOfService struct { + // External: Whether this terms of service version is external. External terms + // of service versions can only be agreed through external processes and not + // directly by the merchant through UI or API. + External bool `json:"external,omitempty"` + // FileUri: URI for terms of service file that needs to be displayed to signing + // users. + FileUri string `json:"fileUri,omitempty"` + // Kind: The Kind this terms of service version applies to. + // + // Possible values: + // "TERMS_OF_SERVICE_KIND_UNSPECIFIED" - Default value. This value is unused. + // "MERCHANT_CENTER" - Merchant Center application. + Kind string `json:"kind,omitempty"` + // Name: Identifier. The resource name of the terms of service version. Format: + // `termsOfService/{version}` + Name string `json:"name,omitempty"` + // RegionCode: Region code as defined by CLDR (https://cldr.unicode.org/). This + // is either a country where the ToS applies specifically to that country or + // `001` when the same `TermsOfService` can be signed in any country. However + // note that when signing a ToS that applies globally we still expect that a + // specific country is provided (this should be merchant business country or + // program country of participation). + RegionCode string `json:"regionCode,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "External") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "External") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *TermsOfService) MarshalJSON() ([]byte, error) { + type NoMethod TermsOfService + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// TermsOfServiceAgreementState: This resource represents the agreement state +// for a given account and terms of service kind. The state is as follows: * If +// the merchant has accepted a terms of service: accepted +// (TermsOfServiceAggrementState.accepted) will be populated, otherwise it will +// be empty * If the merchant must sign a terms of service: required +// (TermsOfServiceAggrementState.required) will be populated, otherwise it will +// be empty. Note that both required (TermsOfServiceAggrementState.required) +// and accepted (TermsOfServiceAggrementState.accepted) can be present. In this +// case the `accepted` terms of services will have an expiration date set in +// the valid_until (Accepted.valid_until) field. The `required` terms of +// services need to be accepted before `valid_until` in order for the account +// to continue having a valid agreement. When accepting new terms of services +// we expect 3Ps to display the text associated with the given terms of service +// agreement (the url to the file containing the text is added in the Required +// message below as tos_file_uri (Accepted.tos_file_uri). The actual acceptance +// of the terms of service is done by calling accept on the TermsOfService +// (TermsOfService) resource. +type TermsOfServiceAgreementState struct { + // Accepted: The accepted terms of service of this kind and for the associated + // region_code + Accepted *Accepted `json:"accepted,omitempty"` + // Name: Identifier. The resource name of the terms of service version. Format: + // `accounts/{account}/termsOfServiceAgreementState/{identifier}` + Name string `json:"name,omitempty"` + // RegionCode: Region code as defined by https://cldr.unicode.org/. This is the + // country the current state applies to. + RegionCode string `json:"regionCode,omitempty"` + // Required: The required terms of service + Required *Required `json:"required,omitempty"` + // TermsOfServiceKind: Terms of Service kind associated with the particular + // version. + // + // Possible values: + // "TERMS_OF_SERVICE_KIND_UNSPECIFIED" - Default value. This value is unused. + // "MERCHANT_CENTER" - Merchant Center application. + TermsOfServiceKind string `json:"termsOfServiceKind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "Accepted") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Accepted") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *TermsOfServiceAgreementState) MarshalJSON() ([]byte, error) { + type NoMethod TermsOfServiceAgreementState + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// TimeZone: Represents a time zone from the IANA Time Zone Database +// (https://www.iana.org/time-zones). +type TimeZone struct { + // Id: IANA Time Zone Database time zone, e.g. "America/New_York". + Id string `json:"id,omitempty"` + // Version: Optional. IANA Time Zone Database version number, e.g. "2019a". + Version string `json:"version,omitempty"` + // ForceSendFields is a list of field names (e.g. "Id") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Id") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *TimeZone) MarshalJSON() ([]byte, error) { + type NoMethod TimeZone + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// TransitTable: Transit time table, number of business days spent in transit +// based on row and column dimensions. Either `min_transit_days`, +// `max_transit_days` or `transit_time_table` can be set, but not both. +type TransitTable struct { + // PostalCodeGroupNames: Required. A list of region names Region.name . The + // last value can be "all other locations". Example: `["zone 1", "zone 2", + // "all other locations"]`. The referred postal code groups must match the + // delivery country of the service. + PostalCodeGroupNames []string `json:"postalCodeGroupNames,omitempty"` + // Rows: Required. If there's only one dimension set of + // `postal_code_group_names` or `transit_time_labels`, there are multiple rows + // each with one value for that dimension. If there are two dimensions, each + // row corresponds to a `postal_code_group_names`, and columns (values) to a + // `transit_time_labels`. + Rows []*TransitTimeRow `json:"rows,omitempty"` + // TransitTimeLabels: Required. A list of transit time labels. The last value + // can be "all other labels". Example: `["food", "electronics", "all other + // labels"]`. + TransitTimeLabels []string `json:"transitTimeLabels,omitempty"` + // ForceSendFields is a list of field names (e.g. "PostalCodeGroupNames") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "PostalCodeGroupNames") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *TransitTable) MarshalJSON() ([]byte, error) { + type NoMethod TransitTable + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// TransitTimeRow: If there's only one dimension set of +// `postal_code_group_names` or `transit_time_labels`, there are multiple rows +// each with one value for that dimension. If there are two dimensions, each +// row corresponds to a `postal_code_group_names`, and columns (values) to a +// `transit_time_labels`. +type TransitTimeRow struct { + // Values: Required. Transit time range (min-max) in business days. + Values []*TransitTimeValue `json:"values,omitempty"` + // ForceSendFields is a list of field names (e.g. "Values") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Values") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *TransitTimeRow) MarshalJSON() ([]byte, error) { + type NoMethod TransitTimeRow + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// TransitTimeValue: Transit time range (min-max) in business days. +type TransitTimeValue struct { + // MaxTransitDays: Must be greater than or equal to `min_transit_days`. + MaxTransitDays int64 `json:"maxTransitDays,omitempty"` + // MinTransitDays: Minimum transit time range in business days. 0 means same + // day delivery, 1 means next day delivery. + MinTransitDays int64 `json:"minTransitDays,omitempty"` + // ForceSendFields is a list of field names (e.g. "MaxTransitDays") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "MaxTransitDays") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *TransitTimeValue) MarshalJSON() ([]byte, error) { + type NoMethod TransitTimeValue + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// UnclaimHomepageRequest: Request message for the `UnclaimHomepage` method. +type UnclaimHomepageRequest struct { +} + +// User: A user (https://support.google.com/merchants/answer/12160472). +type User struct { + // AccessRights: Optional. The access rights + // (https://support.google.com/merchants/answer/12160472?sjid=6789834943175119429-EU#accesstypes) + // the user has. + // + // Possible values: + // "ACCESS_RIGHT_UNSPECIFIED" - Default value. This value is unused. + // "STANDARD" - Standard access rights. + // "ADMIN" - Admin access rights. + // "PERFORMANCE_REPORTING" - Users with this right have access to performance + // and insights. + AccessRights []string `json:"accessRights,omitempty"` + // Name: Identifier. The resource name of the user. Format: + // `accounts/{account}/user/{email}` Use `me` to refer to your own email + // address, for example `accounts/{account}/users/me`. + Name string `json:"name,omitempty"` + // State: Output only. The state of the user. + // + // Possible values: + // "STATE_UNSPECIFIED" - Default value. This value is unused. + // "PENDING" - The user is pending confirmation. In this state, the user + // first needs to accept the invitation before performing other actions. + // "VERIFIED" - The user is verified. + State string `json:"state,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "AccessRights") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AccessRights") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *User) MarshalJSON() ([]byte, error) { + type NoMethod User + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Value: The single value of a rate group or the value of a rate group table's +// cell. Exactly one of `no_shipping`, `flat_rate`, `price_percentage`, +// `carrier_rateName`, `subtable_name` must be set. +type Value struct { + // CarrierRate: The name of a carrier rate referring to a carrier rate defined + // in the same rate group. Can only be set if all other fields are not set. + CarrierRate string `json:"carrierRate,omitempty"` + // FlatRate: A flat rate. Can only be set if all other fields are not set. + FlatRate *Price `json:"flatRate,omitempty"` + // NoShipping: If true, then the product can't be shipped. Must be true when + // set, can only be set if all other fields are not set. + NoShipping bool `json:"noShipping,omitempty"` + // PricePercentage: A percentage of the price represented as a number in + // decimal notation (For example, "5.4"). Can only be set if all other fields + // are not set. + PricePercentage string `json:"pricePercentage,omitempty"` + // Subtable: The name of a subtable. Can only be set in table cells (For + // example, not for single values), and only if all other fields are not set. + Subtable string `json:"subtable,omitempty"` + // ForceSendFields is a list of field names (e.g. "CarrierRate") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "CarrierRate") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Value) MarshalJSON() ([]byte, error) { + type NoMethod Value + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Warehouse: A fulfillment warehouse, which stores and handles inventory. Next +// tag: 7 +type Warehouse struct { + // BusinessDayConfig: Business days of the warehouse. If not set, will be + // Monday to Friday by default. + BusinessDayConfig *BusinessDayConfig `json:"businessDayConfig,omitempty"` + // CutoffTime: Required. The latest time of day that an order can be accepted + // and begin processing. Later orders will be processed in the next day. The + // time is based on the warehouse postal code. + CutoffTime *WarehouseCutoffTime `json:"cutoffTime,omitempty"` + // HandlingDays: Required. The number of days it takes for this warehouse to + // pack up and ship an item. This is on the warehouse level, but can be + // overridden on the offer level based on the attributes of an item. + HandlingDays int64 `json:"handlingDays,omitempty,string"` + // Name: Required. The name of the warehouse. Must be unique within account. + Name string `json:"name,omitempty"` + // ShippingAddress: Required. Shipping address of the warehouse. + ShippingAddress *Address `json:"shippingAddress,omitempty"` + // ForceSendFields is a list of field names (e.g. "BusinessDayConfig") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "BusinessDayConfig") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Warehouse) MarshalJSON() ([]byte, error) { + type NoMethod Warehouse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// WarehouseBasedDeliveryTime: Indicates that the delivery time should be +// calculated per warehouse (shipping origin location) based on the settings of +// the selected carrier. When set, no other transit time related field in +// `delivery_time` should be set. +type WarehouseBasedDeliveryTime struct { + // Carrier: Required. Carrier, such as "UPS" or "Fedex". + Carrier string `json:"carrier,omitempty"` + // CarrierService: Required. Carrier service, such as "ground" or "2 days". + // The name of the service must be in the eddSupportedServices list. + CarrierService string `json:"carrierService,omitempty"` + // Warehouse: Required. Warehouse name. This should match warehouse + Warehouse string `json:"warehouse,omitempty"` + // ForceSendFields is a list of field names (e.g. "Carrier") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Carrier") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *WarehouseBasedDeliveryTime) MarshalJSON() ([]byte, error) { + type NoMethod WarehouseBasedDeliveryTime + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// WarehouseCutoffTime: The latest time of day that an order can be accepted +// and begin processing. Later orders will be processed in the next day. The +// time is based on the warehouse postal code. +type WarehouseCutoffTime struct { + // Hour: Required. Hour of the cutoff time until which an order has to be + // placed to be processed in the same day by the warehouse. Hour is based on + // the timezone of warehouse. + Hour int64 `json:"hour,omitempty"` + // Minute: Required. Minute of the cutoff time until which an order has to be + // placed to be processed in the same day by the warehouse. Minute is based on + // the timezone of warehouse. + Minute int64 `json:"minute,omitempty"` + // ForceSendFields is a list of field names (e.g. "Hour") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Hour") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *WarehouseCutoffTime) MarshalJSON() ([]byte, error) { + type NoMethod WarehouseCutoffTime + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Weight: The weight represented as the value in string and the unit. +type Weight struct { + // AmountMicros: Required. The weight represented as a number in micros (1 + // million micros is an equivalent to one's currency standard unit, for + // example, 1 kg = 1000000 micros). This field can also be set as infinity by + // setting to -1. This field only support -1 and positive value. + AmountMicros int64 `json:"amountMicros,omitempty,string"` + // Unit: Required. The weight unit. Acceptable values are: kg and lb + // + // Possible values: + // "WEIGHT_UNIT_UNSPECIFIED" - unit unspecified + // "POUND" - lb unit. + // "KILOGRAM" - kg unit. + Unit string `json:"unit,omitempty"` + // ForceSendFields is a list of field names (e.g. "AmountMicros") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AmountMicros") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Weight) MarshalJSON() ([]byte, error) { + type NoMethod Weight + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +type AccountsCreateAndConfigureCall struct { + s *APIService + createandconfigureaccountrequest *CreateAndConfigureAccountRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// CreateAndConfigure: Creates a standalone Merchant Center account with +// additional configuration. Adds the user that makes the request as an admin +// for the new account. +func (r *AccountsService) CreateAndConfigure(createandconfigureaccountrequest *CreateAndConfigureAccountRequest) *AccountsCreateAndConfigureCall { + c := &AccountsCreateAndConfigureCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.createandconfigureaccountrequest = createandconfigureaccountrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *AccountsCreateAndConfigureCall) Fields(s ...googleapi.Field) *AccountsCreateAndConfigureCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsCreateAndConfigureCall) Context(ctx context.Context) *AccountsCreateAndConfigureCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsCreateAndConfigureCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsCreateAndConfigureCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.createandconfigureaccountrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/accounts:createAndConfigure") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.createAndConfigure" call. +// Any non-2xx status code is an error. Response headers are in either +// *Account.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 *AccountsCreateAndConfigureCall) Do(opts ...googleapi.CallOption) (*Account, 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 := &Account{ + 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 +} + +type AccountsDeleteCall struct { + s *APIService + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes the specified account regardless of its type: standalone, +// MCA or sub-account. Deleting an MCA leads to the deletion of all of its +// sub-accounts. Executing this method requires admin access. +// +// - name: The name of the account to delete. Format: `accounts/{account}`. +func (r *AccountsService) Delete(name string) *AccountsDeleteCall { + c := &AccountsDeleteCall{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 +// details. +func (c *AccountsDeleteCall) Fields(s ...googleapi.Field) *AccountsDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsDeleteCall) Context(ctx context.Context) *AccountsDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+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 "merchantapi.accounts.delete" call. +// 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 *AccountsDeleteCall) 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 +} + +type AccountsGetCall struct { + s *APIService + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Retrieves an account from your Merchant Center account. After +// inserting, updating, or deleting an account, it may take several minutes +// before changes take effect. +// +// - name: The name of the account to retrieve. Format: `accounts/{account}`. +func (r *AccountsService) Get(name string) *AccountsGetCall { + c := &AccountsGetCall{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 +// details. +func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "accounts/v1beta/{+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 "merchantapi.accounts.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *Account.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 *AccountsGetCall) Do(opts ...googleapi.CallOption) (*Account, 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 := &Account{ + 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 +} + +type AccountsGetBusinessIdentityCall struct { + s *APIService + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// GetBusinessIdentity: Retrieves the business identity of an account. +// +// - name: The resource name of the business identity. Format: +// `accounts/{account}/businessIdentity`. +func (r *AccountsService) GetBusinessIdentity(name string) *AccountsGetBusinessIdentityCall { + c := &AccountsGetBusinessIdentityCall{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 +// details. +func (c *AccountsGetBusinessIdentityCall) Fields(s ...googleapi.Field) *AccountsGetBusinessIdentityCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsGetBusinessIdentityCall) IfNoneMatch(entityTag string) *AccountsGetBusinessIdentityCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsGetBusinessIdentityCall) Context(ctx context.Context) *AccountsGetBusinessIdentityCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsGetBusinessIdentityCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsGetBusinessIdentityCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "accounts/v1beta/{+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 "merchantapi.accounts.getBusinessIdentity" call. +// Any non-2xx status code is an error. Response headers are in either +// *BusinessIdentity.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 *AccountsGetBusinessIdentityCall) Do(opts ...googleapi.CallOption) (*BusinessIdentity, 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 := &BusinessIdentity{ + 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 +} + +type AccountsGetBusinessInfoCall struct { + s *APIService + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// GetBusinessInfo: Retrieves the business info of an account. +// +// - name: The resource name of the business info. Format: +// `accounts/{account}/businessInfo`. +func (r *AccountsService) GetBusinessInfo(name string) *AccountsGetBusinessInfoCall { + c := &AccountsGetBusinessInfoCall{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 +// details. +func (c *AccountsGetBusinessInfoCall) Fields(s ...googleapi.Field) *AccountsGetBusinessInfoCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsGetBusinessInfoCall) IfNoneMatch(entityTag string) *AccountsGetBusinessInfoCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsGetBusinessInfoCall) Context(ctx context.Context) *AccountsGetBusinessInfoCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsGetBusinessInfoCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsGetBusinessInfoCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "accounts/v1beta/{+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 "merchantapi.accounts.getBusinessInfo" call. +// Any non-2xx status code is an error. Response headers are in either +// *BusinessInfo.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 *AccountsGetBusinessInfoCall) Do(opts ...googleapi.CallOption) (*BusinessInfo, 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 := &BusinessInfo{ + 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 +} + +type AccountsGetHomepageCall struct { + s *APIService + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// GetHomepage: Retrieves a store's homepage. +// +// - name: The name of the homepage to retrieve. Format: +// `accounts/{account}/homepage`. +func (r *AccountsService) GetHomepage(name string) *AccountsGetHomepageCall { + c := &AccountsGetHomepageCall{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 +// details. +func (c *AccountsGetHomepageCall) Fields(s ...googleapi.Field) *AccountsGetHomepageCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsGetHomepageCall) IfNoneMatch(entityTag string) *AccountsGetHomepageCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsGetHomepageCall) Context(ctx context.Context) *AccountsGetHomepageCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsGetHomepageCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsGetHomepageCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "accounts/v1beta/{+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 "merchantapi.accounts.getHomepage" call. +// Any non-2xx status code is an error. Response headers are in either +// *Homepage.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 *AccountsGetHomepageCall) Do(opts ...googleapi.CallOption) (*Homepage, 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 := &Homepage{ + 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 +} + +type AccountsGetShippingSettingsCall struct { + s *APIService + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// GetShippingSettings: Retrieve shipping setting information. +// +// - name: The name of the shipping setting to retrieve. Format: +// `accounts/{account}/shippingsetting`. +func (r *AccountsService) GetShippingSettings(name string) *AccountsGetShippingSettingsCall { + c := &AccountsGetShippingSettingsCall{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 +// details. +func (c *AccountsGetShippingSettingsCall) Fields(s ...googleapi.Field) *AccountsGetShippingSettingsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsGetShippingSettingsCall) IfNoneMatch(entityTag string) *AccountsGetShippingSettingsCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsGetShippingSettingsCall) Context(ctx context.Context) *AccountsGetShippingSettingsCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsGetShippingSettingsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsGetShippingSettingsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "accounts/v1beta/{+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 "merchantapi.accounts.getShippingSettings" call. +// Any non-2xx status code is an error. Response headers are in either +// *ShippingSettings.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 *AccountsGetShippingSettingsCall) Do(opts ...googleapi.CallOption) (*ShippingSettings, 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 := &ShippingSettings{ + 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 +} + +type AccountsListCall struct { + s *APIService + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists accounts accessible to the calling user and matching the +// constraints of the request such as page size or filters. This is not just +// listing the sub-accounts of an MCA, but all accounts the calling user has +// access to including other MCAs, linked accounts, standalone accounts and so +// on. +func (r *AccountsService) List() *AccountsListCall { + c := &AccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + return c +} + +// Filter sets the optional parameter "filter": Returns only accounts that +// match the filter (/merchant/api/guides/accounts/filter). For more details, +// see the filter syntax reference +// (/merchant/api/guides/accounts/filter-syntax). +func (c *AccountsListCall) Filter(filter string) *AccountsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number of +// accounts to return. The service may return fewer than this value. If +// unspecified, at most 250 accounts are returned. The maximum value is 500; +// values above 500 are coerced to 500. +func (c *AccountsListCall) PageSize(pageSize int64) *AccountsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, received +// from a previous `ListAccounts` call. Provide this to retrieve the subsequent +// page. When paginating, all other parameters provided to `ListAccounts` must +// match the call that provided the page token. +func (c *AccountsListCall) PageToken(pageToken string) *AccountsListCall { + 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 +// details. +func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "accounts/v1beta/accounts") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *ListAccountsResponse.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 *AccountsListCall) Do(opts ...googleapi.CallOption) (*ListAccountsResponse, 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 := &ListAccountsResponse{ + 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 +} + +// 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 *AccountsListCall) Pages(ctx context.Context, f func(*ListAccountsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + 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) + } +} + +type AccountsListSubaccountsCall struct { + s *APIService + provider string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// ListSubaccounts: List all sub-accounts for a given multi client account. +// This is a convenience wrapper for the more powerful `ListAccounts` method. +// This method will produce the same results as calling `ListsAccounts` with +// the following filter: `relationship(providerId={parent} AND +// service(type="ACCOUNT_AGGREGATION"))` +// +// - provider: The parent account. Format: `accounts/{account}`. +func (r *AccountsService) ListSubaccounts(provider string) *AccountsListSubaccountsCall { + c := &AccountsListSubaccountsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.provider = provider + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number of +// accounts to return. The service may return fewer than this value. If +// unspecified, at most 250 accounts are returned. The maximum value is 500; +// values above 500 are coerced to 500. +func (c *AccountsListSubaccountsCall) PageSize(pageSize int64) *AccountsListSubaccountsCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, received +// from a previous `ListAccounts` call. Provide this to retrieve the subsequent +// page. When paginating, all other parameters provided to `ListAccounts` must +// match the call that provided the page token. +func (c *AccountsListSubaccountsCall) PageToken(pageToken string) *AccountsListSubaccountsCall { + 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 +// details. +func (c *AccountsListSubaccountsCall) Fields(s ...googleapi.Field) *AccountsListSubaccountsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsListSubaccountsCall) IfNoneMatch(entityTag string) *AccountsListSubaccountsCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsListSubaccountsCall) Context(ctx context.Context) *AccountsListSubaccountsCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsListSubaccountsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsListSubaccountsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "accounts/v1beta/{+provider}:listSubaccounts") + 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{ + "provider": c.provider, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.listSubaccounts" call. +// Any non-2xx status code is an error. Response headers are in either +// *ListSubAccountsResponse.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 *AccountsListSubaccountsCall) Do(opts ...googleapi.CallOption) (*ListSubAccountsResponse, 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 := &ListSubAccountsResponse{ + 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 +} + +// 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 *AccountsListSubaccountsCall) Pages(ctx context.Context, f func(*ListSubAccountsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + 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) + } +} + +type AccountsPatchCall struct { + s *APIService + name string + account *Account + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates an account regardless of its type: standalone, MCA or +// sub-account. Executing this method requires admin access. +// +// - name: Identifier. The resource name of the account. Format: +// `accounts/{account}`. +func (r *AccountsService) Patch(name string, account *Account) *AccountsPatchCall { + c := &AccountsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.account = account + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. List of +// fields being updated. +func (c *AccountsPatchCall) UpdateMask(updateMask string) *AccountsPatchCall { + 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 +// details. +func (c *AccountsPatchCall) Fields(s ...googleapi.Field) *AccountsPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsPatchCall) Context(ctx context.Context) *AccountsPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.account) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+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 "merchantapi.accounts.patch" call. +// Any non-2xx status code is an error. Response headers are in either +// *Account.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 *AccountsPatchCall) Do(opts ...googleapi.CallOption) (*Account, 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 := &Account{ + 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 +} + +type AccountsUpdateBusinessIdentityCall struct { + s *APIService + name string + businessidentity *BusinessIdentity + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// UpdateBusinessIdentity: Updates the business identity of an account. +// Executing this method requires admin access. +// +// - name: Identifier. The resource name of the business identity. Format: +// `accounts/{account}/businessIdentity`. +func (r *AccountsService) UpdateBusinessIdentity(name string, businessidentity *BusinessIdentity) *AccountsUpdateBusinessIdentityCall { + c := &AccountsUpdateBusinessIdentityCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.businessidentity = businessidentity + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. List of +// fields being updated. +func (c *AccountsUpdateBusinessIdentityCall) UpdateMask(updateMask string) *AccountsUpdateBusinessIdentityCall { + 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 +// details. +func (c *AccountsUpdateBusinessIdentityCall) Fields(s ...googleapi.Field) *AccountsUpdateBusinessIdentityCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsUpdateBusinessIdentityCall) Context(ctx context.Context) *AccountsUpdateBusinessIdentityCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsUpdateBusinessIdentityCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsUpdateBusinessIdentityCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.businessidentity) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+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 "merchantapi.accounts.updateBusinessIdentity" call. +// Any non-2xx status code is an error. Response headers are in either +// *BusinessIdentity.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 *AccountsUpdateBusinessIdentityCall) Do(opts ...googleapi.CallOption) (*BusinessIdentity, 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 := &BusinessIdentity{ + 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 +} + +type AccountsUpdateBusinessInfoCall struct { + s *APIService + name string + businessinfo *BusinessInfo + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// UpdateBusinessInfo: Updates the business info of an account. Executing this +// method requires admin access. +// +// - name: Identifier. The resource name of the business info. Format: +// `accounts/{account}/businessInfo`. +func (r *AccountsService) UpdateBusinessInfo(name string, businessinfo *BusinessInfo) *AccountsUpdateBusinessInfoCall { + c := &AccountsUpdateBusinessInfoCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.businessinfo = businessinfo + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. List of +// fields being updated. +func (c *AccountsUpdateBusinessInfoCall) UpdateMask(updateMask string) *AccountsUpdateBusinessInfoCall { + 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 +// details. +func (c *AccountsUpdateBusinessInfoCall) Fields(s ...googleapi.Field) *AccountsUpdateBusinessInfoCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsUpdateBusinessInfoCall) Context(ctx context.Context) *AccountsUpdateBusinessInfoCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsUpdateBusinessInfoCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsUpdateBusinessInfoCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.businessinfo) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+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 "merchantapi.accounts.updateBusinessInfo" call. +// Any non-2xx status code is an error. Response headers are in either +// *BusinessInfo.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 *AccountsUpdateBusinessInfoCall) Do(opts ...googleapi.CallOption) (*BusinessInfo, 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 := &BusinessInfo{ + 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 +} + +type AccountsUpdateHomepageCall struct { + s *APIService + name string + homepage *Homepage + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// UpdateHomepage: Updates a store's homepage. Executing this method requires +// admin access. +// +// - name: Identifier. The resource name of the store's homepage. Format: +// `accounts/{account}/homepage`. +func (r *AccountsService) UpdateHomepage(name string, homepage *Homepage) *AccountsUpdateHomepageCall { + c := &AccountsUpdateHomepageCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.homepage = homepage + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. List of +// fields being updated. +func (c *AccountsUpdateHomepageCall) UpdateMask(updateMask string) *AccountsUpdateHomepageCall { + 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 +// details. +func (c *AccountsUpdateHomepageCall) Fields(s ...googleapi.Field) *AccountsUpdateHomepageCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsUpdateHomepageCall) Context(ctx context.Context) *AccountsUpdateHomepageCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsUpdateHomepageCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsUpdateHomepageCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.homepage) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+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 "merchantapi.accounts.updateHomepage" call. +// Any non-2xx status code is an error. Response headers are in either +// *Homepage.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 *AccountsUpdateHomepageCall) Do(opts ...googleapi.CallOption) (*Homepage, 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 := &Homepage{ + 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 +} + +type AccountsAccounttaxGetCall struct { + s *APIService + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Returns the tax rules that match the conditions of GetAccountTaxRequest +// +// - name: The name from which tax settings will be retrieved. +func (r *AccountsAccounttaxService) Get(name string) *AccountsAccounttaxGetCall { + c := &AccountsAccounttaxGetCall{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 +// details. +func (c *AccountsAccounttaxGetCall) Fields(s ...googleapi.Field) *AccountsAccounttaxGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsAccounttaxGetCall) IfNoneMatch(entityTag string) *AccountsAccounttaxGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsAccounttaxGetCall) Context(ctx context.Context) *AccountsAccounttaxGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsAccounttaxGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsAccounttaxGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "accounts/v1beta/{+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 "merchantapi.accounts.accounttax.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *AccountTax.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 *AccountsAccounttaxGetCall) Do(opts ...googleapi.CallOption) (*AccountTax, 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 := &AccountTax{ + 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 +} + +type AccountsAccounttaxListCall struct { + s *APIService + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists the tax settings of the sub-accounts only in your Merchant +// Center account. This method can only be called on a multi-client account, +// otherwise it'll return an error. +// +// - parent: The parent, which owns this collection of account tax. Format: +// accounts/{account}. +func (r *AccountsAccounttaxService) List(parent string) *AccountsAccounttaxListCall { + c := &AccountsAccounttaxListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number of tax +// settings to return in the response, used for paging. +func (c *AccountsAccounttaxListCall) PageSize(pageSize int64) *AccountsAccounttaxListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The token returned by the +// previous request. +func (c *AccountsAccounttaxListCall) PageToken(pageToken string) *AccountsAccounttaxListCall { + 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 +// details. +func (c *AccountsAccounttaxListCall) Fields(s ...googleapi.Field) *AccountsAccounttaxListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsAccounttaxListCall) IfNoneMatch(entityTag string) *AccountsAccounttaxListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsAccounttaxListCall) Context(ctx context.Context) *AccountsAccounttaxListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsAccounttaxListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsAccounttaxListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "accounts/v1beta/{+parent}/accounttax") + 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 "merchantapi.accounts.accounttax.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *ListAccountTaxResponse.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 *AccountsAccounttaxListCall) Do(opts ...googleapi.CallOption) (*ListAccountTaxResponse, 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 := &ListAccountTaxResponse{ + 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 +} + +// 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 *AccountsAccounttaxListCall) Pages(ctx context.Context, f func(*ListAccountTaxResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + 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) + } +} + +type AccountsAccounttaxPatchCall struct { + s *APIService + name string + accounttax *AccountTax + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates the tax settings of the account. +// +// - name: Identifier. The name of the tax setting. Format: +// "{account_tax.name=accounts/{account}}". +func (r *AccountsAccounttaxService) Patch(name string, accounttax *AccountTax) *AccountsAccounttaxPatchCall { + c := &AccountsAccounttaxPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.accounttax = accounttax + return c +} + +// UpdateMask sets the optional parameter "updateMask": The list of fields to +// be updated +func (c *AccountsAccounttaxPatchCall) UpdateMask(updateMask string) *AccountsAccounttaxPatchCall { + 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 +// details. +func (c *AccountsAccounttaxPatchCall) Fields(s ...googleapi.Field) *AccountsAccounttaxPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsAccounttaxPatchCall) Context(ctx context.Context) *AccountsAccounttaxPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsAccounttaxPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsAccounttaxPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.accounttax) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+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 "merchantapi.accounts.accounttax.patch" call. +// Any non-2xx status code is an error. Response headers are in either +// *AccountTax.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 *AccountsAccounttaxPatchCall) Do(opts ...googleapi.CallOption) (*AccountTax, 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 := &AccountTax{ + 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 +} + +type AccountsHomepageClaimCall struct { + s *APIService + name string + claimhomepagerequest *ClaimHomepageRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Claim: Claims a store's homepage. Executing this method requires admin +// access. If the homepage is already claimed, this will recheck the +// verification (unless the merchant is exempted from claiming, which also +// exempts from verification) and return a successful response. If ownership +// can no longer be verified, it will return an error, but it won't clear the +// claim. In case of failure, a canonical error message will be returned: * +// PERMISSION_DENIED: user doesn't have the necessary permissions on this MC +// account; * FAILED_PRECONDITION: - The account is not a Merchant Center +// account; - MC account doesn't have a homepage; - claiming failed (in this +// case the error message will contain more details). +// +// - name: The name of the homepage to claim. Format: +// `accounts/{account}/homepage`. +func (r *AccountsHomepageService) Claim(name string, claimhomepagerequest *ClaimHomepageRequest) *AccountsHomepageClaimCall { + c := &AccountsHomepageClaimCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.claimhomepagerequest = claimhomepagerequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *AccountsHomepageClaimCall) Fields(s ...googleapi.Field) *AccountsHomepageClaimCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsHomepageClaimCall) Context(ctx context.Context) *AccountsHomepageClaimCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsHomepageClaimCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsHomepageClaimCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.claimhomepagerequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+name}:claim") + 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 "merchantapi.accounts.homepage.claim" call. +// Any non-2xx status code is an error. Response headers are in either +// *Homepage.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 *AccountsHomepageClaimCall) Do(opts ...googleapi.CallOption) (*Homepage, 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 := &Homepage{ + 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 +} + +type AccountsHomepageUnclaimCall struct { + s *APIService + name string + unclaimhomepagerequest *UnclaimHomepageRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Unclaim: Unclaims a store's homepage. Executing this method requires admin +// access. +// +// - name: The name of the homepage to unclaim. Format: +// `accounts/{account}/homepage`. +func (r *AccountsHomepageService) Unclaim(name string, unclaimhomepagerequest *UnclaimHomepageRequest) *AccountsHomepageUnclaimCall { + c := &AccountsHomepageUnclaimCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.unclaimhomepagerequest = unclaimhomepagerequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *AccountsHomepageUnclaimCall) Fields(s ...googleapi.Field) *AccountsHomepageUnclaimCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsHomepageUnclaimCall) Context(ctx context.Context) *AccountsHomepageUnclaimCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsHomepageUnclaimCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsHomepageUnclaimCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.unclaimhomepagerequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+name}:unclaim") + 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 "merchantapi.accounts.homepage.unclaim" call. +// Any non-2xx status code is an error. Response headers are in either +// *Homepage.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 *AccountsHomepageUnclaimCall) Do(opts ...googleapi.CallOption) (*Homepage, 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 := &Homepage{ + 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 +} + +type AccountsIssuesListCall struct { + s *APIService + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists all account issues of a Merchant Center account. +// +// - parent: The parent, which owns this collection of issues. Format: +// `accounts/{account}`. +func (r *AccountsIssuesService) List(parent string) *AccountsIssuesListCall { + c := &AccountsIssuesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// LanguageCode sets the optional parameter "languageCode": The issues in the +// response will have human-readable fields in the given language. The format +// is BCP-47 (https://tools.ietf.org/html/bcp47), such as `en-US` or `sr-Latn`. +// If not value is provided, `en-US` will be used. +func (c *AccountsIssuesListCall) LanguageCode(languageCode string) *AccountsIssuesListCall { + c.urlParams_.Set("languageCode", languageCode) + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number of +// issues to return. The service may return fewer than this value. If +// unspecified, at most 50 users will be returned. The maximum value is 100; +// values above 100 will be coerced to 100 +func (c *AccountsIssuesListCall) PageSize(pageSize int64) *AccountsIssuesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, received +// from a previous `ListAccountIssues` call. Provide this to retrieve the +// subsequent page. When paginating, all other parameters provided to +// `ListAccountIssues` must match the call that provided the page token. +func (c *AccountsIssuesListCall) PageToken(pageToken string) *AccountsIssuesListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// TimeZoneId sets the optional parameter "timeZone.id": IANA Time Zone +// Database time zone, e.g. "America/New_York". +func (c *AccountsIssuesListCall) TimeZoneId(timeZoneId string) *AccountsIssuesListCall { + c.urlParams_.Set("timeZone.id", timeZoneId) + return c +} + +// TimeZoneVersion sets the optional parameter "timeZone.version": IANA Time +// Zone Database version number, e.g. "2019a". +func (c *AccountsIssuesListCall) TimeZoneVersion(timeZoneVersion string) *AccountsIssuesListCall { + c.urlParams_.Set("timeZone.version", timeZoneVersion) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *AccountsIssuesListCall) Fields(s ...googleapi.Field) *AccountsIssuesListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsIssuesListCall) IfNoneMatch(entityTag string) *AccountsIssuesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsIssuesListCall) Context(ctx context.Context) *AccountsIssuesListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsIssuesListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsIssuesListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "accounts/v1beta/{+parent}/issues") + 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 "merchantapi.accounts.issues.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *ListAccountIssuesResponse.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 *AccountsIssuesListCall) Do(opts ...googleapi.CallOption) (*ListAccountIssuesResponse, 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 := &ListAccountIssuesResponse{ + 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 +} + +// 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 *AccountsIssuesListCall) Pages(ctx context.Context, f func(*ListAccountIssuesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + 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) + } +} + +type AccountsOnlineReturnPoliciesGetCall struct { + s *APIService + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets an existing return policy. +// +// - name: The name of the return policy to retrieve. Format: +// `accounts/{account}/onlineReturnPolicies/{return_policy}`. +func (r *AccountsOnlineReturnPoliciesService) Get(name string) *AccountsOnlineReturnPoliciesGetCall { + c := &AccountsOnlineReturnPoliciesGetCall{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 +// details. +func (c *AccountsOnlineReturnPoliciesGetCall) Fields(s ...googleapi.Field) *AccountsOnlineReturnPoliciesGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsOnlineReturnPoliciesGetCall) IfNoneMatch(entityTag string) *AccountsOnlineReturnPoliciesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsOnlineReturnPoliciesGetCall) Context(ctx context.Context) *AccountsOnlineReturnPoliciesGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsOnlineReturnPoliciesGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsOnlineReturnPoliciesGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "accounts/v1beta/{+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 "merchantapi.accounts.onlineReturnPolicies.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *OnlineReturnPolicy.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 *AccountsOnlineReturnPoliciesGetCall) Do(opts ...googleapi.CallOption) (*OnlineReturnPolicy, 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 := &OnlineReturnPolicy{ + 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 +} + +type AccountsOnlineReturnPoliciesListCall struct { + s *APIService + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists all existing return policies. +// +// - parent: The merchant account for which to list return policies. Format: +// `accounts/{account}`. +func (r *AccountsOnlineReturnPoliciesService) List(parent string) *AccountsOnlineReturnPoliciesListCall { + c := &AccountsOnlineReturnPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number of +// `OnlineReturnPolicy` resources to return. The service returns fewer than +// this value if the number of return policies for the given merchant is less +// that than the `pageSize`. The default value is 10. The maximum value is 100; +// If a value higher than the maximum is specified, then the `pageSize` will +// default to the maximum +func (c *AccountsOnlineReturnPoliciesListCall) PageSize(pageSize int64) *AccountsOnlineReturnPoliciesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, received +// from a previous `ListOnlineReturnPolicies` call. Provide the page token to +// retrieve the subsequent page. When paginating, all other parameters provided +// to `ListOnlineReturnPolicies` must match the call that provided the page +// token. The token returned as nextPageToken in the response to the previous +// request. +func (c *AccountsOnlineReturnPoliciesListCall) PageToken(pageToken string) *AccountsOnlineReturnPoliciesListCall { + 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 +// details. +func (c *AccountsOnlineReturnPoliciesListCall) Fields(s ...googleapi.Field) *AccountsOnlineReturnPoliciesListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsOnlineReturnPoliciesListCall) IfNoneMatch(entityTag string) *AccountsOnlineReturnPoliciesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsOnlineReturnPoliciesListCall) Context(ctx context.Context) *AccountsOnlineReturnPoliciesListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsOnlineReturnPoliciesListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsOnlineReturnPoliciesListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "accounts/v1beta/{+parent}/onlineReturnPolicies") + 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 "merchantapi.accounts.onlineReturnPolicies.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *ListOnlineReturnPoliciesResponse.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 *AccountsOnlineReturnPoliciesListCall) Do(opts ...googleapi.CallOption) (*ListOnlineReturnPoliciesResponse, 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 := &ListOnlineReturnPoliciesResponse{ + 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 +} + +// 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 *AccountsOnlineReturnPoliciesListCall) Pages(ctx context.Context, f func(*ListOnlineReturnPoliciesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + 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) + } +} + +type AccountsProgramsDisableCall struct { + s *APIService + name string + disableprogramrequest *DisableProgramRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Disable: Disable participation in the specified program for the account. +// Executing this method requires admin access. +// +// - name: The name of the program for which to disable participation for the +// given account. Format: `accounts/{account}/programs/{program}`. +func (r *AccountsProgramsService) Disable(name string, disableprogramrequest *DisableProgramRequest) *AccountsProgramsDisableCall { + c := &AccountsProgramsDisableCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.disableprogramrequest = disableprogramrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *AccountsProgramsDisableCall) Fields(s ...googleapi.Field) *AccountsProgramsDisableCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsProgramsDisableCall) Context(ctx context.Context) *AccountsProgramsDisableCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsProgramsDisableCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsProgramsDisableCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.disableprogramrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+name}:disable") + 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 "merchantapi.accounts.programs.disable" call. +// Any non-2xx status code is an error. Response headers are in either +// *Program.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 *AccountsProgramsDisableCall) Do(opts ...googleapi.CallOption) (*Program, 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 := &Program{ + 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 +} + +type AccountsProgramsEnableCall struct { + s *APIService + name string + enableprogramrequest *EnableProgramRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Enable: Enable participation in the specified program for the account. +// Executing this method requires admin access. +// +// - name: The name of the program for which to enable participation for the +// given account. Format: `accounts/{account}/programs/{program}`. +func (r *AccountsProgramsService) Enable(name string, enableprogramrequest *EnableProgramRequest) *AccountsProgramsEnableCall { + c := &AccountsProgramsEnableCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.enableprogramrequest = enableprogramrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *AccountsProgramsEnableCall) Fields(s ...googleapi.Field) *AccountsProgramsEnableCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsProgramsEnableCall) Context(ctx context.Context) *AccountsProgramsEnableCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsProgramsEnableCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsProgramsEnableCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.enableprogramrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+name}:enable") + 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 "merchantapi.accounts.programs.enable" call. +// Any non-2xx status code is an error. Response headers are in either +// *Program.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 *AccountsProgramsEnableCall) Do(opts ...googleapi.CallOption) (*Program, 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 := &Program{ + 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 +} + +type AccountsProgramsGetCall struct { + s *APIService + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Retrieves the specified program for the account. +// +// - name: The name of the program to retrieve. Format: +// `accounts/{account}/programs/{program}`. +func (r *AccountsProgramsService) Get(name string) *AccountsProgramsGetCall { + c := &AccountsProgramsGetCall{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 +// details. +func (c *AccountsProgramsGetCall) Fields(s ...googleapi.Field) *AccountsProgramsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsProgramsGetCall) IfNoneMatch(entityTag string) *AccountsProgramsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsProgramsGetCall) Context(ctx context.Context) *AccountsProgramsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsProgramsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsProgramsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "accounts/v1beta/{+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 "merchantapi.accounts.programs.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *Program.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 *AccountsProgramsGetCall) Do(opts ...googleapi.CallOption) (*Program, 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 := &Program{ + 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 +} + +type AccountsProgramsListCall struct { + s *APIService + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Retrieves all programs for the account. +// +// - parent: The name of the account for which to retrieve all programs. +// Format: `accounts/{account}`. +func (r *AccountsProgramsService) List(parent string) *AccountsProgramsListCall { + c := &AccountsProgramsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number of +// programs to return in a single response. If unspecified (or 0), a default +// size of 1000 is used. The maximum value is 1000; values above 1000 will be +// coerced to 1000. +func (c *AccountsProgramsListCall) PageSize(pageSize int64) *AccountsProgramsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A continuation token, +// received from a previous `ListPrograms` call. Provide this to retrieve the +// next page. +func (c *AccountsProgramsListCall) PageToken(pageToken string) *AccountsProgramsListCall { + 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 +// details. +func (c *AccountsProgramsListCall) Fields(s ...googleapi.Field) *AccountsProgramsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsProgramsListCall) IfNoneMatch(entityTag string) *AccountsProgramsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsProgramsListCall) Context(ctx context.Context) *AccountsProgramsListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsProgramsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsProgramsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "accounts/v1beta/{+parent}/programs") + 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 "merchantapi.accounts.programs.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *ListProgramsResponse.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 *AccountsProgramsListCall) Do(opts ...googleapi.CallOption) (*ListProgramsResponse, 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 := &ListProgramsResponse{ + 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 +} + +// 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 *AccountsProgramsListCall) Pages(ctx context.Context, f func(*ListProgramsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + 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) + } +} + +type AccountsRegionsCreateCall struct { + s *APIService + parent string + region *Region + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a region definition in your Merchant Center account. +// Executing this method requires admin access. +// +// - parent: The account to create a region for. Format: `accounts/{account}`. +func (r *AccountsRegionsService) Create(parent string, region *Region) *AccountsRegionsCreateCall { + c := &AccountsRegionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.region = region + return c +} + +// RegionId sets the optional parameter "regionId": Required. The identifier +// for the region, unique over all regions of the same account. +func (c *AccountsRegionsCreateCall) RegionId(regionId string) *AccountsRegionsCreateCall { + c.urlParams_.Set("regionId", regionId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *AccountsRegionsCreateCall) Fields(s ...googleapi.Field) *AccountsRegionsCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsRegionsCreateCall) Context(ctx context.Context) *AccountsRegionsCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsRegionsCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsRegionsCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.region) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+parent}/regions") + 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 "merchantapi.accounts.regions.create" call. +// Any non-2xx status code is an error. Response headers are in either +// *Region.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 *AccountsRegionsCreateCall) Do(opts ...googleapi.CallOption) (*Region, 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 := &Region{ + 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 +} + +type AccountsRegionsDeleteCall struct { + s *APIService + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a region definition from your Merchant Center account. +// Executing this method requires admin access. +// +// - name: The name of the region to delete. Format: +// `accounts/{account}/regions/{region}`. +func (r *AccountsRegionsService) Delete(name string) *AccountsRegionsDeleteCall { + c := &AccountsRegionsDeleteCall{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 +// details. +func (c *AccountsRegionsDeleteCall) Fields(s ...googleapi.Field) *AccountsRegionsDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsRegionsDeleteCall) Context(ctx context.Context) *AccountsRegionsDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsRegionsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsRegionsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+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 "merchantapi.accounts.regions.delete" call. +// 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 *AccountsRegionsDeleteCall) 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 +} + +type AccountsRegionsGetCall struct { + s *APIService + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Retrieves a region defined in your Merchant Center account. +// +// - name: The name of the region to retrieve. Format: +// `accounts/{account}/regions/{region}`. +func (r *AccountsRegionsService) Get(name string) *AccountsRegionsGetCall { + c := &AccountsRegionsGetCall{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 +// details. +func (c *AccountsRegionsGetCall) Fields(s ...googleapi.Field) *AccountsRegionsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsRegionsGetCall) IfNoneMatch(entityTag string) *AccountsRegionsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsRegionsGetCall) Context(ctx context.Context) *AccountsRegionsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsRegionsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsRegionsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "accounts/v1beta/{+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 "merchantapi.accounts.regions.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *Region.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 *AccountsRegionsGetCall) Do(opts ...googleapi.CallOption) (*Region, 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 := &Region{ + 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 +} + +type AccountsRegionsListCall struct { + s *APIService + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists the regions in your Merchant Center account. +// +// - parent: The account to list regions for. Format: `accounts/{account}`. +func (r *AccountsRegionsService) List(parent string) *AccountsRegionsListCall { + c := &AccountsRegionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number of +// regions to return. The service may return fewer than this value. If +// unspecified, at most 50 regions will be returned. The maximum value is 1000; +// values above 1000 will be coerced to 1000. +func (c *AccountsRegionsListCall) PageSize(pageSize int64) *AccountsRegionsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, received +// from a previous `ListRegions` call. Provide this to retrieve the subsequent +// page. When paginating, all other parameters provided to `ListRegions` must +// match the call that provided the page token. +func (c *AccountsRegionsListCall) PageToken(pageToken string) *AccountsRegionsListCall { + 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 +// details. +func (c *AccountsRegionsListCall) Fields(s ...googleapi.Field) *AccountsRegionsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsRegionsListCall) IfNoneMatch(entityTag string) *AccountsRegionsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsRegionsListCall) Context(ctx context.Context) *AccountsRegionsListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsRegionsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsRegionsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "accounts/v1beta/{+parent}/regions") + 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 "merchantapi.accounts.regions.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *ListRegionsResponse.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 *AccountsRegionsListCall) Do(opts ...googleapi.CallOption) (*ListRegionsResponse, 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 := &ListRegionsResponse{ + 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 +} + +// 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 *AccountsRegionsListCall) Pages(ctx context.Context, f func(*ListRegionsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + 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) + } +} + +type AccountsRegionsPatchCall struct { + s *APIService + name string + region *Region + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates a region definition in your Merchant Center account. +// Executing this method requires admin access. +// +// - name: Identifier. The resource name of the region. Format: +// `accounts/{account}/regions/{region}`. +func (r *AccountsRegionsService) Patch(name string, region *Region) *AccountsRegionsPatchCall { + c := &AccountsRegionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.region = region + return c +} + +// UpdateMask sets the optional parameter "updateMask": The comma-separated +// field mask indicating the fields to update. Example: +// "displayName,postalCodeArea.regionCode". +func (c *AccountsRegionsPatchCall) UpdateMask(updateMask string) *AccountsRegionsPatchCall { + 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 +// details. +func (c *AccountsRegionsPatchCall) Fields(s ...googleapi.Field) *AccountsRegionsPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsRegionsPatchCall) Context(ctx context.Context) *AccountsRegionsPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsRegionsPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsRegionsPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.region) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+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 "merchantapi.accounts.regions.patch" call. +// Any non-2xx status code is an error. Response headers are in either +// *Region.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 *AccountsRegionsPatchCall) Do(opts ...googleapi.CallOption) (*Region, 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 := &Region{ + 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 +} + +type AccountsShippingSettingsInsertCall struct { + s *APIService + parent string + shippingsettings *ShippingSettings + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Insert: Replace the shipping setting of a merchant with the request shipping +// setting. Executing this method requires admin access. +// +// - parent: The account where this product will be inserted. Format: +// accounts/{account}. +func (r *AccountsShippingSettingsService) Insert(parent string, shippingsettings *ShippingSettings) *AccountsShippingSettingsInsertCall { + c := &AccountsShippingSettingsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.shippingsettings = shippingsettings + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *AccountsShippingSettingsInsertCall) Fields(s ...googleapi.Field) *AccountsShippingSettingsInsertCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsShippingSettingsInsertCall) Context(ctx context.Context) *AccountsShippingSettingsInsertCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsShippingSettingsInsertCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsShippingSettingsInsertCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.shippingsettings) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+parent}/shippingSettings:insert") + 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 "merchantapi.accounts.shippingSettings.insert" call. +// Any non-2xx status code is an error. Response headers are in either +// *ShippingSettings.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 *AccountsShippingSettingsInsertCall) Do(opts ...googleapi.CallOption) (*ShippingSettings, 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 := &ShippingSettings{ + 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 +} + +type AccountsTermsOfServiceAgreementStatesGetCall struct { + s *APIService + nameid string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Returns the state of a terms of service agreement. +// +// - name: The resource name of the terms of service version. Format: +// `accounts/{account}/termsOfServiceAgreementState/{identifier}`. +func (r *AccountsTermsOfServiceAgreementStatesService) Get(nameid string) *AccountsTermsOfServiceAgreementStatesGetCall { + c := &AccountsTermsOfServiceAgreementStatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.nameid = nameid + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *AccountsTermsOfServiceAgreementStatesGetCall) Fields(s ...googleapi.Field) *AccountsTermsOfServiceAgreementStatesGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsTermsOfServiceAgreementStatesGetCall) IfNoneMatch(entityTag string) *AccountsTermsOfServiceAgreementStatesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsTermsOfServiceAgreementStatesGetCall) Context(ctx context.Context) *AccountsTermsOfServiceAgreementStatesGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsTermsOfServiceAgreementStatesGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsTermsOfServiceAgreementStatesGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "accounts/v1beta/{+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.nameid, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.termsOfServiceAgreementStates.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *TermsOfServiceAgreementState.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 *AccountsTermsOfServiceAgreementStatesGetCall) Do(opts ...googleapi.CallOption) (*TermsOfServiceAgreementState, 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 := &TermsOfServiceAgreementState{ + 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 +} + +type AccountsTermsOfServiceAgreementStatesRetrieveForApplicationCall struct { + s *APIService + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// RetrieveForApplication: Retrieves the state of the agreement for the +// application terms of service. +// +// - parent: The account for which to get a TermsOfServiceAgreementState +// Format: `accounts/{account}`. +func (r *AccountsTermsOfServiceAgreementStatesService) RetrieveForApplication(parent string) *AccountsTermsOfServiceAgreementStatesRetrieveForApplicationCall { + c := &AccountsTermsOfServiceAgreementStatesRetrieveForApplicationCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *AccountsTermsOfServiceAgreementStatesRetrieveForApplicationCall) Fields(s ...googleapi.Field) *AccountsTermsOfServiceAgreementStatesRetrieveForApplicationCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsTermsOfServiceAgreementStatesRetrieveForApplicationCall) IfNoneMatch(entityTag string) *AccountsTermsOfServiceAgreementStatesRetrieveForApplicationCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsTermsOfServiceAgreementStatesRetrieveForApplicationCall) Context(ctx context.Context) *AccountsTermsOfServiceAgreementStatesRetrieveForApplicationCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsTermsOfServiceAgreementStatesRetrieveForApplicationCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsTermsOfServiceAgreementStatesRetrieveForApplicationCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "accounts/v1beta/{+parent}/termsOfServiceAgreementStates:retrieveForApplication") + 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 "merchantapi.accounts.termsOfServiceAgreementStates.retrieveForApplication" call. +// Any non-2xx status code is an error. Response headers are in either +// *TermsOfServiceAgreementState.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 *AccountsTermsOfServiceAgreementStatesRetrieveForApplicationCall) Do(opts ...googleapi.CallOption) (*TermsOfServiceAgreementState, 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 := &TermsOfServiceAgreementState{ + 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 +} + +type AccountsUsersCreateCall struct { + s *APIService + parent string + user *User + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a Merchant Center account user. Executing this method +// requires admin access. +// +// - parent: The resource name of the account for which a user will be created. +// Format: `accounts/{account}`. +func (r *AccountsUsersService) Create(parent string, user *User) *AccountsUsersCreateCall { + c := &AccountsUsersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.user = user + return c +} + +// UserId sets the optional parameter "userId": Required. The email address of +// the user (for example, `john.doe@gmail.com`). +func (c *AccountsUsersCreateCall) UserId(userId string) *AccountsUsersCreateCall { + c.urlParams_.Set("userId", userId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *AccountsUsersCreateCall) Fields(s ...googleapi.Field) *AccountsUsersCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsUsersCreateCall) Context(ctx context.Context) *AccountsUsersCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsUsersCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsUsersCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+parent}/users") + 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 "merchantapi.accounts.users.create" call. +// Any non-2xx status code is an error. Response headers are in either +// *User.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 *AccountsUsersCreateCall) Do(opts ...googleapi.CallOption) (*User, 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 := &User{ + 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 +} + +type AccountsUsersDeleteCall struct { + s *APIService + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a Merchant Center account user. Executing this method +// requires admin access. +// +// - name: The name of the user to delete. Format: +// `accounts/{account}/users/{email}` It is also possible to delete the user +// corresponding to the caller by using `me` rather than an email address as +// in `accounts/{account}/users/me`. +func (r *AccountsUsersService) Delete(name string) *AccountsUsersDeleteCall { + c := &AccountsUsersDeleteCall{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 +// details. +func (c *AccountsUsersDeleteCall) Fields(s ...googleapi.Field) *AccountsUsersDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsUsersDeleteCall) Context(ctx context.Context) *AccountsUsersDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsUsersDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsUsersDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+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 "merchantapi.accounts.users.delete" call. +// 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 *AccountsUsersDeleteCall) 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 +} + +type AccountsUsersGetCall struct { + s *APIService + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Retrieves a Merchant Center account user. +// +// - name: The name of the user to retrieve. Format: +// `accounts/{account}/users/{email}` It is also possible to retrieve the +// user corresponding to the caller by using `me` rather than an email +// address as in `accounts/{account}/users/me`. +func (r *AccountsUsersService) Get(name string) *AccountsUsersGetCall { + c := &AccountsUsersGetCall{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 +// details. +func (c *AccountsUsersGetCall) Fields(s ...googleapi.Field) *AccountsUsersGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsUsersGetCall) IfNoneMatch(entityTag string) *AccountsUsersGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsUsersGetCall) Context(ctx context.Context) *AccountsUsersGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsUsersGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsUsersGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "accounts/v1beta/{+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 "merchantapi.accounts.users.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *User.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 *AccountsUsersGetCall) Do(opts ...googleapi.CallOption) (*User, 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 := &User{ + 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 +} + +type AccountsUsersGetEmailPreferencesCall struct { + s *APIService + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// GetEmailPreferences: Returns the email preferences for a Merchant Center +// account user. Use the name=accounts/*/users/me/emailPreferences alias to get +// preferences for the authenticated user. +// +// - name: The name of the `EmailPreferences` resource. Format: +// `accounts/{account}/users/{email}/emailPreferences`. +func (r *AccountsUsersService) GetEmailPreferences(name string) *AccountsUsersGetEmailPreferencesCall { + c := &AccountsUsersGetEmailPreferencesCall{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 +// details. +func (c *AccountsUsersGetEmailPreferencesCall) Fields(s ...googleapi.Field) *AccountsUsersGetEmailPreferencesCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsUsersGetEmailPreferencesCall) IfNoneMatch(entityTag string) *AccountsUsersGetEmailPreferencesCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsUsersGetEmailPreferencesCall) Context(ctx context.Context) *AccountsUsersGetEmailPreferencesCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsUsersGetEmailPreferencesCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsUsersGetEmailPreferencesCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "accounts/v1beta/{+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 "merchantapi.accounts.users.getEmailPreferences" call. +// Any non-2xx status code is an error. Response headers are in either +// *EmailPreferences.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 *AccountsUsersGetEmailPreferencesCall) Do(opts ...googleapi.CallOption) (*EmailPreferences, 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 := &EmailPreferences{ + 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 +} + +type AccountsUsersListCall struct { + s *APIService + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists all users of a Merchant Center account. +// +// - parent: The parent, which owns this collection of users. Format: +// `accounts/{account}`. +func (r *AccountsUsersService) List(parent string) *AccountsUsersListCall { + c := &AccountsUsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number of users +// to return. The service may return fewer than this value. If unspecified, at +// most 50 users will be returned. The maximum value is 100; values above 100 +// will be coerced to 100 +func (c *AccountsUsersListCall) PageSize(pageSize int64) *AccountsUsersListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, received +// from a previous `ListUsers` call. Provide this to retrieve the subsequent +// page. When paginating, all other parameters provided to `ListUsers` must +// match the call that provided the page token. +func (c *AccountsUsersListCall) PageToken(pageToken string) *AccountsUsersListCall { + 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 +// details. +func (c *AccountsUsersListCall) Fields(s ...googleapi.Field) *AccountsUsersListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsUsersListCall) IfNoneMatch(entityTag string) *AccountsUsersListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsUsersListCall) Context(ctx context.Context) *AccountsUsersListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsUsersListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsUsersListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "accounts/v1beta/{+parent}/users") + 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 "merchantapi.accounts.users.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *ListUsersResponse.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 *AccountsUsersListCall) Do(opts ...googleapi.CallOption) (*ListUsersResponse, 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 := &ListUsersResponse{ + 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 +} + +// 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 *AccountsUsersListCall) Pages(ctx context.Context, f func(*ListUsersResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + 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) + } +} + +type AccountsUsersPatchCall struct { + s *APIService + name string + user *User + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates a Merchant Center account user. Executing this method +// requires admin access. +// +// - name: Identifier. The resource name of the user. Format: +// `accounts/{account}/user/{email}` Use `me` to refer to your own email +// address, for example `accounts/{account}/users/me`. +func (r *AccountsUsersService) Patch(name string, user *User) *AccountsUsersPatchCall { + c := &AccountsUsersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.user = user + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. List of +// fields being updated. +func (c *AccountsUsersPatchCall) UpdateMask(updateMask string) *AccountsUsersPatchCall { + 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 +// details. +func (c *AccountsUsersPatchCall) Fields(s ...googleapi.Field) *AccountsUsersPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsUsersPatchCall) Context(ctx context.Context) *AccountsUsersPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsUsersPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsUsersPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+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 "merchantapi.accounts.users.patch" call. +// Any non-2xx status code is an error. Response headers are in either +// *User.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 *AccountsUsersPatchCall) Do(opts ...googleapi.CallOption) (*User, 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 := &User{ + 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 +} + +type AccountsUsersUpdateEmailPreferencesCall struct { + s *APIService + name string + emailpreferences *EmailPreferences + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// UpdateEmailPreferences: Updates the email preferences for a Merchant Center +// account user. MCA users should specify the MCA account rather than a +// sub-account of the MCA. Preferences which are not explicitly selected in the +// update mask will not be updated. It is invalid for updates to specify an +// UNCONFIRMED opt-in status value. Use the +// name=accounts/*/users/me/emailPreferences alias to update preferences for +// the authenticated user. +// +// - name: Identifier. The name of the EmailPreferences. The endpoint is only +// supported for the authenticated user. +func (r *AccountsUsersService) UpdateEmailPreferences(name string, emailpreferences *EmailPreferences) *AccountsUsersUpdateEmailPreferencesCall { + c := &AccountsUsersUpdateEmailPreferencesCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.emailpreferences = emailpreferences + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. List of +// fields being updated. +func (c *AccountsUsersUpdateEmailPreferencesCall) UpdateMask(updateMask string) *AccountsUsersUpdateEmailPreferencesCall { + 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 +// details. +func (c *AccountsUsersUpdateEmailPreferencesCall) Fields(s ...googleapi.Field) *AccountsUsersUpdateEmailPreferencesCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsUsersUpdateEmailPreferencesCall) Context(ctx context.Context) *AccountsUsersUpdateEmailPreferencesCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsUsersUpdateEmailPreferencesCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsUsersUpdateEmailPreferencesCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.emailpreferences) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1beta/{+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 "merchantapi.accounts.users.updateEmailPreferences" call. +// Any non-2xx status code is an error. Response headers are in either +// *EmailPreferences.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 *AccountsUsersUpdateEmailPreferencesCall) Do(opts ...googleapi.CallOption) (*EmailPreferences, 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 := &EmailPreferences{ + 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 +} + +type TermsOfServiceAcceptCall struct { + s *APIService + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Accept: Accepts a `TermsOfService`. Executing this method requires admin +// access. +// +// - name: The resource name of the terms of service version. Format: +// `termsOfService/{version}`. +func (r *TermsOfServiceService) Accept(name string) *TermsOfServiceAcceptCall { + c := &TermsOfServiceAcceptCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Account sets the optional parameter "account": Required. The account for +// which to accept the ToS. +func (c *TermsOfServiceAcceptCall) Account(account string) *TermsOfServiceAcceptCall { + c.urlParams_.Set("account", account) + return c +} + +// RegionCode sets the optional parameter "regionCode": Required. Region code +// as defined by CLDR (https://cldr.unicode.org/). This is either a country +// when the ToS applies specifically to that country or 001 when it applies +// globally. +func (c *TermsOfServiceAcceptCall) RegionCode(regionCode string) *TermsOfServiceAcceptCall { + c.urlParams_.Set("regionCode", regionCode) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *TermsOfServiceAcceptCall) Fields(s ...googleapi.Field) *TermsOfServiceAcceptCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *TermsOfServiceAcceptCall) IfNoneMatch(entityTag string) *TermsOfServiceAcceptCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *TermsOfServiceAcceptCall) Context(ctx context.Context) *TermsOfServiceAcceptCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *TermsOfServiceAcceptCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *TermsOfServiceAcceptCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "accounts/v1beta/{+name}:accept") + 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 "merchantapi.termsOfService.accept" call. +// 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 *TermsOfServiceAcceptCall) 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 +} + +type TermsOfServiceGetCall struct { + s *APIService + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Retrieves the `TermsOfService` associated with the provided version. +// +// - name: The resource name of the terms of service version. Format: +// `termsOfService/{version}`. +func (r *TermsOfServiceService) Get(name string) *TermsOfServiceGetCall { + c := &TermsOfServiceGetCall{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 +// details. +func (c *TermsOfServiceGetCall) Fields(s ...googleapi.Field) *TermsOfServiceGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *TermsOfServiceGetCall) IfNoneMatch(entityTag string) *TermsOfServiceGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *TermsOfServiceGetCall) Context(ctx context.Context) *TermsOfServiceGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *TermsOfServiceGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *TermsOfServiceGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "accounts/v1beta/{+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 "merchantapi.termsOfService.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *TermsOfService.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 *TermsOfServiceGetCall) Do(opts ...googleapi.CallOption) (*TermsOfService, 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 := &TermsOfService{ + 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 +} + +type TermsOfServiceRetrieveLatestCall struct { + s *APIService + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// RetrieveLatest: Retrieves the latest version of the `TermsOfService` for a +// given `kind` and `region_code`. +func (r *TermsOfServiceService) RetrieveLatest() *TermsOfServiceRetrieveLatestCall { + c := &TermsOfServiceRetrieveLatestCall{s: r.s, urlParams_: make(gensupport.URLParams)} + return c +} + +// Kind sets the optional parameter "kind": The Kind this terms of service +// version applies to. +// +// Possible values: +// +// "TERMS_OF_SERVICE_KIND_UNSPECIFIED" - Default value. This value is unused. +// "MERCHANT_CENTER" - Merchant Center application. +func (c *TermsOfServiceRetrieveLatestCall) Kind(kind string) *TermsOfServiceRetrieveLatestCall { + c.urlParams_.Set("kind", kind) + return c +} + +// RegionCode sets the optional parameter "regionCode": Region code as defined +// by CLDR (https://cldr.unicode.org/). This is either a country when the ToS +// applies specifically to that country or 001 when it applies globally. +func (c *TermsOfServiceRetrieveLatestCall) RegionCode(regionCode string) *TermsOfServiceRetrieveLatestCall { + c.urlParams_.Set("regionCode", regionCode) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *TermsOfServiceRetrieveLatestCall) Fields(s ...googleapi.Field) *TermsOfServiceRetrieveLatestCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *TermsOfServiceRetrieveLatestCall) IfNoneMatch(entityTag string) *TermsOfServiceRetrieveLatestCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *TermsOfServiceRetrieveLatestCall) Context(ctx context.Context) *TermsOfServiceRetrieveLatestCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *TermsOfServiceRetrieveLatestCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *TermsOfServiceRetrieveLatestCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "accounts/v1beta/termsOfService:retrieveLatest") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.termsOfService.retrieveLatest" call. +// Any non-2xx status code is an error. Response headers are in either +// *TermsOfService.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 *TermsOfServiceRetrieveLatestCall) Do(opts ...googleapi.CallOption) (*TermsOfService, 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 := &TermsOfService{ + 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 +} diff --git a/merchantapi/conversions_v1beta/merchantapi-api.json b/merchantapi/conversions_v1beta/merchantapi-api.json new file mode 100644 index 00000000000..9829deae998 --- /dev/null +++ b/merchantapi/conversions_v1beta/merchantapi-api.json @@ -0,0 +1,628 @@ +{ + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/content": { + "description": "Manage your product listings and accounts for Google Shopping" + } + } + } + }, + "basePath": "", + "baseUrl": "https://merchantapi.googleapis.com/", + "batchPath": "batch", + "canonicalName": "Merchant", + "description": "Programmatically manage your Merchant Center Accounts.", + "discoveryVersion": "v1", + "documentationLink": "https://developers.devsite.corp.google.com/merchant/api", + "fullyEncodeReservedExpansion": true, + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "id": "merchantapi:conversions_v1beta", + "kind": "discovery#restDescription", + "mtlsRootUrl": "https://merchantapi.mtls.googleapis.com/", + "name": "merchantapi", + "ownerDomain": "google.com", + "ownerName": "Google", + "parameters": { + "$.xgafv": { + "description": "V1 error format.", + "enum": [ + "1", + "2" + ], + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "type": "string" + }, + "access_token": { + "description": "OAuth access token.", + "location": "query", + "type": "string" + }, + "alt": { + "default": "json", + "description": "Data format for response.", + "enum": [ + "json", + "media", + "proto" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query", + "type": "string" + }, + "callback": { + "description": "JSONP", + "location": "query", + "type": "string" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "location": "query", + "type": "string" + }, + "key": { + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query", + "type": "string" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "location": "query", + "type": "string" + }, + "prettyPrint": { + "default": "true", + "description": "Returns response with indentations and line breaks.", + "location": "query", + "type": "boolean" + }, + "quotaUser": { + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query", + "type": "string" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query", + "type": "string" + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query", + "type": "string" + } + }, + "protocol": "rest", + "resources": { + "accounts": { + "resources": { + "conversionSources": { + "methods": { + "create": { + "description": "Creates a new conversion source.", + "flatPath": "conversions/v1beta/accounts/{accountsId}/conversionSources", + "httpMethod": "POST", + "id": "merchantapi.accounts.conversionSources.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The merchant account that will own the new conversion source. Format: accounts/{account}", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "conversions/v1beta/{+parent}/conversionSources", + "request": { + "$ref": "ConversionSource" + }, + "response": { + "$ref": "ConversionSource" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "delete": { + "description": "Archives an existing conversion source. If the conversion source is a Merchant Center Destination, it will be recoverable for 30 days. If the conversion source is a Google Analytics Link, it will be deleted immediately and can be restored by creating a new one.", + "flatPath": "conversions/v1beta/accounts/{accountsId}/conversionSources/{conversionSourcesId}", + "httpMethod": "DELETE", + "id": "merchantapi.accounts.conversionSources.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the conversion source to be deleted. Format: accounts/{account}/conversionSources/{conversion_source}", + "location": "path", + "pattern": "^accounts/[^/]+/conversionSources/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "conversions/v1beta/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "get": { + "description": "Fetches a conversion source.", + "flatPath": "conversions/v1beta/accounts/{accountsId}/conversionSources/{conversionSourcesId}", + "httpMethod": "GET", + "id": "merchantapi.accounts.conversionSources.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the conversion source to be fetched. Format: accounts/{account}/conversionsources/{conversion_source}", + "location": "path", + "pattern": "^accounts/[^/]+/conversionSources/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "conversions/v1beta/{+name}", + "response": { + "$ref": "ConversionSource" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "description": "Retrieves the list of conversion sources the caller has access to.", + "flatPath": "conversions/v1beta/accounts/{accountsId}/conversionSources", + "httpMethod": "GET", + "id": "merchantapi.accounts.conversionSources.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of conversion sources to return in a page. If no `page_size` is specified, `100` is used as the default value. The maximum value is `200`. Values above `200` will be coerced to `200`. Regardless of pagination, at most `200` conversion sources are returned in total.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. Page token.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The merchant account who owns the collection of conversion sources. Format: accounts/{account}", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + }, + "showDeleted": { + "description": "Optional. Show deleted (archived) option.", + "location": "query", + "type": "boolean" + } + }, + "path": "conversions/v1beta/{+parent}/conversionSources", + "response": { + "$ref": "ListConversionSourcesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "patch": { + "description": "Updates information of an existing conversion source. Available only for Merchant Center Destination conversion sources.", + "flatPath": "conversions/v1beta/accounts/{accountsId}/conversionSources/{conversionSourcesId}", + "httpMethod": "PATCH", + "id": "merchantapi.accounts.conversionSources.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Output only. Identifier. Generated by the Content API upon creation of a new `ConversionSource`. Format: [a-z]{4}:.+ The four characters before the colon represent the type of conversio source. Content after the colon represents the ID of the conversion source within that type. The ID of two different conversion sources might be the same across different types. The following type prefixes are supported: - galk: For GoogleAnalyticsLink sources. - mcdn: For MerchantCenterDestination sources.", + "location": "path", + "pattern": "^accounts/[^/]+/conversionSources/[^/]+$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Required. List of fields being updated.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "conversions/v1beta/{+name}", + "request": { + "$ref": "ConversionSource" + }, + "response": { + "$ref": "ConversionSource" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "undelete": { + "description": "Re-enables an archived conversion source. Only Available for Merchant Center Destination conversion sources.", + "flatPath": "conversions/v1beta/accounts/{accountsId}/conversionSources/{conversionSourcesId}:undelete", + "httpMethod": "POST", + "id": "merchantapi.accounts.conversionSources.undelete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the conversion source to be undeleted. Format: accounts/{account}/conversionSources/{conversion_source}", + "location": "path", + "pattern": "^accounts/[^/]+/conversionSources/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "conversions/v1beta/{+name}:undelete", + "request": { + "$ref": "UndeleteConversionSourceRequest" + }, + "response": { + "$ref": "ConversionSource" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + } + } + } + }, + "revision": "20240613", + "rootUrl": "https://merchantapi.googleapis.com/", + "schemas": { + "AttributionSettings": { + "description": "Represents attribution settings for conversion sources receiving pre-attribution data.", + "id": "AttributionSettings", + "properties": { + "attributionLookbackWindowDays": { + "description": "Required. Lookback windows (in days) used for attribution in this source. Supported values are 7, 30, 40.", + "format": "int32", + "type": "integer" + }, + "attributionModel": { + "description": "Required. Attribution model.", + "enum": [ + "ATTRIBUTION_MODEL_UNSPECIFIED", + "CROSS_CHANNEL_LAST_CLICK", + "ADS_PREFERRED_LAST_CLICK", + "CROSS_CHANNEL_DATA_DRIVEN", + "CROSS_CHANNEL_FIRST_CLICK", + "CROSS_CHANNEL_LINEAR", + "CROSS_CHANNEL_POSITION_BASED", + "CROSS_CHANNEL_TIME_DECAY" + ], + "enumDescriptions": [ + "Unspecified model.", + "Cross-channel Last Click model.", + "Ads-preferred Last Click model.", + "Cross-channel Data Driven model.", + "Cross-channel First Click model.", + "Cross-channel Linear model.", + "Cross-channel Position Based model.", + "Cross-channel Time Decay model." + ], + "type": "string" + }, + "conversionType": { + "description": "Immutable. Unordered list. List of different conversion types a conversion event can be classified as. A standard \"purchase\" type will be automatically created if this list is empty at creation time.", + "items": { + "$ref": "ConversionType" + }, + "type": "array" + } + }, + "type": "object" + }, + "ConversionSource": { + "description": "Represents a conversion source owned by a Merchant account. A merchant account can have up to 200 conversion sources.", + "id": "ConversionSource", + "properties": { + "controller": { + "description": "Output only. Controller of the conversion source.", + "enum": [ + "CONTROLLER_UNSPECIFIED", + "MERCHANT", + "YOUTUBE_AFFILIATES" + ], + "enumDescriptions": [ + "Default value. This value is unused.", + "Controlled by the Merchant who owns the Conversion Source.", + "Controlled by the YT Affiliates program." + ], + "readOnly": true, + "type": "string" + }, + "expireTime": { + "description": "Output only. The time when an archived conversion source becomes permanently deleted and is no longer available to undelete.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "googleAnalyticsLink": { + "$ref": "GoogleAnalyticsLink", + "description": "Immutable. Conversion Source of type \"Link to Google Analytics Property\"." + }, + "merchantCenterDestination": { + "$ref": "MerchantCenterDestination", + "description": "Conversion Source of type \"Merchant Center Tag Destination\"." + }, + "name": { + "description": "Output only. Identifier. Generated by the Content API upon creation of a new `ConversionSource`. Format: [a-z]{4}:.+ The four characters before the colon represent the type of conversio source. Content after the colon represents the ID of the conversion source within that type. The ID of two different conversion sources might be the same across different types. The following type prefixes are supported: - galk: For GoogleAnalyticsLink sources. - mcdn: For MerchantCenterDestination sources.", + "readOnly": true, + "type": "string" + }, + "state": { + "description": "Output only. Current state of this conversion source. Can't be edited through the API.", + "enum": [ + "STATE_UNSPECIFIED", + "ACTIVE", + "ARCHIVED", + "PENDING" + ], + "enumDescriptions": [ + "Conversion source has unspecified state.", + "Conversion source is fully functional.", + "Conversion source has been archived in the last 30 days and not currently functional. Can be restored using the undelete method.", + "Conversion source creation has started but not fully finished yet." + ], + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "ConversionType": { + "description": "Message representing a types of conversion events", + "id": "ConversionType", + "properties": { + "name": { + "description": "Output only. Conversion event name, as it'll be reported by the client.", + "readOnly": true, + "type": "string" + }, + "report": { + "description": "Output only. Option indicating if the type should be included in Merchant Center reporting.", + "readOnly": true, + "type": "boolean" + } + }, + "type": "object" + }, + "Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }", + "id": "Empty", + "properties": {}, + "type": "object" + }, + "GoogleAnalyticsLink": { + "description": "\"Google Analytics Link\" sources can be used to get conversion data from an existing Google Analytics property into the linked Merchant Center account.", + "id": "GoogleAnalyticsLink", + "properties": { + "attributionSettings": { + "$ref": "AttributionSettings", + "description": "Output only. Attribution settings for the linked Google Analytics property.", + "readOnly": true + }, + "property": { + "description": "Output only. Name of the Google Analytics property the merchant is linked to.", + "readOnly": true, + "type": "string" + }, + "propertyId": { + "description": "Required. Immutable. ID of the Google Analytics property the merchant is linked to.", + "format": "int64", + "type": "string" + } + }, + "type": "object" + }, + "ListConversionSourcesResponse": { + "description": "Response message for the ListConversionSources method.", + "id": "ListConversionSourcesResponse", + "properties": { + "conversionSources": { + "description": "List of conversion sources.", + "items": { + "$ref": "ConversionSource" + }, + "type": "array" + }, + "nextPageToken": { + "description": "Token to be used to fetch the next results page.", + "type": "string" + } + }, + "type": "object" + }, + "MerchantCenterDestination": { + "description": "\"Merchant Center Destination\" sources can be used to send conversion events from an online store using a Google tag directly to a Merchant Center account where the source is created.", + "id": "MerchantCenterDestination", + "properties": { + "attributionSettings": { + "$ref": "AttributionSettings", + "description": "Required. Attribution settings being used for the Merchant Center Destination." + }, + "currencyCode": { + "description": "Required. Three-letter currency code (ISO 4217). The currency code defines in which currency the conversions sent to this destination will be reported in Merchant Center.", + "type": "string" + }, + "destination": { + "description": "Output only. Merchant Center Destination ID.", + "readOnly": true, + "type": "string" + }, + "displayName": { + "description": "Required. Merchant-specified display name for the destination. This is the name that identifies the conversion source within the Merchant Center UI. Limited to 64 characters.", + "type": "string" + } + }, + "type": "object" + }, + "ProductChange": { + "description": "The change that happened to the product including old value, new value, country code as the region code and reporting context.", + "id": "ProductChange", + "properties": { + "newValue": { + "description": "The new value of the changed resource or attribute.", + "type": "string" + }, + "oldValue": { + "description": "The old value of the changed resource or attribute.", + "type": "string" + }, + "regionCode": { + "description": "Countries that have the change (if applicable)", + "type": "string" + }, + "reportingContext": { + "description": "Reporting contexts that have the change (if applicable)", + "enum": [ + "REPORTING_CONTEXT_ENUM_UNSPECIFIED", + "SHOPPING_ADS", + "DISCOVERY_ADS", + "DEMAND_GEN_ADS", + "DEMAND_GEN_ADS_DISCOVER_SURFACE", + "VIDEO_ADS", + "DISPLAY_ADS", + "LOCAL_INVENTORY_ADS", + "VEHICLE_INVENTORY_ADS", + "FREE_LISTINGS", + "FREE_LOCAL_LISTINGS", + "FREE_LOCAL_VEHICLE_LISTINGS", + "YOUTUBE_SHOPPING", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL" + ], + "enumDeprecated": [ + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false + ], + "enumDescriptions": [ + "Not specified.", + "[Shopping ads](https://support.google.com/merchants/answer/6149970).", + "Deprecated: Use `DEMAND_GEN_ADS` instead. [Discovery and Demand Gen ads](https://support.google.com/merchants/answer/13389785).", + "[Demand Gen ads](https://support.google.com/merchants/answer/13389785).", + "[Demand Gen ads on Discover surface](https://support.google.com/merchants/answer/13389785).", + "[Video ads](https://support.google.com/google-ads/answer/6340491).", + "[Display ads](https://support.google.com/merchants/answer/6069387).", + "[Local inventory ads](https://support.google.com/merchants/answer/3271956).", + "[Vehicle inventory ads](https://support.google.com/merchants/answer/11544533).", + "[Free product listings](https://support.google.com/merchants/answer/9199328).", + "[Free local product listings](https://support.google.com/merchants/answer/9825611).", + "[Free local vehicle listings](https://support.google.com/merchants/answer/11544533).", + "[YouTube Shopping](https://support.google.com/merchants/answer/13478370).", + "[Cloud retail](https://cloud.google.com/solutions/retail).", + "[Local cloud retail](https://cloud.google.com/solutions/retail)." + ], + "type": "string" + } + }, + "type": "object" + }, + "ProductStatusChangeMessage": { + "description": "The message that the merchant will receive to notify about product status change event", + "id": "ProductStatusChangeMessage", + "properties": { + "account": { + "description": "The target account that owns the entity that changed. Format : `accounts/{merchant_id}`", + "type": "string" + }, + "attribute": { + "description": "The attribute in the resource that changed, in this case it will be always `Status`.", + "enum": [ + "ATTRIBUTE_UNSPECIFIED", + "STATUS" + ], + "enumDescriptions": [ + "Unspecified attribute", + "Status of the changed entity" + ], + "type": "string" + }, + "changes": { + "description": "A message to describe the change that happened to the product", + "items": { + "$ref": "ProductChange" + }, + "type": "array" + }, + "managingAccount": { + "description": "The account that manages the merchant's account. can be the same as merchant id if it is standalone account. Format : `accounts/{service_provider_id}`", + "type": "string" + }, + "resource": { + "description": "The product name. Format: `{product.name=accounts/{account}/products/{product}}`", + "type": "string" + }, + "resourceId": { + "description": "The product id.", + "type": "string" + }, + "resourceType": { + "description": "The resource that changed, in this case it will always be `Product`.", + "enum": [ + "RESOURCE_UNSPECIFIED", + "PRODUCT" + ], + "enumDescriptions": [ + "Unspecified resource", + "Resource type : product" + ], + "type": "string" + } + }, + "type": "object" + }, + "UndeleteConversionSourceRequest": { + "description": "Request message for the UndeleteConversionSource method.", + "id": "UndeleteConversionSourceRequest", + "properties": {}, + "type": "object" + } + }, + "servicePath": "", + "title": "Merchant API", + "version": "conversions_v1beta", + "version_module": true +} \ No newline at end of file diff --git a/merchantapi/conversions_v1beta/merchantapi-gen.go b/merchantapi/conversions_v1beta/merchantapi-gen.go new file mode 100644 index 00000000000..0fb3b72ddab --- /dev/null +++ b/merchantapi/conversions_v1beta/merchantapi-gen.go @@ -0,0 +1,1202 @@ +// Copyright 2024 Google LLC. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Code generated file. DO NOT EDIT. + +// Package merchantapi provides access to the Merchant API. +// +// For product documentation, see: https://developers.devsite.corp.google.com/merchant/api +// +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// +// # Creating a client +// +// Usage example: +// +// import "google.golang.org/api/merchantapi/conversions_v1beta" +// ... +// ctx := context.Background() +// merchantapiService, err := merchantapi.NewService(ctx) +// +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// +// # Other authentication options +// +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: +// +// merchantapiService, err := merchantapi.NewService(ctx, option.WithAPIKey("AIza...")) +// +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: +// +// config := &oauth2.Config{...} +// // ... +// token, err := config.Exchange(ctx, ...) +// merchantapiService, err := merchantapi.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) +// +// See [google.golang.org/api/option.ClientOption] for details on options. +package merchantapi // import "google.golang.org/api/merchantapi/conversions_v1beta" + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strconv" + "strings" + + googleapi "google.golang.org/api/googleapi" + internal "google.golang.org/api/internal" + gensupport "google.golang.org/api/internal/gensupport" + option "google.golang.org/api/option" + internaloption "google.golang.org/api/option/internaloption" + htransport "google.golang.org/api/transport/http" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = gensupport.MarshalJSON +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = context.Canceled +var _ = internaloption.WithDefaultEndpoint +var _ = internal.Version + +const apiId = "merchantapi:conversions_v1beta" +const apiName = "merchantapi" +const apiVersion = "conversions_v1beta" +const basePath = "https://merchantapi.googleapis.com/" +const basePathTemplate = "https://merchantapi.UNIVERSE_DOMAIN/" +const mtlsBasePath = "https://merchantapi.mtls.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // Manage your product listings and accounts for Google Shopping + ContentScope = "https://www.googleapis.com/auth/content" +) + +// NewService creates a new Service. +func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { + scopesOption := internaloption.WithDefaultScopes( + "https://www.googleapis.com/auth/content", + ) + // NOTE: prepend, so we don't override user-specified scopes. + opts = append([]option.ClientOption{scopesOption}, opts...) + opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) + opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) + opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) + opts = append(opts, internaloption.EnableNewAuthLibrary()) + client, endpoint, err := htransport.NewClient(ctx, opts...) + if err != nil { + return nil, err + } + s, err := New(client) + if err != nil { + return nil, err + } + if endpoint != "" { + s.BasePath = endpoint + } + return s, nil +} + +// New creates a new Service. It uses the provided http.Client for requests. +// +// Deprecated: please use NewService instead. +// To provide a custom HTTP client, use option.WithHTTPClient. +// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Accounts *AccountsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewAccountsService(s *Service) *AccountsService { + rs := &AccountsService{s: s} + rs.ConversionSources = NewAccountsConversionSourcesService(s) + return rs +} + +type AccountsService struct { + s *Service + + ConversionSources *AccountsConversionSourcesService +} + +func NewAccountsConversionSourcesService(s *Service) *AccountsConversionSourcesService { + rs := &AccountsConversionSourcesService{s: s} + return rs +} + +type AccountsConversionSourcesService struct { + s *Service +} + +// AttributionSettings: Represents attribution settings for conversion sources +// receiving pre-attribution data. +type AttributionSettings struct { + // AttributionLookbackWindowDays: Required. Lookback windows (in days) used for + // attribution in this source. Supported values are 7, 30, 40. + AttributionLookbackWindowDays int64 `json:"attributionLookbackWindowDays,omitempty"` + // AttributionModel: Required. Attribution model. + // + // Possible values: + // "ATTRIBUTION_MODEL_UNSPECIFIED" - Unspecified model. + // "CROSS_CHANNEL_LAST_CLICK" - Cross-channel Last Click model. + // "ADS_PREFERRED_LAST_CLICK" - Ads-preferred Last Click model. + // "CROSS_CHANNEL_DATA_DRIVEN" - Cross-channel Data Driven model. + // "CROSS_CHANNEL_FIRST_CLICK" - Cross-channel First Click model. + // "CROSS_CHANNEL_LINEAR" - Cross-channel Linear model. + // "CROSS_CHANNEL_POSITION_BASED" - Cross-channel Position Based model. + // "CROSS_CHANNEL_TIME_DECAY" - Cross-channel Time Decay model. + AttributionModel string `json:"attributionModel,omitempty"` + // ConversionType: Immutable. Unordered list. List of different conversion + // types a conversion event can be classified as. A standard "purchase" type + // will be automatically created if this list is empty at creation time. + ConversionType []*ConversionType `json:"conversionType,omitempty"` + // ForceSendFields is a list of field names (e.g. + // "AttributionLookbackWindowDays") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. See https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields + // for more details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AttributionLookbackWindowDays") + // to include in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *AttributionSettings) MarshalJSON() ([]byte, error) { + type NoMethod AttributionSettings + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ConversionSource: Represents a conversion source owned by a Merchant +// account. A merchant account can have up to 200 conversion sources. +type ConversionSource struct { + // Controller: Output only. Controller of the conversion source. + // + // Possible values: + // "CONTROLLER_UNSPECIFIED" - Default value. This value is unused. + // "MERCHANT" - Controlled by the Merchant who owns the Conversion Source. + // "YOUTUBE_AFFILIATES" - Controlled by the YT Affiliates program. + Controller string `json:"controller,omitempty"` + // ExpireTime: Output only. The time when an archived conversion source becomes + // permanently deleted and is no longer available to undelete. + ExpireTime string `json:"expireTime,omitempty"` + // GoogleAnalyticsLink: Immutable. Conversion Source of type "Link to Google + // Analytics Property". + GoogleAnalyticsLink *GoogleAnalyticsLink `json:"googleAnalyticsLink,omitempty"` + // MerchantCenterDestination: Conversion Source of type "Merchant Center Tag + // Destination". + MerchantCenterDestination *MerchantCenterDestination `json:"merchantCenterDestination,omitempty"` + // Name: Output only. Identifier. Generated by the Content API upon creation of + // a new `ConversionSource`. Format: [a-z]{4}:.+ The four characters before the + // colon represent the type of conversio source. Content after the colon + // represents the ID of the conversion source within that type. The ID of two + // different conversion sources might be the same across different types. The + // following type prefixes are supported: - galk: For GoogleAnalyticsLink + // sources. - mcdn: For MerchantCenterDestination sources. + Name string `json:"name,omitempty"` + // State: Output only. Current state of this conversion source. Can't be edited + // through the API. + // + // Possible values: + // "STATE_UNSPECIFIED" - Conversion source has unspecified state. + // "ACTIVE" - Conversion source is fully functional. + // "ARCHIVED" - Conversion source has been archived in the last 30 days and + // not currently functional. Can be restored using the undelete method. + // "PENDING" - Conversion source creation has started but not fully finished + // yet. + State string `json:"state,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "Controller") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Controller") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ConversionSource) MarshalJSON() ([]byte, error) { + type NoMethod ConversionSource + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ConversionType: Message representing a types of conversion events +type ConversionType struct { + // Name: Output only. Conversion event name, as it'll be reported by the + // client. + Name string `json:"name,omitempty"` + // Report: Output only. Option indicating if the type should be included in + // Merchant Center reporting. + Report bool `json:"report,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. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + 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. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ConversionType) MarshalJSON() ([]byte, error) { + type NoMethod ConversionType + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Empty: A generic empty message that you can re-use to avoid defining +// duplicated empty messages in your APIs. A typical example is to use it as +// the request or the response type of an API method. For instance: service Foo +// { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } +type Empty struct { + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` +} + +// GoogleAnalyticsLink: "Google Analytics Link" sources can be used to get +// conversion data from an existing Google Analytics property into the linked +// Merchant Center account. +type GoogleAnalyticsLink struct { + // AttributionSettings: Output only. Attribution settings for the linked Google + // Analytics property. + AttributionSettings *AttributionSettings `json:"attributionSettings,omitempty"` + // Property: Output only. Name of the Google Analytics property the merchant is + // linked to. + Property string `json:"property,omitempty"` + // PropertyId: Required. Immutable. ID of the Google Analytics property the + // merchant is linked to. + PropertyId int64 `json:"propertyId,omitempty,string"` + // ForceSendFields is a list of field names (e.g. "AttributionSettings") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AttributionSettings") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *GoogleAnalyticsLink) MarshalJSON() ([]byte, error) { + type NoMethod GoogleAnalyticsLink + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ListConversionSourcesResponse: Response message for the +// ListConversionSources method. +type ListConversionSourcesResponse struct { + // ConversionSources: List of conversion sources. + ConversionSources []*ConversionSource `json:"conversionSources,omitempty"` + // NextPageToken: Token to be used to fetch the next results 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. "ConversionSources") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ConversionSources") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ListConversionSourcesResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListConversionSourcesResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// MerchantCenterDestination: "Merchant Center Destination" sources can be used +// to send conversion events from an online store using a Google tag directly +// to a Merchant Center account where the source is created. +type MerchantCenterDestination struct { + // AttributionSettings: Required. Attribution settings being used for the + // Merchant Center Destination. + AttributionSettings *AttributionSettings `json:"attributionSettings,omitempty"` + // CurrencyCode: Required. Three-letter currency code (ISO 4217). The currency + // code defines in which currency the conversions sent to this destination will + // be reported in Merchant Center. + CurrencyCode string `json:"currencyCode,omitempty"` + // Destination: Output only. Merchant Center Destination ID. + Destination string `json:"destination,omitempty"` + // DisplayName: Required. Merchant-specified display name for the destination. + // This is the name that identifies the conversion source within the Merchant + // Center UI. Limited to 64 characters. + DisplayName string `json:"displayName,omitempty"` + // ForceSendFields is a list of field names (e.g. "AttributionSettings") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AttributionSettings") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *MerchantCenterDestination) MarshalJSON() ([]byte, error) { + type NoMethod MerchantCenterDestination + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ProductChange: The change that happened to the product including old value, +// new value, country code as the region code and reporting context. +type ProductChange struct { + // NewValue: The new value of the changed resource or attribute. + NewValue string `json:"newValue,omitempty"` + // OldValue: The old value of the changed resource or attribute. + OldValue string `json:"oldValue,omitempty"` + // RegionCode: Countries that have the change (if applicable) + RegionCode string `json:"regionCode,omitempty"` + // ReportingContext: Reporting contexts that have the change (if applicable) + // + // Possible values: + // "REPORTING_CONTEXT_ENUM_UNSPECIFIED" - Not specified. + // "SHOPPING_ADS" - [Shopping + // ads](https://support.google.com/merchants/answer/6149970). + // "DISCOVERY_ADS" - Deprecated: Use `DEMAND_GEN_ADS` instead. [Discovery and + // Demand Gen ads](https://support.google.com/merchants/answer/13389785). + // "DEMAND_GEN_ADS" - [Demand Gen + // ads](https://support.google.com/merchants/answer/13389785). + // "DEMAND_GEN_ADS_DISCOVER_SURFACE" - [Demand Gen ads on Discover + // surface](https://support.google.com/merchants/answer/13389785). + // "VIDEO_ADS" - [Video + // ads](https://support.google.com/google-ads/answer/6340491). + // "DISPLAY_ADS" - [Display + // ads](https://support.google.com/merchants/answer/6069387). + // "LOCAL_INVENTORY_ADS" - [Local inventory + // ads](https://support.google.com/merchants/answer/3271956). + // "VEHICLE_INVENTORY_ADS" - [Vehicle inventory + // ads](https://support.google.com/merchants/answer/11544533). + // "FREE_LISTINGS" - [Free product + // listings](https://support.google.com/merchants/answer/9199328). + // "FREE_LOCAL_LISTINGS" - [Free local product + // listings](https://support.google.com/merchants/answer/9825611). + // "FREE_LOCAL_VEHICLE_LISTINGS" - [Free local vehicle + // listings](https://support.google.com/merchants/answer/11544533). + // "YOUTUBE_SHOPPING" - [YouTube + // Shopping](https://support.google.com/merchants/answer/13478370). + // "CLOUD_RETAIL" - [Cloud + // retail](https://cloud.google.com/solutions/retail). + // "LOCAL_CLOUD_RETAIL" - [Local cloud + // retail](https://cloud.google.com/solutions/retail). + ReportingContext string `json:"reportingContext,omitempty"` + // ForceSendFields is a list of field names (e.g. "NewValue") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "NewValue") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ProductChange) MarshalJSON() ([]byte, error) { + type NoMethod ProductChange + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ProductStatusChangeMessage: The message that the merchant will receive to +// notify about product status change event +type ProductStatusChangeMessage struct { + // Account: The target account that owns the entity that changed. Format : + // `accounts/{merchant_id}` + Account string `json:"account,omitempty"` + // Attribute: The attribute in the resource that changed, in this case it will + // be always `Status`. + // + // Possible values: + // "ATTRIBUTE_UNSPECIFIED" - Unspecified attribute + // "STATUS" - Status of the changed entity + Attribute string `json:"attribute,omitempty"` + // Changes: A message to describe the change that happened to the product + Changes []*ProductChange `json:"changes,omitempty"` + // ManagingAccount: The account that manages the merchant's account. can be the + // same as merchant id if it is standalone account. Format : + // `accounts/{service_provider_id}` + ManagingAccount string `json:"managingAccount,omitempty"` + // Resource: The product name. Format: + // `{product.name=accounts/{account}/products/{product}}` + Resource string `json:"resource,omitempty"` + // ResourceId: The product id. + ResourceId string `json:"resourceId,omitempty"` + // ResourceType: The resource that changed, in this case it will always be + // `Product`. + // + // Possible values: + // "RESOURCE_UNSPECIFIED" - Unspecified resource + // "PRODUCT" - Resource type : product + ResourceType string `json:"resourceType,omitempty"` + // ForceSendFields is a list of field names (e.g. "Account") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Account") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ProductStatusChangeMessage) MarshalJSON() ([]byte, error) { + type NoMethod ProductStatusChangeMessage + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// UndeleteConversionSourceRequest: Request message for the +// UndeleteConversionSource method. +type UndeleteConversionSourceRequest struct { +} + +type AccountsConversionSourcesCreateCall struct { + s *Service + parent string + conversionsource *ConversionSource + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a new conversion source. +// +// - parent: The merchant account that will own the new conversion source. +// Format: accounts/{account}. +func (r *AccountsConversionSourcesService) Create(parent string, conversionsource *ConversionSource) *AccountsConversionSourcesCreateCall { + c := &AccountsConversionSourcesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.conversionsource = conversionsource + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *AccountsConversionSourcesCreateCall) Fields(s ...googleapi.Field) *AccountsConversionSourcesCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsConversionSourcesCreateCall) Context(ctx context.Context) *AccountsConversionSourcesCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsConversionSourcesCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsConversionSourcesCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionsource) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "conversions/v1beta/{+parent}/conversionSources") + 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 "merchantapi.accounts.conversionSources.create" call. +// Any non-2xx status code is an error. Response headers are in either +// *ConversionSource.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 *AccountsConversionSourcesCreateCall) Do(opts ...googleapi.CallOption) (*ConversionSource, 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 := &ConversionSource{ + 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 +} + +type AccountsConversionSourcesDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Archives an existing conversion source. If the conversion source is +// a Merchant Center Destination, it will be recoverable for 30 days. If the +// conversion source is a Google Analytics Link, it will be deleted immediately +// and can be restored by creating a new one. +// +// - name: The name of the conversion source to be deleted. Format: +// accounts/{account}/conversionSources/{conversion_source}. +func (r *AccountsConversionSourcesService) Delete(name string) *AccountsConversionSourcesDeleteCall { + c := &AccountsConversionSourcesDeleteCall{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 +// details. +func (c *AccountsConversionSourcesDeleteCall) Fields(s ...googleapi.Field) *AccountsConversionSourcesDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsConversionSourcesDeleteCall) Context(ctx context.Context) *AccountsConversionSourcesDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsConversionSourcesDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsConversionSourcesDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "conversions/v1beta/{+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 "merchantapi.accounts.conversionSources.delete" call. +// 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 *AccountsConversionSourcesDeleteCall) 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 +} + +type AccountsConversionSourcesGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Fetches a conversion source. +// +// - name: The name of the conversion source to be fetched. Format: +// accounts/{account}/conversionsources/{conversion_source}. +func (r *AccountsConversionSourcesService) Get(name string) *AccountsConversionSourcesGetCall { + c := &AccountsConversionSourcesGetCall{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 +// details. +func (c *AccountsConversionSourcesGetCall) Fields(s ...googleapi.Field) *AccountsConversionSourcesGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsConversionSourcesGetCall) IfNoneMatch(entityTag string) *AccountsConversionSourcesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsConversionSourcesGetCall) Context(ctx context.Context) *AccountsConversionSourcesGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsConversionSourcesGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsConversionSourcesGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "conversions/v1beta/{+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 "merchantapi.accounts.conversionSources.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *ConversionSource.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 *AccountsConversionSourcesGetCall) Do(opts ...googleapi.CallOption) (*ConversionSource, 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 := &ConversionSource{ + 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 +} + +type AccountsConversionSourcesListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Retrieves the list of conversion sources the caller has access to. +// +// - parent: The merchant account who owns the collection of conversion +// sources. Format: accounts/{account}. +func (r *AccountsConversionSourcesService) List(parent string) *AccountsConversionSourcesListCall { + c := &AccountsConversionSourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number of +// conversion sources to return in a page. If no `page_size` is specified, +// `100` is used as the default value. The maximum value is `200`. Values above +// `200` will be coerced to `200`. Regardless of pagination, at most `200` +// conversion sources are returned in total. +func (c *AccountsConversionSourcesListCall) PageSize(pageSize int64) *AccountsConversionSourcesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": Page token. +func (c *AccountsConversionSourcesListCall) PageToken(pageToken string) *AccountsConversionSourcesListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ShowDeleted sets the optional parameter "showDeleted": Show deleted +// (archived) option. +func (c *AccountsConversionSourcesListCall) ShowDeleted(showDeleted bool) *AccountsConversionSourcesListCall { + c.urlParams_.Set("showDeleted", fmt.Sprint(showDeleted)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *AccountsConversionSourcesListCall) Fields(s ...googleapi.Field) *AccountsConversionSourcesListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsConversionSourcesListCall) IfNoneMatch(entityTag string) *AccountsConversionSourcesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsConversionSourcesListCall) Context(ctx context.Context) *AccountsConversionSourcesListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsConversionSourcesListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsConversionSourcesListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "conversions/v1beta/{+parent}/conversionSources") + 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 "merchantapi.accounts.conversionSources.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *ListConversionSourcesResponse.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 *AccountsConversionSourcesListCall) Do(opts ...googleapi.CallOption) (*ListConversionSourcesResponse, 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 := &ListConversionSourcesResponse{ + 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 +} + +// 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 *AccountsConversionSourcesListCall) Pages(ctx context.Context, f func(*ListConversionSourcesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + 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) + } +} + +type AccountsConversionSourcesPatchCall struct { + s *Service + name string + conversionsource *ConversionSource + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates information of an existing conversion source. Available only +// for Merchant Center Destination conversion sources. +// +// - name: Output only. Identifier. Generated by the Content API upon creation +// of a new `ConversionSource`. Format: [a-z]{4}:.+ The four characters +// before the colon represent the type of conversio source. Content after the +// colon represents the ID of the conversion source within that type. The ID +// of two different conversion sources might be the same across different +// types. The following type prefixes are supported: - galk: For +// GoogleAnalyticsLink sources. - mcdn: For MerchantCenterDestination +// sources. +func (r *AccountsConversionSourcesService) Patch(name string, conversionsource *ConversionSource) *AccountsConversionSourcesPatchCall { + c := &AccountsConversionSourcesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.conversionsource = conversionsource + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. List of +// fields being updated. +func (c *AccountsConversionSourcesPatchCall) UpdateMask(updateMask string) *AccountsConversionSourcesPatchCall { + 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 +// details. +func (c *AccountsConversionSourcesPatchCall) Fields(s ...googleapi.Field) *AccountsConversionSourcesPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsConversionSourcesPatchCall) Context(ctx context.Context) *AccountsConversionSourcesPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsConversionSourcesPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsConversionSourcesPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionsource) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "conversions/v1beta/{+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 "merchantapi.accounts.conversionSources.patch" call. +// Any non-2xx status code is an error. Response headers are in either +// *ConversionSource.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 *AccountsConversionSourcesPatchCall) Do(opts ...googleapi.CallOption) (*ConversionSource, 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 := &ConversionSource{ + 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 +} + +type AccountsConversionSourcesUndeleteCall struct { + s *Service + name string + undeleteconversionsourcerequest *UndeleteConversionSourceRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Undelete: Re-enables an archived conversion source. Only Available for +// Merchant Center Destination conversion sources. +// +// - name: The name of the conversion source to be undeleted. Format: +// accounts/{account}/conversionSources/{conversion_source}. +func (r *AccountsConversionSourcesService) Undelete(name string, undeleteconversionsourcerequest *UndeleteConversionSourceRequest) *AccountsConversionSourcesUndeleteCall { + c := &AccountsConversionSourcesUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.undeleteconversionsourcerequest = undeleteconversionsourcerequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *AccountsConversionSourcesUndeleteCall) Fields(s ...googleapi.Field) *AccountsConversionSourcesUndeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsConversionSourcesUndeleteCall) Context(ctx context.Context) *AccountsConversionSourcesUndeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsConversionSourcesUndeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsConversionSourcesUndeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeleteconversionsourcerequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "conversions/v1beta/{+name}:undelete") + 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 "merchantapi.accounts.conversionSources.undelete" call. +// Any non-2xx status code is an error. Response headers are in either +// *ConversionSource.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 *AccountsConversionSourcesUndeleteCall) Do(opts ...googleapi.CallOption) (*ConversionSource, 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 := &ConversionSource{ + 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 +} diff --git a/merchantapi/datasources_v1beta/merchantapi-api.json b/merchantapi/datasources_v1beta/merchantapi-api.json new file mode 100644 index 00000000000..1f046b94202 --- /dev/null +++ b/merchantapi/datasources_v1beta/merchantapi-api.json @@ -0,0 +1,756 @@ +{ + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/content": { + "description": "Manage your product listings and accounts for Google Shopping" + } + } + } + }, + "basePath": "", + "baseUrl": "https://merchantapi.googleapis.com/", + "batchPath": "batch", + "canonicalName": "Merchant", + "description": "Programmatically manage your Merchant Center Accounts.", + "discoveryVersion": "v1", + "documentationLink": "https://developers.devsite.corp.google.com/merchant/api", + "fullyEncodeReservedExpansion": true, + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "id": "merchantapi:datasources_v1beta", + "kind": "discovery#restDescription", + "mtlsRootUrl": "https://merchantapi.mtls.googleapis.com/", + "name": "merchantapi", + "ownerDomain": "google.com", + "ownerName": "Google", + "parameters": { + "$.xgafv": { + "description": "V1 error format.", + "enum": [ + "1", + "2" + ], + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "type": "string" + }, + "access_token": { + "description": "OAuth access token.", + "location": "query", + "type": "string" + }, + "alt": { + "default": "json", + "description": "Data format for response.", + "enum": [ + "json", + "media", + "proto" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query", + "type": "string" + }, + "callback": { + "description": "JSONP", + "location": "query", + "type": "string" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "location": "query", + "type": "string" + }, + "key": { + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query", + "type": "string" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "location": "query", + "type": "string" + }, + "prettyPrint": { + "default": "true", + "description": "Returns response with indentations and line breaks.", + "location": "query", + "type": "boolean" + }, + "quotaUser": { + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query", + "type": "string" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query", + "type": "string" + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query", + "type": "string" + } + }, + "protocol": "rest", + "resources": { + "accounts": { + "resources": { + "dataSources": { + "methods": { + "create": { + "description": "Creates the new data source configuration for the given account.", + "flatPath": "datasources/v1beta/accounts/{accountsId}/dataSources", + "httpMethod": "POST", + "id": "merchantapi.accounts.dataSources.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The account where this data source will be created. Format: `accounts/{account}`", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "datasources/v1beta/{+parent}/dataSources", + "request": { + "$ref": "DataSource" + }, + "response": { + "$ref": "DataSource" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "delete": { + "description": "Deletes a data source from your Merchant Center account.", + "flatPath": "datasources/v1beta/accounts/{accountsId}/dataSources/{dataSourcesId}", + "httpMethod": "DELETE", + "id": "merchantapi.accounts.dataSources.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the data source to delete. Format: `accounts/{account}/dataSources/{datasource}`", + "location": "path", + "pattern": "^accounts/[^/]+/dataSources/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "datasources/v1beta/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "fetch": { + "description": "Performs the data fetch immediately (even outside fetch schedule) on a data source from your Merchant Center Account. If you need to call this method more than once per day, you should use the Products service to update your product data instead. This method only works on data sources with a file input set.", + "flatPath": "datasources/v1beta/accounts/{accountsId}/dataSources/{dataSourcesId}:fetch", + "httpMethod": "POST", + "id": "merchantapi.accounts.dataSources.fetch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the data source resource to fetch. Format: `accounts/{account}/dataSources/{datasource}`", + "location": "path", + "pattern": "^accounts/[^/]+/dataSources/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "datasources/v1beta/{+name}:fetch", + "request": { + "$ref": "FetchDataSourceRequest" + }, + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "get": { + "description": "Retrieves the data source configuration for the given account.", + "flatPath": "datasources/v1beta/accounts/{accountsId}/dataSources/{dataSourcesId}", + "httpMethod": "GET", + "id": "merchantapi.accounts.dataSources.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the data source to retrieve. Format: `accounts/{account}/dataSources/{datasource}`", + "location": "path", + "pattern": "^accounts/[^/]+/dataSources/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "datasources/v1beta/{+name}", + "response": { + "$ref": "DataSource" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "description": "Lists the configurations for data sources for the given account.", + "flatPath": "datasources/v1beta/accounts/{accountsId}/dataSources", + "httpMethod": "GET", + "id": "merchantapi.accounts.dataSources.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of data sources to return. The service may return fewer than this value. The maximum value is 1000; values above 1000 will be coerced to 1000. If unspecified, the maximum number of data sources will be returned.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. A page token, received from a previous `ListDataSources` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListDataSources` must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The account to list data sources for. Format: `accounts/{account}`", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "datasources/v1beta/{+parent}/dataSources", + "response": { + "$ref": "ListDataSourcesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "patch": { + "description": "Updates the existing data source configuration. The fields that are set in the update mask but not provided in the resource will be deleted.", + "flatPath": "datasources/v1beta/accounts/{accountsId}/dataSources/{dataSourcesId}", + "httpMethod": "PATCH", + "id": "merchantapi.accounts.dataSources.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Identifier. The name of the data source. Format: `{datasource.name=accounts/{account}/dataSources/{datasource}}`", + "location": "path", + "pattern": "^accounts/[^/]+/dataSources/[^/]+$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Required. The list of data source fields to be updated. Fields specified in the update mask without a value specified in the body will be deleted from the data source. Providing special \"*\" value for full data source replacement is not supported.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "datasources/v1beta/{+name}", + "request": { + "$ref": "DataSource" + }, + "response": { + "$ref": "DataSource" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + } + } + } + }, + "revision": "20240613", + "rootUrl": "https://merchantapi.googleapis.com/", + "schemas": { + "DataSource": { + "description": "The [data source](https://support.google.com/merchants/answer/7439058) for the Merchant Center account.", + "id": "DataSource", + "properties": { + "dataSourceId": { + "description": "Output only. The data source id.", + "format": "int64", + "readOnly": true, + "type": "string" + }, + "displayName": { + "description": "Required. The displayed data source name in the Merchant Center UI.", + "type": "string" + }, + "fileInput": { + "$ref": "FileInput", + "description": "Optional. The field is used only when data is managed through a file." + }, + "input": { + "description": "Output only. Determines the type of input to the data source. Based on the input some settings might not work. Only generic data sources can be created through the API.", + "enum": [ + "INPUT_UNSPECIFIED", + "API", + "FILE", + "UI", + "AUTOFEED" + ], + "enumDescriptions": [ + "Input unspecified.", + "Represents data sources for which the data is primarily provided through the API.", + "Represents data sources for which the data is primarily provided through file input. Data can still be provided through the API.", + "The data source for products added directly in Merchant Center. This type of data source can not be created or updated through this API, only by Merchant Center UI. This type of data source is read only.", + "This is also known as [Automated feeds](https://support.google.com/merchants/answer/12158480) used to automatically build your product data. This type of data source can be enabled or disabled through the Accounts bundle." + ], + "readOnly": true, + "type": "string" + }, + "localInventoryDataSource": { + "$ref": "LocalInventoryDataSource", + "description": "Required. The [local inventory](https://support.google.com/merchants/answer/7023001) data source." + }, + "name": { + "description": "Identifier. The name of the data source. Format: `{datasource.name=accounts/{account}/dataSources/{datasource}}`", + "type": "string" + }, + "primaryProductDataSource": { + "$ref": "PrimaryProductDataSource", + "description": "Required. The [primary data source](https://support.google.com/merchants/answer/7439058) for local and online products." + }, + "promotionDataSource": { + "$ref": "PromotionDataSource", + "description": "Required. The [promotion](https://support.google.com/merchants/answer/2906014) data source." + }, + "regionalInventoryDataSource": { + "$ref": "RegionalInventoryDataSource", + "description": "Required. The [regional inventory](https://support.google.com/merchants/answer/7439058) data source." + }, + "supplementalProductDataSource": { + "$ref": "SupplementalProductDataSource", + "description": "Required. The [supplemental data source](https://support.google.com/merchants/answer/7439058) for local and online products." + } + }, + "type": "object" + }, + "Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }", + "id": "Empty", + "properties": {}, + "type": "object" + }, + "FetchDataSourceRequest": { + "description": "Request message for the FetchDataSource method.", + "id": "FetchDataSourceRequest", + "properties": {}, + "type": "object" + }, + "FetchSettings": { + "description": "Fetch details to deliver the data source.", + "id": "FetchSettings", + "properties": { + "dayOfMonth": { + "description": "Optional. The day of the month when the data source file should be fetched (1-31). This field can only be set for monthly frequency.", + "format": "int32", + "type": "integer" + }, + "dayOfWeek": { + "description": "Optional. The day of the week when the data source file should be fetched. This field can only be set for weekly frequency.", + "enum": [ + "DAY_OF_WEEK_UNSPECIFIED", + "MONDAY", + "TUESDAY", + "WEDNESDAY", + "THURSDAY", + "FRIDAY", + "SATURDAY", + "SUNDAY" + ], + "enumDescriptions": [ + "The day of the week is unspecified.", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", + "Sunday" + ], + "type": "string" + }, + "enabled": { + "description": "Optional. Enables or pauses the fetch schedule.", + "type": "boolean" + }, + "fetchUri": { + "description": "Optional. The URL where the data source file can be fetched. Google Merchant Center supports automatic scheduled uploads using the HTTP, HTTPS or SFTP protocols, so the value will need to be a valid link using one of those three protocols. Immutable for Google Sheets files.", + "type": "string" + }, + "frequency": { + "description": "Required. The frequency describing fetch schedule.", + "enum": [ + "FREQUENCY_UNSPECIFIED", + "FREQUENCY_DAILY", + "FREQUENCY_WEEKLY", + "FREQUENCY_MONTHLY" + ], + "enumDescriptions": [ + "Frequency unspecified.", + "The fetch happens every day.", + "The fetch happens every week.", + "The fetch happens every month." + ], + "type": "string" + }, + "password": { + "description": "Optional. An optional password for fetch url. Used for [submitting data sources through SFTP](https://support.google.com/merchants/answer/13813117).", + "type": "string" + }, + "timeOfDay": { + "$ref": "TimeOfDay", + "description": "Optional. The hour of the day when the data source file should be fetched. Minutes and seconds are not supported and will be ignored." + }, + "timeZone": { + "description": "Optional. [Time zone](https://cldr.unicode.org) used for schedule. UTC by default. For example, \"America/Los_Angeles\".", + "type": "string" + }, + "username": { + "description": "Optional. An optional user name for fetch url. Used for [submitting data sources through SFTP](https://support.google.com/merchants/answer/13813117).", + "type": "string" + } + }, + "type": "object" + }, + "FileInput": { + "description": "The data specific for file data sources. This field is empty for other data source inputs.", + "id": "FileInput", + "properties": { + "fetchSettings": { + "$ref": "FetchSettings", + "description": "Optional. Fetch details to deliver the data source. It contains settings for `FETCH` and `GOOGLE_SHEETS` file input types. The required fields vary based on the frequency of fetching." + }, + "fileInputType": { + "description": "Output only. The type of file input.", + "enum": [ + "FILE_INPUT_TYPE_UNSPECIFIED", + "UPLOAD", + "FETCH", + "GOOGLE_SHEETS" + ], + "enumDescriptions": [ + "File input type unspecified.", + "The file is uploaded through SFTP, Google Cloud Storage or manually in the Merchant Center.", + "The file is fetched from the configured fetch_uri.", + "The file is fetched from Google Sheets specified in the fetch_uri." + ], + "readOnly": true, + "type": "string" + }, + "fileName": { + "description": "Optional. The file name of the data source. Required for `UPLOAD` file input type.", + "type": "string" + } + }, + "type": "object" + }, + "ListDataSourcesResponse": { + "description": "Response message for the ListDataSources method.", + "id": "ListDataSourcesResponse", + "properties": { + "dataSources": { + "description": "The data sources from the specified account.", + "items": { + "$ref": "DataSource" + }, + "type": "array" + }, + "nextPageToken": { + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "type": "string" + } + }, + "type": "object" + }, + "LocalInventoryDataSource": { + "description": "The local inventory data source.", + "id": "LocalInventoryDataSource", + "properties": { + "contentLanguage": { + "description": "Required. Immutable. The two-letter ISO 639-1 language of the items to which the local inventory is provided.", + "type": "string" + }, + "feedLabel": { + "description": "Required. Immutable. The feed label of the offers to which the local inventory is provided. Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), and dashes (-). See also [migration to feed labels](https://developers.google.com/shopping-content/guides/products/feed-labels).", + "type": "string" + } + }, + "type": "object" + }, + "PrimaryProductDataSource": { + "description": "The primary data source for local and online products.", + "id": "PrimaryProductDataSource", + "properties": { + "channel": { + "description": "Required. Immutable. Specifies the type of data source channel.", + "enum": [ + "CHANNEL_UNSPECIFIED", + "ONLINE_PRODUCTS", + "LOCAL_PRODUCTS", + "PRODUCTS" + ], + "enumDescriptions": [ + "Not specified.", + "Online product.", + "Local product.", + "Unified data source for both local and online products." + ], + "type": "string" + }, + "contentLanguage": { + "description": "Optional. Immutable. The two-letter ISO 639-1 language of the items in the data source. `feedLabel` and `contentLanguage` must be either both set or unset. The fields can only be unset for data sources without file input. If set, the data source will only accept products matching this combination. If unset, the data source will accept products without that restriction.", + "type": "string" + }, + "countries": { + "description": "Optional. The countries where the items may be displayed. Represented as a [CLDR territory code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).", + "items": { + "type": "string" + }, + "type": "array" + }, + "feedLabel": { + "description": "Optional. Immutable. The feed label that is specified on the data source level. Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), and dashes (-). See also [migration to feed labels](https://developers.google.com/shopping-content/guides/products/feed-labels). `feedLabel` and `contentLanguage` must be either both set or unset for data sources with product content type. They must be set for data sources with a file input. If set, the data source will only accept products matching this combination. If unset, the data source will accept products without that restriction.", + "type": "string" + } + }, + "type": "object" + }, + "ProductChange": { + "description": "The change that happened to the product including old value, new value, country code as the region code and reporting context.", + "id": "ProductChange", + "properties": { + "newValue": { + "description": "The new value of the changed resource or attribute.", + "type": "string" + }, + "oldValue": { + "description": "The old value of the changed resource or attribute.", + "type": "string" + }, + "regionCode": { + "description": "Countries that have the change (if applicable)", + "type": "string" + }, + "reportingContext": { + "description": "Reporting contexts that have the change (if applicable)", + "enum": [ + "REPORTING_CONTEXT_ENUM_UNSPECIFIED", + "SHOPPING_ADS", + "DISCOVERY_ADS", + "DEMAND_GEN_ADS", + "DEMAND_GEN_ADS_DISCOVER_SURFACE", + "VIDEO_ADS", + "DISPLAY_ADS", + "LOCAL_INVENTORY_ADS", + "VEHICLE_INVENTORY_ADS", + "FREE_LISTINGS", + "FREE_LOCAL_LISTINGS", + "FREE_LOCAL_VEHICLE_LISTINGS", + "YOUTUBE_SHOPPING", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL" + ], + "enumDeprecated": [ + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false + ], + "enumDescriptions": [ + "Not specified.", + "[Shopping ads](https://support.google.com/merchants/answer/6149970).", + "Deprecated: Use `DEMAND_GEN_ADS` instead. [Discovery and Demand Gen ads](https://support.google.com/merchants/answer/13389785).", + "[Demand Gen ads](https://support.google.com/merchants/answer/13389785).", + "[Demand Gen ads on Discover surface](https://support.google.com/merchants/answer/13389785).", + "[Video ads](https://support.google.com/google-ads/answer/6340491).", + "[Display ads](https://support.google.com/merchants/answer/6069387).", + "[Local inventory ads](https://support.google.com/merchants/answer/3271956).", + "[Vehicle inventory ads](https://support.google.com/merchants/answer/11544533).", + "[Free product listings](https://support.google.com/merchants/answer/9199328).", + "[Free local product listings](https://support.google.com/merchants/answer/9825611).", + "[Free local vehicle listings](https://support.google.com/merchants/answer/11544533).", + "[YouTube Shopping](https://support.google.com/merchants/answer/13478370).", + "[Cloud retail](https://cloud.google.com/solutions/retail).", + "[Local cloud retail](https://cloud.google.com/solutions/retail)." + ], + "type": "string" + } + }, + "type": "object" + }, + "ProductStatusChangeMessage": { + "description": "The message that the merchant will receive to notify about product status change event", + "id": "ProductStatusChangeMessage", + "properties": { + "account": { + "description": "The target account that owns the entity that changed. Format : `accounts/{merchant_id}`", + "type": "string" + }, + "attribute": { + "description": "The attribute in the resource that changed, in this case it will be always `Status`.", + "enum": [ + "ATTRIBUTE_UNSPECIFIED", + "STATUS" + ], + "enumDescriptions": [ + "Unspecified attribute", + "Status of the changed entity" + ], + "type": "string" + }, + "changes": { + "description": "A message to describe the change that happened to the product", + "items": { + "$ref": "ProductChange" + }, + "type": "array" + }, + "managingAccount": { + "description": "The account that manages the merchant's account. can be the same as merchant id if it is standalone account. Format : `accounts/{service_provider_id}`", + "type": "string" + }, + "resource": { + "description": "The product name. Format: `{product.name=accounts/{account}/products/{product}}`", + "type": "string" + }, + "resourceId": { + "description": "The product id.", + "type": "string" + }, + "resourceType": { + "description": "The resource that changed, in this case it will always be `Product`.", + "enum": [ + "RESOURCE_UNSPECIFIED", + "PRODUCT" + ], + "enumDescriptions": [ + "Unspecified resource", + "Resource type : product" + ], + "type": "string" + } + }, + "type": "object" + }, + "PromotionDataSource": { + "description": "The promotion data source.", + "id": "PromotionDataSource", + "properties": { + "contentLanguage": { + "description": "Required. Immutable. The two-letter ISO 639-1 language of the items in the data source.", + "type": "string" + }, + "targetCountry": { + "description": "Required. Immutable. The target country used as part of the unique identifier. Represented as a [CLDR territory code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml). Promotions are only available in selected [countries](https://support.google.com/merchants/answer/4588460).", + "type": "string" + } + }, + "type": "object" + }, + "RegionalInventoryDataSource": { + "description": "The regional inventory data source.", + "id": "RegionalInventoryDataSource", + "properties": { + "contentLanguage": { + "description": "Required. Immutable. The two-letter ISO 639-1 language of the items to which the regional inventory is provided.", + "type": "string" + }, + "feedLabel": { + "description": "Required. Immutable. The feed label of the offers to which the regional inventory is provided. Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), and dashes (-). See also [migration to feed labels](https://developers.google.com/shopping-content/guides/products/feed-labels).", + "type": "string" + } + }, + "type": "object" + }, + "SupplementalProductDataSource": { + "description": "The supplemental data source for local and online products.", + "id": "SupplementalProductDataSource", + "properties": { + "contentLanguage": { + "description": "Optional. Immutable. The two-letter ISO 639-1 language of the items in the data source. `feedLabel` and `contentLanguage` must be either both set or unset. The fields can only be unset for data sources without file input. If set, the data source will only accept products matching this combination. If unset, the data source will accept produts without that restriction.", + "type": "string" + }, + "feedLabel": { + "description": "Optional. Immutable. The feed label that is specified on the data source level. Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), and dashes (-). See also [migration to feed labels](https://developers.google.com/shopping-content/guides/products/feed-labels). `feedLabel` and `contentLanguage` must be either both set or unset for data sources with product content type. They must be set for data sources with a file input. If set, the data source will only accept products matching this combination. If unset, the data source will accept produts without that restriction.", + "type": "string" + } + }, + "type": "object" + }, + "TimeOfDay": { + "description": "Represents a time of day. The date and time zone are either not significant or are specified elsewhere. An API may choose to allow leap seconds. Related types are google.type.Date and `google.protobuf.Timestamp`.", + "id": "TimeOfDay", + "properties": { + "hours": { + "description": "Hours of day in 24 hour format. Should be from 0 to 23. An API may choose to allow the value \"24:00:00\" for scenarios like business closing time.", + "format": "int32", + "type": "integer" + }, + "minutes": { + "description": "Minutes of hour of day. Must be from 0 to 59.", + "format": "int32", + "type": "integer" + }, + "nanos": { + "description": "Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.", + "format": "int32", + "type": "integer" + }, + "seconds": { + "description": "Seconds of minutes of the time. Must normally be from 0 to 59. An API may allow the value 60 if it allows leap-seconds.", + "format": "int32", + "type": "integer" + } + }, + "type": "object" + } + }, + "servicePath": "", + "title": "Merchant API", + "version": "datasources_v1beta", + "version_module": true +} \ No newline at end of file diff --git a/merchantapi/datasources_v1beta/merchantapi-gen.go b/merchantapi/datasources_v1beta/merchantapi-gen.go new file mode 100644 index 00000000000..7dfe916cfed --- /dev/null +++ b/merchantapi/datasources_v1beta/merchantapi-gen.go @@ -0,0 +1,1379 @@ +// Copyright 2024 Google LLC. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Code generated file. DO NOT EDIT. + +// Package merchantapi provides access to the Merchant API. +// +// For product documentation, see: https://developers.devsite.corp.google.com/merchant/api +// +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// +// # Creating a client +// +// Usage example: +// +// import "google.golang.org/api/merchantapi/datasources_v1beta" +// ... +// ctx := context.Background() +// merchantapiService, err := merchantapi.NewService(ctx) +// +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// +// # Other authentication options +// +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: +// +// merchantapiService, err := merchantapi.NewService(ctx, option.WithAPIKey("AIza...")) +// +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: +// +// config := &oauth2.Config{...} +// // ... +// token, err := config.Exchange(ctx, ...) +// merchantapiService, err := merchantapi.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) +// +// See [google.golang.org/api/option.ClientOption] for details on options. +package merchantapi // import "google.golang.org/api/merchantapi/datasources_v1beta" + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strconv" + "strings" + + googleapi "google.golang.org/api/googleapi" + internal "google.golang.org/api/internal" + gensupport "google.golang.org/api/internal/gensupport" + option "google.golang.org/api/option" + internaloption "google.golang.org/api/option/internaloption" + htransport "google.golang.org/api/transport/http" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = gensupport.MarshalJSON +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = context.Canceled +var _ = internaloption.WithDefaultEndpoint +var _ = internal.Version + +const apiId = "merchantapi:datasources_v1beta" +const apiName = "merchantapi" +const apiVersion = "datasources_v1beta" +const basePath = "https://merchantapi.googleapis.com/" +const basePathTemplate = "https://merchantapi.UNIVERSE_DOMAIN/" +const mtlsBasePath = "https://merchantapi.mtls.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // Manage your product listings and accounts for Google Shopping + ContentScope = "https://www.googleapis.com/auth/content" +) + +// NewService creates a new Service. +func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { + scopesOption := internaloption.WithDefaultScopes( + "https://www.googleapis.com/auth/content", + ) + // NOTE: prepend, so we don't override user-specified scopes. + opts = append([]option.ClientOption{scopesOption}, opts...) + opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) + opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) + opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) + opts = append(opts, internaloption.EnableNewAuthLibrary()) + client, endpoint, err := htransport.NewClient(ctx, opts...) + if err != nil { + return nil, err + } + s, err := New(client) + if err != nil { + return nil, err + } + if endpoint != "" { + s.BasePath = endpoint + } + return s, nil +} + +// New creates a new Service. It uses the provided http.Client for requests. +// +// Deprecated: please use NewService instead. +// To provide a custom HTTP client, use option.WithHTTPClient. +// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Accounts *AccountsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewAccountsService(s *Service) *AccountsService { + rs := &AccountsService{s: s} + rs.DataSources = NewAccountsDataSourcesService(s) + return rs +} + +type AccountsService struct { + s *Service + + DataSources *AccountsDataSourcesService +} + +func NewAccountsDataSourcesService(s *Service) *AccountsDataSourcesService { + rs := &AccountsDataSourcesService{s: s} + return rs +} + +type AccountsDataSourcesService struct { + s *Service +} + +// DataSource: The data source +// (https://support.google.com/merchants/answer/7439058) for the Merchant +// Center account. +type DataSource struct { + // DataSourceId: Output only. The data source id. + DataSourceId int64 `json:"dataSourceId,omitempty,string"` + // DisplayName: Required. The displayed data source name in the Merchant Center + // UI. + DisplayName string `json:"displayName,omitempty"` + // FileInput: Optional. The field is used only when data is managed through a + // file. + FileInput *FileInput `json:"fileInput,omitempty"` + // Input: Output only. Determines the type of input to the data source. Based + // on the input some settings might not work. Only generic data sources can be + // created through the API. + // + // Possible values: + // "INPUT_UNSPECIFIED" - Input unspecified. + // "API" - Represents data sources for which the data is primarily provided + // through the API. + // "FILE" - Represents data sources for which the data is primarily provided + // through file input. Data can still be provided through the API. + // "UI" - The data source for products added directly in Merchant Center. + // This type of data source can not be created or updated through this API, + // only by Merchant Center UI. This type of data source is read only. + // "AUTOFEED" - This is also known as [Automated + // feeds](https://support.google.com/merchants/answer/12158480) used to + // automatically build your product data. This type of data source can be + // enabled or disabled through the Accounts bundle. + Input string `json:"input,omitempty"` + // LocalInventoryDataSource: Required. The local inventory + // (https://support.google.com/merchants/answer/7023001) data source. + LocalInventoryDataSource *LocalInventoryDataSource `json:"localInventoryDataSource,omitempty"` + // Name: Identifier. The name of the data source. Format: + // `{datasource.name=accounts/{account}/dataSources/{datasource}}` + Name string `json:"name,omitempty"` + // PrimaryProductDataSource: Required. The primary data source + // (https://support.google.com/merchants/answer/7439058) for local and online + // products. + PrimaryProductDataSource *PrimaryProductDataSource `json:"primaryProductDataSource,omitempty"` + // PromotionDataSource: Required. The promotion + // (https://support.google.com/merchants/answer/2906014) data source. + PromotionDataSource *PromotionDataSource `json:"promotionDataSource,omitempty"` + // RegionalInventoryDataSource: Required. The regional inventory + // (https://support.google.com/merchants/answer/7439058) data source. + RegionalInventoryDataSource *RegionalInventoryDataSource `json:"regionalInventoryDataSource,omitempty"` + // SupplementalProductDataSource: Required. The supplemental data source + // (https://support.google.com/merchants/answer/7439058) for local and online + // products. + SupplementalProductDataSource *SupplementalProductDataSource `json:"supplementalProductDataSource,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "DataSourceId") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "DataSourceId") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *DataSource) MarshalJSON() ([]byte, error) { + type NoMethod DataSource + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Empty: A generic empty message that you can re-use to avoid defining +// duplicated empty messages in your APIs. A typical example is to use it as +// the request or the response type of an API method. For instance: service Foo +// { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } +type Empty struct { + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` +} + +// FetchDataSourceRequest: Request message for the FetchDataSource method. +type FetchDataSourceRequest struct { +} + +// FetchSettings: Fetch details to deliver the data source. +type FetchSettings struct { + // DayOfMonth: Optional. The day of the month when the data source file should + // be fetched (1-31). This field can only be set for monthly frequency. + DayOfMonth int64 `json:"dayOfMonth,omitempty"` + // DayOfWeek: Optional. The day of the week when the data source file should be + // fetched. This field can only be set for weekly frequency. + // + // Possible values: + // "DAY_OF_WEEK_UNSPECIFIED" - The day of the week is unspecified. + // "MONDAY" - Monday + // "TUESDAY" - Tuesday + // "WEDNESDAY" - Wednesday + // "THURSDAY" - Thursday + // "FRIDAY" - Friday + // "SATURDAY" - Saturday + // "SUNDAY" - Sunday + DayOfWeek string `json:"dayOfWeek,omitempty"` + // Enabled: Optional. Enables or pauses the fetch schedule. + Enabled bool `json:"enabled,omitempty"` + // FetchUri: Optional. The URL where the data source file can be fetched. + // Google Merchant Center supports automatic scheduled uploads using the HTTP, + // HTTPS or SFTP protocols, so the value will need to be a valid link using one + // of those three protocols. Immutable for Google Sheets files. + FetchUri string `json:"fetchUri,omitempty"` + // Frequency: Required. The frequency describing fetch schedule. + // + // Possible values: + // "FREQUENCY_UNSPECIFIED" - Frequency unspecified. + // "FREQUENCY_DAILY" - The fetch happens every day. + // "FREQUENCY_WEEKLY" - The fetch happens every week. + // "FREQUENCY_MONTHLY" - The fetch happens every month. + Frequency string `json:"frequency,omitempty"` + // Password: Optional. An optional password for fetch url. Used for submitting + // data sources through SFTP + // (https://support.google.com/merchants/answer/13813117). + Password string `json:"password,omitempty"` + // TimeOfDay: Optional. The hour of the day when the data source file should be + // fetched. Minutes and seconds are not supported and will be ignored. + TimeOfDay *TimeOfDay `json:"timeOfDay,omitempty"` + // TimeZone: Optional. Time zone (https://cldr.unicode.org) used for schedule. + // UTC by default. For example, "America/Los_Angeles". + TimeZone string `json:"timeZone,omitempty"` + // Username: Optional. An optional user name for fetch url. Used for submitting + // data sources through SFTP + // (https://support.google.com/merchants/answer/13813117). + Username string `json:"username,omitempty"` + // ForceSendFields is a list of field names (e.g. "DayOfMonth") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "DayOfMonth") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *FetchSettings) MarshalJSON() ([]byte, error) { + type NoMethod FetchSettings + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// FileInput: The data specific for file data sources. This field is empty for +// other data source inputs. +type FileInput struct { + // FetchSettings: Optional. Fetch details to deliver the data source. It + // contains settings for `FETCH` and `GOOGLE_SHEETS` file input types. The + // required fields vary based on the frequency of fetching. + FetchSettings *FetchSettings `json:"fetchSettings,omitempty"` + // FileInputType: Output only. The type of file input. + // + // Possible values: + // "FILE_INPUT_TYPE_UNSPECIFIED" - File input type unspecified. + // "UPLOAD" - The file is uploaded through SFTP, Google Cloud Storage or + // manually in the Merchant Center. + // "FETCH" - The file is fetched from the configured fetch_uri. + // "GOOGLE_SHEETS" - The file is fetched from Google Sheets specified in the + // fetch_uri. + FileInputType string `json:"fileInputType,omitempty"` + // FileName: Optional. The file name of the data source. Required for `UPLOAD` + // file input type. + FileName string `json:"fileName,omitempty"` + // ForceSendFields is a list of field names (e.g. "FetchSettings") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "FetchSettings") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *FileInput) MarshalJSON() ([]byte, error) { + type NoMethod FileInput + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ListDataSourcesResponse: Response message for the ListDataSources method. +type ListDataSourcesResponse struct { + // DataSources: The data sources from the specified account. + DataSources []*DataSource `json:"dataSources,omitempty"` + // NextPageToken: A token, which can be sent as `page_token` to retrieve the + // next page. If this field is omitted, there are no subsequent pages. + 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. "DataSources") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "DataSources") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ListDataSourcesResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListDataSourcesResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// LocalInventoryDataSource: The local inventory data source. +type LocalInventoryDataSource struct { + // ContentLanguage: Required. Immutable. The two-letter ISO 639-1 language of + // the items to which the local inventory is provided. + ContentLanguage string `json:"contentLanguage,omitempty"` + // FeedLabel: Required. Immutable. The feed label of the offers to which the + // local inventory is provided. Must be less than or equal to 20 uppercase + // letters (A-Z), numbers (0-9), and dashes (-). See also migration to feed + // labels + // (https://developers.google.com/shopping-content/guides/products/feed-labels). + FeedLabel string `json:"feedLabel,omitempty"` + // ForceSendFields is a list of field names (e.g. "ContentLanguage") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ContentLanguage") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *LocalInventoryDataSource) MarshalJSON() ([]byte, error) { + type NoMethod LocalInventoryDataSource + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// PrimaryProductDataSource: The primary data source for local and online +// products. +type PrimaryProductDataSource struct { + // Channel: Required. Immutable. Specifies the type of data source channel. + // + // Possible values: + // "CHANNEL_UNSPECIFIED" - Not specified. + // "ONLINE_PRODUCTS" - Online product. + // "LOCAL_PRODUCTS" - Local product. + // "PRODUCTS" - Unified data source for both local and online products. + Channel string `json:"channel,omitempty"` + // ContentLanguage: Optional. Immutable. The two-letter ISO 639-1 language of + // the items in the data source. `feedLabel` and `contentLanguage` must be + // either both set or unset. The fields can only be unset for data sources + // without file input. If set, the data source will only accept products + // matching this combination. If unset, the data source will accept products + // without that restriction. + ContentLanguage string `json:"contentLanguage,omitempty"` + // Countries: Optional. The countries where the items may be displayed. + // Represented as a CLDR territory code + // (https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml). + Countries []string `json:"countries,omitempty"` + // FeedLabel: Optional. Immutable. The feed label that is specified on the data + // source level. Must be less than or equal to 20 uppercase letters (A-Z), + // numbers (0-9), and dashes (-). See also migration to feed labels + // (https://developers.google.com/shopping-content/guides/products/feed-labels). + // `feedLabel` and `contentLanguage` must be either both set or unset for data + // sources with product content type. They must be set for data sources with a + // file input. If set, the data source will only accept products matching this + // combination. If unset, the data source will accept products without that + // restriction. + FeedLabel string `json:"feedLabel,omitempty"` + // ForceSendFields is a list of field names (e.g. "Channel") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Channel") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *PrimaryProductDataSource) MarshalJSON() ([]byte, error) { + type NoMethod PrimaryProductDataSource + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ProductChange: The change that happened to the product including old value, +// new value, country code as the region code and reporting context. +type ProductChange struct { + // NewValue: The new value of the changed resource or attribute. + NewValue string `json:"newValue,omitempty"` + // OldValue: The old value of the changed resource or attribute. + OldValue string `json:"oldValue,omitempty"` + // RegionCode: Countries that have the change (if applicable) + RegionCode string `json:"regionCode,omitempty"` + // ReportingContext: Reporting contexts that have the change (if applicable) + // + // Possible values: + // "REPORTING_CONTEXT_ENUM_UNSPECIFIED" - Not specified. + // "SHOPPING_ADS" - [Shopping + // ads](https://support.google.com/merchants/answer/6149970). + // "DISCOVERY_ADS" - Deprecated: Use `DEMAND_GEN_ADS` instead. [Discovery and + // Demand Gen ads](https://support.google.com/merchants/answer/13389785). + // "DEMAND_GEN_ADS" - [Demand Gen + // ads](https://support.google.com/merchants/answer/13389785). + // "DEMAND_GEN_ADS_DISCOVER_SURFACE" - [Demand Gen ads on Discover + // surface](https://support.google.com/merchants/answer/13389785). + // "VIDEO_ADS" - [Video + // ads](https://support.google.com/google-ads/answer/6340491). + // "DISPLAY_ADS" - [Display + // ads](https://support.google.com/merchants/answer/6069387). + // "LOCAL_INVENTORY_ADS" - [Local inventory + // ads](https://support.google.com/merchants/answer/3271956). + // "VEHICLE_INVENTORY_ADS" - [Vehicle inventory + // ads](https://support.google.com/merchants/answer/11544533). + // "FREE_LISTINGS" - [Free product + // listings](https://support.google.com/merchants/answer/9199328). + // "FREE_LOCAL_LISTINGS" - [Free local product + // listings](https://support.google.com/merchants/answer/9825611). + // "FREE_LOCAL_VEHICLE_LISTINGS" - [Free local vehicle + // listings](https://support.google.com/merchants/answer/11544533). + // "YOUTUBE_SHOPPING" - [YouTube + // Shopping](https://support.google.com/merchants/answer/13478370). + // "CLOUD_RETAIL" - [Cloud + // retail](https://cloud.google.com/solutions/retail). + // "LOCAL_CLOUD_RETAIL" - [Local cloud + // retail](https://cloud.google.com/solutions/retail). + ReportingContext string `json:"reportingContext,omitempty"` + // ForceSendFields is a list of field names (e.g. "NewValue") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "NewValue") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ProductChange) MarshalJSON() ([]byte, error) { + type NoMethod ProductChange + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ProductStatusChangeMessage: The message that the merchant will receive to +// notify about product status change event +type ProductStatusChangeMessage struct { + // Account: The target account that owns the entity that changed. Format : + // `accounts/{merchant_id}` + Account string `json:"account,omitempty"` + // Attribute: The attribute in the resource that changed, in this case it will + // be always `Status`. + // + // Possible values: + // "ATTRIBUTE_UNSPECIFIED" - Unspecified attribute + // "STATUS" - Status of the changed entity + Attribute string `json:"attribute,omitempty"` + // Changes: A message to describe the change that happened to the product + Changes []*ProductChange `json:"changes,omitempty"` + // ManagingAccount: The account that manages the merchant's account. can be the + // same as merchant id if it is standalone account. Format : + // `accounts/{service_provider_id}` + ManagingAccount string `json:"managingAccount,omitempty"` + // Resource: The product name. Format: + // `{product.name=accounts/{account}/products/{product}}` + Resource string `json:"resource,omitempty"` + // ResourceId: The product id. + ResourceId string `json:"resourceId,omitempty"` + // ResourceType: The resource that changed, in this case it will always be + // `Product`. + // + // Possible values: + // "RESOURCE_UNSPECIFIED" - Unspecified resource + // "PRODUCT" - Resource type : product + ResourceType string `json:"resourceType,omitempty"` + // ForceSendFields is a list of field names (e.g. "Account") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Account") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ProductStatusChangeMessage) MarshalJSON() ([]byte, error) { + type NoMethod ProductStatusChangeMessage + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// PromotionDataSource: The promotion data source. +type PromotionDataSource struct { + // ContentLanguage: Required. Immutable. The two-letter ISO 639-1 language of + // the items in the data source. + ContentLanguage string `json:"contentLanguage,omitempty"` + // TargetCountry: Required. Immutable. The target country used as part of the + // unique identifier. Represented as a CLDR territory code + // (https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml). + // Promotions are only available in selected countries + // (https://support.google.com/merchants/answer/4588460). + TargetCountry string `json:"targetCountry,omitempty"` + // ForceSendFields is a list of field names (e.g. "ContentLanguage") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ContentLanguage") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *PromotionDataSource) MarshalJSON() ([]byte, error) { + type NoMethod PromotionDataSource + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// RegionalInventoryDataSource: The regional inventory data source. +type RegionalInventoryDataSource struct { + // ContentLanguage: Required. Immutable. The two-letter ISO 639-1 language of + // the items to which the regional inventory is provided. + ContentLanguage string `json:"contentLanguage,omitempty"` + // FeedLabel: Required. Immutable. The feed label of the offers to which the + // regional inventory is provided. Must be less than or equal to 20 uppercase + // letters (A-Z), numbers (0-9), and dashes (-). See also migration to feed + // labels + // (https://developers.google.com/shopping-content/guides/products/feed-labels). + FeedLabel string `json:"feedLabel,omitempty"` + // ForceSendFields is a list of field names (e.g. "ContentLanguage") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ContentLanguage") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *RegionalInventoryDataSource) MarshalJSON() ([]byte, error) { + type NoMethod RegionalInventoryDataSource + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// SupplementalProductDataSource: The supplemental data source for local and +// online products. +type SupplementalProductDataSource struct { + // ContentLanguage: Optional. Immutable. The two-letter ISO 639-1 language of + // the items in the data source. `feedLabel` and `contentLanguage` must be + // either both set or unset. The fields can only be unset for data sources + // without file input. If set, the data source will only accept products + // matching this combination. If unset, the data source will accept produts + // without that restriction. + ContentLanguage string `json:"contentLanguage,omitempty"` + // FeedLabel: Optional. Immutable. The feed label that is specified on the data + // source level. Must be less than or equal to 20 uppercase letters (A-Z), + // numbers (0-9), and dashes (-). See also migration to feed labels + // (https://developers.google.com/shopping-content/guides/products/feed-labels). + // `feedLabel` and `contentLanguage` must be either both set or unset for data + // sources with product content type. They must be set for data sources with a + // file input. If set, the data source will only accept products matching this + // combination. If unset, the data source will accept produts without that + // restriction. + FeedLabel string `json:"feedLabel,omitempty"` + // ForceSendFields is a list of field names (e.g. "ContentLanguage") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ContentLanguage") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *SupplementalProductDataSource) MarshalJSON() ([]byte, error) { + type NoMethod SupplementalProductDataSource + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// TimeOfDay: Represents a time of day. The date and time zone are either not +// significant or are specified elsewhere. An API may choose to allow leap +// seconds. Related types are google.type.Date and `google.protobuf.Timestamp`. +type TimeOfDay struct { + // Hours: Hours of day in 24 hour format. Should be from 0 to 23. An API may + // choose to allow the value "24:00:00" for scenarios like business closing + // time. + Hours int64 `json:"hours,omitempty"` + // Minutes: Minutes of hour of day. Must be from 0 to 59. + Minutes int64 `json:"minutes,omitempty"` + // Nanos: Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. + Nanos int64 `json:"nanos,omitempty"` + // Seconds: Seconds of minutes of the time. Must normally be from 0 to 59. An + // API may allow the value 60 if it allows leap-seconds. + Seconds int64 `json:"seconds,omitempty"` + // ForceSendFields is a list of field names (e.g. "Hours") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Hours") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *TimeOfDay) MarshalJSON() ([]byte, error) { + type NoMethod TimeOfDay + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +type AccountsDataSourcesCreateCall struct { + s *Service + parent string + datasource *DataSource + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates the new data source configuration for the given account. +// +// - parent: The account where this data source will be created. Format: +// `accounts/{account}`. +func (r *AccountsDataSourcesService) Create(parent string, datasource *DataSource) *AccountsDataSourcesCreateCall { + c := &AccountsDataSourcesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.datasource = datasource + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *AccountsDataSourcesCreateCall) Fields(s ...googleapi.Field) *AccountsDataSourcesCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsDataSourcesCreateCall) Context(ctx context.Context) *AccountsDataSourcesCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsDataSourcesCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsDataSourcesCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.datasource) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "datasources/v1beta/{+parent}/dataSources") + 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 "merchantapi.accounts.dataSources.create" call. +// Any non-2xx status code is an error. Response headers are in either +// *DataSource.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 *AccountsDataSourcesCreateCall) Do(opts ...googleapi.CallOption) (*DataSource, 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 := &DataSource{ + 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 +} + +type AccountsDataSourcesDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a data source from your Merchant Center account. +// +// - name: The name of the data source to delete. Format: +// `accounts/{account}/dataSources/{datasource}`. +func (r *AccountsDataSourcesService) Delete(name string) *AccountsDataSourcesDeleteCall { + c := &AccountsDataSourcesDeleteCall{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 +// details. +func (c *AccountsDataSourcesDeleteCall) Fields(s ...googleapi.Field) *AccountsDataSourcesDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsDataSourcesDeleteCall) Context(ctx context.Context) *AccountsDataSourcesDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsDataSourcesDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsDataSourcesDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "datasources/v1beta/{+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 "merchantapi.accounts.dataSources.delete" call. +// 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 *AccountsDataSourcesDeleteCall) 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 +} + +type AccountsDataSourcesFetchCall struct { + s *Service + name string + fetchdatasourcerequest *FetchDataSourceRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Fetch: Performs the data fetch immediately (even outside fetch schedule) on +// a data source from your Merchant Center Account. If you need to call this +// method more than once per day, you should use the Products service to update +// your product data instead. This method only works on data sources with a +// file input set. +// +// - name: The name of the data source resource to fetch. Format: +// `accounts/{account}/dataSources/{datasource}`. +func (r *AccountsDataSourcesService) Fetch(name string, fetchdatasourcerequest *FetchDataSourceRequest) *AccountsDataSourcesFetchCall { + c := &AccountsDataSourcesFetchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.fetchdatasourcerequest = fetchdatasourcerequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *AccountsDataSourcesFetchCall) Fields(s ...googleapi.Field) *AccountsDataSourcesFetchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsDataSourcesFetchCall) Context(ctx context.Context) *AccountsDataSourcesFetchCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsDataSourcesFetchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsDataSourcesFetchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.fetchdatasourcerequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "datasources/v1beta/{+name}:fetch") + 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 "merchantapi.accounts.dataSources.fetch" call. +// 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 *AccountsDataSourcesFetchCall) 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 +} + +type AccountsDataSourcesGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Retrieves the data source configuration for the given account. +// +// - name: The name of the data source to retrieve. Format: +// `accounts/{account}/dataSources/{datasource}`. +func (r *AccountsDataSourcesService) Get(name string) *AccountsDataSourcesGetCall { + c := &AccountsDataSourcesGetCall{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 +// details. +func (c *AccountsDataSourcesGetCall) Fields(s ...googleapi.Field) *AccountsDataSourcesGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsDataSourcesGetCall) IfNoneMatch(entityTag string) *AccountsDataSourcesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsDataSourcesGetCall) Context(ctx context.Context) *AccountsDataSourcesGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsDataSourcesGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsDataSourcesGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "datasources/v1beta/{+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 "merchantapi.accounts.dataSources.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *DataSource.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 *AccountsDataSourcesGetCall) Do(opts ...googleapi.CallOption) (*DataSource, 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 := &DataSource{ + 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 +} + +type AccountsDataSourcesListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists the configurations for data sources for the given account. +// +// - parent: The account to list data sources for. Format: `accounts/{account}`. +func (r *AccountsDataSourcesService) List(parent string) *AccountsDataSourcesListCall { + c := &AccountsDataSourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number of data +// sources to return. The service may return fewer than this value. The maximum +// value is 1000; values above 1000 will be coerced to 1000. If unspecified, +// the maximum number of data sources will be returned. +func (c *AccountsDataSourcesListCall) PageSize(pageSize int64) *AccountsDataSourcesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, received +// from a previous `ListDataSources` call. Provide this to retrieve the +// subsequent page. When paginating, all other parameters provided to +// `ListDataSources` must match the call that provided the page token. +func (c *AccountsDataSourcesListCall) PageToken(pageToken string) *AccountsDataSourcesListCall { + 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 +// details. +func (c *AccountsDataSourcesListCall) Fields(s ...googleapi.Field) *AccountsDataSourcesListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsDataSourcesListCall) IfNoneMatch(entityTag string) *AccountsDataSourcesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsDataSourcesListCall) Context(ctx context.Context) *AccountsDataSourcesListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsDataSourcesListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsDataSourcesListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "datasources/v1beta/{+parent}/dataSources") + 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 "merchantapi.accounts.dataSources.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *ListDataSourcesResponse.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 *AccountsDataSourcesListCall) Do(opts ...googleapi.CallOption) (*ListDataSourcesResponse, 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 := &ListDataSourcesResponse{ + 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 +} + +// 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 *AccountsDataSourcesListCall) Pages(ctx context.Context, f func(*ListDataSourcesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + 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) + } +} + +type AccountsDataSourcesPatchCall struct { + s *Service + name string + datasource *DataSource + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates the existing data source configuration. The fields that are +// set in the update mask but not provided in the resource will be deleted. +// +// - name: Identifier. The name of the data source. Format: +// `{datasource.name=accounts/{account}/dataSources/{datasource}}`. +func (r *AccountsDataSourcesService) Patch(name string, datasource *DataSource) *AccountsDataSourcesPatchCall { + c := &AccountsDataSourcesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.datasource = datasource + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. The list of +// data source fields to be updated. Fields specified in the update mask +// without a value specified in the body will be deleted from the data source. +// Providing special "*" value for full data source replacement is not +// supported. +func (c *AccountsDataSourcesPatchCall) UpdateMask(updateMask string) *AccountsDataSourcesPatchCall { + 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 +// details. +func (c *AccountsDataSourcesPatchCall) Fields(s ...googleapi.Field) *AccountsDataSourcesPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsDataSourcesPatchCall) Context(ctx context.Context) *AccountsDataSourcesPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsDataSourcesPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsDataSourcesPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.datasource) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "datasources/v1beta/{+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 "merchantapi.accounts.dataSources.patch" call. +// Any non-2xx status code is an error. Response headers are in either +// *DataSource.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 *AccountsDataSourcesPatchCall) Do(opts ...googleapi.CallOption) (*DataSource, 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 := &DataSource{ + 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 +} diff --git a/merchantapi/inventories_v1beta/merchantapi-api.json b/merchantapi/inventories_v1beta/merchantapi-api.json new file mode 100644 index 00000000000..7b425607238 --- /dev/null +++ b/merchantapi/inventories_v1beta/merchantapi-api.json @@ -0,0 +1,643 @@ +{ + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/content": { + "description": "Manage your product listings and accounts for Google Shopping" + } + } + } + }, + "basePath": "", + "baseUrl": "https://merchantapi.googleapis.com/", + "batchPath": "batch", + "canonicalName": "Merchant", + "description": "Programmatically manage your Merchant Center Accounts.", + "discoveryVersion": "v1", + "documentationLink": "https://developers.devsite.corp.google.com/merchant/api", + "fullyEncodeReservedExpansion": true, + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "id": "merchantapi:inventories_v1beta", + "kind": "discovery#restDescription", + "mtlsRootUrl": "https://merchantapi.mtls.googleapis.com/", + "name": "merchantapi", + "ownerDomain": "google.com", + "ownerName": "Google", + "parameters": { + "$.xgafv": { + "description": "V1 error format.", + "enum": [ + "1", + "2" + ], + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "type": "string" + }, + "access_token": { + "description": "OAuth access token.", + "location": "query", + "type": "string" + }, + "alt": { + "default": "json", + "description": "Data format for response.", + "enum": [ + "json", + "media", + "proto" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query", + "type": "string" + }, + "callback": { + "description": "JSONP", + "location": "query", + "type": "string" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "location": "query", + "type": "string" + }, + "key": { + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query", + "type": "string" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "location": "query", + "type": "string" + }, + "prettyPrint": { + "default": "true", + "description": "Returns response with indentations and line breaks.", + "location": "query", + "type": "boolean" + }, + "quotaUser": { + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query", + "type": "string" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query", + "type": "string" + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query", + "type": "string" + } + }, + "protocol": "rest", + "resources": { + "accounts": { + "resources": { + "products": { + "resources": { + "localInventories": { + "methods": { + "delete": { + "description": "Deletes the specified `LocalInventory` from the given product in your merchant account. It might take a up to an hour for the `LocalInventory` to be deleted from the specific product. Once you have received a successful delete response, wait for that period before attempting a delete again.", + "flatPath": "inventories/v1beta/accounts/{accountsId}/products/{productsId}/localInventories/{localInventoriesId}", + "httpMethod": "DELETE", + "id": "merchantapi.accounts.products.localInventories.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the local inventory for the given product to delete. Format: `accounts/{account}/products/{product}/localInventories/{store_code}`", + "location": "path", + "pattern": "^accounts/[^/]+/products/[^/]+/localInventories/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "inventories/v1beta/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "insert": { + "description": "Inserts a `LocalInventory` resource to a product in your merchant account. Replaces the full `LocalInventory` resource if an entry with the same `storeCode` already exists for the product. It might take up to 30 minutes for the new or updated `LocalInventory` resource to appear in products.", + "flatPath": "inventories/v1beta/accounts/{accountsId}/products/{productsId}/localInventories:insert", + "httpMethod": "POST", + "id": "merchantapi.accounts.products.localInventories.insert", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The account and product where this inventory will be inserted. Format: `accounts/{account}/products/{product}`", + "location": "path", + "pattern": "^accounts/[^/]+/products/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "inventories/v1beta/{+parent}/localInventories:insert", + "request": { + "$ref": "LocalInventory" + }, + "response": { + "$ref": "LocalInventory" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "description": "Lists the `LocalInventory` resources for the given product in your merchant account. The response might contain fewer items than specified by `pageSize`. If `pageToken` was returned in previous request, it can be used to obtain additional results. `LocalInventory` resources are listed per product for a given account.", + "flatPath": "inventories/v1beta/accounts/{accountsId}/products/{productsId}/localInventories", + "httpMethod": "GET", + "id": "merchantapi.accounts.products.localInventories.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "The maximum number of `LocalInventory` resources for the given product to return. The service returns fewer than this value if the number of inventories for the given product is less that than the `pageSize`. The default value is 25000. The maximum value is 25000; If a value higher than the maximum is specified, then the `pageSize` will default to the maximum", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "A page token, received from a previous `ListLocalInventories` call. Provide the page token to retrieve the subsequent page. When paginating, all other parameters provided to `ListLocalInventories` must match the call that provided the page token. The token returned as nextPageToken in the response to the previous request.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The `name` of the parent product to list local inventories for. Format: `accounts/{account}/products/{product}`", + "location": "path", + "pattern": "^accounts/[^/]+/products/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "inventories/v1beta/{+parent}/localInventories", + "response": { + "$ref": "ListLocalInventoriesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + }, + "regionalInventories": { + "methods": { + "delete": { + "description": "Deletes the specified `RegionalInventory` resource from the given product in your merchant account. It might take up to an hour for the `RegionalInventory` to be deleted from the specific product. Once you have received a successful delete response, wait for that period before attempting a delete again.", + "flatPath": "inventories/v1beta/accounts/{accountsId}/products/{productsId}/regionalInventories/{regionalInventoriesId}", + "httpMethod": "DELETE", + "id": "merchantapi.accounts.products.regionalInventories.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the `RegionalInventory` resource to delete. Format: `accounts/{account}/products/{product}/regionalInventories/{region}`", + "location": "path", + "pattern": "^accounts/[^/]+/products/[^/]+/regionalInventories/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "inventories/v1beta/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "insert": { + "description": "Inserts a `RegionalInventory` to a given product in your merchant account. Replaces the full `RegionalInventory` resource if an entry with the same `region` already exists for the product. It might take up to 30 minutes for the new or updated `RegionalInventory` resource to appear in products.", + "flatPath": "inventories/v1beta/accounts/{accountsId}/products/{productsId}/regionalInventories:insert", + "httpMethod": "POST", + "id": "merchantapi.accounts.products.regionalInventories.insert", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The account and product where this inventory will be inserted. Format: `accounts/{account}/products/{product}`", + "location": "path", + "pattern": "^accounts/[^/]+/products/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "inventories/v1beta/{+parent}/regionalInventories:insert", + "request": { + "$ref": "RegionalInventory" + }, + "response": { + "$ref": "RegionalInventory" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "description": "Lists the `RegionalInventory` resources for the given product in your merchant account. The response might contain fewer items than specified by `pageSize`. If `pageToken` was returned in previous request, it can be used to obtain additional results. `RegionalInventory` resources are listed per product for a given account.", + "flatPath": "inventories/v1beta/accounts/{accountsId}/products/{productsId}/regionalInventories", + "httpMethod": "GET", + "id": "merchantapi.accounts.products.regionalInventories.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "The maximum number of `RegionalInventory` resources for the given product to return. The service returns fewer than this value if the number of inventories for the given product is less that than the `pageSize`. The default value is 25000. The maximum value is 100000; If a value higher than the maximum is specified, then the `pageSize` will default to the maximum.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "A page token, received from a previous `ListRegionalInventories` call. Provide the page token to retrieve the subsequent page. When paginating, all other parameters provided to `ListRegionalInventories` must match the call that provided the page token. The token returned as nextPageToken in the response to the previous request.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The `name` of the parent product to list `RegionalInventory` resources for. Format: `accounts/{account}/products/{product}`", + "location": "path", + "pattern": "^accounts/[^/]+/products/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "inventories/v1beta/{+parent}/regionalInventories", + "response": { + "$ref": "ListRegionalInventoriesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + } + } + } + } + } + }, + "revision": "20240613", + "rootUrl": "https://merchantapi.googleapis.com/", + "schemas": { + "CustomAttribute": { + "description": "A message that represents custom attributes. Exactly one of `value` or `group_values` must not be empty.", + "id": "CustomAttribute", + "properties": { + "groupValues": { + "description": "Subattributes within this attribute group. If `group_values` is not empty, `value` must be empty.", + "items": { + "$ref": "CustomAttribute" + }, + "type": "array" + }, + "name": { + "description": "The name of the attribute.", + "type": "string" + }, + "value": { + "description": "The value of the attribute. If `value` is not empty, `group_values` must be empty.", + "type": "string" + } + }, + "type": "object" + }, + "Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }", + "id": "Empty", + "properties": {}, + "type": "object" + }, + "Interval": { + "description": "Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive). The start must be less than or equal to the end. When the start equals the end, the interval is empty (matches no time). When both start and end are unspecified, the interval matches any time.", + "id": "Interval", + "properties": { + "endTime": { + "description": "Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end.", + "format": "google-datetime", + "type": "string" + }, + "startTime": { + "description": "Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, + "ListLocalInventoriesResponse": { + "description": "Response message for the `ListLocalInventories` method.", + "id": "ListLocalInventoriesResponse", + "properties": { + "localInventories": { + "description": "The `LocalInventory` resources for the given product from the specified account.", + "items": { + "$ref": "LocalInventory" + }, + "type": "array" + }, + "nextPageToken": { + "description": "A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "type": "string" + } + }, + "type": "object" + }, + "ListRegionalInventoriesResponse": { + "description": "Response message for the `ListRegionalInventories` method.", + "id": "ListRegionalInventoriesResponse", + "properties": { + "nextPageToken": { + "description": "A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "type": "string" + }, + "regionalInventories": { + "description": "The `RegionalInventory` resources for the given product from the specified account.", + "items": { + "$ref": "RegionalInventory" + }, + "type": "array" + } + }, + "type": "object" + }, + "LocalInventory": { + "description": "Local inventory information for the product. Represents in-store information for a specific product at the store specified by `storeCode`. For a list of all accepted attribute values, see the [local product inventory data specification](https://support.google.com/merchants/answer/3061342).", + "id": "LocalInventory", + "properties": { + "account": { + "description": "Output only. The account that owns the product. This field will be ignored if set by the client.", + "format": "int64", + "readOnly": true, + "type": "string" + }, + "availability": { + "description": "Availability of the product at this store. For accepted attribute values, see the [local product inventory data specification](https://support.google.com/merchants/answer/3061342)", + "type": "string" + }, + "customAttributes": { + "description": "A list of custom (merchant-provided) attributes. You can also use `CustomAttribute` to submit any attribute of the data specification in its generic form.", + "items": { + "$ref": "CustomAttribute" + }, + "type": "array" + }, + "instoreProductLocation": { + "description": "Location of the product inside the store. Maximum length is 20 bytes.", + "type": "string" + }, + "name": { + "description": "Output only. The name of the `LocalInventory` resource. Format: `accounts/{account}/products/{product}/localInventories/{store_code}`", + "readOnly": true, + "type": "string" + }, + "pickupMethod": { + "description": "Supported pickup method for this product. Unless the value is `\"not supported\"`, this field must be submitted together with `pickupSla`. For accepted attribute values, see the [local product inventory data specification](https://support.google.com/merchants/answer/3061342)", + "type": "string" + }, + "pickupSla": { + "description": "Relative time period from the order date for an order for this product, from this store, to be ready for pickup. Must be submitted with `pickupMethod`. For accepted attribute values, see the [local product inventory data specification](https://support.google.com/merchants/answer/3061342)", + "type": "string" + }, + "price": { + "$ref": "Price", + "description": "Price of the product at this store." + }, + "quantity": { + "description": "Quantity of the product available at this store. Must be greater than or equal to zero.", + "format": "int64", + "type": "string" + }, + "salePrice": { + "$ref": "Price", + "description": "Sale price of the product at this store. Mandatory if `salePriceEffectiveDate` is defined." + }, + "salePriceEffectiveDate": { + "$ref": "Interval", + "description": "The `TimePeriod` of the sale at this store." + }, + "storeCode": { + "description": "Required. Immutable. Store code (the store ID from your Business Profile) of the physical store the product is sold in. See the [Local product inventory data specification](https://support.google.com/merchants/answer/3061342) for more information.", + "type": "string" + } + }, + "type": "object" + }, + "Price": { + "description": "The price represented as a number and currency.", + "id": "Price", + "properties": { + "amountMicros": { + "description": "The price represented as a number in micros (1 million micros is an equivalent to one's currency standard unit, for example, 1 USD = 1000000 micros).", + "format": "int64", + "type": "string" + }, + "currencyCode": { + "description": "The currency of the price using three-letter acronyms according to [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217).", + "type": "string" + } + }, + "type": "object" + }, + "ProductChange": { + "description": "The change that happened to the product including old value, new value, country code as the region code and reporting context.", + "id": "ProductChange", + "properties": { + "newValue": { + "description": "The new value of the changed resource or attribute.", + "type": "string" + }, + "oldValue": { + "description": "The old value of the changed resource or attribute.", + "type": "string" + }, + "regionCode": { + "description": "Countries that have the change (if applicable)", + "type": "string" + }, + "reportingContext": { + "description": "Reporting contexts that have the change (if applicable)", + "enum": [ + "REPORTING_CONTEXT_ENUM_UNSPECIFIED", + "SHOPPING_ADS", + "DISCOVERY_ADS", + "DEMAND_GEN_ADS", + "DEMAND_GEN_ADS_DISCOVER_SURFACE", + "VIDEO_ADS", + "DISPLAY_ADS", + "LOCAL_INVENTORY_ADS", + "VEHICLE_INVENTORY_ADS", + "FREE_LISTINGS", + "FREE_LOCAL_LISTINGS", + "FREE_LOCAL_VEHICLE_LISTINGS", + "YOUTUBE_SHOPPING", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL" + ], + "enumDeprecated": [ + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false + ], + "enumDescriptions": [ + "Not specified.", + "[Shopping ads](https://support.google.com/merchants/answer/6149970).", + "Deprecated: Use `DEMAND_GEN_ADS` instead. [Discovery and Demand Gen ads](https://support.google.com/merchants/answer/13389785).", + "[Demand Gen ads](https://support.google.com/merchants/answer/13389785).", + "[Demand Gen ads on Discover surface](https://support.google.com/merchants/answer/13389785).", + "[Video ads](https://support.google.com/google-ads/answer/6340491).", + "[Display ads](https://support.google.com/merchants/answer/6069387).", + "[Local inventory ads](https://support.google.com/merchants/answer/3271956).", + "[Vehicle inventory ads](https://support.google.com/merchants/answer/11544533).", + "[Free product listings](https://support.google.com/merchants/answer/9199328).", + "[Free local product listings](https://support.google.com/merchants/answer/9825611).", + "[Free local vehicle listings](https://support.google.com/merchants/answer/11544533).", + "[YouTube Shopping](https://support.google.com/merchants/answer/13478370).", + "[Cloud retail](https://cloud.google.com/solutions/retail).", + "[Local cloud retail](https://cloud.google.com/solutions/retail)." + ], + "type": "string" + } + }, + "type": "object" + }, + "ProductStatusChangeMessage": { + "description": "The message that the merchant will receive to notify about product status change event", + "id": "ProductStatusChangeMessage", + "properties": { + "account": { + "description": "The target account that owns the entity that changed. Format : `accounts/{merchant_id}`", + "type": "string" + }, + "attribute": { + "description": "The attribute in the resource that changed, in this case it will be always `Status`.", + "enum": [ + "ATTRIBUTE_UNSPECIFIED", + "STATUS" + ], + "enumDescriptions": [ + "Unspecified attribute", + "Status of the changed entity" + ], + "type": "string" + }, + "changes": { + "description": "A message to describe the change that happened to the product", + "items": { + "$ref": "ProductChange" + }, + "type": "array" + }, + "managingAccount": { + "description": "The account that manages the merchant's account. can be the same as merchant id if it is standalone account. Format : `accounts/{service_provider_id}`", + "type": "string" + }, + "resource": { + "description": "The product name. Format: `{product.name=accounts/{account}/products/{product}}`", + "type": "string" + }, + "resourceId": { + "description": "The product id.", + "type": "string" + }, + "resourceType": { + "description": "The resource that changed, in this case it will always be `Product`.", + "enum": [ + "RESOURCE_UNSPECIFIED", + "PRODUCT" + ], + "enumDescriptions": [ + "Unspecified resource", + "Resource type : product" + ], + "type": "string" + } + }, + "type": "object" + }, + "RegionalInventory": { + "description": "Regional inventory information for the product. Represents specific information like price and availability for a given product in a specific `region`. For a list of all accepted attribute values, see the [regional product inventory data specification](https://support.google.com/merchants/answer/9698880).", + "id": "RegionalInventory", + "properties": { + "account": { + "description": "Output only. The account that owns the product. This field will be ignored if set by the client.", + "format": "int64", + "readOnly": true, + "type": "string" + }, + "availability": { + "description": "Availability of the product in this region. For accepted attribute values, see the [regional product inventory data specification](https://support.google.com/merchants/answer/3061342)", + "type": "string" + }, + "customAttributes": { + "description": "A list of custom (merchant-provided) attributes. You can also use `CustomAttribute` to submit any attribute of the data specification in its generic form.", + "items": { + "$ref": "CustomAttribute" + }, + "type": "array" + }, + "name": { + "description": "Output only. The name of the `RegionalInventory` resource. Format: `{regional_inventory.name=accounts/{account}/products/{product}/regionalInventories/{region}`", + "readOnly": true, + "type": "string" + }, + "price": { + "$ref": "Price", + "description": "Price of the product in this region." + }, + "region": { + "description": "Required. Immutable. ID of the region for this `RegionalInventory` resource. See the [Regional availability and pricing](https://support.google.com/merchants/answer/9698880) for more details.", + "type": "string" + }, + "salePrice": { + "$ref": "Price", + "description": "Sale price of the product in this region. Mandatory if `salePriceEffectiveDate` is defined." + }, + "salePriceEffectiveDate": { + "$ref": "Interval", + "description": "The `TimePeriod` of the sale price in this region." + } + }, + "type": "object" + } + }, + "servicePath": "", + "title": "Merchant API", + "version": "inventories_v1beta", + "version_module": true +} \ No newline at end of file diff --git a/merchantapi/inventories_v1beta/merchantapi-gen.go b/merchantapi/inventories_v1beta/merchantapi-gen.go new file mode 100644 index 00000000000..fed720172cf --- /dev/null +++ b/merchantapi/inventories_v1beta/merchantapi-gen.go @@ -0,0 +1,1311 @@ +// Copyright 2024 Google LLC. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Code generated file. DO NOT EDIT. + +// Package merchantapi provides access to the Merchant API. +// +// For product documentation, see: https://developers.devsite.corp.google.com/merchant/api +// +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// +// # Creating a client +// +// Usage example: +// +// import "google.golang.org/api/merchantapi/inventories_v1beta" +// ... +// ctx := context.Background() +// merchantapiService, err := merchantapi.NewService(ctx) +// +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// +// # Other authentication options +// +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: +// +// merchantapiService, err := merchantapi.NewService(ctx, option.WithAPIKey("AIza...")) +// +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: +// +// config := &oauth2.Config{...} +// // ... +// token, err := config.Exchange(ctx, ...) +// merchantapiService, err := merchantapi.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) +// +// See [google.golang.org/api/option.ClientOption] for details on options. +package merchantapi // import "google.golang.org/api/merchantapi/inventories_v1beta" + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strconv" + "strings" + + googleapi "google.golang.org/api/googleapi" + internal "google.golang.org/api/internal" + gensupport "google.golang.org/api/internal/gensupport" + option "google.golang.org/api/option" + internaloption "google.golang.org/api/option/internaloption" + htransport "google.golang.org/api/transport/http" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = gensupport.MarshalJSON +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = context.Canceled +var _ = internaloption.WithDefaultEndpoint +var _ = internal.Version + +const apiId = "merchantapi:inventories_v1beta" +const apiName = "merchantapi" +const apiVersion = "inventories_v1beta" +const basePath = "https://merchantapi.googleapis.com/" +const basePathTemplate = "https://merchantapi.UNIVERSE_DOMAIN/" +const mtlsBasePath = "https://merchantapi.mtls.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // Manage your product listings and accounts for Google Shopping + ContentScope = "https://www.googleapis.com/auth/content" +) + +// NewService creates a new Service. +func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { + scopesOption := internaloption.WithDefaultScopes( + "https://www.googleapis.com/auth/content", + ) + // NOTE: prepend, so we don't override user-specified scopes. + opts = append([]option.ClientOption{scopesOption}, opts...) + opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) + opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) + opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) + opts = append(opts, internaloption.EnableNewAuthLibrary()) + client, endpoint, err := htransport.NewClient(ctx, opts...) + if err != nil { + return nil, err + } + s, err := New(client) + if err != nil { + return nil, err + } + if endpoint != "" { + s.BasePath = endpoint + } + return s, nil +} + +// New creates a new Service. It uses the provided http.Client for requests. +// +// Deprecated: please use NewService instead. +// To provide a custom HTTP client, use option.WithHTTPClient. +// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Accounts *AccountsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewAccountsService(s *Service) *AccountsService { + rs := &AccountsService{s: s} + rs.Products = NewAccountsProductsService(s) + return rs +} + +type AccountsService struct { + s *Service + + Products *AccountsProductsService +} + +func NewAccountsProductsService(s *Service) *AccountsProductsService { + rs := &AccountsProductsService{s: s} + rs.LocalInventories = NewAccountsProductsLocalInventoriesService(s) + rs.RegionalInventories = NewAccountsProductsRegionalInventoriesService(s) + return rs +} + +type AccountsProductsService struct { + s *Service + + LocalInventories *AccountsProductsLocalInventoriesService + + RegionalInventories *AccountsProductsRegionalInventoriesService +} + +func NewAccountsProductsLocalInventoriesService(s *Service) *AccountsProductsLocalInventoriesService { + rs := &AccountsProductsLocalInventoriesService{s: s} + return rs +} + +type AccountsProductsLocalInventoriesService struct { + s *Service +} + +func NewAccountsProductsRegionalInventoriesService(s *Service) *AccountsProductsRegionalInventoriesService { + rs := &AccountsProductsRegionalInventoriesService{s: s} + return rs +} + +type AccountsProductsRegionalInventoriesService struct { + s *Service +} + +// CustomAttribute: A message that represents custom attributes. Exactly one of +// `value` or `group_values` must not be empty. +type CustomAttribute struct { + // GroupValues: Subattributes within this attribute group. If `group_values` is + // not empty, `value` must be empty. + GroupValues []*CustomAttribute `json:"groupValues,omitempty"` + // Name: The name of the attribute. + Name string `json:"name,omitempty"` + // Value: The value of the attribute. If `value` is not empty, `group_values` + // must be empty. + Value string `json:"value,omitempty"` + // ForceSendFields is a list of field names (e.g. "GroupValues") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "GroupValues") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *CustomAttribute) MarshalJSON() ([]byte, error) { + type NoMethod CustomAttribute + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Empty: A generic empty message that you can re-use to avoid defining +// duplicated empty messages in your APIs. A typical example is to use it as +// the request or the response type of an API method. For instance: service Foo +// { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } +type Empty struct { + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` +} + +// Interval: Represents a time interval, encoded as a Timestamp start +// (inclusive) and a Timestamp end (exclusive). The start must be less than or +// equal to the end. When the start equals the end, the interval is empty +// (matches no time). When both start and end are unspecified, the interval +// matches any time. +type Interval struct { + // EndTime: Optional. Exclusive end of the interval. If specified, a Timestamp + // matching this interval will have to be before the end. + EndTime string `json:"endTime,omitempty"` + // StartTime: Optional. Inclusive start of the interval. If specified, a + // Timestamp matching this interval will have to be the same or after the + // start. + StartTime string `json:"startTime,omitempty"` + // ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "EndTime") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Interval) MarshalJSON() ([]byte, error) { + type NoMethod Interval + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ListLocalInventoriesResponse: Response message for the +// `ListLocalInventories` method. +type ListLocalInventoriesResponse struct { + // LocalInventories: The `LocalInventory` resources for the given product from + // the specified account. + LocalInventories []*LocalInventory `json:"localInventories,omitempty"` + // NextPageToken: A token, which can be sent as `pageToken` to retrieve the + // next page. If this field is omitted, there are no subsequent pages. + 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. "LocalInventories") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "LocalInventories") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ListLocalInventoriesResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListLocalInventoriesResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ListRegionalInventoriesResponse: Response message for the +// `ListRegionalInventories` method. +type ListRegionalInventoriesResponse struct { + // NextPageToken: A token, which can be sent as `pageToken` to retrieve the + // next page. If this field is omitted, there are no subsequent pages. + NextPageToken string `json:"nextPageToken,omitempty"` + // RegionalInventories: The `RegionalInventory` resources for the given product + // from the specified account. + RegionalInventories []*RegionalInventory `json:"regionalInventories,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "NextPageToken") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ListRegionalInventoriesResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListRegionalInventoriesResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// LocalInventory: Local inventory information for the product. Represents +// in-store information for a specific product at the store specified by +// `storeCode`. For a list of all accepted attribute values, see the local +// product inventory data specification +// (https://support.google.com/merchants/answer/3061342). +type LocalInventory struct { + // Account: Output only. The account that owns the product. This field will be + // ignored if set by the client. + Account int64 `json:"account,omitempty,string"` + // Availability: Availability of the product at this store. For accepted + // attribute values, see the local product inventory data specification + // (https://support.google.com/merchants/answer/3061342) + Availability string `json:"availability,omitempty"` + // CustomAttributes: A list of custom (merchant-provided) attributes. You can + // also use `CustomAttribute` to submit any attribute of the data specification + // in its generic form. + CustomAttributes []*CustomAttribute `json:"customAttributes,omitempty"` + // InstoreProductLocation: Location of the product inside the store. Maximum + // length is 20 bytes. + InstoreProductLocation string `json:"instoreProductLocation,omitempty"` + // Name: Output only. The name of the `LocalInventory` resource. Format: + // `accounts/{account}/products/{product}/localInventories/{store_code}` + Name string `json:"name,omitempty"` + // PickupMethod: Supported pickup method for this product. Unless the value is + // "not supported", this field must be submitted together with `pickupSla`. + // For accepted attribute values, see the local product inventory data + // specification (https://support.google.com/merchants/answer/3061342) + PickupMethod string `json:"pickupMethod,omitempty"` + // PickupSla: Relative time period from the order date for an order for this + // product, from this store, to be ready for pickup. Must be submitted with + // `pickupMethod`. For accepted attribute values, see the local product + // inventory data specification + // (https://support.google.com/merchants/answer/3061342) + PickupSla string `json:"pickupSla,omitempty"` + // Price: Price of the product at this store. + Price *Price `json:"price,omitempty"` + // Quantity: Quantity of the product available at this store. Must be greater + // than or equal to zero. + Quantity int64 `json:"quantity,omitempty,string"` + // SalePrice: Sale price of the product at this store. Mandatory if + // `salePriceEffectiveDate` is defined. + SalePrice *Price `json:"salePrice,omitempty"` + // SalePriceEffectiveDate: The `TimePeriod` of the sale at this store. + SalePriceEffectiveDate *Interval `json:"salePriceEffectiveDate,omitempty"` + // StoreCode: Required. Immutable. Store code (the store ID from your Business + // Profile) of the physical store the product is sold in. See the Local product + // inventory data specification + // (https://support.google.com/merchants/answer/3061342) for more information. + StoreCode string `json:"storeCode,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "Account") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Account") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *LocalInventory) MarshalJSON() ([]byte, error) { + type NoMethod LocalInventory + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Price: The price represented as a number and currency. +type Price struct { + // AmountMicros: The price represented as a number in micros (1 million micros + // is an equivalent to one's currency standard unit, for example, 1 USD = + // 1000000 micros). + AmountMicros int64 `json:"amountMicros,omitempty,string"` + // CurrencyCode: The currency of the price using three-letter acronyms + // according to ISO 4217 (http://en.wikipedia.org/wiki/ISO_4217). + CurrencyCode string `json:"currencyCode,omitempty"` + // ForceSendFields is a list of field names (e.g. "AmountMicros") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AmountMicros") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Price) MarshalJSON() ([]byte, error) { + type NoMethod Price + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ProductChange: The change that happened to the product including old value, +// new value, country code as the region code and reporting context. +type ProductChange struct { + // NewValue: The new value of the changed resource or attribute. + NewValue string `json:"newValue,omitempty"` + // OldValue: The old value of the changed resource or attribute. + OldValue string `json:"oldValue,omitempty"` + // RegionCode: Countries that have the change (if applicable) + RegionCode string `json:"regionCode,omitempty"` + // ReportingContext: Reporting contexts that have the change (if applicable) + // + // Possible values: + // "REPORTING_CONTEXT_ENUM_UNSPECIFIED" - Not specified. + // "SHOPPING_ADS" - [Shopping + // ads](https://support.google.com/merchants/answer/6149970). + // "DISCOVERY_ADS" - Deprecated: Use `DEMAND_GEN_ADS` instead. [Discovery and + // Demand Gen ads](https://support.google.com/merchants/answer/13389785). + // "DEMAND_GEN_ADS" - [Demand Gen + // ads](https://support.google.com/merchants/answer/13389785). + // "DEMAND_GEN_ADS_DISCOVER_SURFACE" - [Demand Gen ads on Discover + // surface](https://support.google.com/merchants/answer/13389785). + // "VIDEO_ADS" - [Video + // ads](https://support.google.com/google-ads/answer/6340491). + // "DISPLAY_ADS" - [Display + // ads](https://support.google.com/merchants/answer/6069387). + // "LOCAL_INVENTORY_ADS" - [Local inventory + // ads](https://support.google.com/merchants/answer/3271956). + // "VEHICLE_INVENTORY_ADS" - [Vehicle inventory + // ads](https://support.google.com/merchants/answer/11544533). + // "FREE_LISTINGS" - [Free product + // listings](https://support.google.com/merchants/answer/9199328). + // "FREE_LOCAL_LISTINGS" - [Free local product + // listings](https://support.google.com/merchants/answer/9825611). + // "FREE_LOCAL_VEHICLE_LISTINGS" - [Free local vehicle + // listings](https://support.google.com/merchants/answer/11544533). + // "YOUTUBE_SHOPPING" - [YouTube + // Shopping](https://support.google.com/merchants/answer/13478370). + // "CLOUD_RETAIL" - [Cloud + // retail](https://cloud.google.com/solutions/retail). + // "LOCAL_CLOUD_RETAIL" - [Local cloud + // retail](https://cloud.google.com/solutions/retail). + ReportingContext string `json:"reportingContext,omitempty"` + // ForceSendFields is a list of field names (e.g. "NewValue") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "NewValue") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ProductChange) MarshalJSON() ([]byte, error) { + type NoMethod ProductChange + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ProductStatusChangeMessage: The message that the merchant will receive to +// notify about product status change event +type ProductStatusChangeMessage struct { + // Account: The target account that owns the entity that changed. Format : + // `accounts/{merchant_id}` + Account string `json:"account,omitempty"` + // Attribute: The attribute in the resource that changed, in this case it will + // be always `Status`. + // + // Possible values: + // "ATTRIBUTE_UNSPECIFIED" - Unspecified attribute + // "STATUS" - Status of the changed entity + Attribute string `json:"attribute,omitempty"` + // Changes: A message to describe the change that happened to the product + Changes []*ProductChange `json:"changes,omitempty"` + // ManagingAccount: The account that manages the merchant's account. can be the + // same as merchant id if it is standalone account. Format : + // `accounts/{service_provider_id}` + ManagingAccount string `json:"managingAccount,omitempty"` + // Resource: The product name. Format: + // `{product.name=accounts/{account}/products/{product}}` + Resource string `json:"resource,omitempty"` + // ResourceId: The product id. + ResourceId string `json:"resourceId,omitempty"` + // ResourceType: The resource that changed, in this case it will always be + // `Product`. + // + // Possible values: + // "RESOURCE_UNSPECIFIED" - Unspecified resource + // "PRODUCT" - Resource type : product + ResourceType string `json:"resourceType,omitempty"` + // ForceSendFields is a list of field names (e.g. "Account") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Account") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ProductStatusChangeMessage) MarshalJSON() ([]byte, error) { + type NoMethod ProductStatusChangeMessage + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// RegionalInventory: Regional inventory information for the product. +// Represents specific information like price and availability for a given +// product in a specific `region`. For a list of all accepted attribute values, +// see the regional product inventory data specification +// (https://support.google.com/merchants/answer/9698880). +type RegionalInventory struct { + // Account: Output only. The account that owns the product. This field will be + // ignored if set by the client. + Account int64 `json:"account,omitempty,string"` + // Availability: Availability of the product in this region. For accepted + // attribute values, see the regional product inventory data specification + // (https://support.google.com/merchants/answer/3061342) + Availability string `json:"availability,omitempty"` + // CustomAttributes: A list of custom (merchant-provided) attributes. You can + // also use `CustomAttribute` to submit any attribute of the data specification + // in its generic form. + CustomAttributes []*CustomAttribute `json:"customAttributes,omitempty"` + // Name: Output only. The name of the `RegionalInventory` resource. Format: + // `{regional_inventory.name=accounts/{account}/products/{product}/regionalInven + // tories/{region}` + Name string `json:"name,omitempty"` + // Price: Price of the product in this region. + Price *Price `json:"price,omitempty"` + // Region: Required. Immutable. ID of the region for this `RegionalInventory` + // resource. See the Regional availability and pricing + // (https://support.google.com/merchants/answer/9698880) for more details. + Region string `json:"region,omitempty"` + // SalePrice: Sale price of the product in this region. Mandatory if + // `salePriceEffectiveDate` is defined. + SalePrice *Price `json:"salePrice,omitempty"` + // SalePriceEffectiveDate: The `TimePeriod` of the sale price in this region. + SalePriceEffectiveDate *Interval `json:"salePriceEffectiveDate,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "Account") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Account") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *RegionalInventory) MarshalJSON() ([]byte, error) { + type NoMethod RegionalInventory + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +type AccountsProductsLocalInventoriesDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes the specified `LocalInventory` from the given product in +// your merchant account. It might take a up to an hour for the +// `LocalInventory` to be deleted from the specific product. Once you have +// received a successful delete response, wait for that period before +// attempting a delete again. +// +// - name: The name of the local inventory for the given product to delete. +// Format: +// `accounts/{account}/products/{product}/localInventories/{store_code}`. +func (r *AccountsProductsLocalInventoriesService) Delete(name string) *AccountsProductsLocalInventoriesDeleteCall { + c := &AccountsProductsLocalInventoriesDeleteCall{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 +// details. +func (c *AccountsProductsLocalInventoriesDeleteCall) Fields(s ...googleapi.Field) *AccountsProductsLocalInventoriesDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsProductsLocalInventoriesDeleteCall) Context(ctx context.Context) *AccountsProductsLocalInventoriesDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsProductsLocalInventoriesDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsProductsLocalInventoriesDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "inventories/v1beta/{+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 "merchantapi.accounts.products.localInventories.delete" call. +// 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 *AccountsProductsLocalInventoriesDeleteCall) 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 +} + +type AccountsProductsLocalInventoriesInsertCall struct { + s *Service + parent string + localinventory *LocalInventory + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Insert: Inserts a `LocalInventory` resource to a product in your merchant +// account. Replaces the full `LocalInventory` resource if an entry with the +// same `storeCode` already exists for the product. It might take up to 30 +// minutes for the new or updated `LocalInventory` resource to appear in +// products. +// +// - parent: The account and product where this inventory will be inserted. +// Format: `accounts/{account}/products/{product}`. +func (r *AccountsProductsLocalInventoriesService) Insert(parent string, localinventory *LocalInventory) *AccountsProductsLocalInventoriesInsertCall { + c := &AccountsProductsLocalInventoriesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.localinventory = localinventory + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *AccountsProductsLocalInventoriesInsertCall) Fields(s ...googleapi.Field) *AccountsProductsLocalInventoriesInsertCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsProductsLocalInventoriesInsertCall) Context(ctx context.Context) *AccountsProductsLocalInventoriesInsertCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsProductsLocalInventoriesInsertCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsProductsLocalInventoriesInsertCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.localinventory) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "inventories/v1beta/{+parent}/localInventories:insert") + 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 "merchantapi.accounts.products.localInventories.insert" call. +// Any non-2xx status code is an error. Response headers are in either +// *LocalInventory.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 *AccountsProductsLocalInventoriesInsertCall) Do(opts ...googleapi.CallOption) (*LocalInventory, 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 := &LocalInventory{ + 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 +} + +type AccountsProductsLocalInventoriesListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists the `LocalInventory` resources for the given product in your +// merchant account. The response might contain fewer items than specified by +// `pageSize`. If `pageToken` was returned in previous request, it can be used +// to obtain additional results. `LocalInventory` resources are listed per +// product for a given account. +// +// - parent: The `name` of the parent product to list local inventories for. +// Format: `accounts/{account}/products/{product}`. +func (r *AccountsProductsLocalInventoriesService) List(parent string) *AccountsProductsLocalInventoriesListCall { + c := &AccountsProductsLocalInventoriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number of +// `LocalInventory` resources for the given product to return. The service +// returns fewer than this value if the number of inventories for the given +// product is less that than the `pageSize`. The default value is 25000. The +// maximum value is 25000; If a value higher than the maximum is specified, +// then the `pageSize` will default to the maximum +func (c *AccountsProductsLocalInventoriesListCall) PageSize(pageSize int64) *AccountsProductsLocalInventoriesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, received +// from a previous `ListLocalInventories` call. Provide the page token to +// retrieve the subsequent page. When paginating, all other parameters provided +// to `ListLocalInventories` must match the call that provided the page token. +// The token returned as nextPageToken in the response to the previous request. +func (c *AccountsProductsLocalInventoriesListCall) PageToken(pageToken string) *AccountsProductsLocalInventoriesListCall { + 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 +// details. +func (c *AccountsProductsLocalInventoriesListCall) Fields(s ...googleapi.Field) *AccountsProductsLocalInventoriesListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsProductsLocalInventoriesListCall) IfNoneMatch(entityTag string) *AccountsProductsLocalInventoriesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsProductsLocalInventoriesListCall) Context(ctx context.Context) *AccountsProductsLocalInventoriesListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsProductsLocalInventoriesListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsProductsLocalInventoriesListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "inventories/v1beta/{+parent}/localInventories") + 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 "merchantapi.accounts.products.localInventories.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *ListLocalInventoriesResponse.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 *AccountsProductsLocalInventoriesListCall) Do(opts ...googleapi.CallOption) (*ListLocalInventoriesResponse, 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 := &ListLocalInventoriesResponse{ + 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 +} + +// 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 *AccountsProductsLocalInventoriesListCall) Pages(ctx context.Context, f func(*ListLocalInventoriesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + 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) + } +} + +type AccountsProductsRegionalInventoriesDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes the specified `RegionalInventory` resource from the given +// product in your merchant account. It might take up to an hour for the +// `RegionalInventory` to be deleted from the specific product. Once you have +// received a successful delete response, wait for that period before +// attempting a delete again. +// +// - name: The name of the `RegionalInventory` resource to delete. Format: +// `accounts/{account}/products/{product}/regionalInventories/{region}`. +func (r *AccountsProductsRegionalInventoriesService) Delete(name string) *AccountsProductsRegionalInventoriesDeleteCall { + c := &AccountsProductsRegionalInventoriesDeleteCall{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 +// details. +func (c *AccountsProductsRegionalInventoriesDeleteCall) Fields(s ...googleapi.Field) *AccountsProductsRegionalInventoriesDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsProductsRegionalInventoriesDeleteCall) Context(ctx context.Context) *AccountsProductsRegionalInventoriesDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsProductsRegionalInventoriesDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsProductsRegionalInventoriesDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "inventories/v1beta/{+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 "merchantapi.accounts.products.regionalInventories.delete" call. +// 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 *AccountsProductsRegionalInventoriesDeleteCall) 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 +} + +type AccountsProductsRegionalInventoriesInsertCall struct { + s *Service + parent string + regionalinventory *RegionalInventory + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Insert: Inserts a `RegionalInventory` to a given product in your merchant +// account. Replaces the full `RegionalInventory` resource if an entry with the +// same `region` already exists for the product. It might take up to 30 minutes +// for the new or updated `RegionalInventory` resource to appear in products. +// +// - parent: The account and product where this inventory will be inserted. +// Format: `accounts/{account}/products/{product}`. +func (r *AccountsProductsRegionalInventoriesService) Insert(parent string, regionalinventory *RegionalInventory) *AccountsProductsRegionalInventoriesInsertCall { + c := &AccountsProductsRegionalInventoriesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.regionalinventory = regionalinventory + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *AccountsProductsRegionalInventoriesInsertCall) Fields(s ...googleapi.Field) *AccountsProductsRegionalInventoriesInsertCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsProductsRegionalInventoriesInsertCall) Context(ctx context.Context) *AccountsProductsRegionalInventoriesInsertCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsProductsRegionalInventoriesInsertCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsProductsRegionalInventoriesInsertCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionalinventory) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "inventories/v1beta/{+parent}/regionalInventories:insert") + 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 "merchantapi.accounts.products.regionalInventories.insert" call. +// Any non-2xx status code is an error. Response headers are in either +// *RegionalInventory.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 *AccountsProductsRegionalInventoriesInsertCall) Do(opts ...googleapi.CallOption) (*RegionalInventory, 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 := &RegionalInventory{ + 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 +} + +type AccountsProductsRegionalInventoriesListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists the `RegionalInventory` resources for the given product in your +// merchant account. The response might contain fewer items than specified by +// `pageSize`. If `pageToken` was returned in previous request, it can be used +// to obtain additional results. `RegionalInventory` resources are listed per +// product for a given account. +// +// - parent: The `name` of the parent product to list `RegionalInventory` +// resources for. Format: `accounts/{account}/products/{product}`. +func (r *AccountsProductsRegionalInventoriesService) List(parent string) *AccountsProductsRegionalInventoriesListCall { + c := &AccountsProductsRegionalInventoriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number of +// `RegionalInventory` resources for the given product to return. The service +// returns fewer than this value if the number of inventories for the given +// product is less that than the `pageSize`. The default value is 25000. The +// maximum value is 100000; If a value higher than the maximum is specified, +// then the `pageSize` will default to the maximum. +func (c *AccountsProductsRegionalInventoriesListCall) PageSize(pageSize int64) *AccountsProductsRegionalInventoriesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, received +// from a previous `ListRegionalInventories` call. Provide the page token to +// retrieve the subsequent page. When paginating, all other parameters provided +// to `ListRegionalInventories` must match the call that provided the page +// token. The token returned as nextPageToken in the response to the previous +// request. +func (c *AccountsProductsRegionalInventoriesListCall) PageToken(pageToken string) *AccountsProductsRegionalInventoriesListCall { + 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 +// details. +func (c *AccountsProductsRegionalInventoriesListCall) Fields(s ...googleapi.Field) *AccountsProductsRegionalInventoriesListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsProductsRegionalInventoriesListCall) IfNoneMatch(entityTag string) *AccountsProductsRegionalInventoriesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsProductsRegionalInventoriesListCall) Context(ctx context.Context) *AccountsProductsRegionalInventoriesListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsProductsRegionalInventoriesListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsProductsRegionalInventoriesListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "inventories/v1beta/{+parent}/regionalInventories") + 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 "merchantapi.accounts.products.regionalInventories.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *ListRegionalInventoriesResponse.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 *AccountsProductsRegionalInventoriesListCall) Do(opts ...googleapi.CallOption) (*ListRegionalInventoriesResponse, 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 := &ListRegionalInventoriesResponse{ + 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 +} + +// 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 *AccountsProductsRegionalInventoriesListCall) Pages(ctx context.Context, f func(*ListRegionalInventoriesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + 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) + } +} diff --git a/merchantapi/lfp_v1beta/merchantapi-api.json b/merchantapi/lfp_v1beta/merchantapi-api.json new file mode 100644 index 00000000000..26ba153491e --- /dev/null +++ b/merchantapi/lfp_v1beta/merchantapi-api.json @@ -0,0 +1,672 @@ +{ + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/content": { + "description": "Manage your product listings and accounts for Google Shopping" + } + } + } + }, + "basePath": "", + "baseUrl": "https://merchantapi.googleapis.com/", + "batchPath": "batch", + "canonicalName": "Merchant", + "description": "Programmatically manage your Merchant Center Accounts.", + "discoveryVersion": "v1", + "documentationLink": "https://developers.devsite.corp.google.com/merchant/api", + "fullyEncodeReservedExpansion": true, + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "id": "merchantapi:lfp_v1beta", + "kind": "discovery#restDescription", + "mtlsRootUrl": "https://merchantapi.mtls.googleapis.com/", + "name": "merchantapi", + "ownerDomain": "google.com", + "ownerName": "Google", + "parameters": { + "$.xgafv": { + "description": "V1 error format.", + "enum": [ + "1", + "2" + ], + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "type": "string" + }, + "access_token": { + "description": "OAuth access token.", + "location": "query", + "type": "string" + }, + "alt": { + "default": "json", + "description": "Data format for response.", + "enum": [ + "json", + "media", + "proto" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query", + "type": "string" + }, + "callback": { + "description": "JSONP", + "location": "query", + "type": "string" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "location": "query", + "type": "string" + }, + "key": { + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query", + "type": "string" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "location": "query", + "type": "string" + }, + "prettyPrint": { + "default": "true", + "description": "Returns response with indentations and line breaks.", + "location": "query", + "type": "boolean" + }, + "quotaUser": { + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query", + "type": "string" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query", + "type": "string" + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query", + "type": "string" + } + }, + "protocol": "rest", + "resources": { + "accounts": { + "resources": { + "lfpInventories": { + "methods": { + "insert": { + "description": "Inserts a `LfpInventory` resource for the given target merchant account. If the resource already exists, it will be replaced. The inventory automatically expires after 30 days.", + "flatPath": "lfp/v1beta/accounts/{accountsId}/lfpInventories:insert", + "httpMethod": "POST", + "id": "merchantapi.accounts.lfpInventories.insert", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The LFP provider account. Format: `accounts/{account}`", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "lfp/v1beta/{+parent}/lfpInventories:insert", + "request": { + "$ref": "LfpInventory" + }, + "response": { + "$ref": "LfpInventory" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + }, + "lfpSales": { + "methods": { + "insert": { + "description": "Inserts a `LfpSale` for the given merchant.", + "flatPath": "lfp/v1beta/accounts/{accountsId}/lfpSales:insert", + "httpMethod": "POST", + "id": "merchantapi.accounts.lfpSales.insert", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The LFP provider account. Format: `accounts/{lfp_partner}`", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "lfp/v1beta/{+parent}/lfpSales:insert", + "request": { + "$ref": "LfpSale" + }, + "response": { + "$ref": "LfpSale" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + }, + "lfpStores": { + "methods": { + "delete": { + "description": "Deletes a store for a target merchant.", + "flatPath": "lfp/v1beta/accounts/{accountsId}/lfpStores/{lfpStoresId}", + "httpMethod": "DELETE", + "id": "merchantapi.accounts.lfpStores.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the store to delete for the target merchant account. Format: `accounts/{account}/lfpStores/{target_merchant}~{store_code}`", + "location": "path", + "pattern": "^accounts/[^/]+/lfpStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "lfp/v1beta/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "get": { + "description": "Retrieves information about a store.", + "flatPath": "lfp/v1beta/accounts/{accountsId}/lfpStores/{lfpStoresId}", + "httpMethod": "GET", + "id": "merchantapi.accounts.lfpStores.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the store to retrieve. Format: `accounts/{account}/lfpStores/{target_merchant}~{store_code}`", + "location": "path", + "pattern": "^accounts/[^/]+/lfpStores/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "lfp/v1beta/{+name}", + "response": { + "$ref": "LfpStore" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "insert": { + "description": "Inserts a store for the target merchant. If the store with the same store code already exists, it will be replaced.", + "flatPath": "lfp/v1beta/accounts/{accountsId}/lfpStores:insert", + "httpMethod": "POST", + "id": "merchantapi.accounts.lfpStores.insert", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The LFP provider account Format: `accounts/{account}`", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "lfp/v1beta/{+parent}/lfpStores:insert", + "request": { + "$ref": "LfpStore" + }, + "response": { + "$ref": "LfpStore" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "description": "Lists the stores of the target merchant, specified by the filter in `ListLfpStoresRequest`.", + "flatPath": "lfp/v1beta/accounts/{accountsId}/lfpStores", + "httpMethod": "GET", + "id": "merchantapi.accounts.lfpStores.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of `LfpStore` resources for the given account to return. The service returns fewer than this value if the number of stores for the given account is less than the `pageSize`. The default value is 250. The maximum value is 1000; If a value higher than the maximum is specified, then the `pageSize` will default to the maximum.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. A page token, received from a previous `ListLfpStoresRequest` call. Provide the page token to retrieve the subsequent page. When paginating, all other parameters provided to `ListLfpStoresRequest` must match the call that provided the page token. The token returned as nextPageToken in the response to the previous request.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The LFP partner. Format: `accounts/{account}`", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + }, + "targetAccount": { + "description": "Required. The Merchant Center id of the merchant to list stores for.", + "format": "int64", + "location": "query", + "type": "string" + } + }, + "path": "lfp/v1beta/{+parent}/lfpStores", + "response": { + "$ref": "ListLfpStoresResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + } + } + } + }, + "revision": "20240613", + "rootUrl": "https://merchantapi.googleapis.com/", + "schemas": { + "Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }", + "id": "Empty", + "properties": {}, + "type": "object" + }, + "LfpInventory": { + "description": "Local Inventory for the merchant.", + "id": "LfpInventory", + "properties": { + "availability": { + "description": "Required. Availability of the product at this store. For accepted attribute values, see the [local product inventory data specification](https://support.google.com/merchants/answer/3061342)", + "type": "string" + }, + "collectionTime": { + "description": "Optional. The time when the inventory is collected. If not set, it will be set to the time when the inventory is submitted.", + "format": "google-datetime", + "type": "string" + }, + "contentLanguage": { + "description": "Required. The two-letter ISO 639-1 language code for the item.", + "type": "string" + }, + "feedLabel": { + "description": "Optional. The [feed label](https://developers.google.com/shopping-content/guides/products/feed-labels) for the product. If this is not set, it will default to `regionCode`.", + "type": "string" + }, + "gtin": { + "description": "Optional. The Global Trade Item Number of the product.", + "type": "string" + }, + "name": { + "description": "Output only. Identifier. The name for the `LfpInventory` resource. Format: `accounts/{account}/lfpInventories/{target_merchant}~{store_code}~{offer}`", + "readOnly": true, + "type": "string" + }, + "offerId": { + "description": "Required. Immutable. A unique identifier for the product. If both inventories and sales are submitted for a merchant, this id should match for the same product. **Note**: if the merchant sells the same product new and used, they should have different IDs.", + "type": "string" + }, + "pickupMethod": { + "description": "Optional. Supported pickup method for this offer. Unless the value is \"not supported\", this field must be submitted together with `pickupSla`. For accepted attribute values, see the [local product inventory data specification](https://support.google.com/merchants/answer/3061342).", + "type": "string" + }, + "pickupSla": { + "description": "Optional. Expected date that an order will be ready for pickup relative to the order date. Must be submitted together with `pickupMethod`. For accepted attribute values, see the [local product inventory data specification](https://support.google.com/merchants/answer/3061342).", + "type": "string" + }, + "price": { + "$ref": "Price", + "description": "Optional. The current price of the product." + }, + "quantity": { + "description": "Optional. Quantity of the product available at this store. Must be greater than or equal to zero.", + "format": "int64", + "type": "string" + }, + "regionCode": { + "description": "Required. The [CLDR territory code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml) for the country where the product is sold.", + "type": "string" + }, + "storeCode": { + "description": "Required. The identifier of the merchant's store. Either the store code inserted through `InsertLfpStore` or the store code in the Business Profile.", + "type": "string" + }, + "targetAccount": { + "description": "Required. The Merchant Center ID of the merchant to submit the inventory for.", + "format": "int64", + "type": "string" + } + }, + "type": "object" + }, + "LfpSale": { + "description": "A sale for the merchant.", + "id": "LfpSale", + "properties": { + "contentLanguage": { + "description": "Required. The two-letter ISO 639-1 language code for the item.", + "type": "string" + }, + "feedLabel": { + "description": "Optional. The [feed label](https://developers.google.com/shopping-content/guides/products/feed-labels) for the product. If this is not set, it will default to `regionCode`.", + "type": "string" + }, + "gtin": { + "description": "Required. The Global Trade Item Number of the sold product.", + "type": "string" + }, + "name": { + "description": "Output only. Identifier. The name of the `LfpSale` resource. Format: `accounts/{account}/lfpSales/{sale}`", + "readOnly": true, + "type": "string" + }, + "offerId": { + "description": "Required. A unique identifier for the product. If both inventories and sales are submitted for a merchant, this id should match for the same product. **Note**: if the merchant sells the same product new and used, they should have different IDs.", + "type": "string" + }, + "price": { + "$ref": "Price", + "description": "Required. The unit price of the product." + }, + "quantity": { + "description": "Required. The relative change of the available quantity. Negative for items returned.", + "format": "int64", + "type": "string" + }, + "regionCode": { + "description": "Required. The [CLDR territory code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml) for the country where the product is sold.", + "type": "string" + }, + "saleTime": { + "description": "Required. The timestamp for the sale.", + "format": "google-datetime", + "type": "string" + }, + "storeCode": { + "description": "Required. The identifier of the merchant's store. Either a `storeCode` inserted through the API or the code of the store in the Business Profile.", + "type": "string" + }, + "targetAccount": { + "description": "Required. The Merchant Center ID of the merchant to submit the sale for.", + "format": "int64", + "type": "string" + }, + "uid": { + "description": "Output only. System generated globally unique ID for the `LfpSale`.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "LfpStore": { + "description": "A store for the merchant. This will be used to match to a store under the Google Business Profile of the target merchant. If a matching store can't be found, the inventories or sales submitted with the store code will not be used.", + "id": "LfpStore", + "properties": { + "gcidCategory": { + "description": "Optional. [Google My Business category id](https://gcid-explorer.corp.google.com/static/gcid.html).", + "items": { + "type": "string" + }, + "type": "array" + }, + "matchingState": { + "description": "Optional. Output only. The state of matching to a Google Business Profile. See matchingStateHint for further details if no match is found.", + "enum": [ + "STORE_MATCHING_STATE_UNSPECIFIED", + "STORE_MATCHING_STATE_MATCHED", + "STORE_MATCHING_STATE_FAILED" + ], + "enumDescriptions": [ + "Store matching state unspecified.", + "The `LfpStore` is successfully matched with a Google Business Profile store.", + "The `LfpStore` is not matched with a Google Business Profile store." + ], + "readOnly": true, + "type": "string" + }, + "matchingStateHint": { + "description": "Optional. Output only. The hint of why the matching has failed. This is only set when matchingState=`STORE_MATCHING_STATE_FAILED`. Possible values are: - \"`linked-store-not-found`\": There aren't any Google Business Profile stores available for matching. - \"`store-match-not-found`\": The provided `LfpStore` couldn't be matched to any of the connected Google Business Profile stores. Merchant Center account is connected correctly and stores are available on Google Business Profile, but the `LfpStore` location address does not match with Google Business Profile stores' addresses. Update the `LfpStore` address or Google Business Profile store address to match correctly. - \"`store-match-unverified`\": The provided `LfpStore` couldn't be matched to any of the connected Google Business Profile stores, as the matched Google Business Profile store is unverified. Go through the Google Business Profile verification process to match correctly.", + "readOnly": true, + "type": "string" + }, + "name": { + "description": "Output only. Identifier. The name of the `LfpStore` resource. Format: `accounts/{account}/lfpStores/{target_merchant}~{store_code}`", + "readOnly": true, + "type": "string" + }, + "phoneNumber": { + "description": "Optional. The store phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format. Example: `+15556767888`", + "type": "string" + }, + "placeId": { + "description": "Optional. The [Google Place Id](https://developers.google.com/maps/documentation/places/web-service/place-id#id-overview) of the store location.", + "type": "string" + }, + "storeAddress": { + "description": "Required. The street address of the store. Example: 1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA.", + "type": "string" + }, + "storeCode": { + "description": "Required. Immutable. A store identifier that is unique for the target merchant.", + "type": "string" + }, + "storeName": { + "description": "Optional. The merchant or store name.", + "type": "string" + }, + "targetAccount": { + "description": "Required. The Merchant Center id of the merchant to submit the store for.", + "format": "int64", + "type": "string" + }, + "websiteUri": { + "description": "Optional. The website URL for the store or merchant.", + "type": "string" + } + }, + "type": "object" + }, + "ListLfpStoresResponse": { + "description": "Response message for the ListLfpStores method.", + "id": "ListLfpStoresResponse", + "properties": { + "lfpStores": { + "description": "The stores from the specified merchant.", + "items": { + "$ref": "LfpStore" + }, + "type": "array" + }, + "nextPageToken": { + "description": "A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "type": "string" + } + }, + "type": "object" + }, + "Price": { + "description": "The price represented as a number and currency.", + "id": "Price", + "properties": { + "amountMicros": { + "description": "The price represented as a number in micros (1 million micros is an equivalent to one's currency standard unit, for example, 1 USD = 1000000 micros).", + "format": "int64", + "type": "string" + }, + "currencyCode": { + "description": "The currency of the price using three-letter acronyms according to [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217).", + "type": "string" + } + }, + "type": "object" + }, + "ProductChange": { + "description": "The change that happened to the product including old value, new value, country code as the region code and reporting context.", + "id": "ProductChange", + "properties": { + "newValue": { + "description": "The new value of the changed resource or attribute.", + "type": "string" + }, + "oldValue": { + "description": "The old value of the changed resource or attribute.", + "type": "string" + }, + "regionCode": { + "description": "Countries that have the change (if applicable)", + "type": "string" + }, + "reportingContext": { + "description": "Reporting contexts that have the change (if applicable)", + "enum": [ + "REPORTING_CONTEXT_ENUM_UNSPECIFIED", + "SHOPPING_ADS", + "DISCOVERY_ADS", + "DEMAND_GEN_ADS", + "DEMAND_GEN_ADS_DISCOVER_SURFACE", + "VIDEO_ADS", + "DISPLAY_ADS", + "LOCAL_INVENTORY_ADS", + "VEHICLE_INVENTORY_ADS", + "FREE_LISTINGS", + "FREE_LOCAL_LISTINGS", + "FREE_LOCAL_VEHICLE_LISTINGS", + "YOUTUBE_SHOPPING", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL" + ], + "enumDeprecated": [ + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false + ], + "enumDescriptions": [ + "Not specified.", + "[Shopping ads](https://support.google.com/merchants/answer/6149970).", + "Deprecated: Use `DEMAND_GEN_ADS` instead. [Discovery and Demand Gen ads](https://support.google.com/merchants/answer/13389785).", + "[Demand Gen ads](https://support.google.com/merchants/answer/13389785).", + "[Demand Gen ads on Discover surface](https://support.google.com/merchants/answer/13389785).", + "[Video ads](https://support.google.com/google-ads/answer/6340491).", + "[Display ads](https://support.google.com/merchants/answer/6069387).", + "[Local inventory ads](https://support.google.com/merchants/answer/3271956).", + "[Vehicle inventory ads](https://support.google.com/merchants/answer/11544533).", + "[Free product listings](https://support.google.com/merchants/answer/9199328).", + "[Free local product listings](https://support.google.com/merchants/answer/9825611).", + "[Free local vehicle listings](https://support.google.com/merchants/answer/11544533).", + "[YouTube Shopping](https://support.google.com/merchants/answer/13478370).", + "[Cloud retail](https://cloud.google.com/solutions/retail).", + "[Local cloud retail](https://cloud.google.com/solutions/retail)." + ], + "type": "string" + } + }, + "type": "object" + }, + "ProductStatusChangeMessage": { + "description": "The message that the merchant will receive to notify about product status change event", + "id": "ProductStatusChangeMessage", + "properties": { + "account": { + "description": "The target account that owns the entity that changed. Format : `accounts/{merchant_id}`", + "type": "string" + }, + "attribute": { + "description": "The attribute in the resource that changed, in this case it will be always `Status`.", + "enum": [ + "ATTRIBUTE_UNSPECIFIED", + "STATUS" + ], + "enumDescriptions": [ + "Unspecified attribute", + "Status of the changed entity" + ], + "type": "string" + }, + "changes": { + "description": "A message to describe the change that happened to the product", + "items": { + "$ref": "ProductChange" + }, + "type": "array" + }, + "managingAccount": { + "description": "The account that manages the merchant's account. can be the same as merchant id if it is standalone account. Format : `accounts/{service_provider_id}`", + "type": "string" + }, + "resource": { + "description": "The product name. Format: `{product.name=accounts/{account}/products/{product}}`", + "type": "string" + }, + "resourceId": { + "description": "The product id.", + "type": "string" + }, + "resourceType": { + "description": "The resource that changed, in this case it will always be `Product`.", + "enum": [ + "RESOURCE_UNSPECIFIED", + "PRODUCT" + ], + "enumDescriptions": [ + "Unspecified resource", + "Resource type : product" + ], + "type": "string" + } + }, + "type": "object" + } + }, + "servicePath": "", + "title": "Merchant API", + "version": "lfp_v1beta", + "version_module": true +} \ No newline at end of file diff --git a/merchantapi/lfp_v1beta/merchantapi-gen.go b/merchantapi/lfp_v1beta/merchantapi-gen.go new file mode 100644 index 00000000000..3126bc2e81e --- /dev/null +++ b/merchantapi/lfp_v1beta/merchantapi-gen.go @@ -0,0 +1,1251 @@ +// Copyright 2024 Google LLC. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Code generated file. DO NOT EDIT. + +// Package merchantapi provides access to the Merchant API. +// +// For product documentation, see: https://developers.devsite.corp.google.com/merchant/api +// +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// +// # Creating a client +// +// Usage example: +// +// import "google.golang.org/api/merchantapi/lfp_v1beta" +// ... +// ctx := context.Background() +// merchantapiService, err := merchantapi.NewService(ctx) +// +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// +// # Other authentication options +// +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: +// +// merchantapiService, err := merchantapi.NewService(ctx, option.WithAPIKey("AIza...")) +// +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: +// +// config := &oauth2.Config{...} +// // ... +// token, err := config.Exchange(ctx, ...) +// merchantapiService, err := merchantapi.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) +// +// See [google.golang.org/api/option.ClientOption] for details on options. +package merchantapi // import "google.golang.org/api/merchantapi/lfp_v1beta" + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strconv" + "strings" + + googleapi "google.golang.org/api/googleapi" + internal "google.golang.org/api/internal" + gensupport "google.golang.org/api/internal/gensupport" + option "google.golang.org/api/option" + internaloption "google.golang.org/api/option/internaloption" + htransport "google.golang.org/api/transport/http" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = gensupport.MarshalJSON +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = context.Canceled +var _ = internaloption.WithDefaultEndpoint +var _ = internal.Version + +const apiId = "merchantapi:lfp_v1beta" +const apiName = "merchantapi" +const apiVersion = "lfp_v1beta" +const basePath = "https://merchantapi.googleapis.com/" +const basePathTemplate = "https://merchantapi.UNIVERSE_DOMAIN/" +const mtlsBasePath = "https://merchantapi.mtls.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // Manage your product listings and accounts for Google Shopping + ContentScope = "https://www.googleapis.com/auth/content" +) + +// NewService creates a new Service. +func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { + scopesOption := internaloption.WithDefaultScopes( + "https://www.googleapis.com/auth/content", + ) + // NOTE: prepend, so we don't override user-specified scopes. + opts = append([]option.ClientOption{scopesOption}, opts...) + opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) + opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) + opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) + opts = append(opts, internaloption.EnableNewAuthLibrary()) + client, endpoint, err := htransport.NewClient(ctx, opts...) + if err != nil { + return nil, err + } + s, err := New(client) + if err != nil { + return nil, err + } + if endpoint != "" { + s.BasePath = endpoint + } + return s, nil +} + +// New creates a new Service. It uses the provided http.Client for requests. +// +// Deprecated: please use NewService instead. +// To provide a custom HTTP client, use option.WithHTTPClient. +// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Accounts *AccountsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewAccountsService(s *Service) *AccountsService { + rs := &AccountsService{s: s} + rs.LfpInventories = NewAccountsLfpInventoriesService(s) + rs.LfpSales = NewAccountsLfpSalesService(s) + rs.LfpStores = NewAccountsLfpStoresService(s) + return rs +} + +type AccountsService struct { + s *Service + + LfpInventories *AccountsLfpInventoriesService + + LfpSales *AccountsLfpSalesService + + LfpStores *AccountsLfpStoresService +} + +func NewAccountsLfpInventoriesService(s *Service) *AccountsLfpInventoriesService { + rs := &AccountsLfpInventoriesService{s: s} + return rs +} + +type AccountsLfpInventoriesService struct { + s *Service +} + +func NewAccountsLfpSalesService(s *Service) *AccountsLfpSalesService { + rs := &AccountsLfpSalesService{s: s} + return rs +} + +type AccountsLfpSalesService struct { + s *Service +} + +func NewAccountsLfpStoresService(s *Service) *AccountsLfpStoresService { + rs := &AccountsLfpStoresService{s: s} + return rs +} + +type AccountsLfpStoresService struct { + s *Service +} + +// Empty: A generic empty message that you can re-use to avoid defining +// duplicated empty messages in your APIs. A typical example is to use it as +// the request or the response type of an API method. For instance: service Foo +// { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } +type Empty struct { + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` +} + +// LfpInventory: Local Inventory for the merchant. +type LfpInventory struct { + // Availability: Required. Availability of the product at this store. For + // accepted attribute values, see the local product inventory data + // specification (https://support.google.com/merchants/answer/3061342) + Availability string `json:"availability,omitempty"` + // CollectionTime: Optional. The time when the inventory is collected. If not + // set, it will be set to the time when the inventory is submitted. + CollectionTime string `json:"collectionTime,omitempty"` + // ContentLanguage: Required. The two-letter ISO 639-1 language code for the + // item. + ContentLanguage string `json:"contentLanguage,omitempty"` + // FeedLabel: Optional. The feed label + // (https://developers.google.com/shopping-content/guides/products/feed-labels) + // for the product. If this is not set, it will default to `regionCode`. + FeedLabel string `json:"feedLabel,omitempty"` + // Gtin: Optional. The Global Trade Item Number of the product. + Gtin string `json:"gtin,omitempty"` + // Name: Output only. Identifier. The name for the `LfpInventory` resource. + // Format: + // `accounts/{account}/lfpInventories/{target_merchant}~{store_code}~{offer}` + Name string `json:"name,omitempty"` + // OfferId: Required. Immutable. A unique identifier for the product. If both + // inventories and sales are submitted for a merchant, this id should match for + // the same product. **Note**: if the merchant sells the same product new and + // used, they should have different IDs. + OfferId string `json:"offerId,omitempty"` + // PickupMethod: Optional. Supported pickup method for this offer. Unless the + // value is "not supported", this field must be submitted together with + // `pickupSla`. For accepted attribute values, see the local product inventory + // data specification (https://support.google.com/merchants/answer/3061342). + PickupMethod string `json:"pickupMethod,omitempty"` + // PickupSla: Optional. Expected date that an order will be ready for pickup + // relative to the order date. Must be submitted together with `pickupMethod`. + // For accepted attribute values, see the local product inventory data + // specification (https://support.google.com/merchants/answer/3061342). + PickupSla string `json:"pickupSla,omitempty"` + // Price: Optional. The current price of the product. + Price *Price `json:"price,omitempty"` + // Quantity: Optional. Quantity of the product available at this store. Must be + // greater than or equal to zero. + Quantity int64 `json:"quantity,omitempty,string"` + // RegionCode: Required. The CLDR territory code + // (https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml) for the + // country where the product is sold. + RegionCode string `json:"regionCode,omitempty"` + // StoreCode: Required. The identifier of the merchant's store. Either the + // store code inserted through `InsertLfpStore` or the store code in the + // Business Profile. + StoreCode string `json:"storeCode,omitempty"` + // TargetAccount: Required. The Merchant Center ID of the merchant to submit + // the inventory for. + TargetAccount int64 `json:"targetAccount,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "Availability") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Availability") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *LfpInventory) MarshalJSON() ([]byte, error) { + type NoMethod LfpInventory + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// LfpSale: A sale for the merchant. +type LfpSale struct { + // ContentLanguage: Required. The two-letter ISO 639-1 language code for the + // item. + ContentLanguage string `json:"contentLanguage,omitempty"` + // FeedLabel: Optional. The feed label + // (https://developers.google.com/shopping-content/guides/products/feed-labels) + // for the product. If this is not set, it will default to `regionCode`. + FeedLabel string `json:"feedLabel,omitempty"` + // Gtin: Required. The Global Trade Item Number of the sold product. + Gtin string `json:"gtin,omitempty"` + // Name: Output only. Identifier. The name of the `LfpSale` resource. Format: + // `accounts/{account}/lfpSales/{sale}` + Name string `json:"name,omitempty"` + // OfferId: Required. A unique identifier for the product. If both inventories + // and sales are submitted for a merchant, this id should match for the same + // product. **Note**: if the merchant sells the same product new and used, they + // should have different IDs. + OfferId string `json:"offerId,omitempty"` + // Price: Required. The unit price of the product. + Price *Price `json:"price,omitempty"` + // Quantity: Required. The relative change of the available quantity. Negative + // for items returned. + Quantity int64 `json:"quantity,omitempty,string"` + // RegionCode: Required. The CLDR territory code + // (https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml) for the + // country where the product is sold. + RegionCode string `json:"regionCode,omitempty"` + // SaleTime: Required. The timestamp for the sale. + SaleTime string `json:"saleTime,omitempty"` + // StoreCode: Required. The identifier of the merchant's store. Either a + // `storeCode` inserted through the API or the code of the store in the + // Business Profile. + StoreCode string `json:"storeCode,omitempty"` + // TargetAccount: Required. The Merchant Center ID of the merchant to submit + // the sale for. + TargetAccount int64 `json:"targetAccount,omitempty,string"` + // Uid: Output only. System generated globally unique ID for the `LfpSale`. + Uid string `json:"uid,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "ContentLanguage") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ContentLanguage") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *LfpSale) MarshalJSON() ([]byte, error) { + type NoMethod LfpSale + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// LfpStore: A store for the merchant. This will be used to match to a store +// under the Google Business Profile of the target merchant. If a matching +// store can't be found, the inventories or sales submitted with the store code +// will not be used. +type LfpStore struct { + // GcidCategory: Optional. Google My Business category id + // (https://gcid-explorer.corp.google.com/static/gcid.html). + GcidCategory []string `json:"gcidCategory,omitempty"` + // MatchingState: Optional. Output only. The state of matching to a Google + // Business Profile. See matchingStateHint for further details if no match is + // found. + // + // Possible values: + // "STORE_MATCHING_STATE_UNSPECIFIED" - Store matching state unspecified. + // "STORE_MATCHING_STATE_MATCHED" - The `LfpStore` is successfully matched + // with a Google Business Profile store. + // "STORE_MATCHING_STATE_FAILED" - The `LfpStore` is not matched with a + // Google Business Profile store. + MatchingState string `json:"matchingState,omitempty"` + // MatchingStateHint: Optional. Output only. The hint of why the matching has + // failed. This is only set when matchingState=`STORE_MATCHING_STATE_FAILED`. + // Possible values are: - "linked-store-not-found": There aren't any Google + // Business Profile stores available for matching. - "store-match-not-found": + // The provided `LfpStore` couldn't be matched to any of the connected Google + // Business Profile stores. Merchant Center account is connected correctly and + // stores are available on Google Business Profile, but the `LfpStore` location + // address does not match with Google Business Profile stores' addresses. + // Update the `LfpStore` address or Google Business Profile store address to + // match correctly. - "store-match-unverified": The provided `LfpStore` + // couldn't be matched to any of the connected Google Business Profile stores, + // as the matched Google Business Profile store is unverified. Go through the + // Google Business Profile verification process to match correctly. + MatchingStateHint string `json:"matchingStateHint,omitempty"` + // Name: Output only. Identifier. The name of the `LfpStore` resource. Format: + // `accounts/{account}/lfpStores/{target_merchant}~{store_code}` + Name string `json:"name,omitempty"` + // PhoneNumber: Optional. The store phone number in E.164 + // (https://en.wikipedia.org/wiki/E.164) format. Example: `+15556767888` + PhoneNumber string `json:"phoneNumber,omitempty"` + // PlaceId: Optional. The Google Place Id + // (https://developers.google.com/maps/documentation/places/web-service/place-id#id-overview) + // of the store location. + PlaceId string `json:"placeId,omitempty"` + // StoreAddress: Required. The street address of the store. Example: 1600 + // Amphitheatre Pkwy, Mountain View, CA 94043, USA. + StoreAddress string `json:"storeAddress,omitempty"` + // StoreCode: Required. Immutable. A store identifier that is unique for the + // target merchant. + StoreCode string `json:"storeCode,omitempty"` + // StoreName: Optional. The merchant or store name. + StoreName string `json:"storeName,omitempty"` + // TargetAccount: Required. The Merchant Center id of the merchant to submit + // the store for. + TargetAccount int64 `json:"targetAccount,omitempty,string"` + // WebsiteUri: Optional. The website URL for the store or merchant. + WebsiteUri string `json:"websiteUri,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "GcidCategory") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "GcidCategory") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *LfpStore) MarshalJSON() ([]byte, error) { + type NoMethod LfpStore + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ListLfpStoresResponse: Response message for the ListLfpStores method. +type ListLfpStoresResponse struct { + // LfpStores: The stores from the specified merchant. + LfpStores []*LfpStore `json:"lfpStores,omitempty"` + // NextPageToken: A token, which can be sent as `pageToken` to retrieve the + // next page. If this field is omitted, there are no subsequent pages. + 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. "LfpStores") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "LfpStores") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ListLfpStoresResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListLfpStoresResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Price: The price represented as a number and currency. +type Price struct { + // AmountMicros: The price represented as a number in micros (1 million micros + // is an equivalent to one's currency standard unit, for example, 1 USD = + // 1000000 micros). + AmountMicros int64 `json:"amountMicros,omitempty,string"` + // CurrencyCode: The currency of the price using three-letter acronyms + // according to ISO 4217 (http://en.wikipedia.org/wiki/ISO_4217). + CurrencyCode string `json:"currencyCode,omitempty"` + // ForceSendFields is a list of field names (e.g. "AmountMicros") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AmountMicros") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Price) MarshalJSON() ([]byte, error) { + type NoMethod Price + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ProductChange: The change that happened to the product including old value, +// new value, country code as the region code and reporting context. +type ProductChange struct { + // NewValue: The new value of the changed resource or attribute. + NewValue string `json:"newValue,omitempty"` + // OldValue: The old value of the changed resource or attribute. + OldValue string `json:"oldValue,omitempty"` + // RegionCode: Countries that have the change (if applicable) + RegionCode string `json:"regionCode,omitempty"` + // ReportingContext: Reporting contexts that have the change (if applicable) + // + // Possible values: + // "REPORTING_CONTEXT_ENUM_UNSPECIFIED" - Not specified. + // "SHOPPING_ADS" - [Shopping + // ads](https://support.google.com/merchants/answer/6149970). + // "DISCOVERY_ADS" - Deprecated: Use `DEMAND_GEN_ADS` instead. [Discovery and + // Demand Gen ads](https://support.google.com/merchants/answer/13389785). + // "DEMAND_GEN_ADS" - [Demand Gen + // ads](https://support.google.com/merchants/answer/13389785). + // "DEMAND_GEN_ADS_DISCOVER_SURFACE" - [Demand Gen ads on Discover + // surface](https://support.google.com/merchants/answer/13389785). + // "VIDEO_ADS" - [Video + // ads](https://support.google.com/google-ads/answer/6340491). + // "DISPLAY_ADS" - [Display + // ads](https://support.google.com/merchants/answer/6069387). + // "LOCAL_INVENTORY_ADS" - [Local inventory + // ads](https://support.google.com/merchants/answer/3271956). + // "VEHICLE_INVENTORY_ADS" - [Vehicle inventory + // ads](https://support.google.com/merchants/answer/11544533). + // "FREE_LISTINGS" - [Free product + // listings](https://support.google.com/merchants/answer/9199328). + // "FREE_LOCAL_LISTINGS" - [Free local product + // listings](https://support.google.com/merchants/answer/9825611). + // "FREE_LOCAL_VEHICLE_LISTINGS" - [Free local vehicle + // listings](https://support.google.com/merchants/answer/11544533). + // "YOUTUBE_SHOPPING" - [YouTube + // Shopping](https://support.google.com/merchants/answer/13478370). + // "CLOUD_RETAIL" - [Cloud + // retail](https://cloud.google.com/solutions/retail). + // "LOCAL_CLOUD_RETAIL" - [Local cloud + // retail](https://cloud.google.com/solutions/retail). + ReportingContext string `json:"reportingContext,omitempty"` + // ForceSendFields is a list of field names (e.g. "NewValue") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "NewValue") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ProductChange) MarshalJSON() ([]byte, error) { + type NoMethod ProductChange + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ProductStatusChangeMessage: The message that the merchant will receive to +// notify about product status change event +type ProductStatusChangeMessage struct { + // Account: The target account that owns the entity that changed. Format : + // `accounts/{merchant_id}` + Account string `json:"account,omitempty"` + // Attribute: The attribute in the resource that changed, in this case it will + // be always `Status`. + // + // Possible values: + // "ATTRIBUTE_UNSPECIFIED" - Unspecified attribute + // "STATUS" - Status of the changed entity + Attribute string `json:"attribute,omitempty"` + // Changes: A message to describe the change that happened to the product + Changes []*ProductChange `json:"changes,omitempty"` + // ManagingAccount: The account that manages the merchant's account. can be the + // same as merchant id if it is standalone account. Format : + // `accounts/{service_provider_id}` + ManagingAccount string `json:"managingAccount,omitempty"` + // Resource: The product name. Format: + // `{product.name=accounts/{account}/products/{product}}` + Resource string `json:"resource,omitempty"` + // ResourceId: The product id. + ResourceId string `json:"resourceId,omitempty"` + // ResourceType: The resource that changed, in this case it will always be + // `Product`. + // + // Possible values: + // "RESOURCE_UNSPECIFIED" - Unspecified resource + // "PRODUCT" - Resource type : product + ResourceType string `json:"resourceType,omitempty"` + // ForceSendFields is a list of field names (e.g. "Account") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Account") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ProductStatusChangeMessage) MarshalJSON() ([]byte, error) { + type NoMethod ProductStatusChangeMessage + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +type AccountsLfpInventoriesInsertCall struct { + s *Service + parent string + lfpinventory *LfpInventory + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Insert: Inserts a `LfpInventory` resource for the given target merchant +// account. If the resource already exists, it will be replaced. The inventory +// automatically expires after 30 days. +// +// - parent: The LFP provider account. Format: `accounts/{account}`. +func (r *AccountsLfpInventoriesService) Insert(parent string, lfpinventory *LfpInventory) *AccountsLfpInventoriesInsertCall { + c := &AccountsLfpInventoriesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.lfpinventory = lfpinventory + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *AccountsLfpInventoriesInsertCall) Fields(s ...googleapi.Field) *AccountsLfpInventoriesInsertCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsLfpInventoriesInsertCall) Context(ctx context.Context) *AccountsLfpInventoriesInsertCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsLfpInventoriesInsertCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsLfpInventoriesInsertCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.lfpinventory) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "lfp/v1beta/{+parent}/lfpInventories:insert") + 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 "merchantapi.accounts.lfpInventories.insert" call. +// Any non-2xx status code is an error. Response headers are in either +// *LfpInventory.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 *AccountsLfpInventoriesInsertCall) Do(opts ...googleapi.CallOption) (*LfpInventory, 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 := &LfpInventory{ + 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 +} + +type AccountsLfpSalesInsertCall struct { + s *Service + parent string + lfpsale *LfpSale + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Insert: Inserts a `LfpSale` for the given merchant. +// +// - parent: The LFP provider account. Format: `accounts/{lfp_partner}`. +func (r *AccountsLfpSalesService) Insert(parent string, lfpsale *LfpSale) *AccountsLfpSalesInsertCall { + c := &AccountsLfpSalesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.lfpsale = lfpsale + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *AccountsLfpSalesInsertCall) Fields(s ...googleapi.Field) *AccountsLfpSalesInsertCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsLfpSalesInsertCall) Context(ctx context.Context) *AccountsLfpSalesInsertCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsLfpSalesInsertCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsLfpSalesInsertCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.lfpsale) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "lfp/v1beta/{+parent}/lfpSales:insert") + 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 "merchantapi.accounts.lfpSales.insert" call. +// Any non-2xx status code is an error. Response headers are in either +// *LfpSale.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 *AccountsLfpSalesInsertCall) Do(opts ...googleapi.CallOption) (*LfpSale, 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 := &LfpSale{ + 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 +} + +type AccountsLfpStoresDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a store for a target merchant. +// +// - name: The name of the store to delete for the target merchant account. +// Format: `accounts/{account}/lfpStores/{target_merchant}~{store_code}`. +func (r *AccountsLfpStoresService) Delete(name string) *AccountsLfpStoresDeleteCall { + c := &AccountsLfpStoresDeleteCall{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 +// details. +func (c *AccountsLfpStoresDeleteCall) Fields(s ...googleapi.Field) *AccountsLfpStoresDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsLfpStoresDeleteCall) Context(ctx context.Context) *AccountsLfpStoresDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsLfpStoresDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsLfpStoresDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "lfp/v1beta/{+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 "merchantapi.accounts.lfpStores.delete" call. +// 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 *AccountsLfpStoresDeleteCall) 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 +} + +type AccountsLfpStoresGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Retrieves information about a store. +// +// - name: The name of the store to retrieve. Format: +// `accounts/{account}/lfpStores/{target_merchant}~{store_code}`. +func (r *AccountsLfpStoresService) Get(name string) *AccountsLfpStoresGetCall { + c := &AccountsLfpStoresGetCall{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 +// details. +func (c *AccountsLfpStoresGetCall) Fields(s ...googleapi.Field) *AccountsLfpStoresGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsLfpStoresGetCall) IfNoneMatch(entityTag string) *AccountsLfpStoresGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsLfpStoresGetCall) Context(ctx context.Context) *AccountsLfpStoresGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsLfpStoresGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsLfpStoresGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "lfp/v1beta/{+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 "merchantapi.accounts.lfpStores.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *LfpStore.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 *AccountsLfpStoresGetCall) Do(opts ...googleapi.CallOption) (*LfpStore, 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 := &LfpStore{ + 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 +} + +type AccountsLfpStoresInsertCall struct { + s *Service + parent string + lfpstore *LfpStore + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Insert: Inserts a store for the target merchant. If the store with the same +// store code already exists, it will be replaced. +// +// - parent: The LFP provider account Format: `accounts/{account}`. +func (r *AccountsLfpStoresService) Insert(parent string, lfpstore *LfpStore) *AccountsLfpStoresInsertCall { + c := &AccountsLfpStoresInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.lfpstore = lfpstore + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *AccountsLfpStoresInsertCall) Fields(s ...googleapi.Field) *AccountsLfpStoresInsertCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsLfpStoresInsertCall) Context(ctx context.Context) *AccountsLfpStoresInsertCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsLfpStoresInsertCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsLfpStoresInsertCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.lfpstore) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "lfp/v1beta/{+parent}/lfpStores:insert") + 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 "merchantapi.accounts.lfpStores.insert" call. +// Any non-2xx status code is an error. Response headers are in either +// *LfpStore.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 *AccountsLfpStoresInsertCall) Do(opts ...googleapi.CallOption) (*LfpStore, 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 := &LfpStore{ + 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 +} + +type AccountsLfpStoresListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists the stores of the target merchant, specified by the filter in +// `ListLfpStoresRequest`. +// +// - parent: The LFP partner. Format: `accounts/{account}`. +func (r *AccountsLfpStoresService) List(parent string) *AccountsLfpStoresListCall { + c := &AccountsLfpStoresListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number of +// `LfpStore` resources for the given account to return. The service returns +// fewer than this value if the number of stores for the given account is less +// than the `pageSize`. The default value is 250. The maximum value is 1000; If +// a value higher than the maximum is specified, then the `pageSize` will +// default to the maximum. +func (c *AccountsLfpStoresListCall) PageSize(pageSize int64) *AccountsLfpStoresListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, received +// from a previous `ListLfpStoresRequest` call. Provide the page token to +// retrieve the subsequent page. When paginating, all other parameters provided +// to `ListLfpStoresRequest` must match the call that provided the page token. +// The token returned as nextPageToken in the response to the previous request. +func (c *AccountsLfpStoresListCall) PageToken(pageToken string) *AccountsLfpStoresListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// TargetAccount sets the optional parameter "targetAccount": Required. The +// Merchant Center id of the merchant to list stores for. +func (c *AccountsLfpStoresListCall) TargetAccount(targetAccount int64) *AccountsLfpStoresListCall { + c.urlParams_.Set("targetAccount", fmt.Sprint(targetAccount)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *AccountsLfpStoresListCall) Fields(s ...googleapi.Field) *AccountsLfpStoresListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsLfpStoresListCall) IfNoneMatch(entityTag string) *AccountsLfpStoresListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsLfpStoresListCall) Context(ctx context.Context) *AccountsLfpStoresListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsLfpStoresListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsLfpStoresListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "lfp/v1beta/{+parent}/lfpStores") + 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 "merchantapi.accounts.lfpStores.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *ListLfpStoresResponse.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 *AccountsLfpStoresListCall) Do(opts ...googleapi.CallOption) (*ListLfpStoresResponse, 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 := &ListLfpStoresResponse{ + 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 +} + +// 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 *AccountsLfpStoresListCall) Pages(ctx context.Context, f func(*ListLfpStoresResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + 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) + } +} diff --git a/merchantapi/notifications_v1beta/merchantapi-api.json b/merchantapi/notifications_v1beta/merchantapi-api.json new file mode 100644 index 00000000000..df687ac723a --- /dev/null +++ b/merchantapi/notifications_v1beta/merchantapi-api.json @@ -0,0 +1,461 @@ +{ + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/content": { + "description": "Manage your product listings and accounts for Google Shopping" + } + } + } + }, + "basePath": "", + "baseUrl": "https://merchantapi.googleapis.com/", + "batchPath": "batch", + "canonicalName": "Merchant", + "description": "Programmatically manage your Merchant Center Accounts.", + "discoveryVersion": "v1", + "documentationLink": "https://developers.devsite.corp.google.com/merchant/api", + "fullyEncodeReservedExpansion": true, + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "id": "merchantapi:notifications_v1beta", + "kind": "discovery#restDescription", + "mtlsRootUrl": "https://merchantapi.mtls.googleapis.com/", + "name": "merchantapi", + "ownerDomain": "google.com", + "ownerName": "Google", + "parameters": { + "$.xgafv": { + "description": "V1 error format.", + "enum": [ + "1", + "2" + ], + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "type": "string" + }, + "access_token": { + "description": "OAuth access token.", + "location": "query", + "type": "string" + }, + "alt": { + "default": "json", + "description": "Data format for response.", + "enum": [ + "json", + "media", + "proto" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query", + "type": "string" + }, + "callback": { + "description": "JSONP", + "location": "query", + "type": "string" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "location": "query", + "type": "string" + }, + "key": { + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query", + "type": "string" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "location": "query", + "type": "string" + }, + "prettyPrint": { + "default": "true", + "description": "Returns response with indentations and line breaks.", + "location": "query", + "type": "boolean" + }, + "quotaUser": { + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query", + "type": "string" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query", + "type": "string" + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query", + "type": "string" + } + }, + "protocol": "rest", + "resources": { + "accounts": { + "resources": { + "notificationsubscriptions": { + "methods": { + "create": { + "description": "Creates a notification subscription for a merchant. We will allow the following types of notification subscriptions to exist together (per merchant as a subscriber per event type): 1. Subscription for all managed accounts + subscription for self 2. Multiple \"partial\" subscriptions for managed accounts + subscription for self we will not allow (per merchant as a subscriber per event type): 1. multiple self subscriptions. 2. multiple \"all managed accounts\" subscriptions. 3. all and partial subscriptions at the same time. 4. multiple partial subscriptions for the same target account", + "flatPath": "notifications/v1beta/accounts/{accountsId}/notificationsubscriptions", + "httpMethod": "POST", + "id": "merchantapi.accounts.notificationsubscriptions.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The merchant account that owns the new notification subscription. Format: `accounts/{account}`", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "notifications/v1beta/{+parent}/notificationsubscriptions", + "request": { + "$ref": "NotificationSubscription" + }, + "response": { + "$ref": "NotificationSubscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "delete": { + "description": "Deletes a notification subscription for a merchant.", + "flatPath": "notifications/v1beta/accounts/{accountsId}/notificationsubscriptions/{notificationsubscriptionsId}", + "httpMethod": "DELETE", + "id": "merchantapi.accounts.notificationsubscriptions.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the notification subscription to be deleted.", + "location": "path", + "pattern": "^accounts/[^/]+/notificationsubscriptions/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "notifications/v1beta/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "get": { + "description": "Gets notification subscriptions for an account.", + "flatPath": "notifications/v1beta/accounts/{accountsId}/notificationsubscriptions/{notificationsubscriptionsId}", + "httpMethod": "GET", + "id": "merchantapi.accounts.notificationsubscriptions.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The `name` of the notification subscription.", + "location": "path", + "pattern": "^accounts/[^/]+/notificationsubscriptions/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "notifications/v1beta/{+name}", + "response": { + "$ref": "NotificationSubscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "description": "Gets all the notification subscriptions for a merchant.", + "flatPath": "notifications/v1beta/accounts/{accountsId}/notificationsubscriptions", + "httpMethod": "GET", + "id": "merchantapi.accounts.notificationsubscriptions.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "The maximum number of notification subscriptions to return in a page. The default value for `page_size` is 100. The maximum value is `200`. Values above `200` will be coerced to `200`.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Token (if provided) to retrieve the subsequent page. All other parameters must match the original call that provided the page token.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The merchant account who owns the notification subscriptions. Format: `accounts/{account}`", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "notifications/v1beta/{+parent}/notificationsubscriptions", + "response": { + "$ref": "ListNotificationSubscriptionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "patch": { + "description": "Updates an existing notification subscription for a merchant.", + "flatPath": "notifications/v1beta/accounts/{accountsId}/notificationsubscriptions/{notificationsubscriptionsId}", + "httpMethod": "PATCH", + "id": "merchantapi.accounts.notificationsubscriptions.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Output only. The `name` of the notification configuration. Generated by the Content API upon creation of a new `NotificationSubscription`. The `account` represents the merchant ID of the merchant that owns the configuration. Format: `accounts/{account}/notificationsubscriptions/{notification_subscription}`", + "location": "path", + "pattern": "^accounts/[^/]+/notificationsubscriptions/[^/]+$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "List of fields being updated.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "notifications/v1beta/{+name}", + "request": { + "$ref": "NotificationSubscription" + }, + "response": { + "$ref": "NotificationSubscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + } + } + } + }, + "revision": "20240613", + "rootUrl": "https://merchantapi.googleapis.com/", + "schemas": { + "Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }", + "id": "Empty", + "properties": {}, + "type": "object" + }, + "ListNotificationSubscriptionsResponse": { + "description": "Response message for the ListNotificationSubscription method.", + "id": "ListNotificationSubscriptionsResponse", + "properties": { + "nextPageToken": { + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "type": "string" + }, + "notificationSubscriptions": { + "description": "The list of notification subscriptions requested by the merchant.", + "items": { + "$ref": "NotificationSubscription" + }, + "type": "array" + } + }, + "type": "object" + }, + "NotificationSubscription": { + "description": "Represents a notification subscription owned by a Merchant account.", + "id": "NotificationSubscription", + "properties": { + "allManagedAccounts": { + "description": "If this value is true, the requesting account is notified of the specified event for all managed accounts (can be subaccounts or other linked accounts) including newly added accounts on a daily basis.", + "type": "boolean" + }, + "callBackUri": { + "description": "URL to be used to push the notification to the merchant.", + "type": "string" + }, + "name": { + "description": "Output only. The `name` of the notification configuration. Generated by the Content API upon creation of a new `NotificationSubscription`. The `account` represents the merchant ID of the merchant that owns the configuration. Format: `accounts/{account}/notificationsubscriptions/{notification_subscription}`", + "readOnly": true, + "type": "string" + }, + "registeredEvent": { + "description": "The event that the merchant wants to be notified about.", + "enum": [ + "NOTIFICATION_EVENT_TYPE_UNSPECIFIED", + "PRODUCT_STATUS_CHANGE" + ], + "enumDescriptions": [ + "Notifications event type is unspecified.", + "Notification of product status changes, for example when product becomes disapproved." + ], + "type": "string" + }, + "targetAccount": { + "description": "The `name` of the account you want to receive notifications for. Format: `accounts/{account}`", + "type": "string" + } + }, + "type": "object" + }, + "ProductChange": { + "description": "The change that happened to the product including old value, new value, country code as the region code and reporting context.", + "id": "ProductChange", + "properties": { + "newValue": { + "description": "The new value of the changed resource or attribute.", + "type": "string" + }, + "oldValue": { + "description": "The old value of the changed resource or attribute.", + "type": "string" + }, + "regionCode": { + "description": "Countries that have the change (if applicable)", + "type": "string" + }, + "reportingContext": { + "description": "Reporting contexts that have the change (if applicable)", + "enum": [ + "REPORTING_CONTEXT_ENUM_UNSPECIFIED", + "SHOPPING_ADS", + "DISCOVERY_ADS", + "DEMAND_GEN_ADS", + "DEMAND_GEN_ADS_DISCOVER_SURFACE", + "VIDEO_ADS", + "DISPLAY_ADS", + "LOCAL_INVENTORY_ADS", + "VEHICLE_INVENTORY_ADS", + "FREE_LISTINGS", + "FREE_LOCAL_LISTINGS", + "FREE_LOCAL_VEHICLE_LISTINGS", + "YOUTUBE_SHOPPING", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL" + ], + "enumDeprecated": [ + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false + ], + "enumDescriptions": [ + "Not specified.", + "[Shopping ads](https://support.google.com/merchants/answer/6149970).", + "Deprecated: Use `DEMAND_GEN_ADS` instead. [Discovery and Demand Gen ads](https://support.google.com/merchants/answer/13389785).", + "[Demand Gen ads](https://support.google.com/merchants/answer/13389785).", + "[Demand Gen ads on Discover surface](https://support.google.com/merchants/answer/13389785).", + "[Video ads](https://support.google.com/google-ads/answer/6340491).", + "[Display ads](https://support.google.com/merchants/answer/6069387).", + "[Local inventory ads](https://support.google.com/merchants/answer/3271956).", + "[Vehicle inventory ads](https://support.google.com/merchants/answer/11544533).", + "[Free product listings](https://support.google.com/merchants/answer/9199328).", + "[Free local product listings](https://support.google.com/merchants/answer/9825611).", + "[Free local vehicle listings](https://support.google.com/merchants/answer/11544533).", + "[YouTube Shopping](https://support.google.com/merchants/answer/13478370).", + "[Cloud retail](https://cloud.google.com/solutions/retail).", + "[Local cloud retail](https://cloud.google.com/solutions/retail)." + ], + "type": "string" + } + }, + "type": "object" + }, + "ProductStatusChangeMessage": { + "description": "The message that the merchant will receive to notify about product status change event", + "id": "ProductStatusChangeMessage", + "properties": { + "account": { + "description": "The target account that owns the entity that changed. Format : `accounts/{merchant_id}`", + "type": "string" + }, + "attribute": { + "description": "The attribute in the resource that changed, in this case it will be always `Status`.", + "enum": [ + "ATTRIBUTE_UNSPECIFIED", + "STATUS" + ], + "enumDescriptions": [ + "Unspecified attribute", + "Status of the changed entity" + ], + "type": "string" + }, + "changes": { + "description": "A message to describe the change that happened to the product", + "items": { + "$ref": "ProductChange" + }, + "type": "array" + }, + "managingAccount": { + "description": "The account that manages the merchant's account. can be the same as merchant id if it is standalone account. Format : `accounts/{service_provider_id}`", + "type": "string" + }, + "resource": { + "description": "The product name. Format: `{product.name=accounts/{account}/products/{product}}`", + "type": "string" + }, + "resourceId": { + "description": "The product id.", + "type": "string" + }, + "resourceType": { + "description": "The resource that changed, in this case it will always be `Product`.", + "enum": [ + "RESOURCE_UNSPECIFIED", + "PRODUCT" + ], + "enumDescriptions": [ + "Unspecified resource", + "Resource type : product" + ], + "type": "string" + } + }, + "type": "object" + } + }, + "servicePath": "", + "title": "Merchant API", + "version": "notifications_v1beta", + "version_module": true +} \ No newline at end of file diff --git a/merchantapi/notifications_v1beta/merchantapi-gen.go b/merchantapi/notifications_v1beta/merchantapi-gen.go new file mode 100644 index 00000000000..b9e9b9cf722 --- /dev/null +++ b/merchantapi/notifications_v1beta/merchantapi-gen.go @@ -0,0 +1,943 @@ +// Copyright 2024 Google LLC. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Code generated file. DO NOT EDIT. + +// Package merchantapi provides access to the Merchant API. +// +// For product documentation, see: https://developers.devsite.corp.google.com/merchant/api +// +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// +// # Creating a client +// +// Usage example: +// +// import "google.golang.org/api/merchantapi/notifications_v1beta" +// ... +// ctx := context.Background() +// merchantapiService, err := merchantapi.NewService(ctx) +// +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// +// # Other authentication options +// +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: +// +// merchantapiService, err := merchantapi.NewService(ctx, option.WithAPIKey("AIza...")) +// +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: +// +// config := &oauth2.Config{...} +// // ... +// token, err := config.Exchange(ctx, ...) +// merchantapiService, err := merchantapi.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) +// +// See [google.golang.org/api/option.ClientOption] for details on options. +package merchantapi // import "google.golang.org/api/merchantapi/notifications_v1beta" + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strconv" + "strings" + + googleapi "google.golang.org/api/googleapi" + internal "google.golang.org/api/internal" + gensupport "google.golang.org/api/internal/gensupport" + option "google.golang.org/api/option" + internaloption "google.golang.org/api/option/internaloption" + htransport "google.golang.org/api/transport/http" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = gensupport.MarshalJSON +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = context.Canceled +var _ = internaloption.WithDefaultEndpoint +var _ = internal.Version + +const apiId = "merchantapi:notifications_v1beta" +const apiName = "merchantapi" +const apiVersion = "notifications_v1beta" +const basePath = "https://merchantapi.googleapis.com/" +const basePathTemplate = "https://merchantapi.UNIVERSE_DOMAIN/" +const mtlsBasePath = "https://merchantapi.mtls.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // Manage your product listings and accounts for Google Shopping + ContentScope = "https://www.googleapis.com/auth/content" +) + +// NewService creates a new Service. +func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { + scopesOption := internaloption.WithDefaultScopes( + "https://www.googleapis.com/auth/content", + ) + // NOTE: prepend, so we don't override user-specified scopes. + opts = append([]option.ClientOption{scopesOption}, opts...) + opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) + opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) + opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) + opts = append(opts, internaloption.EnableNewAuthLibrary()) + client, endpoint, err := htransport.NewClient(ctx, opts...) + if err != nil { + return nil, err + } + s, err := New(client) + if err != nil { + return nil, err + } + if endpoint != "" { + s.BasePath = endpoint + } + return s, nil +} + +// New creates a new Service. It uses the provided http.Client for requests. +// +// Deprecated: please use NewService instead. +// To provide a custom HTTP client, use option.WithHTTPClient. +// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Accounts *AccountsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewAccountsService(s *Service) *AccountsService { + rs := &AccountsService{s: s} + rs.Notificationsubscriptions = NewAccountsNotificationsubscriptionsService(s) + return rs +} + +type AccountsService struct { + s *Service + + Notificationsubscriptions *AccountsNotificationsubscriptionsService +} + +func NewAccountsNotificationsubscriptionsService(s *Service) *AccountsNotificationsubscriptionsService { + rs := &AccountsNotificationsubscriptionsService{s: s} + return rs +} + +type AccountsNotificationsubscriptionsService struct { + s *Service +} + +// Empty: A generic empty message that you can re-use to avoid defining +// duplicated empty messages in your APIs. A typical example is to use it as +// the request or the response type of an API method. For instance: service Foo +// { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } +type Empty struct { + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` +} + +// ListNotificationSubscriptionsResponse: Response message for the +// ListNotificationSubscription method. +type ListNotificationSubscriptionsResponse struct { + // NextPageToken: A token, which can be sent as `page_token` to retrieve the + // next page. If this field is omitted, there are no subsequent pages. + NextPageToken string `json:"nextPageToken,omitempty"` + // NotificationSubscriptions: The list of notification subscriptions requested + // by the merchant. + NotificationSubscriptions []*NotificationSubscription `json:"notificationSubscriptions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "NextPageToken") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ListNotificationSubscriptionsResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListNotificationSubscriptionsResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// NotificationSubscription: Represents a notification subscription owned by a +// Merchant account. +type NotificationSubscription struct { + // AllManagedAccounts: If this value is true, the requesting account is + // notified of the specified event for all managed accounts (can be subaccounts + // or other linked accounts) including newly added accounts on a daily basis. + AllManagedAccounts bool `json:"allManagedAccounts,omitempty"` + // CallBackUri: URL to be used to push the notification to the merchant. + CallBackUri string `json:"callBackUri,omitempty"` + // Name: Output only. The `name` of the notification configuration. Generated + // by the Content API upon creation of a new `NotificationSubscription`. The + // `account` represents the merchant ID of the merchant that owns the + // configuration. Format: + // `accounts/{account}/notificationsubscriptions/{notification_subscription}` + Name string `json:"name,omitempty"` + // RegisteredEvent: The event that the merchant wants to be notified about. + // + // Possible values: + // "NOTIFICATION_EVENT_TYPE_UNSPECIFIED" - Notifications event type is + // unspecified. + // "PRODUCT_STATUS_CHANGE" - Notification of product status changes, for + // example when product becomes disapproved. + RegisteredEvent string `json:"registeredEvent,omitempty"` + // TargetAccount: The `name` of the account you want to receive notifications + // for. Format: `accounts/{account}` + TargetAccount string `json:"targetAccount,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "AllManagedAccounts") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AllManagedAccounts") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *NotificationSubscription) MarshalJSON() ([]byte, error) { + type NoMethod NotificationSubscription + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ProductChange: The change that happened to the product including old value, +// new value, country code as the region code and reporting context. +type ProductChange struct { + // NewValue: The new value of the changed resource or attribute. + NewValue string `json:"newValue,omitempty"` + // OldValue: The old value of the changed resource or attribute. + OldValue string `json:"oldValue,omitempty"` + // RegionCode: Countries that have the change (if applicable) + RegionCode string `json:"regionCode,omitempty"` + // ReportingContext: Reporting contexts that have the change (if applicable) + // + // Possible values: + // "REPORTING_CONTEXT_ENUM_UNSPECIFIED" - Not specified. + // "SHOPPING_ADS" - [Shopping + // ads](https://support.google.com/merchants/answer/6149970). + // "DISCOVERY_ADS" - Deprecated: Use `DEMAND_GEN_ADS` instead. [Discovery and + // Demand Gen ads](https://support.google.com/merchants/answer/13389785). + // "DEMAND_GEN_ADS" - [Demand Gen + // ads](https://support.google.com/merchants/answer/13389785). + // "DEMAND_GEN_ADS_DISCOVER_SURFACE" - [Demand Gen ads on Discover + // surface](https://support.google.com/merchants/answer/13389785). + // "VIDEO_ADS" - [Video + // ads](https://support.google.com/google-ads/answer/6340491). + // "DISPLAY_ADS" - [Display + // ads](https://support.google.com/merchants/answer/6069387). + // "LOCAL_INVENTORY_ADS" - [Local inventory + // ads](https://support.google.com/merchants/answer/3271956). + // "VEHICLE_INVENTORY_ADS" - [Vehicle inventory + // ads](https://support.google.com/merchants/answer/11544533). + // "FREE_LISTINGS" - [Free product + // listings](https://support.google.com/merchants/answer/9199328). + // "FREE_LOCAL_LISTINGS" - [Free local product + // listings](https://support.google.com/merchants/answer/9825611). + // "FREE_LOCAL_VEHICLE_LISTINGS" - [Free local vehicle + // listings](https://support.google.com/merchants/answer/11544533). + // "YOUTUBE_SHOPPING" - [YouTube + // Shopping](https://support.google.com/merchants/answer/13478370). + // "CLOUD_RETAIL" - [Cloud + // retail](https://cloud.google.com/solutions/retail). + // "LOCAL_CLOUD_RETAIL" - [Local cloud + // retail](https://cloud.google.com/solutions/retail). + ReportingContext string `json:"reportingContext,omitempty"` + // ForceSendFields is a list of field names (e.g. "NewValue") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "NewValue") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ProductChange) MarshalJSON() ([]byte, error) { + type NoMethod ProductChange + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ProductStatusChangeMessage: The message that the merchant will receive to +// notify about product status change event +type ProductStatusChangeMessage struct { + // Account: The target account that owns the entity that changed. Format : + // `accounts/{merchant_id}` + Account string `json:"account,omitempty"` + // Attribute: The attribute in the resource that changed, in this case it will + // be always `Status`. + // + // Possible values: + // "ATTRIBUTE_UNSPECIFIED" - Unspecified attribute + // "STATUS" - Status of the changed entity + Attribute string `json:"attribute,omitempty"` + // Changes: A message to describe the change that happened to the product + Changes []*ProductChange `json:"changes,omitempty"` + // ManagingAccount: The account that manages the merchant's account. can be the + // same as merchant id if it is standalone account. Format : + // `accounts/{service_provider_id}` + ManagingAccount string `json:"managingAccount,omitempty"` + // Resource: The product name. Format: + // `{product.name=accounts/{account}/products/{product}}` + Resource string `json:"resource,omitempty"` + // ResourceId: The product id. + ResourceId string `json:"resourceId,omitempty"` + // ResourceType: The resource that changed, in this case it will always be + // `Product`. + // + // Possible values: + // "RESOURCE_UNSPECIFIED" - Unspecified resource + // "PRODUCT" - Resource type : product + ResourceType string `json:"resourceType,omitempty"` + // ForceSendFields is a list of field names (e.g. "Account") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Account") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ProductStatusChangeMessage) MarshalJSON() ([]byte, error) { + type NoMethod ProductStatusChangeMessage + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +type AccountsNotificationsubscriptionsCreateCall struct { + s *Service + parent string + notificationsubscription *NotificationSubscription + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a notification subscription for a merchant. We will allow +// the following types of notification subscriptions to exist together (per +// merchant as a subscriber per event type): 1. Subscription for all managed +// accounts + subscription for self 2. Multiple "partial" subscriptions for +// managed accounts + subscription for self we will not allow (per merchant as +// a subscriber per event type): 1. multiple self subscriptions. 2. multiple +// "all managed accounts" subscriptions. 3. all and partial subscriptions at +// the same time. 4. multiple partial subscriptions for the same target account +// +// - parent: The merchant account that owns the new notification subscription. +// Format: `accounts/{account}`. +func (r *AccountsNotificationsubscriptionsService) Create(parent string, notificationsubscription *NotificationSubscription) *AccountsNotificationsubscriptionsCreateCall { + c := &AccountsNotificationsubscriptionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.notificationsubscription = notificationsubscription + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *AccountsNotificationsubscriptionsCreateCall) Fields(s ...googleapi.Field) *AccountsNotificationsubscriptionsCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsNotificationsubscriptionsCreateCall) Context(ctx context.Context) *AccountsNotificationsubscriptionsCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsNotificationsubscriptionsCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsNotificationsubscriptionsCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationsubscription) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "notifications/v1beta/{+parent}/notificationsubscriptions") + 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 "merchantapi.accounts.notificationsubscriptions.create" call. +// Any non-2xx status code is an error. Response headers are in either +// *NotificationSubscription.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 *AccountsNotificationsubscriptionsCreateCall) Do(opts ...googleapi.CallOption) (*NotificationSubscription, 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 := &NotificationSubscription{ + 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 +} + +type AccountsNotificationsubscriptionsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a notification subscription for a merchant. +// +// - name: The name of the notification subscription to be deleted. +func (r *AccountsNotificationsubscriptionsService) Delete(name string) *AccountsNotificationsubscriptionsDeleteCall { + c := &AccountsNotificationsubscriptionsDeleteCall{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 +// details. +func (c *AccountsNotificationsubscriptionsDeleteCall) Fields(s ...googleapi.Field) *AccountsNotificationsubscriptionsDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsNotificationsubscriptionsDeleteCall) Context(ctx context.Context) *AccountsNotificationsubscriptionsDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsNotificationsubscriptionsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsNotificationsubscriptionsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "notifications/v1beta/{+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 "merchantapi.accounts.notificationsubscriptions.delete" call. +// 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 *AccountsNotificationsubscriptionsDeleteCall) 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 +} + +type AccountsNotificationsubscriptionsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets notification subscriptions for an account. +// +// - name: The `name` of the notification subscription. +func (r *AccountsNotificationsubscriptionsService) Get(name string) *AccountsNotificationsubscriptionsGetCall { + c := &AccountsNotificationsubscriptionsGetCall{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 +// details. +func (c *AccountsNotificationsubscriptionsGetCall) Fields(s ...googleapi.Field) *AccountsNotificationsubscriptionsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsNotificationsubscriptionsGetCall) IfNoneMatch(entityTag string) *AccountsNotificationsubscriptionsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsNotificationsubscriptionsGetCall) Context(ctx context.Context) *AccountsNotificationsubscriptionsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsNotificationsubscriptionsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsNotificationsubscriptionsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "notifications/v1beta/{+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 "merchantapi.accounts.notificationsubscriptions.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *NotificationSubscription.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 *AccountsNotificationsubscriptionsGetCall) Do(opts ...googleapi.CallOption) (*NotificationSubscription, 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 := &NotificationSubscription{ + 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 +} + +type AccountsNotificationsubscriptionsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Gets all the notification subscriptions for a merchant. +// +// - parent: The merchant account who owns the notification subscriptions. +// Format: `accounts/{account}`. +func (r *AccountsNotificationsubscriptionsService) List(parent string) *AccountsNotificationsubscriptionsListCall { + c := &AccountsNotificationsubscriptionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number of +// notification subscriptions to return in a page. The default value for +// `page_size` is 100. The maximum value is `200`. Values above `200` will be +// coerced to `200`. +func (c *AccountsNotificationsubscriptionsListCall) PageSize(pageSize int64) *AccountsNotificationsubscriptionsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": Token (if provided) to +// retrieve the subsequent page. All other parameters must match the original +// call that provided the page token. +func (c *AccountsNotificationsubscriptionsListCall) PageToken(pageToken string) *AccountsNotificationsubscriptionsListCall { + 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 +// details. +func (c *AccountsNotificationsubscriptionsListCall) Fields(s ...googleapi.Field) *AccountsNotificationsubscriptionsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsNotificationsubscriptionsListCall) IfNoneMatch(entityTag string) *AccountsNotificationsubscriptionsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsNotificationsubscriptionsListCall) Context(ctx context.Context) *AccountsNotificationsubscriptionsListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsNotificationsubscriptionsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsNotificationsubscriptionsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "notifications/v1beta/{+parent}/notificationsubscriptions") + 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 "merchantapi.accounts.notificationsubscriptions.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *ListNotificationSubscriptionsResponse.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 *AccountsNotificationsubscriptionsListCall) Do(opts ...googleapi.CallOption) (*ListNotificationSubscriptionsResponse, 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 := &ListNotificationSubscriptionsResponse{ + 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 +} + +// 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 *AccountsNotificationsubscriptionsListCall) Pages(ctx context.Context, f func(*ListNotificationSubscriptionsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + 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) + } +} + +type AccountsNotificationsubscriptionsPatchCall struct { + s *Service + name string + notificationsubscription *NotificationSubscription + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates an existing notification subscription for a merchant. +// +// - name: Output only. The `name` of the notification configuration. Generated +// by the Content API upon creation of a new `NotificationSubscription`. The +// `account` represents the merchant ID of the merchant that owns the +// configuration. Format: +// `accounts/{account}/notificationsubscriptions/{notification_subscription}`. +func (r *AccountsNotificationsubscriptionsService) Patch(name string, notificationsubscription *NotificationSubscription) *AccountsNotificationsubscriptionsPatchCall { + c := &AccountsNotificationsubscriptionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.notificationsubscription = notificationsubscription + return c +} + +// UpdateMask sets the optional parameter "updateMask": List of fields being +// updated. +func (c *AccountsNotificationsubscriptionsPatchCall) UpdateMask(updateMask string) *AccountsNotificationsubscriptionsPatchCall { + 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 +// details. +func (c *AccountsNotificationsubscriptionsPatchCall) Fields(s ...googleapi.Field) *AccountsNotificationsubscriptionsPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsNotificationsubscriptionsPatchCall) Context(ctx context.Context) *AccountsNotificationsubscriptionsPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsNotificationsubscriptionsPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsNotificationsubscriptionsPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationsubscription) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "notifications/v1beta/{+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 "merchantapi.accounts.notificationsubscriptions.patch" call. +// Any non-2xx status code is an error. Response headers are in either +// *NotificationSubscription.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 *AccountsNotificationsubscriptionsPatchCall) Do(opts ...googleapi.CallOption) (*NotificationSubscription, 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 := &NotificationSubscription{ + 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 +} diff --git a/merchantapi/products_v1beta/merchantapi-api.json b/merchantapi/products_v1beta/merchantapi-api.json new file mode 100644 index 00000000000..78f77be6c35 --- /dev/null +++ b/merchantapi/products_v1beta/merchantapi-api.json @@ -0,0 +1,1680 @@ +{ + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/content": { + "description": "Manage your product listings and accounts for Google Shopping" + } + } + } + }, + "basePath": "", + "baseUrl": "https://merchantapi.googleapis.com/", + "batchPath": "batch", + "canonicalName": "Merchant", + "description": "Programmatically manage your Merchant Center Accounts.", + "discoveryVersion": "v1", + "documentationLink": "https://developers.devsite.corp.google.com/merchant/api", + "fullyEncodeReservedExpansion": true, + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "id": "merchantapi:products_v1beta", + "kind": "discovery#restDescription", + "mtlsRootUrl": "https://merchantapi.mtls.googleapis.com/", + "name": "merchantapi", + "ownerDomain": "google.com", + "ownerName": "Google", + "parameters": { + "$.xgafv": { + "description": "V1 error format.", + "enum": [ + "1", + "2" + ], + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "type": "string" + }, + "access_token": { + "description": "OAuth access token.", + "location": "query", + "type": "string" + }, + "alt": { + "default": "json", + "description": "Data format for response.", + "enum": [ + "json", + "media", + "proto" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query", + "type": "string" + }, + "callback": { + "description": "JSONP", + "location": "query", + "type": "string" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "location": "query", + "type": "string" + }, + "key": { + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query", + "type": "string" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "location": "query", + "type": "string" + }, + "prettyPrint": { + "default": "true", + "description": "Returns response with indentations and line breaks.", + "location": "query", + "type": "boolean" + }, + "quotaUser": { + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query", + "type": "string" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query", + "type": "string" + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query", + "type": "string" + } + }, + "protocol": "rest", + "resources": { + "accounts": { + "resources": { + "productInputs": { + "methods": { + "delete": { + "description": "Deletes a product input from your Merchant Center account. After inserting, updating, or deleting a product input, it may take several minutes before the processed product can be retrieved.", + "flatPath": "products/v1beta/accounts/{accountsId}/productInputs/{productInputsId}", + "httpMethod": "DELETE", + "id": "merchantapi.accounts.productInputs.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "dataSource": { + "description": "Required. The primary or supplemental data source from which the product input should be deleted. Format: `accounts/{account}/dataSources/{datasource}`.", + "location": "query", + "type": "string" + }, + "name": { + "description": "Required. The name of the product input resource to delete. Format: accounts/{account}/productInputs/{product}", + "location": "path", + "pattern": "^accounts/[^/]+/productInputs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "products/v1beta/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "insert": { + "description": "Uploads a product input to your Merchant Center account. If an input with the same contentLanguage, offerId, and dataSource already exists, this method replaces that entry. After inserting, updating, or deleting a product input, it may take several minutes before the processed product can be retrieved.", + "flatPath": "products/v1beta/accounts/{accountsId}/productInputs:insert", + "httpMethod": "POST", + "id": "merchantapi.accounts.productInputs.insert", + "parameterOrder": [ + "parent" + ], + "parameters": { + "dataSource": { + "description": "Required. The primary or supplemental product data source name. If the product already exists and data source provided is different, then the product will be moved to a new data source. Format: `accounts/{account}/dataSources/{datasource}`.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The account where this product will be inserted. Format: accounts/{account}", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "products/v1beta/{+parent}/productInputs:insert", + "request": { + "$ref": "ProductInput" + }, + "response": { + "$ref": "ProductInput" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + }, + "products": { + "methods": { + "get": { + "description": "Retrieves the processed product from your Merchant Center account. After inserting, updating, or deleting a product input, it may take several minutes before the updated final product can be retrieved.", + "flatPath": "products/v1beta/accounts/{accountsId}/products/{productsId}", + "httpMethod": "GET", + "id": "merchantapi.accounts.products.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the product to retrieve. Format: `accounts/{account}/products/{product}`", + "location": "path", + "pattern": "^accounts/[^/]+/products/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "products/v1beta/{+name}", + "response": { + "$ref": "Product" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "description": "Lists the processed products in your Merchant Center account. The response might contain fewer items than specified by pageSize. Rely on pageToken to determine if there are more items to be requested. After inserting, updating, or deleting a product input, it may take several minutes before the updated processed product can be retrieved.", + "flatPath": "products/v1beta/accounts/{accountsId}/products", + "httpMethod": "GET", + "id": "merchantapi.accounts.products.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "The maximum number of products to return. The service may return fewer than this value. The maximum value is 1000; values above 1000 will be coerced to 1000. If unspecified, the maximum number of products will be returned.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "A page token, received from a previous `ListProducts` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListProducts` must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The account to list processed products for. Format: accounts/{account}", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "products/v1beta/{+parent}/products", + "response": { + "$ref": "ListProductsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + } + } + } + }, + "revision": "20240613", + "rootUrl": "https://merchantapi.googleapis.com/", + "schemas": { + "Attributes": { + "description": "Attributes.", + "id": "Attributes", + "properties": { + "additionalImageLinks": { + "description": "Additional URLs of images of the item.", + "items": { + "type": "string" + }, + "type": "array" + }, + "adsGrouping": { + "description": "Used to group items in an arbitrary way. Only for CPA%, discouraged otherwise.", + "type": "string" + }, + "adsLabels": { + "description": "Similar to ads_grouping, but only works on CPC.", + "items": { + "type": "string" + }, + "type": "array" + }, + "adsRedirect": { + "description": "Allows advertisers to override the item URL when the product is shown within the context of Product ads.", + "type": "string" + }, + "adult": { + "description": "Set to true if the item is targeted towards adults.", + "type": "boolean" + }, + "ageGroup": { + "description": "Target [age group](https://support.google.com/merchants/answer/6324463) of the item.", + "type": "string" + }, + "autoPricingMinPrice": { + "$ref": "Price", + "description": "A safeguard in the \"Automated Discounts\" (https://support.google.com/merchants/answer/10295759) and \"Dynamic Promotions\" (https://support.google.com/merchants/answer/13949249) projects, ensuring that discounts on merchants' offers do not fall below this value, thereby preserving the offer's value and profitability." + }, + "availability": { + "description": "Availability status of the item.", + "type": "string" + }, + "availabilityDate": { + "description": "The day a pre-ordered product becomes available for delivery, in [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) format.", + "format": "google-datetime", + "type": "string" + }, + "brand": { + "description": "Brand of the item.", + "type": "string" + }, + "canonicalLink": { + "description": "URL for the canonical version of your item's landing page.", + "type": "string" + }, + "certifications": { + "description": "Product Certifications, for example for energy efficiency labeling of products recorded in the [EU EPREL](https://eprel.ec.europa.eu/screen/home) database. See the [Help Center](https://support.google.com/merchants/answer/13528839) article for more information.", + "items": { + "$ref": "Certification" + }, + "type": "array" + }, + "cloudExportAdditionalProperties": { + "description": "Extra fields to export to the Cloud Retail program.", + "items": { + "$ref": "CloudExportAdditionalProperties" + }, + "type": "array" + }, + "color": { + "description": "Color of the item.", + "type": "string" + }, + "condition": { + "description": "Condition or state of the item.", + "type": "string" + }, + "costOfGoodsSold": { + "$ref": "Price", + "description": "Cost of goods sold. Used for gross profit reporting." + }, + "customLabel0": { + "description": "Custom label 0 for custom grouping of items in a Shopping campaign.", + "type": "string" + }, + "customLabel1": { + "description": "Custom label 1 for custom grouping of items in a Shopping campaign.", + "type": "string" + }, + "customLabel2": { + "description": "Custom label 2 for custom grouping of items in a Shopping campaign.", + "type": "string" + }, + "customLabel3": { + "description": "Custom label 3 for custom grouping of items in a Shopping campaign.", + "type": "string" + }, + "customLabel4": { + "description": "Custom label 4 for custom grouping of items in a Shopping campaign.", + "type": "string" + }, + "description": { + "description": "Description of the item.", + "type": "string" + }, + "disclosureDate": { + "description": "The date time when an offer becomes visible in search results across Google’s YouTube surfaces, in [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) format. See [Disclosure date]( https://support.google.com/merchants/answer/13034208) for more information.", + "format": "google-datetime", + "type": "string" + }, + "displayAdsId": { + "description": "An identifier for an item for dynamic remarketing campaigns.", + "type": "string" + }, + "displayAdsLink": { + "description": "URL directly to your item's landing page for dynamic remarketing campaigns.", + "type": "string" + }, + "displayAdsSimilarIds": { + "description": "Advertiser-specified recommendations.", + "items": { + "type": "string" + }, + "type": "array" + }, + "displayAdsTitle": { + "description": "Title of an item for dynamic remarketing campaigns.", + "type": "string" + }, + "displayAdsValue": { + "description": "Offer margin for dynamic remarketing campaigns.", + "format": "double", + "type": "number" + }, + "energyEfficiencyClass": { + "description": "The energy efficiency class as defined in EU directive 2010/30/EU.", + "type": "string" + }, + "excludedDestinations": { + "description": "The list of destinations to exclude for this target (corresponds to unchecked check boxes in Merchant Center).", + "items": { + "type": "string" + }, + "type": "array" + }, + "expirationDate": { + "description": "Date on which the item should expire, as specified upon insertion, in [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) format. The actual expiration date is exposed in `productstatuses` as [googleExpirationDate](https://support.google.com/merchants/answer/6324499) and might be earlier if `expirationDate` is too far in the future.", + "format": "google-datetime", + "type": "string" + }, + "externalSellerId": { + "description": "Required for multi-seller accounts. Use this attribute if you're a marketplace uploading products for various sellers to your multi-seller account.", + "type": "string" + }, + "freeShippingThreshold": { + "description": "Conditions to be met for a product to have free shipping.", + "items": { + "$ref": "FreeShippingThreshold" + }, + "type": "array" + }, + "gender": { + "description": "Target gender of the item.", + "type": "string" + }, + "googleProductCategory": { + "description": "Google's category of the item (see [Google product taxonomy](https://support.google.com/merchants/answer/1705911)). When querying products, this field will contain the user provided value. There is currently no way to get back the auto assigned google product categories through the API.", + "type": "string" + }, + "gtin": { + "description": "Global Trade Item Number ([GTIN](https://support.google.com/merchants/answer/188494#gtin)) of the item.", + "type": "string" + }, + "identifierExists": { + "description": "Set this value to false when the item does not have unique product identifiers appropriate to its category, such as GTIN, MPN, and brand. Defaults to true, if not provided.", + "type": "boolean" + }, + "imageLink": { + "description": "URL of an image of the item.", + "type": "string" + }, + "includedDestinations": { + "description": "The list of destinations to include for this target (corresponds to checked check boxes in Merchant Center). Default destinations are always included unless provided in `excludedDestinations`.", + "items": { + "type": "string" + }, + "type": "array" + }, + "installment": { + "$ref": "Installment", + "description": "Number and amount of installments to pay for an item." + }, + "isBundle": { + "description": "Whether the item is a merchant-defined bundle. A bundle is a custom grouping of different products sold by a merchant for a single price.", + "type": "boolean" + }, + "itemGroupId": { + "description": "Shared identifier for all variants of the same product.", + "type": "string" + }, + "lifestyleImageLinks": { + "description": "Additional URLs of lifestyle images of the item, used to explicitly identify images that showcase your item in a real-world context. See the [Help Center article](https://support.google.com/merchants/answer/9103186) for more information.", + "items": { + "type": "string" + }, + "type": "array" + }, + "link": { + "description": "URL directly linking to your item's page on your online store.", + "type": "string" + }, + "linkTemplate": { + "description": "Link template for merchant hosted local storefront.", + "type": "string" + }, + "loyaltyPoints": { + "$ref": "LoyaltyPoints", + "description": "Loyalty points that users receive after purchasing the item. Japan only." + }, + "loyaltyPrograms": { + "description": "A list of loyalty program information that is used to surface loyalty benefits (for example, better pricing, points, etc) to the user of this item.", + "items": { + "$ref": "LoyaltyProgram" + }, + "type": "array" + }, + "material": { + "description": "The material of which the item is made.", + "type": "string" + }, + "maxEnergyEfficiencyClass": { + "description": "The energy efficiency class as defined in EU directive 2010/30/EU.", + "type": "string" + }, + "maxHandlingTime": { + "description": "Maximal product handling time (in business days).", + "format": "int64", + "type": "string" + }, + "minEnergyEfficiencyClass": { + "description": "The energy efficiency class as defined in EU directive 2010/30/EU.", + "type": "string" + }, + "minHandlingTime": { + "description": "Minimal product handling time (in business days).", + "format": "int64", + "type": "string" + }, + "mobileLink": { + "description": "URL for the mobile-optimized version of your item's landing page.", + "type": "string" + }, + "mobileLinkTemplate": { + "description": "Link template for merchant hosted local storefront optimized for mobile devices.", + "type": "string" + }, + "mpn": { + "description": "Manufacturer Part Number ([MPN](https://support.google.com/merchants/answer/188494#mpn)) of the item.", + "type": "string" + }, + "multipack": { + "description": "The number of identical products in a merchant-defined multipack.", + "format": "int64", + "type": "string" + }, + "pattern": { + "description": "The item's pattern (for example, polka dots).", + "type": "string" + }, + "pause": { + "description": "Publication of this item will be temporarily [paused](https://support.google.com/merchants/answer/11909930).", + "type": "string" + }, + "pickupMethod": { + "description": "The pick up option for the item.", + "type": "string" + }, + "pickupSla": { + "description": "Item store pickup timeline.", + "type": "string" + }, + "price": { + "$ref": "Price", + "description": "Price of the item." + }, + "productDetails": { + "description": "Technical specification or additional product details.", + "items": { + "$ref": "ProductDetail" + }, + "type": "array" + }, + "productHeight": { + "$ref": "ProductDimension", + "description": "The height of the product in the units provided. The value must be between 0 (exclusive) and 3000 (inclusive)." + }, + "productHighlights": { + "description": "Bullet points describing the most relevant highlights of a product.", + "items": { + "type": "string" + }, + "type": "array" + }, + "productLength": { + "$ref": "ProductDimension", + "description": "The length of the product in the units provided. The value must be between 0 (exclusive) and 3000 (inclusive)." + }, + "productTypes": { + "description": "Categories of the item (formatted as in [product data specification](https://support.google.com/merchants/answer/188494#product_type)).", + "items": { + "type": "string" + }, + "type": "array" + }, + "productWeight": { + "$ref": "ProductWeight", + "description": "The weight of the product in the units provided. The value must be between 0 (exclusive) and 2000 (inclusive)." + }, + "productWidth": { + "$ref": "ProductDimension", + "description": "The width of the product in the units provided. The value must be between 0 (exclusive) and 3000 (inclusive)." + }, + "promotionIds": { + "description": "The unique ID of a promotion.", + "items": { + "type": "string" + }, + "type": "array" + }, + "salePrice": { + "$ref": "Price", + "description": "Advertised sale price of the item." + }, + "salePriceEffectiveDate": { + "$ref": "Interval", + "description": "Date range during which the item is on sale (see [product data specification](https://support.google.com/merchants/answer/188494#sale_price_effective_date))." + }, + "sellOnGoogleQuantity": { + "description": "The quantity of the product that is available for selling on Google. Supported only for online products.", + "format": "int64", + "type": "string" + }, + "shipping": { + "description": "Shipping rules.", + "items": { + "$ref": "Shipping" + }, + "type": "array" + }, + "shippingHeight": { + "$ref": "ShippingDimension", + "description": "Height of the item for shipping." + }, + "shippingLabel": { + "description": "The shipping label of the product, used to group product in account-level shipping rules.", + "type": "string" + }, + "shippingLength": { + "$ref": "ShippingDimension", + "description": "Length of the item for shipping." + }, + "shippingWeight": { + "$ref": "ShippingWeight", + "description": "Weight of the item for shipping." + }, + "shippingWidth": { + "$ref": "ShippingDimension", + "description": "Width of the item for shipping." + }, + "shoppingAdsExcludedCountries": { + "description": "List of country codes (ISO 3166-1 alpha-2) to exclude the offer from Shopping Ads destination. Countries from this list are removed from countries configured in data source settings.", + "items": { + "type": "string" + }, + "type": "array" + }, + "size": { + "description": "Size of the item. Only one value is allowed. For variants with different sizes, insert a separate product for each size with the same `itemGroupId` value (see [https://support.google.com/merchants/answer/6324492](size definition)).", + "type": "string" + }, + "sizeSystem": { + "description": "System in which the size is specified. Recommended for apparel items.", + "type": "string" + }, + "sizeTypes": { + "description": "The cut of the item. It can be used to represent combined size types for apparel items. Maximum two of size types can be provided (see [https://support.google.com/merchants/answer/6324497](size type)).", + "items": { + "type": "string" + }, + "type": "array" + }, + "structuredDescription": { + "$ref": "ProductStructuredDescription", + "description": "Structured description, for algorithmically (AI)-generated descriptions." + }, + "structuredTitle": { + "$ref": "ProductStructuredTitle", + "description": "Structured title, for algorithmically (AI)-generated titles." + }, + "subscriptionCost": { + "$ref": "SubscriptionCost", + "description": "Number of periods (months or years) and amount of payment per period for an item with an associated subscription contract." + }, + "taxCategory": { + "description": "The tax category of the product, used to configure detailed tax nexus in account-level tax settings.", + "type": "string" + }, + "taxes": { + "description": "Tax information.", + "items": { + "$ref": "Tax" + }, + "type": "array" + }, + "title": { + "description": "Title of the item.", + "type": "string" + }, + "transitTimeLabel": { + "description": "The transit time label of the product, used to group product in account-level transit time tables.", + "type": "string" + }, + "unitPricingBaseMeasure": { + "$ref": "UnitPricingBaseMeasure", + "description": "The preference of the denominator of the unit price." + }, + "unitPricingMeasure": { + "$ref": "UnitPricingMeasure", + "description": "The measure and dimension of an item." + }, + "virtualModelLink": { + "description": "URL of the 3D image of the item. See the [Help Center article](https://support.google.com/merchants/answer/13674896) for more information.", + "type": "string" + } + }, + "type": "object" + }, + "Certification": { + "description": "Product [certification](https://support.google.com/merchants/answer/13528839), initially introduced for EU energy efficiency labeling compliance using the EU EPREL database.", + "id": "Certification", + "properties": { + "certificationAuthority": { + "description": "The certification authority, for example \"European_Commission\". Maximum length is 2000 characters.", + "type": "string" + }, + "certificationCode": { + "description": "The certification code. Maximum length is 2000 characters.", + "type": "string" + }, + "certificationName": { + "description": "The name of the certification, for example \"EPREL\". Maximum length is 2000 characters.", + "type": "string" + }, + "certificationValue": { + "description": "The certification value (also known as class, level or grade), for example \"A+\", \"C\", \"gold\". Maximum length is 2000 characters.", + "type": "string" + } + }, + "type": "object" + }, + "CloudExportAdditionalProperties": { + "description": "Product property for the Cloud Retail API. For example, properties for a TV product could be \"Screen-Resolution\" or \"Screen-Size\".", + "id": "CloudExportAdditionalProperties", + "properties": { + "boolValue": { + "description": "Boolean value of the given property. For example for a TV product, \"True\" or \"False\" if the screen is UHD.", + "type": "boolean" + }, + "floatValue": { + "description": "Float values of the given property. For example for a TV product 1.2345. Maximum repeatedness of this value is 400. Values are stored in an arbitrary but consistent order.", + "items": { + "format": "float", + "type": "number" + }, + "type": "array" + }, + "intValue": { + "description": "Integer values of the given property. For example, 1080 for a TV product's Screen Resolution. Maximum repeatedness of this value is 400. Values are stored in an arbitrary but consistent order.", + "items": { + "format": "int64", + "type": "string" + }, + "type": "array" + }, + "maxValue": { + "description": "Maximum float value of the given property. For example for a TV product 100.00.", + "format": "float", + "type": "number" + }, + "minValue": { + "description": "Minimum float value of the given property. For example for a TV product 1.00.", + "format": "float", + "type": "number" + }, + "propertyName": { + "description": "Name of the given property. For example, \"Screen-Resolution\" for a TV product. Maximum string size is 256 characters.", + "type": "string" + }, + "textValue": { + "description": "Text value of the given property. For example, \"8K(UHD)\" could be a text value for a TV product. Maximum repeatedness of this value is 400. Values are stored in an arbitrary but consistent order. Maximum string size is 256 characters.", + "items": { + "type": "string" + }, + "type": "array" + }, + "unitCode": { + "description": "Unit of the given property. For example, \"Pixels\" for a TV product. Maximum string size is 256B.", + "type": "string" + } + }, + "type": "object" + }, + "CustomAttribute": { + "description": "A message that represents custom attributes. Exactly one of `value` or `group_values` must not be empty.", + "id": "CustomAttribute", + "properties": { + "groupValues": { + "description": "Subattributes within this attribute group. If `group_values` is not empty, `value` must be empty.", + "items": { + "$ref": "CustomAttribute" + }, + "type": "array" + }, + "name": { + "description": "The name of the attribute.", + "type": "string" + }, + "value": { + "description": "The value of the attribute. If `value` is not empty, `group_values` must be empty.", + "type": "string" + } + }, + "type": "object" + }, + "DestinationStatus": { + "description": "The destination status of the product status.", + "id": "DestinationStatus", + "properties": { + "approvedCountries": { + "description": "List of country codes (ISO 3166-1 alpha-2) where the offer is approved.", + "items": { + "type": "string" + }, + "type": "array" + }, + "disapprovedCountries": { + "description": "List of country codes (ISO 3166-1 alpha-2) where the offer is disapproved.", + "items": { + "type": "string" + }, + "type": "array" + }, + "pendingCountries": { + "description": "List of country codes (ISO 3166-1 alpha-2) where the offer is pending approval.", + "items": { + "type": "string" + }, + "type": "array" + }, + "reportingContext": { + "description": "The name of the reporting context.", + "enum": [ + "REPORTING_CONTEXT_ENUM_UNSPECIFIED", + "SHOPPING_ADS", + "DISCOVERY_ADS", + "DEMAND_GEN_ADS", + "DEMAND_GEN_ADS_DISCOVER_SURFACE", + "VIDEO_ADS", + "DISPLAY_ADS", + "LOCAL_INVENTORY_ADS", + "VEHICLE_INVENTORY_ADS", + "FREE_LISTINGS", + "FREE_LOCAL_LISTINGS", + "FREE_LOCAL_VEHICLE_LISTINGS", + "YOUTUBE_SHOPPING", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL" + ], + "enumDeprecated": [ + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false + ], + "enumDescriptions": [ + "Not specified.", + "[Shopping ads](https://support.google.com/merchants/answer/6149970).", + "Deprecated: Use `DEMAND_GEN_ADS` instead. [Discovery and Demand Gen ads](https://support.google.com/merchants/answer/13389785).", + "[Demand Gen ads](https://support.google.com/merchants/answer/13389785).", + "[Demand Gen ads on Discover surface](https://support.google.com/merchants/answer/13389785).", + "[Video ads](https://support.google.com/google-ads/answer/6340491).", + "[Display ads](https://support.google.com/merchants/answer/6069387).", + "[Local inventory ads](https://support.google.com/merchants/answer/3271956).", + "[Vehicle inventory ads](https://support.google.com/merchants/answer/11544533).", + "[Free product listings](https://support.google.com/merchants/answer/9199328).", + "[Free local product listings](https://support.google.com/merchants/answer/9825611).", + "[Free local vehicle listings](https://support.google.com/merchants/answer/11544533).", + "[YouTube Shopping](https://support.google.com/merchants/answer/13478370).", + "[Cloud retail](https://cloud.google.com/solutions/retail).", + "[Local cloud retail](https://cloud.google.com/solutions/retail)." + ], + "type": "string" + } + }, + "type": "object" + }, + "Empty": { + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }", + "id": "Empty", + "properties": {}, + "type": "object" + }, + "FreeShippingThreshold": { + "description": "Conditions to be met for a product to have free shipping.", + "id": "FreeShippingThreshold", + "properties": { + "country": { + "description": "The [CLDR territory code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) of the country to which an item will ship.", + "type": "string" + }, + "priceThreshold": { + "$ref": "Price", + "description": "The minimum product price for the shipping cost to become free. Represented as a number." + } + }, + "type": "object" + }, + "Installment": { + "description": "A message that represents installment.", + "id": "Installment", + "properties": { + "amount": { + "$ref": "Price", + "description": "The amount the buyer has to pay per month." + }, + "creditType": { + "description": "Type of installment payments. Supported values are: * \"`finance`\" * \"`lease`\"", + "type": "string" + }, + "downpayment": { + "$ref": "Price", + "description": "The up-front down payment amount the buyer has to pay." + }, + "months": { + "description": "The number of installments the buyer has to pay.", + "format": "int64", + "type": "string" + } + }, + "type": "object" + }, + "Interval": { + "description": "Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive). The start must be less than or equal to the end. When the start equals the end, the interval is empty (matches no time). When both start and end are unspecified, the interval matches any time.", + "id": "Interval", + "properties": { + "endTime": { + "description": "Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end.", + "format": "google-datetime", + "type": "string" + }, + "startTime": { + "description": "Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, + "ItemLevelIssue": { + "description": "The ItemLevelIssue of the product status.", + "id": "ItemLevelIssue", + "properties": { + "applicableCountries": { + "description": "List of country codes (ISO 3166-1 alpha-2) where issue applies to the offer.", + "items": { + "type": "string" + }, + "type": "array" + }, + "attribute": { + "description": "The attribute's name, if the issue is caused by a single attribute.", + "type": "string" + }, + "code": { + "description": "The error code of the issue.", + "type": "string" + }, + "description": { + "description": "A short issue description in English.", + "type": "string" + }, + "detail": { + "description": "A detailed issue description in English.", + "type": "string" + }, + "documentation": { + "description": "The URL of a web page to help with resolving this issue.", + "type": "string" + }, + "reportingContext": { + "description": "The reporting context the issue applies to.", + "enum": [ + "REPORTING_CONTEXT_ENUM_UNSPECIFIED", + "SHOPPING_ADS", + "DISCOVERY_ADS", + "DEMAND_GEN_ADS", + "DEMAND_GEN_ADS_DISCOVER_SURFACE", + "VIDEO_ADS", + "DISPLAY_ADS", + "LOCAL_INVENTORY_ADS", + "VEHICLE_INVENTORY_ADS", + "FREE_LISTINGS", + "FREE_LOCAL_LISTINGS", + "FREE_LOCAL_VEHICLE_LISTINGS", + "YOUTUBE_SHOPPING", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL" + ], + "enumDeprecated": [ + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false + ], + "enumDescriptions": [ + "Not specified.", + "[Shopping ads](https://support.google.com/merchants/answer/6149970).", + "Deprecated: Use `DEMAND_GEN_ADS` instead. [Discovery and Demand Gen ads](https://support.google.com/merchants/answer/13389785).", + "[Demand Gen ads](https://support.google.com/merchants/answer/13389785).", + "[Demand Gen ads on Discover surface](https://support.google.com/merchants/answer/13389785).", + "[Video ads](https://support.google.com/google-ads/answer/6340491).", + "[Display ads](https://support.google.com/merchants/answer/6069387).", + "[Local inventory ads](https://support.google.com/merchants/answer/3271956).", + "[Vehicle inventory ads](https://support.google.com/merchants/answer/11544533).", + "[Free product listings](https://support.google.com/merchants/answer/9199328).", + "[Free local product listings](https://support.google.com/merchants/answer/9825611).", + "[Free local vehicle listings](https://support.google.com/merchants/answer/11544533).", + "[YouTube Shopping](https://support.google.com/merchants/answer/13478370).", + "[Cloud retail](https://cloud.google.com/solutions/retail).", + "[Local cloud retail](https://cloud.google.com/solutions/retail)." + ], + "type": "string" + }, + "resolution": { + "description": "Whether the issue can be resolved by the merchant.", + "type": "string" + }, + "severity": { + "description": "How this issue affects serving of the offer.", + "enum": [ + "SEVERITY_UNSPECIFIED", + "NOT_IMPACTED", + "DEMOTED", + "DISAPPROVED" + ], + "enumDescriptions": [ + "Not specified.", + "This issue represents a warning and does not have a direct affect on the product.", + "The product is demoted and most likely have limited performance in search results", + "Issue disapproves the product." + ], + "type": "string" + } + }, + "type": "object" + }, + "ListProductsResponse": { + "description": "Response message for the ListProducts method.", + "id": "ListProductsResponse", + "properties": { + "nextPageToken": { + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "type": "string" + }, + "products": { + "description": "The processed products from the specified account. These are your processed products after applying rules and supplemental data sources.", + "items": { + "$ref": "Product" + }, + "type": "array" + } + }, + "type": "object" + }, + "LoyaltyPoints": { + "description": "A message that represents loyalty points.", + "id": "LoyaltyPoints", + "properties": { + "name": { + "description": "Name of loyalty points program. It is recommended to limit the name to 12 full-width characters or 24 Roman characters.", + "type": "string" + }, + "pointsValue": { + "description": "The retailer's loyalty points in absolute value.", + "format": "int64", + "type": "string" + }, + "ratio": { + "description": "The ratio of a point when converted to currency. Google assumes currency based on Merchant Center settings. If ratio is left out, it defaults to 1.0.", + "format": "double", + "type": "number" + } + }, + "type": "object" + }, + "LoyaltyProgram": { + "description": "A message that represents loyalty program.", + "id": "LoyaltyProgram", + "properties": { + "cashbackForFutureUse": { + "$ref": "Price", + "description": "The cashback that can be used for future purchases." + }, + "loyaltyPoints": { + "description": "The amount of loyalty points earned on a purchase.", + "format": "int64", + "type": "string" + }, + "price": { + "$ref": "Price", + "description": "The price for members of the given tier, that is, the instant discount price. Must be smaller or equal to the regular price." + }, + "programLabel": { + "description": "The label of the loyalty program. This is an internal label that uniquely identifies the relationship between a merchant entity and a loyalty program entity. The label must be provided so that the system can associate the assets below (for example, price and points) with a merchant. The corresponding program must be linked to the merchant account.", + "type": "string" + }, + "tierLabel": { + "description": "The label of the tier within the loyalty program. Must match one of the labels within the program.", + "type": "string" + } + }, + "type": "object" + }, + "Price": { + "description": "The price represented as a number and currency.", + "id": "Price", + "properties": { + "amountMicros": { + "description": "The price represented as a number in micros (1 million micros is an equivalent to one's currency standard unit, for example, 1 USD = 1000000 micros).", + "format": "int64", + "type": "string" + }, + "currencyCode": { + "description": "The currency of the price using three-letter acronyms according to [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217).", + "type": "string" + } + }, + "type": "object" + }, + "Product": { + "description": "The processed product, built from multiple product inputs after applying rules and supplemental data sources. This processed product matches what is shown in your Merchant Center account and in Shopping ads and other surfaces across Google. Each product is built from exactly one primary data source product input, and multiple supplemental data source inputs. After inserting, updating, or deleting a product input, it may take several minutes before the updated processed product can be retrieved. All fields in the processed product and its sub-messages match the name of their corresponding attribute in the [Product data specification](https://support.google.com/merchants/answer/7052112) with some exceptions.", + "id": "Product", + "properties": { + "attributes": { + "$ref": "Attributes", + "description": "Output only. A list of product attributes.", + "readOnly": true + }, + "channel": { + "description": "Output only. The [channel](https://support.google.com/merchants/answer/7361332) of the product.", + "enum": [ + "CHANNEL_ENUM_UNSPECIFIED", + "ONLINE", + "LOCAL" + ], + "enumDescriptions": [ + "Not specified.", + "Online product.", + "Local product." + ], + "readOnly": true, + "type": "string" + }, + "contentLanguage": { + "description": "Output only. The two-letter [ISO 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the product.", + "readOnly": true, + "type": "string" + }, + "customAttributes": { + "description": "Output only. A list of custom (merchant-provided) attributes. It can also be used to submit any attribute of the data specification in its generic form (for example, `{ \"name\": \"size type\", \"value\": \"regular\" }`). This is useful for submitting attributes not explicitly exposed by the API, such as additional attributes used for Buy on Google.", + "items": { + "$ref": "CustomAttribute" + }, + "readOnly": true, + "type": "array" + }, + "dataSource": { + "description": "Output only. The primary data source of the product.", + "readOnly": true, + "type": "string" + }, + "feedLabel": { + "description": "Output only. The feed label for the product.", + "readOnly": true, + "type": "string" + }, + "name": { + "description": "The name of the product. Format: `\"{product.name=accounts/{account}/products/{product}}\"`", + "type": "string" + }, + "offerId": { + "description": "Output only. Your unique identifier for the product. This is the same for the product input and processed product. Leading and trailing whitespaces are stripped and multiple whitespaces are replaced by a single whitespace upon submission. See the [product data specification](https://support.google.com/merchants/answer/188494#id) for details.", + "readOnly": true, + "type": "string" + }, + "productStatus": { + "$ref": "ProductStatus", + "description": "Output only. The status of a product, data validation issues, that is, information about a product computed asynchronously.", + "readOnly": true + }, + "versionNumber": { + "description": "Output only. Represents the existing version (freshness) of the product, which can be used to preserve the right order when multiple updates are done at the same time. If set, the insertion is prevented when version number is lower than the current version number of the existing product. Re-insertion (for example, product refresh after 30 days) can be performed with the current `version_number`. Only supported for insertions into primary data sources. If the operation is prevented, the aborted exception will be thrown.", + "format": "int64", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "ProductChange": { + "description": "The change that happened to the product including old value, new value, country code as the region code and reporting context.", + "id": "ProductChange", + "properties": { + "newValue": { + "description": "The new value of the changed resource or attribute.", + "type": "string" + }, + "oldValue": { + "description": "The old value of the changed resource or attribute.", + "type": "string" + }, + "regionCode": { + "description": "Countries that have the change (if applicable)", + "type": "string" + }, + "reportingContext": { + "description": "Reporting contexts that have the change (if applicable)", + "enum": [ + "REPORTING_CONTEXT_ENUM_UNSPECIFIED", + "SHOPPING_ADS", + "DISCOVERY_ADS", + "DEMAND_GEN_ADS", + "DEMAND_GEN_ADS_DISCOVER_SURFACE", + "VIDEO_ADS", + "DISPLAY_ADS", + "LOCAL_INVENTORY_ADS", + "VEHICLE_INVENTORY_ADS", + "FREE_LISTINGS", + "FREE_LOCAL_LISTINGS", + "FREE_LOCAL_VEHICLE_LISTINGS", + "YOUTUBE_SHOPPING", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL" + ], + "enumDeprecated": [ + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false + ], + "enumDescriptions": [ + "Not specified.", + "[Shopping ads](https://support.google.com/merchants/answer/6149970).", + "Deprecated: Use `DEMAND_GEN_ADS` instead. [Discovery and Demand Gen ads](https://support.google.com/merchants/answer/13389785).", + "[Demand Gen ads](https://support.google.com/merchants/answer/13389785).", + "[Demand Gen ads on Discover surface](https://support.google.com/merchants/answer/13389785).", + "[Video ads](https://support.google.com/google-ads/answer/6340491).", + "[Display ads](https://support.google.com/merchants/answer/6069387).", + "[Local inventory ads](https://support.google.com/merchants/answer/3271956).", + "[Vehicle inventory ads](https://support.google.com/merchants/answer/11544533).", + "[Free product listings](https://support.google.com/merchants/answer/9199328).", + "[Free local product listings](https://support.google.com/merchants/answer/9825611).", + "[Free local vehicle listings](https://support.google.com/merchants/answer/11544533).", + "[YouTube Shopping](https://support.google.com/merchants/answer/13478370).", + "[Cloud retail](https://cloud.google.com/solutions/retail).", + "[Local cloud retail](https://cloud.google.com/solutions/retail)." + ], + "type": "string" + } + }, + "type": "object" + }, + "ProductDetail": { + "description": "The product details.", + "id": "ProductDetail", + "properties": { + "attributeName": { + "description": "The name of the product detail.", + "type": "string" + }, + "attributeValue": { + "description": "The value of the product detail.", + "type": "string" + }, + "sectionName": { + "description": "The section header used to group a set of product details.", + "type": "string" + } + }, + "type": "object" + }, + "ProductDimension": { + "description": "The dimension of the product.", + "id": "ProductDimension", + "properties": { + "unit": { + "description": "Required. The dimension units. Acceptable values are: * \"`in`\" * \"`cm`\"", + "type": "string" + }, + "value": { + "description": "Required. The dimension value represented as a number. The value can have a maximum precision of four decimal places.", + "format": "double", + "type": "number" + } + }, + "type": "object" + }, + "ProductInput": { + "description": "This resource represents input data you submit for a product, not the processed product that you see in Merchant Center, in Shopping ads, or across Google surfaces. Product inputs, rules and supplemental data source data are combined to create the processed product. Required product input attributes to pass data validation checks are primarily defined in the [Products Data Specification](https://support.google.com/merchants/answer/188494). The following attributes are required: feedLabel, contentLanguage and offerId. After inserting, updating, or deleting a product input, it may take several minutes before the processed product can be retrieved. All fields in the product input and its sub-messages match the English name of their corresponding attribute in the vertical spec with [some exceptions](https://support.google.com/merchants/answer/7052112).", + "id": "ProductInput", + "properties": { + "attributes": { + "$ref": "Attributes", + "description": "Optional. A list of product attributes." + }, + "channel": { + "description": "Required. Immutable. The [channel](https://support.google.com/merchants/answer/7361332) of the product.", + "enum": [ + "CHANNEL_ENUM_UNSPECIFIED", + "ONLINE", + "LOCAL" + ], + "enumDescriptions": [ + "Not specified.", + "Online product.", + "Local product." + ], + "type": "string" + }, + "contentLanguage": { + "description": "Required. Immutable. The two-letter [ISO 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the product.", + "type": "string" + }, + "customAttributes": { + "description": "Optional. A list of custom (merchant-provided) attributes. It can also be used for submitting any attribute of the data specification in its generic form (for example, `{ \"name\": \"size type\", \"value\": \"regular\" }`). This is useful for submitting attributes not explicitly exposed by the API, such as additional attributes used for Buy on Google. Maximum allowed number of characters for each custom attribute is 10240 (represents sum of characters for name and value). Maximum 2500 custom attributes can be set per product, with total size of 102.4kB. Underscores in custom attribute names are replaced by spaces upon insertion.", + "items": { + "$ref": "CustomAttribute" + }, + "type": "array" + }, + "feedLabel": { + "description": "Required. Immutable. The [feed label](https://developers.google.com/shopping-content/guides/products/feed-labels) for the product.", + "type": "string" + }, + "name": { + "description": "Identifier. The name of the product input. Format: `\"{productinput.name=accounts/{account}/productInputs/{productinput}}\"`", + "type": "string" + }, + "offerId": { + "description": "Required. Immutable. Your unique identifier for the product. This is the same for the product input and processed product. Leading and trailing whitespaces are stripped and multiple whitespaces are replaced by a single whitespace upon submission. See the [products data specification](https://support.google.com/merchants/answer/188494#id) for details.", + "type": "string" + }, + "product": { + "description": "Output only. The name of the processed product. Format: `\"{product.name=accounts/{account}/products/{product}}\"`", + "readOnly": true, + "type": "string" + }, + "versionNumber": { + "description": "Optional. Represents the existing version (freshness) of the product, which can be used to preserve the right order when multiple updates are done at the same time. If set, the insertion is prevented when version number is lower than the current version number of the existing product. Re-insertion (for example, product refresh after 30 days) can be performed with the current `version_number`. Only supported for insertions into primary data sources. If the operation is prevented, the aborted exception will be thrown.", + "format": "int64", + "type": "string" + } + }, + "type": "object" + }, + "ProductStatus": { + "description": "The status of a product, data validation issues, that is, information about a product computed asynchronously.", + "id": "ProductStatus", + "properties": { + "creationDate": { + "description": "Date on which the item has been created, in [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) format.", + "format": "google-datetime", + "type": "string" + }, + "destinationStatuses": { + "description": "The intended destinations for the product.", + "items": { + "$ref": "DestinationStatus" + }, + "type": "array" + }, + "googleExpirationDate": { + "description": "Date on which the item expires, in [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) format.", + "format": "google-datetime", + "type": "string" + }, + "itemLevelIssues": { + "description": "A list of all issues associated with the product.", + "items": { + "$ref": "ItemLevelIssue" + }, + "type": "array" + }, + "lastUpdateDate": { + "description": "Date on which the item has been last updated, in [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) format.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, + "ProductStatusChangeMessage": { + "description": "The message that the merchant will receive to notify about product status change event", + "id": "ProductStatusChangeMessage", + "properties": { + "account": { + "description": "The target account that owns the entity that changed. Format : `accounts/{merchant_id}`", + "type": "string" + }, + "attribute": { + "description": "The attribute in the resource that changed, in this case it will be always `Status`.", + "enum": [ + "ATTRIBUTE_UNSPECIFIED", + "STATUS" + ], + "enumDescriptions": [ + "Unspecified attribute", + "Status of the changed entity" + ], + "type": "string" + }, + "changes": { + "description": "A message to describe the change that happened to the product", + "items": { + "$ref": "ProductChange" + }, + "type": "array" + }, + "managingAccount": { + "description": "The account that manages the merchant's account. can be the same as merchant id if it is standalone account. Format : `accounts/{service_provider_id}`", + "type": "string" + }, + "resource": { + "description": "The product name. Format: `{product.name=accounts/{account}/products/{product}}`", + "type": "string" + }, + "resourceId": { + "description": "The product id.", + "type": "string" + }, + "resourceType": { + "description": "The resource that changed, in this case it will always be `Product`.", + "enum": [ + "RESOURCE_UNSPECIFIED", + "PRODUCT" + ], + "enumDescriptions": [ + "Unspecified resource", + "Resource type : product" + ], + "type": "string" + } + }, + "type": "object" + }, + "ProductStructuredDescription": { + "description": "Structured description, for algorithmically (AI)-generated descriptions.", + "id": "ProductStructuredDescription", + "properties": { + "content": { + "description": "The description text Maximum length is 5000 characters", + "type": "string" + }, + "digitalSourceType": { + "description": "The digital source type, for example \"trained_algorithmic_media\". Following [IPTC](https://cv.iptc.org/newscodes/digitalsourcetype). Maximum length is 40 characters.", + "type": "string" + } + }, + "type": "object" + }, + "ProductStructuredTitle": { + "description": "Structured title, for algorithmically (AI)-generated titles.", + "id": "ProductStructuredTitle", + "properties": { + "content": { + "description": "The title text Maximum length is 150 characters", + "type": "string" + }, + "digitalSourceType": { + "description": "The digital source type, for example \"trained_algorithmic_media\". Following [IPTC](https://cv.iptc.org/newscodes/digitalsourcetype). Maximum length is 40 characters.", + "type": "string" + } + }, + "type": "object" + }, + "ProductWeight": { + "description": "The weight of the product.", + "id": "ProductWeight", + "properties": { + "unit": { + "description": "Required. The weight unit. Acceptable values are: * \"`g`\" * \"`kg`\" * \"`oz`\" * \"`lb`\"", + "type": "string" + }, + "value": { + "description": "Required. The weight represented as a number. The weight can have a maximum precision of four decimal places.", + "format": "double", + "type": "number" + } + }, + "type": "object" + }, + "Shipping": { + "description": "The Shipping of the product.", + "id": "Shipping", + "properties": { + "country": { + "description": "The [CLDR territory code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) of the country to which an item will ship.", + "type": "string" + }, + "locationGroupName": { + "description": "The location where the shipping is applicable, represented by a location group name.", + "type": "string" + }, + "locationId": { + "description": "The numeric ID of a location that the shipping rate applies to as defined in the [AdWords API](https://developers.google.com/adwords/api/docs/appendix/geotargeting).", + "format": "int64", + "type": "string" + }, + "maxHandlingTime": { + "description": "Maximum handling time (inclusive) between when the order is received and shipped in business days. 0 means that the order is shipped on the same day as it is received if it happens before the cut-off time. Both maxHandlingTime and maxTransitTime are required if providing shipping speeds. minHandlingTime is optional if maxHandlingTime is present.", + "format": "int64", + "type": "string" + }, + "maxTransitTime": { + "description": "Maximum transit time (inclusive) between when the order has shipped and when it is delivered in business days. 0 means that the order is delivered on the same day as it ships. Both maxHandlingTime and maxTransitTime are required if providing shipping speeds. minTransitTime is optional if maxTransitTime is present.", + "format": "int64", + "type": "string" + }, + "minHandlingTime": { + "description": "Minimum handling time (inclusive) between when the order is received and shipped in business days. 0 means that the order is shipped on the same day as it is received if it happens before the cut-off time. minHandlingTime can only be present together with maxHandlingTime; but it is not required if maxHandlingTime is present.", + "format": "int64", + "type": "string" + }, + "minTransitTime": { + "description": "Minimum transit time (inclusive) between when the order has shipped and when it is delivered in business days. 0 means that the order is delivered on the same day as it ships. minTransitTime can only be present together with maxTransitTime; but it is not required if maxTransitTime is present.", + "format": "int64", + "type": "string" + }, + "postalCode": { + "description": "The postal code range that the shipping rate applies to, represented by a postal code, a postal code prefix followed by a * wildcard, a range between two postal codes or two postal code prefixes of equal length.", + "type": "string" + }, + "price": { + "$ref": "Price", + "description": "Fixed shipping price, represented as a number." + }, + "region": { + "description": "The geographic region to which a shipping rate applies. See [region](https://support.google.com/merchants/answer/6324484) for more information.", + "type": "string" + }, + "service": { + "description": "A free-form description of the service class or delivery speed.", + "type": "string" + } + }, + "type": "object" + }, + "ShippingDimension": { + "description": "The ShippingDimension of the product.", + "id": "ShippingDimension", + "properties": { + "unit": { + "description": "The unit of value.", + "type": "string" + }, + "value": { + "description": "The dimension of the product used to calculate the shipping cost of the item.", + "format": "double", + "type": "number" + } + }, + "type": "object" + }, + "ShippingWeight": { + "description": "The ShippingWeight of the product.", + "id": "ShippingWeight", + "properties": { + "unit": { + "description": "The unit of value.", + "type": "string" + }, + "value": { + "description": "The weight of the product used to calculate the shipping cost of the item.", + "format": "double", + "type": "number" + } + }, + "type": "object" + }, + "SubscriptionCost": { + "description": "The SubscriptionCost of the product.", + "id": "SubscriptionCost", + "properties": { + "amount": { + "$ref": "Price", + "description": "The amount the buyer has to pay per subscription period." + }, + "period": { + "description": "The type of subscription period. Supported values are: * \"`month`\" * \"`year`\"", + "enum": [ + "SUBSCRIPTION_PERIOD_UNSPECIFIED", + "MONTH", + "YEAR" + ], + "enumDescriptions": [ + "Indicates that the subscription period is unspecified.", + "Indicates that the subscription period is month.", + "Indicates that the subscription period is year." + ], + "type": "string" + }, + "periodLength": { + "description": "The number of subscription periods the buyer has to pay.", + "format": "int64", + "type": "string" + } + }, + "type": "object" + }, + "Tax": { + "description": "The Tax of the product.", + "id": "Tax", + "properties": { + "country": { + "description": "The country within which the item is taxed, specified as a [CLDR territory code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml).", + "type": "string" + }, + "locationId": { + "description": "The numeric ID of a location that the tax rate applies to as defined in the [AdWords API](https://developers.google.com/adwords/api/docs/appendix/geotargeting).", + "format": "int64", + "type": "string" + }, + "postalCode": { + "description": "The postal code range that the tax rate applies to, represented by a ZIP code, a ZIP code prefix using * wildcard, a range between two ZIP codes or two ZIP code prefixes of equal length. Examples: 94114, 94*, 94002-95460, 94*-95*.", + "type": "string" + }, + "rate": { + "description": "The percentage of tax rate that applies to the item price.", + "format": "double", + "type": "number" + }, + "region": { + "description": "The geographic region to which the tax rate applies.", + "type": "string" + }, + "taxShip": { + "description": "Set to true if tax is charged on shipping.", + "type": "boolean" + } + }, + "type": "object" + }, + "UnitPricingBaseMeasure": { + "description": "The UnitPricingBaseMeasure of the product.", + "id": "UnitPricingBaseMeasure", + "properties": { + "unit": { + "description": "The unit of the denominator.", + "type": "string" + }, + "value": { + "description": "The denominator of the unit price.", + "format": "int64", + "type": "string" + } + }, + "type": "object" + }, + "UnitPricingMeasure": { + "description": "The UnitPricingMeasure of the product.", + "id": "UnitPricingMeasure", + "properties": { + "unit": { + "description": "The unit of the measure.", + "type": "string" + }, + "value": { + "description": "The measure of an item.", + "format": "double", + "type": "number" + } + }, + "type": "object" + } + }, + "servicePath": "", + "title": "Merchant API", + "version": "products_v1beta", + "version_module": true +} \ No newline at end of file diff --git a/merchantapi/products_v1beta/merchantapi-gen.go b/merchantapi/products_v1beta/merchantapi-gen.go new file mode 100644 index 00000000000..5225612dafb --- /dev/null +++ b/merchantapi/products_v1beta/merchantapi-gen.go @@ -0,0 +1,2232 @@ +// Copyright 2024 Google LLC. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Code generated file. DO NOT EDIT. + +// Package merchantapi provides access to the Merchant API. +// +// For product documentation, see: https://developers.devsite.corp.google.com/merchant/api +// +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// +// # Creating a client +// +// Usage example: +// +// import "google.golang.org/api/merchantapi/products_v1beta" +// ... +// ctx := context.Background() +// merchantapiService, err := merchantapi.NewService(ctx) +// +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// +// # Other authentication options +// +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: +// +// merchantapiService, err := merchantapi.NewService(ctx, option.WithAPIKey("AIza...")) +// +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: +// +// config := &oauth2.Config{...} +// // ... +// token, err := config.Exchange(ctx, ...) +// merchantapiService, err := merchantapi.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) +// +// See [google.golang.org/api/option.ClientOption] for details on options. +package merchantapi // import "google.golang.org/api/merchantapi/products_v1beta" + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strconv" + "strings" + + googleapi "google.golang.org/api/googleapi" + internal "google.golang.org/api/internal" + gensupport "google.golang.org/api/internal/gensupport" + option "google.golang.org/api/option" + internaloption "google.golang.org/api/option/internaloption" + htransport "google.golang.org/api/transport/http" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = gensupport.MarshalJSON +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = context.Canceled +var _ = internaloption.WithDefaultEndpoint +var _ = internal.Version + +const apiId = "merchantapi:products_v1beta" +const apiName = "merchantapi" +const apiVersion = "products_v1beta" +const basePath = "https://merchantapi.googleapis.com/" +const basePathTemplate = "https://merchantapi.UNIVERSE_DOMAIN/" +const mtlsBasePath = "https://merchantapi.mtls.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // Manage your product listings and accounts for Google Shopping + ContentScope = "https://www.googleapis.com/auth/content" +) + +// NewService creates a new Service. +func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { + scopesOption := internaloption.WithDefaultScopes( + "https://www.googleapis.com/auth/content", + ) + // NOTE: prepend, so we don't override user-specified scopes. + opts = append([]option.ClientOption{scopesOption}, opts...) + opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) + opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) + opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) + opts = append(opts, internaloption.EnableNewAuthLibrary()) + client, endpoint, err := htransport.NewClient(ctx, opts...) + if err != nil { + return nil, err + } + s, err := New(client) + if err != nil { + return nil, err + } + if endpoint != "" { + s.BasePath = endpoint + } + return s, nil +} + +// New creates a new Service. It uses the provided http.Client for requests. +// +// Deprecated: please use NewService instead. +// To provide a custom HTTP client, use option.WithHTTPClient. +// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Accounts *AccountsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewAccountsService(s *Service) *AccountsService { + rs := &AccountsService{s: s} + rs.ProductInputs = NewAccountsProductInputsService(s) + rs.Products = NewAccountsProductsService(s) + return rs +} + +type AccountsService struct { + s *Service + + ProductInputs *AccountsProductInputsService + + Products *AccountsProductsService +} + +func NewAccountsProductInputsService(s *Service) *AccountsProductInputsService { + rs := &AccountsProductInputsService{s: s} + return rs +} + +type AccountsProductInputsService struct { + s *Service +} + +func NewAccountsProductsService(s *Service) *AccountsProductsService { + rs := &AccountsProductsService{s: s} + return rs +} + +type AccountsProductsService struct { + s *Service +} + +// Attributes: Attributes. +type Attributes struct { + // AdditionalImageLinks: Additional URLs of images of the item. + AdditionalImageLinks []string `json:"additionalImageLinks,omitempty"` + // AdsGrouping: Used to group items in an arbitrary way. Only for CPA%, + // discouraged otherwise. + AdsGrouping string `json:"adsGrouping,omitempty"` + // AdsLabels: Similar to ads_grouping, but only works on CPC. + AdsLabels []string `json:"adsLabels,omitempty"` + // AdsRedirect: Allows advertisers to override the item URL when the product is + // shown within the context of Product ads. + AdsRedirect string `json:"adsRedirect,omitempty"` + // Adult: Set to true if the item is targeted towards adults. + Adult bool `json:"adult,omitempty"` + // AgeGroup: Target age group + // (https://support.google.com/merchants/answer/6324463) of the item. + AgeGroup string `json:"ageGroup,omitempty"` + // AutoPricingMinPrice: A safeguard in the "Automated Discounts" + // (https://support.google.com/merchants/answer/10295759) and "Dynamic + // Promotions" (https://support.google.com/merchants/answer/13949249) projects, + // ensuring that discounts on merchants' offers do not fall below this value, + // thereby preserving the offer's value and profitability. + AutoPricingMinPrice *Price `json:"autoPricingMinPrice,omitempty"` + // Availability: Availability status of the item. + Availability string `json:"availability,omitempty"` + // AvailabilityDate: The day a pre-ordered product becomes available for + // delivery, in ISO 8601 (http://en.wikipedia.org/wiki/ISO_8601) format. + AvailabilityDate string `json:"availabilityDate,omitempty"` + // Brand: Brand of the item. + Brand string `json:"brand,omitempty"` + // CanonicalLink: URL for the canonical version of your item's landing page. + CanonicalLink string `json:"canonicalLink,omitempty"` + // Certifications: Product Certifications, for example for energy efficiency + // labeling of products recorded in the EU EPREL + // (https://eprel.ec.europa.eu/screen/home) database. See the Help Center + // (https://support.google.com/merchants/answer/13528839) article for more + // information. + Certifications []*Certification `json:"certifications,omitempty"` + // CloudExportAdditionalProperties: Extra fields to export to the Cloud Retail + // program. + CloudExportAdditionalProperties []*CloudExportAdditionalProperties `json:"cloudExportAdditionalProperties,omitempty"` + // Color: Color of the item. + Color string `json:"color,omitempty"` + // Condition: Condition or state of the item. + Condition string `json:"condition,omitempty"` + // CostOfGoodsSold: Cost of goods sold. Used for gross profit reporting. + CostOfGoodsSold *Price `json:"costOfGoodsSold,omitempty"` + // CustomLabel0: Custom label 0 for custom grouping of items in a Shopping + // campaign. + CustomLabel0 string `json:"customLabel0,omitempty"` + // CustomLabel1: Custom label 1 for custom grouping of items in a Shopping + // campaign. + CustomLabel1 string `json:"customLabel1,omitempty"` + // CustomLabel2: Custom label 2 for custom grouping of items in a Shopping + // campaign. + CustomLabel2 string `json:"customLabel2,omitempty"` + // CustomLabel3: Custom label 3 for custom grouping of items in a Shopping + // campaign. + CustomLabel3 string `json:"customLabel3,omitempty"` + // CustomLabel4: Custom label 4 for custom grouping of items in a Shopping + // campaign. + CustomLabel4 string `json:"customLabel4,omitempty"` + // Description: Description of the item. + Description string `json:"description,omitempty"` + // DisclosureDate: The date time when an offer becomes visible in search + // results across Google’s YouTube surfaces, in ISO 8601 + // (http://en.wikipedia.org/wiki/ISO_8601) format. See Disclosure date ( + // https://support.google.com/merchants/answer/13034208) for more information. + DisclosureDate string `json:"disclosureDate,omitempty"` + // DisplayAdsId: An identifier for an item for dynamic remarketing campaigns. + DisplayAdsId string `json:"displayAdsId,omitempty"` + // DisplayAdsLink: URL directly to your item's landing page for dynamic + // remarketing campaigns. + DisplayAdsLink string `json:"displayAdsLink,omitempty"` + // DisplayAdsSimilarIds: Advertiser-specified recommendations. + DisplayAdsSimilarIds []string `json:"displayAdsSimilarIds,omitempty"` + // DisplayAdsTitle: Title of an item for dynamic remarketing campaigns. + DisplayAdsTitle string `json:"displayAdsTitle,omitempty"` + // DisplayAdsValue: Offer margin for dynamic remarketing campaigns. + DisplayAdsValue float64 `json:"displayAdsValue,omitempty"` + // EnergyEfficiencyClass: The energy efficiency class as defined in EU + // directive 2010/30/EU. + EnergyEfficiencyClass string `json:"energyEfficiencyClass,omitempty"` + // ExcludedDestinations: The list of destinations to exclude for this target + // (corresponds to unchecked check boxes in Merchant Center). + ExcludedDestinations []string `json:"excludedDestinations,omitempty"` + // ExpirationDate: Date on which the item should expire, as specified upon + // insertion, in ISO 8601 (http://en.wikipedia.org/wiki/ISO_8601) format. The + // actual expiration date is exposed in `productstatuses` as + // googleExpirationDate (https://support.google.com/merchants/answer/6324499) + // and might be earlier if `expirationDate` is too far in the future. + ExpirationDate string `json:"expirationDate,omitempty"` + // ExternalSellerId: Required for multi-seller accounts. Use this attribute if + // you're a marketplace uploading products for various sellers to your + // multi-seller account. + ExternalSellerId string `json:"externalSellerId,omitempty"` + // FreeShippingThreshold: Conditions to be met for a product to have free + // shipping. + FreeShippingThreshold []*FreeShippingThreshold `json:"freeShippingThreshold,omitempty"` + // Gender: Target gender of the item. + Gender string `json:"gender,omitempty"` + // GoogleProductCategory: Google's category of the item (see Google product + // taxonomy (https://support.google.com/merchants/answer/1705911)). When + // querying products, this field will contain the user provided value. There is + // currently no way to get back the auto assigned google product categories + // through the API. + GoogleProductCategory string `json:"googleProductCategory,omitempty"` + // Gtin: Global Trade Item Number (GTIN + // (https://support.google.com/merchants/answer/188494#gtin)) of the item. + Gtin string `json:"gtin,omitempty"` + // IdentifierExists: Set this value to false when the item does not have unique + // product identifiers appropriate to its category, such as GTIN, MPN, and + // brand. Defaults to true, if not provided. + IdentifierExists bool `json:"identifierExists,omitempty"` + // ImageLink: URL of an image of the item. + ImageLink string `json:"imageLink,omitempty"` + // IncludedDestinations: The list of destinations to include for this target + // (corresponds to checked check boxes in Merchant Center). Default + // destinations are always included unless provided in `excludedDestinations`. + IncludedDestinations []string `json:"includedDestinations,omitempty"` + // Installment: Number and amount of installments to pay for an item. + Installment *Installment `json:"installment,omitempty"` + // IsBundle: Whether the item is a merchant-defined bundle. A bundle is a + // custom grouping of different products sold by a merchant for a single price. + IsBundle bool `json:"isBundle,omitempty"` + // ItemGroupId: Shared identifier for all variants of the same product. + ItemGroupId string `json:"itemGroupId,omitempty"` + // LifestyleImageLinks: Additional URLs of lifestyle images of the item, used + // to explicitly identify images that showcase your item in a real-world + // context. See the Help Center article + // (https://support.google.com/merchants/answer/9103186) for more information. + LifestyleImageLinks []string `json:"lifestyleImageLinks,omitempty"` + // Link: URL directly linking to your item's page on your online store. + Link string `json:"link,omitempty"` + // LinkTemplate: Link template for merchant hosted local storefront. + LinkTemplate string `json:"linkTemplate,omitempty"` + // LoyaltyPoints: Loyalty points that users receive after purchasing the item. + // Japan only. + LoyaltyPoints *LoyaltyPoints `json:"loyaltyPoints,omitempty"` + // LoyaltyPrograms: A list of loyalty program information that is used to + // surface loyalty benefits (for example, better pricing, points, etc) to the + // user of this item. + LoyaltyPrograms []*LoyaltyProgram `json:"loyaltyPrograms,omitempty"` + // Material: The material of which the item is made. + Material string `json:"material,omitempty"` + // MaxEnergyEfficiencyClass: The energy efficiency class as defined in EU + // directive 2010/30/EU. + MaxEnergyEfficiencyClass string `json:"maxEnergyEfficiencyClass,omitempty"` + // MaxHandlingTime: Maximal product handling time (in business days). + MaxHandlingTime int64 `json:"maxHandlingTime,omitempty,string"` + // MinEnergyEfficiencyClass: The energy efficiency class as defined in EU + // directive 2010/30/EU. + MinEnergyEfficiencyClass string `json:"minEnergyEfficiencyClass,omitempty"` + // MinHandlingTime: Minimal product handling time (in business days). + MinHandlingTime int64 `json:"minHandlingTime,omitempty,string"` + // MobileLink: URL for the mobile-optimized version of your item's landing + // page. + MobileLink string `json:"mobileLink,omitempty"` + // MobileLinkTemplate: Link template for merchant hosted local storefront + // optimized for mobile devices. + MobileLinkTemplate string `json:"mobileLinkTemplate,omitempty"` + // Mpn: Manufacturer Part Number (MPN + // (https://support.google.com/merchants/answer/188494#mpn)) of the item. + Mpn string `json:"mpn,omitempty"` + // Multipack: The number of identical products in a merchant-defined multipack. + Multipack int64 `json:"multipack,omitempty,string"` + // Pattern: The item's pattern (for example, polka dots). + Pattern string `json:"pattern,omitempty"` + // Pause: Publication of this item will be temporarily paused + // (https://support.google.com/merchants/answer/11909930). + Pause string `json:"pause,omitempty"` + // PickupMethod: The pick up option for the item. + PickupMethod string `json:"pickupMethod,omitempty"` + // PickupSla: Item store pickup timeline. + PickupSla string `json:"pickupSla,omitempty"` + // Price: Price of the item. + Price *Price `json:"price,omitempty"` + // ProductDetails: Technical specification or additional product details. + ProductDetails []*ProductDetail `json:"productDetails,omitempty"` + // ProductHeight: The height of the product in the units provided. The value + // must be between 0 (exclusive) and 3000 (inclusive). + ProductHeight *ProductDimension `json:"productHeight,omitempty"` + // ProductHighlights: Bullet points describing the most relevant highlights of + // a product. + ProductHighlights []string `json:"productHighlights,omitempty"` + // ProductLength: The length of the product in the units provided. The value + // must be between 0 (exclusive) and 3000 (inclusive). + ProductLength *ProductDimension `json:"productLength,omitempty"` + // ProductTypes: Categories of the item (formatted as in product data + // specification + // (https://support.google.com/merchants/answer/188494#product_type)). + ProductTypes []string `json:"productTypes,omitempty"` + // ProductWeight: The weight of the product in the units provided. The value + // must be between 0 (exclusive) and 2000 (inclusive). + ProductWeight *ProductWeight `json:"productWeight,omitempty"` + // ProductWidth: The width of the product in the units provided. The value must + // be between 0 (exclusive) and 3000 (inclusive). + ProductWidth *ProductDimension `json:"productWidth,omitempty"` + // PromotionIds: The unique ID of a promotion. + PromotionIds []string `json:"promotionIds,omitempty"` + // SalePrice: Advertised sale price of the item. + SalePrice *Price `json:"salePrice,omitempty"` + // SalePriceEffectiveDate: Date range during which the item is on sale (see + // product data specification + // (https://support.google.com/merchants/answer/188494#sale_price_effective_date)). + SalePriceEffectiveDate *Interval `json:"salePriceEffectiveDate,omitempty"` + // SellOnGoogleQuantity: The quantity of the product that is available for + // selling on Google. Supported only for online products. + SellOnGoogleQuantity int64 `json:"sellOnGoogleQuantity,omitempty,string"` + // Shipping: Shipping rules. + Shipping []*Shipping `json:"shipping,omitempty"` + // ShippingHeight: Height of the item for shipping. + ShippingHeight *ShippingDimension `json:"shippingHeight,omitempty"` + // ShippingLabel: The shipping label of the product, used to group product in + // account-level shipping rules. + ShippingLabel string `json:"shippingLabel,omitempty"` + // ShippingLength: Length of the item for shipping. + ShippingLength *ShippingDimension `json:"shippingLength,omitempty"` + // ShippingWeight: Weight of the item for shipping. + ShippingWeight *ShippingWeight `json:"shippingWeight,omitempty"` + // ShippingWidth: Width of the item for shipping. + ShippingWidth *ShippingDimension `json:"shippingWidth,omitempty"` + // ShoppingAdsExcludedCountries: List of country codes (ISO 3166-1 alpha-2) to + // exclude the offer from Shopping Ads destination. Countries from this list + // are removed from countries configured in data source settings. + ShoppingAdsExcludedCountries []string `json:"shoppingAdsExcludedCountries,omitempty"` + // Size: Size of the item. Only one value is allowed. For variants with + // different sizes, insert a separate product for each size with the same + // `itemGroupId` value (see https://support.google.com/merchants/answer/6324492 + // (size definition)). + Size string `json:"size,omitempty"` + // SizeSystem: System in which the size is specified. Recommended for apparel + // items. + SizeSystem string `json:"sizeSystem,omitempty"` + // SizeTypes: The cut of the item. It can be used to represent combined size + // types for apparel items. Maximum two of size types can be provided (see + // https://support.google.com/merchants/answer/6324497 (size type)). + SizeTypes []string `json:"sizeTypes,omitempty"` + // StructuredDescription: Structured description, for algorithmically + // (AI)-generated descriptions. + StructuredDescription *ProductStructuredDescription `json:"structuredDescription,omitempty"` + // StructuredTitle: Structured title, for algorithmically (AI)-generated + // titles. + StructuredTitle *ProductStructuredTitle `json:"structuredTitle,omitempty"` + // SubscriptionCost: Number of periods (months or years) and amount of payment + // per period for an item with an associated subscription contract. + SubscriptionCost *SubscriptionCost `json:"subscriptionCost,omitempty"` + // TaxCategory: The tax category of the product, used to configure detailed tax + // nexus in account-level tax settings. + TaxCategory string `json:"taxCategory,omitempty"` + // Taxes: Tax information. + Taxes []*Tax `json:"taxes,omitempty"` + // Title: Title of the item. + Title string `json:"title,omitempty"` + // TransitTimeLabel: The transit time label of the product, used to group + // product in account-level transit time tables. + TransitTimeLabel string `json:"transitTimeLabel,omitempty"` + // UnitPricingBaseMeasure: The preference of the denominator of the unit price. + UnitPricingBaseMeasure *UnitPricingBaseMeasure `json:"unitPricingBaseMeasure,omitempty"` + // UnitPricingMeasure: The measure and dimension of an item. + UnitPricingMeasure *UnitPricingMeasure `json:"unitPricingMeasure,omitempty"` + // VirtualModelLink: URL of the 3D image of the item. See the Help Center + // article (https://support.google.com/merchants/answer/13674896) for more + // information. + VirtualModelLink string `json:"virtualModelLink,omitempty"` + // ForceSendFields is a list of field names (e.g. "AdditionalImageLinks") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AdditionalImageLinks") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Attributes) MarshalJSON() ([]byte, error) { + type NoMethod Attributes + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +func (s *Attributes) UnmarshalJSON(data []byte) error { + type NoMethod Attributes + var s1 struct { + DisplayAdsValue gensupport.JSONFloat64 `json:"displayAdsValue"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.DisplayAdsValue = float64(s1.DisplayAdsValue) + return nil +} + +// Certification: Product certification +// (https://support.google.com/merchants/answer/13528839), initially introduced +// for EU energy efficiency labeling compliance using the EU EPREL database. +type Certification struct { + // CertificationAuthority: The certification authority, for example + // "European_Commission". Maximum length is 2000 characters. + CertificationAuthority string `json:"certificationAuthority,omitempty"` + // CertificationCode: The certification code. Maximum length is 2000 + // characters. + CertificationCode string `json:"certificationCode,omitempty"` + // CertificationName: The name of the certification, for example "EPREL". + // Maximum length is 2000 characters. + CertificationName string `json:"certificationName,omitempty"` + // CertificationValue: The certification value (also known as class, level or + // grade), for example "A+", "C", "gold". Maximum length is 2000 characters. + CertificationValue string `json:"certificationValue,omitempty"` + // ForceSendFields is a list of field names (e.g. "CertificationAuthority") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "CertificationAuthority") to + // include in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Certification) MarshalJSON() ([]byte, error) { + type NoMethod Certification + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// CloudExportAdditionalProperties: Product property for the Cloud Retail API. +// For example, properties for a TV product could be "Screen-Resolution" or +// "Screen-Size". +type CloudExportAdditionalProperties struct { + // BoolValue: Boolean value of the given property. For example for a TV + // product, "True" or "False" if the screen is UHD. + BoolValue bool `json:"boolValue,omitempty"` + // FloatValue: Float values of the given property. For example for a TV product + // 1.2345. Maximum repeatedness of this value is 400. Values are stored in an + // arbitrary but consistent order. + FloatValue []float64 `json:"floatValue,omitempty"` + // IntValue: Integer values of the given property. For example, 1080 for a TV + // product's Screen Resolution. Maximum repeatedness of this value is 400. + // Values are stored in an arbitrary but consistent order. + IntValue googleapi.Int64s `json:"intValue,omitempty"` + // MaxValue: Maximum float value of the given property. For example for a TV + // product 100.00. + MaxValue float64 `json:"maxValue,omitempty"` + // MinValue: Minimum float value of the given property. For example for a TV + // product 1.00. + MinValue float64 `json:"minValue,omitempty"` + // PropertyName: Name of the given property. For example, "Screen-Resolution" + // for a TV product. Maximum string size is 256 characters. + PropertyName string `json:"propertyName,omitempty"` + // TextValue: Text value of the given property. For example, "8K(UHD)" could be + // a text value for a TV product. Maximum repeatedness of this value is 400. + // Values are stored in an arbitrary but consistent order. Maximum string size + // is 256 characters. + TextValue []string `json:"textValue,omitempty"` + // UnitCode: Unit of the given property. For example, "Pixels" for a TV + // product. Maximum string size is 256B. + UnitCode string `json:"unitCode,omitempty"` + // ForceSendFields is a list of field names (e.g. "BoolValue") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "BoolValue") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *CloudExportAdditionalProperties) MarshalJSON() ([]byte, error) { + type NoMethod CloudExportAdditionalProperties + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +func (s *CloudExportAdditionalProperties) UnmarshalJSON(data []byte) error { + type NoMethod CloudExportAdditionalProperties + var s1 struct { + FloatValue []gensupport.JSONFloat64 `json:"floatValue"` + MaxValue gensupport.JSONFloat64 `json:"maxValue"` + MinValue gensupport.JSONFloat64 `json:"minValue"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.FloatValue = make([]float64, len(s1.FloatValue)) + for i := range s1.FloatValue { + s.FloatValue[i] = float64(s1.FloatValue[i]) + } + s.MaxValue = float64(s1.MaxValue) + s.MinValue = float64(s1.MinValue) + return nil +} + +// CustomAttribute: A message that represents custom attributes. Exactly one of +// `value` or `group_values` must not be empty. +type CustomAttribute struct { + // GroupValues: Subattributes within this attribute group. If `group_values` is + // not empty, `value` must be empty. + GroupValues []*CustomAttribute `json:"groupValues,omitempty"` + // Name: The name of the attribute. + Name string `json:"name,omitempty"` + // Value: The value of the attribute. If `value` is not empty, `group_values` + // must be empty. + Value string `json:"value,omitempty"` + // ForceSendFields is a list of field names (e.g. "GroupValues") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "GroupValues") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *CustomAttribute) MarshalJSON() ([]byte, error) { + type NoMethod CustomAttribute + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// DestinationStatus: The destination status of the product status. +type DestinationStatus struct { + // ApprovedCountries: List of country codes (ISO 3166-1 alpha-2) where the + // offer is approved. + ApprovedCountries []string `json:"approvedCountries,omitempty"` + // DisapprovedCountries: List of country codes (ISO 3166-1 alpha-2) where the + // offer is disapproved. + DisapprovedCountries []string `json:"disapprovedCountries,omitempty"` + // PendingCountries: List of country codes (ISO 3166-1 alpha-2) where the offer + // is pending approval. + PendingCountries []string `json:"pendingCountries,omitempty"` + // ReportingContext: The name of the reporting context. + // + // Possible values: + // "REPORTING_CONTEXT_ENUM_UNSPECIFIED" - Not specified. + // "SHOPPING_ADS" - [Shopping + // ads](https://support.google.com/merchants/answer/6149970). + // "DISCOVERY_ADS" - Deprecated: Use `DEMAND_GEN_ADS` instead. [Discovery and + // Demand Gen ads](https://support.google.com/merchants/answer/13389785). + // "DEMAND_GEN_ADS" - [Demand Gen + // ads](https://support.google.com/merchants/answer/13389785). + // "DEMAND_GEN_ADS_DISCOVER_SURFACE" - [Demand Gen ads on Discover + // surface](https://support.google.com/merchants/answer/13389785). + // "VIDEO_ADS" - [Video + // ads](https://support.google.com/google-ads/answer/6340491). + // "DISPLAY_ADS" - [Display + // ads](https://support.google.com/merchants/answer/6069387). + // "LOCAL_INVENTORY_ADS" - [Local inventory + // ads](https://support.google.com/merchants/answer/3271956). + // "VEHICLE_INVENTORY_ADS" - [Vehicle inventory + // ads](https://support.google.com/merchants/answer/11544533). + // "FREE_LISTINGS" - [Free product + // listings](https://support.google.com/merchants/answer/9199328). + // "FREE_LOCAL_LISTINGS" - [Free local product + // listings](https://support.google.com/merchants/answer/9825611). + // "FREE_LOCAL_VEHICLE_LISTINGS" - [Free local vehicle + // listings](https://support.google.com/merchants/answer/11544533). + // "YOUTUBE_SHOPPING" - [YouTube + // Shopping](https://support.google.com/merchants/answer/13478370). + // "CLOUD_RETAIL" - [Cloud + // retail](https://cloud.google.com/solutions/retail). + // "LOCAL_CLOUD_RETAIL" - [Local cloud + // retail](https://cloud.google.com/solutions/retail). + ReportingContext string `json:"reportingContext,omitempty"` + // ForceSendFields is a list of field names (e.g. "ApprovedCountries") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ApprovedCountries") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *DestinationStatus) MarshalJSON() ([]byte, error) { + type NoMethod DestinationStatus + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Empty: A generic empty message that you can re-use to avoid defining +// duplicated empty messages in your APIs. A typical example is to use it as +// the request or the response type of an API method. For instance: service Foo +// { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } +type Empty struct { + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` +} + +// FreeShippingThreshold: Conditions to be met for a product to have free +// shipping. +type FreeShippingThreshold struct { + // Country: The CLDR territory code + // (http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) of the + // country to which an item will ship. + Country string `json:"country,omitempty"` + // PriceThreshold: The minimum product price for the shipping cost to become + // free. Represented as a number. + PriceThreshold *Price `json:"priceThreshold,omitempty"` + // ForceSendFields is a list of field names (e.g. "Country") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Country") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *FreeShippingThreshold) MarshalJSON() ([]byte, error) { + type NoMethod FreeShippingThreshold + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Installment: A message that represents installment. +type Installment struct { + // Amount: The amount the buyer has to pay per month. + Amount *Price `json:"amount,omitempty"` + // CreditType: Type of installment payments. Supported values are: * + // "finance" * "lease" + CreditType string `json:"creditType,omitempty"` + // Downpayment: The up-front down payment amount the buyer has to pay. + Downpayment *Price `json:"downpayment,omitempty"` + // Months: The number of installments the buyer has to pay. + Months int64 `json:"months,omitempty,string"` + // ForceSendFields is a list of field names (e.g. "Amount") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Amount") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Installment) MarshalJSON() ([]byte, error) { + type NoMethod Installment + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Interval: Represents a time interval, encoded as a Timestamp start +// (inclusive) and a Timestamp end (exclusive). The start must be less than or +// equal to the end. When the start equals the end, the interval is empty +// (matches no time). When both start and end are unspecified, the interval +// matches any time. +type Interval struct { + // EndTime: Optional. Exclusive end of the interval. If specified, a Timestamp + // matching this interval will have to be before the end. + EndTime string `json:"endTime,omitempty"` + // StartTime: Optional. Inclusive start of the interval. If specified, a + // Timestamp matching this interval will have to be the same or after the + // start. + StartTime string `json:"startTime,omitempty"` + // ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "EndTime") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Interval) MarshalJSON() ([]byte, error) { + type NoMethod Interval + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ItemLevelIssue: The ItemLevelIssue of the product status. +type ItemLevelIssue struct { + // ApplicableCountries: List of country codes (ISO 3166-1 alpha-2) where issue + // applies to the offer. + ApplicableCountries []string `json:"applicableCountries,omitempty"` + // Attribute: The attribute's name, if the issue is caused by a single + // attribute. + Attribute string `json:"attribute,omitempty"` + // Code: The error code of the issue. + Code string `json:"code,omitempty"` + // Description: A short issue description in English. + Description string `json:"description,omitempty"` + // Detail: A detailed issue description in English. + Detail string `json:"detail,omitempty"` + // Documentation: The URL of a web page to help with resolving this issue. + Documentation string `json:"documentation,omitempty"` + // ReportingContext: The reporting context the issue applies to. + // + // Possible values: + // "REPORTING_CONTEXT_ENUM_UNSPECIFIED" - Not specified. + // "SHOPPING_ADS" - [Shopping + // ads](https://support.google.com/merchants/answer/6149970). + // "DISCOVERY_ADS" - Deprecated: Use `DEMAND_GEN_ADS` instead. [Discovery and + // Demand Gen ads](https://support.google.com/merchants/answer/13389785). + // "DEMAND_GEN_ADS" - [Demand Gen + // ads](https://support.google.com/merchants/answer/13389785). + // "DEMAND_GEN_ADS_DISCOVER_SURFACE" - [Demand Gen ads on Discover + // surface](https://support.google.com/merchants/answer/13389785). + // "VIDEO_ADS" - [Video + // ads](https://support.google.com/google-ads/answer/6340491). + // "DISPLAY_ADS" - [Display + // ads](https://support.google.com/merchants/answer/6069387). + // "LOCAL_INVENTORY_ADS" - [Local inventory + // ads](https://support.google.com/merchants/answer/3271956). + // "VEHICLE_INVENTORY_ADS" - [Vehicle inventory + // ads](https://support.google.com/merchants/answer/11544533). + // "FREE_LISTINGS" - [Free product + // listings](https://support.google.com/merchants/answer/9199328). + // "FREE_LOCAL_LISTINGS" - [Free local product + // listings](https://support.google.com/merchants/answer/9825611). + // "FREE_LOCAL_VEHICLE_LISTINGS" - [Free local vehicle + // listings](https://support.google.com/merchants/answer/11544533). + // "YOUTUBE_SHOPPING" - [YouTube + // Shopping](https://support.google.com/merchants/answer/13478370). + // "CLOUD_RETAIL" - [Cloud + // retail](https://cloud.google.com/solutions/retail). + // "LOCAL_CLOUD_RETAIL" - [Local cloud + // retail](https://cloud.google.com/solutions/retail). + ReportingContext string `json:"reportingContext,omitempty"` + // Resolution: Whether the issue can be resolved by the merchant. + Resolution string `json:"resolution,omitempty"` + // Severity: How this issue affects serving of the offer. + // + // Possible values: + // "SEVERITY_UNSPECIFIED" - Not specified. + // "NOT_IMPACTED" - This issue represents a warning and does not have a + // direct affect on the product. + // "DEMOTED" - The product is demoted and most likely have limited + // performance in search results + // "DISAPPROVED" - Issue disapproves the product. + Severity string `json:"severity,omitempty"` + // ForceSendFields is a list of field names (e.g. "ApplicableCountries") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ApplicableCountries") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ItemLevelIssue) MarshalJSON() ([]byte, error) { + type NoMethod ItemLevelIssue + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ListProductsResponse: Response message for the ListProducts method. +type ListProductsResponse struct { + // NextPageToken: A token, which can be sent as `page_token` to retrieve the + // next page. If this field is omitted, there are no subsequent pages. + NextPageToken string `json:"nextPageToken,omitempty"` + // Products: The processed products from the specified account. These are your + // processed products after applying rules and supplemental data sources. + Products []*Product `json:"products,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "NextPageToken") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ListProductsResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListProductsResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// LoyaltyPoints: A message that represents loyalty points. +type LoyaltyPoints struct { + // Name: Name of loyalty points program. It is recommended to limit the name to + // 12 full-width characters or 24 Roman characters. + Name string `json:"name,omitempty"` + // PointsValue: The retailer's loyalty points in absolute value. + PointsValue int64 `json:"pointsValue,omitempty,string"` + // Ratio: The ratio of a point when converted to currency. Google assumes + // currency based on Merchant Center settings. If ratio is left out, it + // defaults to 1.0. + Ratio float64 `json:"ratio,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. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + 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. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *LoyaltyPoints) MarshalJSON() ([]byte, error) { + type NoMethod LoyaltyPoints + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +func (s *LoyaltyPoints) UnmarshalJSON(data []byte) error { + type NoMethod LoyaltyPoints + var s1 struct { + Ratio gensupport.JSONFloat64 `json:"ratio"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Ratio = float64(s1.Ratio) + return nil +} + +// LoyaltyProgram: A message that represents loyalty program. +type LoyaltyProgram struct { + // CashbackForFutureUse: The cashback that can be used for future purchases. + CashbackForFutureUse *Price `json:"cashbackForFutureUse,omitempty"` + // LoyaltyPoints: The amount of loyalty points earned on a purchase. + LoyaltyPoints int64 `json:"loyaltyPoints,omitempty,string"` + // Price: The price for members of the given tier, that is, the instant + // discount price. Must be smaller or equal to the regular price. + Price *Price `json:"price,omitempty"` + // ProgramLabel: The label of the loyalty program. This is an internal label + // that uniquely identifies the relationship between a merchant entity and a + // loyalty program entity. The label must be provided so that the system can + // associate the assets below (for example, price and points) with a merchant. + // The corresponding program must be linked to the merchant account. + ProgramLabel string `json:"programLabel,omitempty"` + // TierLabel: The label of the tier within the loyalty program. Must match one + // of the labels within the program. + TierLabel string `json:"tierLabel,omitempty"` + // ForceSendFields is a list of field names (e.g. "CashbackForFutureUse") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "CashbackForFutureUse") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *LoyaltyProgram) MarshalJSON() ([]byte, error) { + type NoMethod LoyaltyProgram + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Price: The price represented as a number and currency. +type Price struct { + // AmountMicros: The price represented as a number in micros (1 million micros + // is an equivalent to one's currency standard unit, for example, 1 USD = + // 1000000 micros). + AmountMicros int64 `json:"amountMicros,omitempty,string"` + // CurrencyCode: The currency of the price using three-letter acronyms + // according to ISO 4217 (http://en.wikipedia.org/wiki/ISO_4217). + CurrencyCode string `json:"currencyCode,omitempty"` + // ForceSendFields is a list of field names (e.g. "AmountMicros") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AmountMicros") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Price) MarshalJSON() ([]byte, error) { + type NoMethod Price + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Product: The processed product, built from multiple product inputs after +// applying rules and supplemental data sources. This processed product matches +// what is shown in your Merchant Center account and in Shopping ads and other +// surfaces across Google. Each product is built from exactly one primary data +// source product input, and multiple supplemental data source inputs. After +// inserting, updating, or deleting a product input, it may take several +// minutes before the updated processed product can be retrieved. All fields in +// the processed product and its sub-messages match the name of their +// corresponding attribute in the Product data specification +// (https://support.google.com/merchants/answer/7052112) with some exceptions. +type Product struct { + // Attributes: Output only. A list of product attributes. + Attributes *Attributes `json:"attributes,omitempty"` + // Channel: Output only. The channel + // (https://support.google.com/merchants/answer/7361332) of the product. + // + // Possible values: + // "CHANNEL_ENUM_UNSPECIFIED" - Not specified. + // "ONLINE" - Online product. + // "LOCAL" - Local product. + Channel string `json:"channel,omitempty"` + // ContentLanguage: Output only. The two-letter ISO 639-1 + // (http://en.wikipedia.org/wiki/ISO_639-1) language code for the product. + ContentLanguage string `json:"contentLanguage,omitempty"` + // CustomAttributes: Output only. A list of custom (merchant-provided) + // attributes. It can also be used to submit any attribute of the data + // specification in its generic form (for example, `{ "name": "size type", + // "value": "regular" }`). This is useful for submitting attributes not + // explicitly exposed by the API, such as additional attributes used for Buy on + // Google. + CustomAttributes []*CustomAttribute `json:"customAttributes,omitempty"` + // DataSource: Output only. The primary data source of the product. + DataSource string `json:"dataSource,omitempty"` + // FeedLabel: Output only. The feed label for the product. + FeedLabel string `json:"feedLabel,omitempty"` + // Name: The name of the product. Format: + // "{product.name=accounts/{account}/products/{product}}" + Name string `json:"name,omitempty"` + // OfferId: Output only. Your unique identifier for the product. This is the + // same for the product input and processed product. Leading and trailing + // whitespaces are stripped and multiple whitespaces are replaced by a single + // whitespace upon submission. See the product data specification + // (https://support.google.com/merchants/answer/188494#id) for details. + OfferId string `json:"offerId,omitempty"` + // ProductStatus: Output only. The status of a product, data validation issues, + // that is, information about a product computed asynchronously. + ProductStatus *ProductStatus `json:"productStatus,omitempty"` + // VersionNumber: Output only. Represents the existing version (freshness) of + // the product, which can be used to preserve the right order when multiple + // updates are done at the same time. If set, the insertion is prevented when + // version number is lower than the current version number of the existing + // product. Re-insertion (for example, product refresh after 30 days) can be + // performed with the current `version_number`. Only supported for insertions + // into primary data sources. If the operation is prevented, the aborted + // exception will be thrown. + VersionNumber int64 `json:"versionNumber,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "Attributes") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Attributes") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Product) MarshalJSON() ([]byte, error) { + type NoMethod Product + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ProductChange: The change that happened to the product including old value, +// new value, country code as the region code and reporting context. +type ProductChange struct { + // NewValue: The new value of the changed resource or attribute. + NewValue string `json:"newValue,omitempty"` + // OldValue: The old value of the changed resource or attribute. + OldValue string `json:"oldValue,omitempty"` + // RegionCode: Countries that have the change (if applicable) + RegionCode string `json:"regionCode,omitempty"` + // ReportingContext: Reporting contexts that have the change (if applicable) + // + // Possible values: + // "REPORTING_CONTEXT_ENUM_UNSPECIFIED" - Not specified. + // "SHOPPING_ADS" - [Shopping + // ads](https://support.google.com/merchants/answer/6149970). + // "DISCOVERY_ADS" - Deprecated: Use `DEMAND_GEN_ADS` instead. [Discovery and + // Demand Gen ads](https://support.google.com/merchants/answer/13389785). + // "DEMAND_GEN_ADS" - [Demand Gen + // ads](https://support.google.com/merchants/answer/13389785). + // "DEMAND_GEN_ADS_DISCOVER_SURFACE" - [Demand Gen ads on Discover + // surface](https://support.google.com/merchants/answer/13389785). + // "VIDEO_ADS" - [Video + // ads](https://support.google.com/google-ads/answer/6340491). + // "DISPLAY_ADS" - [Display + // ads](https://support.google.com/merchants/answer/6069387). + // "LOCAL_INVENTORY_ADS" - [Local inventory + // ads](https://support.google.com/merchants/answer/3271956). + // "VEHICLE_INVENTORY_ADS" - [Vehicle inventory + // ads](https://support.google.com/merchants/answer/11544533). + // "FREE_LISTINGS" - [Free product + // listings](https://support.google.com/merchants/answer/9199328). + // "FREE_LOCAL_LISTINGS" - [Free local product + // listings](https://support.google.com/merchants/answer/9825611). + // "FREE_LOCAL_VEHICLE_LISTINGS" - [Free local vehicle + // listings](https://support.google.com/merchants/answer/11544533). + // "YOUTUBE_SHOPPING" - [YouTube + // Shopping](https://support.google.com/merchants/answer/13478370). + // "CLOUD_RETAIL" - [Cloud + // retail](https://cloud.google.com/solutions/retail). + // "LOCAL_CLOUD_RETAIL" - [Local cloud + // retail](https://cloud.google.com/solutions/retail). + ReportingContext string `json:"reportingContext,omitempty"` + // ForceSendFields is a list of field names (e.g. "NewValue") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "NewValue") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ProductChange) MarshalJSON() ([]byte, error) { + type NoMethod ProductChange + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ProductDetail: The product details. +type ProductDetail struct { + // AttributeName: The name of the product detail. + AttributeName string `json:"attributeName,omitempty"` + // AttributeValue: The value of the product detail. + AttributeValue string `json:"attributeValue,omitempty"` + // SectionName: The section header used to group a set of product details. + SectionName string `json:"sectionName,omitempty"` + // ForceSendFields is a list of field names (e.g. "AttributeName") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AttributeName") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ProductDetail) MarshalJSON() ([]byte, error) { + type NoMethod ProductDetail + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ProductDimension: The dimension of the product. +type ProductDimension struct { + // Unit: Required. The dimension units. Acceptable values are: * "in" * + // "cm" + Unit string `json:"unit,omitempty"` + // Value: Required. The dimension value represented as a number. The value can + // have a maximum precision of four decimal places. + Value float64 `json:"value,omitempty"` + // ForceSendFields is a list of field names (e.g. "Unit") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Unit") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ProductDimension) MarshalJSON() ([]byte, error) { + type NoMethod ProductDimension + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +func (s *ProductDimension) UnmarshalJSON(data []byte) error { + type NoMethod ProductDimension + var s1 struct { + Value gensupport.JSONFloat64 `json:"value"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Value = float64(s1.Value) + return nil +} + +// ProductInput: This resource represents input data you submit for a product, +// not the processed product that you see in Merchant Center, in Shopping ads, +// or across Google surfaces. Product inputs, rules and supplemental data +// source data are combined to create the processed product. Required product +// input attributes to pass data validation checks are primarily defined in the +// Products Data Specification +// (https://support.google.com/merchants/answer/188494). The following +// attributes are required: feedLabel, contentLanguage and offerId. After +// inserting, updating, or deleting a product input, it may take several +// minutes before the processed product can be retrieved. All fields in the +// product input and its sub-messages match the English name of their +// corresponding attribute in the vertical spec with some exceptions +// (https://support.google.com/merchants/answer/7052112). +type ProductInput struct { + // Attributes: Optional. A list of product attributes. + Attributes *Attributes `json:"attributes,omitempty"` + // Channel: Required. Immutable. The channel + // (https://support.google.com/merchants/answer/7361332) of the product. + // + // Possible values: + // "CHANNEL_ENUM_UNSPECIFIED" - Not specified. + // "ONLINE" - Online product. + // "LOCAL" - Local product. + Channel string `json:"channel,omitempty"` + // ContentLanguage: Required. Immutable. The two-letter ISO 639-1 + // (http://en.wikipedia.org/wiki/ISO_639-1) language code for the product. + ContentLanguage string `json:"contentLanguage,omitempty"` + // CustomAttributes: Optional. A list of custom (merchant-provided) attributes. + // It can also be used for submitting any attribute of the data specification + // in its generic form (for example, `{ "name": "size type", "value": "regular" + // }`). This is useful for submitting attributes not explicitly exposed by the + // API, such as additional attributes used for Buy on Google. Maximum allowed + // number of characters for each custom attribute is 10240 (represents sum of + // characters for name and value). Maximum 2500 custom attributes can be set + // per product, with total size of 102.4kB. Underscores in custom attribute + // names are replaced by spaces upon insertion. + CustomAttributes []*CustomAttribute `json:"customAttributes,omitempty"` + // FeedLabel: Required. Immutable. The feed label + // (https://developers.google.com/shopping-content/guides/products/feed-labels) + // for the product. + FeedLabel string `json:"feedLabel,omitempty"` + // Name: Identifier. The name of the product input. Format: + // "{productinput.name=accounts/{account}/productInputs/{productinput}}" + Name string `json:"name,omitempty"` + // OfferId: Required. Immutable. Your unique identifier for the product. This + // is the same for the product input and processed product. Leading and + // trailing whitespaces are stripped and multiple whitespaces are replaced by a + // single whitespace upon submission. See the products data specification + // (https://support.google.com/merchants/answer/188494#id) for details. + OfferId string `json:"offerId,omitempty"` + // Product: Output only. The name of the processed product. Format: + // "{product.name=accounts/{account}/products/{product}}" + Product string `json:"product,omitempty"` + // VersionNumber: Optional. Represents the existing version (freshness) of the + // product, which can be used to preserve the right order when multiple updates + // are done at the same time. If set, the insertion is prevented when version + // number is lower than the current version number of the existing product. + // Re-insertion (for example, product refresh after 30 days) can be performed + // with the current `version_number`. Only supported for insertions into + // primary data sources. If the operation is prevented, the aborted exception + // will be thrown. + VersionNumber int64 `json:"versionNumber,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "Attributes") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Attributes") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ProductInput) MarshalJSON() ([]byte, error) { + type NoMethod ProductInput + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ProductStatus: The status of a product, data validation issues, that is, +// information about a product computed asynchronously. +type ProductStatus struct { + // CreationDate: Date on which the item has been created, in ISO 8601 + // (http://en.wikipedia.org/wiki/ISO_8601) format. + CreationDate string `json:"creationDate,omitempty"` + // DestinationStatuses: The intended destinations for the product. + DestinationStatuses []*DestinationStatus `json:"destinationStatuses,omitempty"` + // GoogleExpirationDate: Date on which the item expires, in ISO 8601 + // (http://en.wikipedia.org/wiki/ISO_8601) format. + GoogleExpirationDate string `json:"googleExpirationDate,omitempty"` + // ItemLevelIssues: A list of all issues associated with the product. + ItemLevelIssues []*ItemLevelIssue `json:"itemLevelIssues,omitempty"` + // LastUpdateDate: Date on which the item has been last updated, in ISO 8601 + // (http://en.wikipedia.org/wiki/ISO_8601) format. + LastUpdateDate string `json:"lastUpdateDate,omitempty"` + // ForceSendFields is a list of field names (e.g. "CreationDate") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "CreationDate") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ProductStatus) MarshalJSON() ([]byte, error) { + type NoMethod ProductStatus + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ProductStatusChangeMessage: The message that the merchant will receive to +// notify about product status change event +type ProductStatusChangeMessage struct { + // Account: The target account that owns the entity that changed. Format : + // `accounts/{merchant_id}` + Account string `json:"account,omitempty"` + // Attribute: The attribute in the resource that changed, in this case it will + // be always `Status`. + // + // Possible values: + // "ATTRIBUTE_UNSPECIFIED" - Unspecified attribute + // "STATUS" - Status of the changed entity + Attribute string `json:"attribute,omitempty"` + // Changes: A message to describe the change that happened to the product + Changes []*ProductChange `json:"changes,omitempty"` + // ManagingAccount: The account that manages the merchant's account. can be the + // same as merchant id if it is standalone account. Format : + // `accounts/{service_provider_id}` + ManagingAccount string `json:"managingAccount,omitempty"` + // Resource: The product name. Format: + // `{product.name=accounts/{account}/products/{product}}` + Resource string `json:"resource,omitempty"` + // ResourceId: The product id. + ResourceId string `json:"resourceId,omitempty"` + // ResourceType: The resource that changed, in this case it will always be + // `Product`. + // + // Possible values: + // "RESOURCE_UNSPECIFIED" - Unspecified resource + // "PRODUCT" - Resource type : product + ResourceType string `json:"resourceType,omitempty"` + // ForceSendFields is a list of field names (e.g. "Account") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Account") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ProductStatusChangeMessage) MarshalJSON() ([]byte, error) { + type NoMethod ProductStatusChangeMessage + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ProductStructuredDescription: Structured description, for algorithmically +// (AI)-generated descriptions. +type ProductStructuredDescription struct { + // Content: The description text Maximum length is 5000 characters + Content string `json:"content,omitempty"` + // DigitalSourceType: The digital source type, for example + // "trained_algorithmic_media". Following IPTC + // (https://cv.iptc.org/newscodes/digitalsourcetype). Maximum length is 40 + // characters. + DigitalSourceType string `json:"digitalSourceType,omitempty"` + // ForceSendFields is a list of field names (e.g. "Content") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Content") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ProductStructuredDescription) MarshalJSON() ([]byte, error) { + type NoMethod ProductStructuredDescription + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ProductStructuredTitle: Structured title, for algorithmically (AI)-generated +// titles. +type ProductStructuredTitle struct { + // Content: The title text Maximum length is 150 characters + Content string `json:"content,omitempty"` + // DigitalSourceType: The digital source type, for example + // "trained_algorithmic_media". Following IPTC + // (https://cv.iptc.org/newscodes/digitalsourcetype). Maximum length is 40 + // characters. + DigitalSourceType string `json:"digitalSourceType,omitempty"` + // ForceSendFields is a list of field names (e.g. "Content") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Content") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ProductStructuredTitle) MarshalJSON() ([]byte, error) { + type NoMethod ProductStructuredTitle + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ProductWeight: The weight of the product. +type ProductWeight struct { + // Unit: Required. The weight unit. Acceptable values are: * "g" * "kg" * + // "oz" * "lb" + Unit string `json:"unit,omitempty"` + // Value: Required. The weight represented as a number. The weight can have a + // maximum precision of four decimal places. + Value float64 `json:"value,omitempty"` + // ForceSendFields is a list of field names (e.g. "Unit") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Unit") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ProductWeight) MarshalJSON() ([]byte, error) { + type NoMethod ProductWeight + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +func (s *ProductWeight) UnmarshalJSON(data []byte) error { + type NoMethod ProductWeight + var s1 struct { + Value gensupport.JSONFloat64 `json:"value"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Value = float64(s1.Value) + return nil +} + +// Shipping: The Shipping of the product. +type Shipping struct { + // Country: The CLDR territory code + // (http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) of the + // country to which an item will ship. + Country string `json:"country,omitempty"` + // LocationGroupName: The location where the shipping is applicable, + // represented by a location group name. + LocationGroupName string `json:"locationGroupName,omitempty"` + // LocationId: The numeric ID of a location that the shipping rate applies to + // as defined in the AdWords API + // (https://developers.google.com/adwords/api/docs/appendix/geotargeting). + LocationId int64 `json:"locationId,omitempty,string"` + // MaxHandlingTime: Maximum handling time (inclusive) between when the order is + // received and shipped in business days. 0 means that the order is shipped on + // the same day as it is received if it happens before the cut-off time. Both + // maxHandlingTime and maxTransitTime are required if providing shipping + // speeds. minHandlingTime is optional if maxHandlingTime is present. + MaxHandlingTime int64 `json:"maxHandlingTime,omitempty,string"` + // MaxTransitTime: Maximum transit time (inclusive) between when the order has + // shipped and when it is delivered in business days. 0 means that the order is + // delivered on the same day as it ships. Both maxHandlingTime and + // maxTransitTime are required if providing shipping speeds. minTransitTime is + // optional if maxTransitTime is present. + MaxTransitTime int64 `json:"maxTransitTime,omitempty,string"` + // MinHandlingTime: Minimum handling time (inclusive) between when the order is + // received and shipped in business days. 0 means that the order is shipped on + // the same day as it is received if it happens before the cut-off time. + // minHandlingTime can only be present together with maxHandlingTime; but it is + // not required if maxHandlingTime is present. + MinHandlingTime int64 `json:"minHandlingTime,omitempty,string"` + // MinTransitTime: Minimum transit time (inclusive) between when the order has + // shipped and when it is delivered in business days. 0 means that the order is + // delivered on the same day as it ships. minTransitTime can only be present + // together with maxTransitTime; but it is not required if maxTransitTime is + // present. + MinTransitTime int64 `json:"minTransitTime,omitempty,string"` + // PostalCode: The postal code range that the shipping rate applies to, + // represented by a postal code, a postal code prefix followed by a * wildcard, + // a range between two postal codes or two postal code prefixes of equal + // length. + PostalCode string `json:"postalCode,omitempty"` + // Price: Fixed shipping price, represented as a number. + Price *Price `json:"price,omitempty"` + // Region: The geographic region to which a shipping rate applies. See region + // (https://support.google.com/merchants/answer/6324484) for more information. + Region string `json:"region,omitempty"` + // Service: A free-form description of the service class or delivery speed. + Service string `json:"service,omitempty"` + // ForceSendFields is a list of field names (e.g. "Country") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Country") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Shipping) MarshalJSON() ([]byte, error) { + type NoMethod Shipping + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ShippingDimension: The ShippingDimension of the product. +type ShippingDimension struct { + // Unit: The unit of value. + Unit string `json:"unit,omitempty"` + // Value: The dimension of the product used to calculate the shipping cost of + // the item. + Value float64 `json:"value,omitempty"` + // ForceSendFields is a list of field names (e.g. "Unit") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Unit") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ShippingDimension) MarshalJSON() ([]byte, error) { + type NoMethod ShippingDimension + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +func (s *ShippingDimension) UnmarshalJSON(data []byte) error { + type NoMethod ShippingDimension + var s1 struct { + Value gensupport.JSONFloat64 `json:"value"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Value = float64(s1.Value) + return nil +} + +// ShippingWeight: The ShippingWeight of the product. +type ShippingWeight struct { + // Unit: The unit of value. + Unit string `json:"unit,omitempty"` + // Value: The weight of the product used to calculate the shipping cost of the + // item. + Value float64 `json:"value,omitempty"` + // ForceSendFields is a list of field names (e.g. "Unit") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Unit") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ShippingWeight) MarshalJSON() ([]byte, error) { + type NoMethod ShippingWeight + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +func (s *ShippingWeight) UnmarshalJSON(data []byte) error { + type NoMethod ShippingWeight + var s1 struct { + Value gensupport.JSONFloat64 `json:"value"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Value = float64(s1.Value) + return nil +} + +// SubscriptionCost: The SubscriptionCost of the product. +type SubscriptionCost struct { + // Amount: The amount the buyer has to pay per subscription period. + Amount *Price `json:"amount,omitempty"` + // Period: The type of subscription period. Supported values are: * "month" * + // "year" + // + // Possible values: + // "SUBSCRIPTION_PERIOD_UNSPECIFIED" - Indicates that the subscription period + // is unspecified. + // "MONTH" - Indicates that the subscription period is month. + // "YEAR" - Indicates that the subscription period is year. + Period string `json:"period,omitempty"` + // PeriodLength: The number of subscription periods the buyer has to pay. + PeriodLength int64 `json:"periodLength,omitempty,string"` + // ForceSendFields is a list of field names (e.g. "Amount") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Amount") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *SubscriptionCost) MarshalJSON() ([]byte, error) { + type NoMethod SubscriptionCost + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Tax: The Tax of the product. +type Tax struct { + // Country: The country within which the item is taxed, specified as a CLDR + // territory code + // (http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml). + Country string `json:"country,omitempty"` + // LocationId: The numeric ID of a location that the tax rate applies to as + // defined in the AdWords API + // (https://developers.google.com/adwords/api/docs/appendix/geotargeting). + LocationId int64 `json:"locationId,omitempty,string"` + // PostalCode: The postal code range that the tax rate applies to, represented + // by a ZIP code, a ZIP code prefix using * wildcard, a range between two ZIP + // codes or two ZIP code prefixes of equal length. Examples: 94114, 94*, + // 94002-95460, 94*-95*. + PostalCode string `json:"postalCode,omitempty"` + // Rate: The percentage of tax rate that applies to the item price. + Rate float64 `json:"rate,omitempty"` + // Region: The geographic region to which the tax rate applies. + Region string `json:"region,omitempty"` + // TaxShip: Set to true if tax is charged on shipping. + TaxShip bool `json:"taxShip,omitempty"` + // ForceSendFields is a list of field names (e.g. "Country") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Country") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Tax) MarshalJSON() ([]byte, error) { + type NoMethod Tax + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +func (s *Tax) UnmarshalJSON(data []byte) error { + type NoMethod Tax + var s1 struct { + Rate gensupport.JSONFloat64 `json:"rate"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Rate = float64(s1.Rate) + return nil +} + +// UnitPricingBaseMeasure: The UnitPricingBaseMeasure of the product. +type UnitPricingBaseMeasure struct { + // Unit: The unit of the denominator. + Unit string `json:"unit,omitempty"` + // Value: The denominator of the unit price. + Value int64 `json:"value,omitempty,string"` + // ForceSendFields is a list of field names (e.g. "Unit") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Unit") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *UnitPricingBaseMeasure) MarshalJSON() ([]byte, error) { + type NoMethod UnitPricingBaseMeasure + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// UnitPricingMeasure: The UnitPricingMeasure of the product. +type UnitPricingMeasure struct { + // Unit: The unit of the measure. + Unit string `json:"unit,omitempty"` + // Value: The measure of an item. + Value float64 `json:"value,omitempty"` + // ForceSendFields is a list of field names (e.g. "Unit") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Unit") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *UnitPricingMeasure) MarshalJSON() ([]byte, error) { + type NoMethod UnitPricingMeasure + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +func (s *UnitPricingMeasure) UnmarshalJSON(data []byte) error { + type NoMethod UnitPricingMeasure + var s1 struct { + Value gensupport.JSONFloat64 `json:"value"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Value = float64(s1.Value) + return nil +} + +type AccountsProductInputsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a product input from your Merchant Center account. After +// inserting, updating, or deleting a product input, it may take several +// minutes before the processed product can be retrieved. +// +// - name: The name of the product input resource to delete. Format: +// accounts/{account}/productInputs/{product}. +func (r *AccountsProductInputsService) Delete(name string) *AccountsProductInputsDeleteCall { + c := &AccountsProductInputsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// DataSource sets the optional parameter "dataSource": Required. The primary +// or supplemental data source from which the product input should be deleted. +// Format: `accounts/{account}/dataSources/{datasource}`. +func (c *AccountsProductInputsDeleteCall) DataSource(dataSource string) *AccountsProductInputsDeleteCall { + c.urlParams_.Set("dataSource", dataSource) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *AccountsProductInputsDeleteCall) Fields(s ...googleapi.Field) *AccountsProductInputsDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsProductInputsDeleteCall) Context(ctx context.Context) *AccountsProductInputsDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsProductInputsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsProductInputsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "products/v1beta/{+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 "merchantapi.accounts.productInputs.delete" call. +// 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 *AccountsProductInputsDeleteCall) 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 +} + +type AccountsProductInputsInsertCall struct { + s *Service + parent string + productinput *ProductInput + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Insert: Uploads a product input to your Merchant Center account. If an input +// with the same contentLanguage, offerId, and dataSource already exists, this +// method replaces that entry. After inserting, updating, or deleting a product +// input, it may take several minutes before the processed product can be +// retrieved. +// +// - parent: The account where this product will be inserted. Format: +// accounts/{account}. +func (r *AccountsProductInputsService) Insert(parent string, productinput *ProductInput) *AccountsProductInputsInsertCall { + c := &AccountsProductInputsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.productinput = productinput + return c +} + +// DataSource sets the optional parameter "dataSource": Required. The primary +// or supplemental product data source name. If the product already exists and +// data source provided is different, then the product will be moved to a new +// data source. Format: `accounts/{account}/dataSources/{datasource}`. +func (c *AccountsProductInputsInsertCall) DataSource(dataSource string) *AccountsProductInputsInsertCall { + c.urlParams_.Set("dataSource", dataSource) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *AccountsProductInputsInsertCall) Fields(s ...googleapi.Field) *AccountsProductInputsInsertCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsProductInputsInsertCall) Context(ctx context.Context) *AccountsProductInputsInsertCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsProductInputsInsertCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsProductInputsInsertCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.productinput) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "products/v1beta/{+parent}/productInputs:insert") + 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 "merchantapi.accounts.productInputs.insert" call. +// Any non-2xx status code is an error. Response headers are in either +// *ProductInput.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 *AccountsProductInputsInsertCall) Do(opts ...googleapi.CallOption) (*ProductInput, 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 := &ProductInput{ + 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 +} + +type AccountsProductsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Retrieves the processed product from your Merchant Center account. +// After inserting, updating, or deleting a product input, it may take several +// minutes before the updated final product can be retrieved. +// +// - name: The name of the product to retrieve. Format: +// `accounts/{account}/products/{product}`. +func (r *AccountsProductsService) Get(name string) *AccountsProductsGetCall { + c := &AccountsProductsGetCall{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 +// details. +func (c *AccountsProductsGetCall) Fields(s ...googleapi.Field) *AccountsProductsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsProductsGetCall) IfNoneMatch(entityTag string) *AccountsProductsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsProductsGetCall) Context(ctx context.Context) *AccountsProductsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsProductsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsProductsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "products/v1beta/{+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 "merchantapi.accounts.products.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *Product.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 *AccountsProductsGetCall) Do(opts ...googleapi.CallOption) (*Product, 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 := &Product{ + 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 +} + +type AccountsProductsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists the processed products in your Merchant Center account. The +// response might contain fewer items than specified by pageSize. Rely on +// pageToken to determine if there are more items to be requested. After +// inserting, updating, or deleting a product input, it may take several +// minutes before the updated processed product can be retrieved. +// +// - parent: The account to list processed products for. Format: +// accounts/{account}. +func (r *AccountsProductsService) List(parent string) *AccountsProductsListCall { + c := &AccountsProductsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number of +// products to return. The service may return fewer than this value. The +// maximum value is 1000; values above 1000 will be coerced to 1000. If +// unspecified, the maximum number of products will be returned. +func (c *AccountsProductsListCall) PageSize(pageSize int64) *AccountsProductsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, received +// from a previous `ListProducts` call. Provide this to retrieve the subsequent +// page. When paginating, all other parameters provided to `ListProducts` must +// match the call that provided the page token. +func (c *AccountsProductsListCall) PageToken(pageToken string) *AccountsProductsListCall { + 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 +// details. +func (c *AccountsProductsListCall) Fields(s ...googleapi.Field) *AccountsProductsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsProductsListCall) IfNoneMatch(entityTag string) *AccountsProductsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsProductsListCall) Context(ctx context.Context) *AccountsProductsListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsProductsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsProductsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "products/v1beta/{+parent}/products") + 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 "merchantapi.accounts.products.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *ListProductsResponse.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 *AccountsProductsListCall) Do(opts ...googleapi.CallOption) (*ListProductsResponse, 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 := &ListProductsResponse{ + 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 +} + +// 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 *AccountsProductsListCall) Pages(ctx context.Context, f func(*ListProductsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + 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) + } +} diff --git a/merchantapi/promotions_v1beta/merchantapi-api.json b/merchantapi/promotions_v1beta/merchantapi-api.json new file mode 100644 index 00000000000..90dcb933c20 --- /dev/null +++ b/merchantapi/promotions_v1beta/merchantapi-api.json @@ -0,0 +1,977 @@ +{ + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/content": { + "description": "Manage your product listings and accounts for Google Shopping" + } + } + } + }, + "basePath": "", + "baseUrl": "https://merchantapi.googleapis.com/", + "batchPath": "batch", + "canonicalName": "Merchant", + "description": "Programmatically manage your Merchant Center Accounts.", + "discoveryVersion": "v1", + "documentationLink": "https://developers.devsite.corp.google.com/merchant/api", + "fullyEncodeReservedExpansion": true, + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "id": "merchantapi:promotions_v1beta", + "kind": "discovery#restDescription", + "mtlsRootUrl": "https://merchantapi.mtls.googleapis.com/", + "name": "merchantapi", + "ownerDomain": "google.com", + "ownerName": "Google", + "parameters": { + "$.xgafv": { + "description": "V1 error format.", + "enum": [ + "1", + "2" + ], + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "type": "string" + }, + "access_token": { + "description": "OAuth access token.", + "location": "query", + "type": "string" + }, + "alt": { + "default": "json", + "description": "Data format for response.", + "enum": [ + "json", + "media", + "proto" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query", + "type": "string" + }, + "callback": { + "description": "JSONP", + "location": "query", + "type": "string" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "location": "query", + "type": "string" + }, + "key": { + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query", + "type": "string" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "location": "query", + "type": "string" + }, + "prettyPrint": { + "default": "true", + "description": "Returns response with indentations and line breaks.", + "location": "query", + "type": "boolean" + }, + "quotaUser": { + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query", + "type": "string" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query", + "type": "string" + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query", + "type": "string" + } + }, + "protocol": "rest", + "resources": { + "accounts": { + "resources": { + "promotions": { + "methods": { + "get": { + "description": "Retrieves the promotion from your Merchant Center account. After inserting or updating a promotion input, it may take several minutes before the updated promotion can be retrieved.", + "flatPath": "promotions/v1beta/accounts/{accountsId}/promotions/{promotionsId}", + "httpMethod": "GET", + "id": "merchantapi.accounts.promotions.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the promotion to retrieve. Format: `accounts/{account}/promotions/{promotions}`", + "location": "path", + "pattern": "^accounts/[^/]+/promotions/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "promotions/v1beta/{+name}", + "response": { + "$ref": "Promotion" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "insert": { + "description": "Inserts a promotion for your Merchant Center account. If the promotion already exists, then it updates the promotion instead.", + "flatPath": "promotions/v1beta/accounts/{accountsId}/promotions:insert", + "httpMethod": "POST", + "id": "merchantapi.accounts.promotions.insert", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The account where the promotion will be inserted. Format: accounts/{account}", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "promotions/v1beta/{+parent}/promotions:insert", + "request": { + "$ref": "InsertPromotionRequest" + }, + "response": { + "$ref": "Promotion" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "description": "Lists the promotions in your Merchant Center account. The response might contain fewer items than specified by `pageSize`. Rely on `pageToken` to determine if there are more items to be requested. After inserting or updating a promotion, it may take several minutes before the updated processed promotion can be retrieved.", + "flatPath": "promotions/v1beta/accounts/{accountsId}/promotions", + "httpMethod": "GET", + "id": "merchantapi.accounts.promotions.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Output only. The maximum number of promotions to return. The service may return fewer than this value. The maximum value is 1000; values above 1000 will be coerced to 1000. If unspecified, the maximum number of promotions will be returned.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Output only. A page token, received from a previous `ListPromotions` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListPromotions` must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The account to list processed promotions for. Format: `accounts/{account}`", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "promotions/v1beta/{+parent}/promotions", + "response": { + "$ref": "ListPromotionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + } + } + } + }, + "revision": "20240613", + "rootUrl": "https://merchantapi.googleapis.com/", + "schemas": { + "Attributes": { + "description": "Attributes.", + "id": "Attributes", + "properties": { + "brandExclusion": { + "description": "Optional. Product filter by [brand exclusion](https://support.google.com/merchants/answer/13861679?ref_topic=13773355\u0026sjid=17642868584668136159-NC) for the promotion. The product filter attributes only applies when the products eligible for promotion product applicability `product_applicability` attribute is set to [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355\u0026sjid=17642868584668136159-NC).", + "items": { + "type": "string" + }, + "type": "array" + }, + "brandInclusion": { + "description": "Optional. Product filter by brand for the promotion. The product filter attributes only applies when the products eligible for promotion product applicability `product_applicability` attribute is set to [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355\u0026sjid=17642868584668136159-NC).", + "items": { + "type": "string" + }, + "type": "array" + }, + "couponValueType": { + "description": "Required. The [coupon value type] (https://support.google.com/merchants/answer/13861986?ref_topic=13773355\u0026sjid=17642868584668136159-NC) attribute to signal the type of promotion that you are running. Depending on type of the selected coupon value [some attributes are required](https://support.google.com/merchants/answer/6393006?ref_topic=7322920).", + "enum": [ + "COUPON_VALUE_TYPE_UNSPECIFIED", + "MONEY_OFF", + "PERCENT_OFF", + "BUY_M_GET_N_MONEY_OFF", + "BUY_M_GET_N_PERCENT_OFF", + "BUY_M_GET_MONEY_OFF", + "BUY_M_GET_PERCENT_OFF", + "FREE_GIFT", + "FREE_GIFT_WITH_VALUE", + "FREE_GIFT_WITH_ITEM_ID", + "FREE_SHIPPING_STANDARD", + "FREE_SHIPPING_OVERNIGHT", + "FREE_SHIPPING_TWO_DAY" + ], + "enumDescriptions": [ + "Indicates that the coupon value type is unspecified.", + "Money off coupon value type.", + "Percent off coupon value type.", + "Buy M quantity, get N money off coupon value type. `minimum_purchase_quantity` and `get_this_quantity_discounted` must be present. `money_off_amount` must also be present.", + "Buy M quantity, get N percent off coupon value type. `minimum_purchase_quantity` and `get_this_quantity_discounted` must be present. `percent_off_percentage` must also be present.", + "Buy M quantity, get money off. `minimum_purchase_quantity` and `money_off_amount` must be present.", + "Buy M quantity, get money off. `minimum_purchase_quantity` and `percent_off_percentage` must be present.", + "Free gift with description only.", + "Free gift with monetary value.", + "Free gift with item ID.", + "Standard free shipping coupon value type.", + "Overnight free shipping coupon value type.", + "Two day free shipping coupon value type." + ], + "type": "string" + }, + "freeGiftDescription": { + "description": "Optional. [Free gift description](https://support.google.com/merchants/answer/13847245?ref_topic=13773355\u0026sjid=17642868584668136159-NC) for the promotion.", + "type": "string" + }, + "freeGiftItemId": { + "description": "Optional. [Free gift item ID](https://support.google.com/merchants/answer/13857152?ref_topic=13773355\u0026sjid=17642868584668136159-NC) for the promotion.", + "type": "string" + }, + "freeGiftValue": { + "$ref": "Price", + "description": "Optional. [Free gift value](https://support.google.com/merchants/answer/13844477?ref_topic=13773355\u0026sjid=17642868584668136159-NC) for the promotion." + }, + "genericRedemptionCode": { + "description": "Optional. Generic redemption code for the promotion. To be used with the `offerType` field and must meet the [minimum requirements](https://support.google.com/merchants/answer/13837405?ref_topic=13773355\u0026sjid=17642868584668136159-NC).", + "type": "string" + }, + "getThisQuantityDiscounted": { + "description": "Optional. The number of items discounted in the promotion. The attribute is set when `couponValueType` is equal to `buy_m_get_n_money_off` or `buy_m_get_n_percent_off`.", + "format": "int64", + "type": "string" + }, + "itemGroupIdExclusion": { + "description": "Optional. Product filter by [item group ID](https://support.google.com/merchants/answer/13837298?ref_topic=13773355\u0026sjid=17642868584668136159-NC). The product filter attributes only applies when the products eligible for promotion product applicability `product_applicability` attribute is set to [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355\u0026sjid=17642868584668136159-NC). exclusion for the promotion.", + "items": { + "type": "string" + }, + "type": "array" + }, + "itemGroupIdInclusion": { + "description": "Optional. Product filter by item group ID for the promotion. The product filter attributes only applies when the products eligible for promotion product applicability [product_applicability] attribute is set to [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355\u0026sjid=17642868584668136159-NC).", + "items": { + "type": "string" + }, + "type": "array" + }, + "itemIdExclusion": { + "description": "Optional. Product filter by [item ID exclusion](https://support.google.com/merchants/answer/13863524?ref_topic=13773355\u0026sjid=17642868584668136159-NC) for the promotion. The product filter attributes only applies when the products eligible for promotion product applicability `product_applicability` attribute is set to [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355\u0026sjid=17642868584668136159-NC).", + "items": { + "type": "string" + }, + "type": "array" + }, + "itemIdInclusion": { + "description": "Optional. Product filter by [item ID](https://support.google.com/merchants/answer/13861565?ref_topic=13773355\u0026sjid=17642868584668136159-NC) for the promotion. The product filter attributes only applies when the products eligible for promotion product applicability `product_applicability` attribute is set to [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355\u0026sjid=17642868584668136159-NC).", + "items": { + "type": "string" + }, + "type": "array" + }, + "limitQuantity": { + "description": "Optional. [Maximum purchase quantity](https://support.google.com/merchants/answer/13861564?ref_topic=13773355\u0026sjid=17642868584668136159-NC) for the promotion.", + "format": "int64", + "type": "string" + }, + "limitValue": { + "$ref": "Price", + "description": "Optional. [Maximum product price](https://support.google.com/merchants/answer/2906014) for promotion." + }, + "longTitle": { + "description": "Required. [Long title](https://support.google.com/merchants/answer/13838102?ref_topic=13773355\u0026sjid=17642868584668136159-NC) for the promotion.", + "type": "string" + }, + "minimumPurchaseAmount": { + "$ref": "Price", + "description": "Optional. [Minimum purchase amount](https://support.google.com/merchants/answer/13837705?ref_topic=13773355\u0026sjid=17642868584668136159-NC) for the promotion." + }, + "minimumPurchaseQuantity": { + "description": "Optional. [Minimum purchase quantity](https://support.google.com/merchants/answer/13838182?ref_topic=13773355\u0026sjid=17642868584668136159-NC) for the promotion.", + "format": "int64", + "type": "string" + }, + "moneyOffAmount": { + "$ref": "Price", + "description": "Optional. The [money off amount](https://support.google.com/merchants/answer/13838101?ref_topic=13773355\u0026sjid=17642868584668136159-NC) offered in the promotion." + }, + "offerType": { + "description": "Required. [Type](https://support.google.com/merchants/answer/13837405?ref_topic=13773355\u0026sjid=17642868584668136159-NC) of the promotion. Use this attribute to indicate whether or not customers need a coupon code to redeem your promotion.", + "enum": [ + "OFFER_TYPE_UNSPECIFIED", + "NO_CODE", + "GENERIC_CODE" + ], + "enumDescriptions": [ + "Unknown offer type.", + "Offer type without a code.", + "Offer type with a code. Generic redemption code for the promotion is required when `offerType` = `GENERIC_CODE`." + ], + "type": "string" + }, + "percentOff": { + "description": "Optional. The [percentage discount](https://support.google.com/merchants/answer/13837404?sjid=17642868584668136159-NC) offered in the promotion.", + "format": "int64", + "type": "string" + }, + "productApplicability": { + "description": "Required. Applicability of the promotion to either all products or [only specific products](https://support.google.com/merchants/answer/6396257?ref_topic=6396150\u0026sjid=17642868584668136159-NC).", + "enum": [ + "PRODUCT_APPLICABILITY_UNSPECIFIED", + "ALL_PRODUCTS", + "SPECIFIC_PRODUCTS" + ], + "enumDescriptions": [ + "Which products the promotion applies to is unknown.", + "Applicable to all products.", + "Applicable to only a single product or list of products." + ], + "type": "string" + }, + "productTypeExclusion": { + "description": "Optional. Product filter by [product type exclusion](https://support.google.com/merchants/answer/13863746?ref_topic=13773355\u0026sjid=17642868584668136159-NC) for the promotion. The product filter attributes only applies when the products eligible for promotion product applicability `product_applicability` attribute is set to [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355\u0026sjid=17642868584668136159-NC).", + "items": { + "type": "string" + }, + "type": "array" + }, + "productTypeInclusion": { + "description": "Optional. Product filter by product type for the promotion. The product filter attributes only applies when the products eligible for promotion product applicability `product_applicability` attribute is set to [specific_products](https://support.google.com/merchants/answer/13837299?ref_topic=13773355\u0026sjid=17642868584668136159-NC).", + "items": { + "type": "string" + }, + "type": "array" + }, + "promotionDestinations": { + "description": "Required. The list of destinations where the promotion applies to. If you don't specify a destination by including a supported value in your data source, your promotion will display in Shopping ads and free listings by default. You may have previously submitted the following values as destinations for your products: Shopping Actions, Surfaces across Google, Local surfaces across Google. To represent these values use `FREE_LISTINGS`, `FREE_LOCAL_LISTINGS`, `LOCAL_INVENTORY_ADS`. For more details see [Promotion destination](https://support.google.com/merchants/answer/13837465?sjid=5155774230887277618-NC)", + "items": { + "enum": [ + "DESTINATION_ENUM_UNSPECIFIED", + "SHOPPING_ADS", + "DISPLAY_ADS", + "LOCAL_INVENTORY_ADS", + "FREE_LISTINGS", + "FREE_LOCAL_LISTINGS", + "YOUTUBE_SHOPPING" + ], + "enumDescriptions": [ + "Not specified.", + "[Shopping ads](https://support.google.com/google-ads/answer/2454022).", + "[Display ads](https://support.google.com/merchants/answer/6069387).", + "[Local inventory ads](https://support.google.com/merchants/answer/3057972).", + "[Free listings](https://support.google.com/merchants/answer/9199328).", + "[Free local product listings](https://support.google.com/merchants/answer/9825611).", + "[YouTube Shopping](https://support.google.com/merchants/answer/12362804)." + ], + "type": "string" + }, + "type": "array" + }, + "promotionDisplayTimePeriod": { + "$ref": "Interval", + "description": "Optional. `TimePeriod` representation of the promotion's display dates. This attribute specifies the date and time frame when the promotion will be live on Google.com and Shopping ads. If the display time period for promotion `promotion_display_time_period` attribute is not specified, the promotion effective time period `promotion_effective_time_period` determines the date and time frame when the promotion will be live on Google.com and Shopping ads." + }, + "promotionEffectiveTimePeriod": { + "$ref": "Interval", + "description": "Required. `TimePeriod` representation of the promotion's effective dates. This attribute specifies that the promotion can be tested on your online store during this time period." + }, + "promotionUrl": { + "description": "Optional. URL to the page on the merchant's site where the promotion shows. Local Inventory ads promotions throw an error if no `promotion_url` is included. URL is used to confirm that the promotion is valid and can be redeemed.", + "type": "string" + }, + "storeApplicability": { + "description": "Optional. Whether the promotion applies to [all stores, or only specified stores](https://support.google.com/merchants/answer/13857563?sjid=17642868584668136159-NC). Local Inventory ads promotions throw an error if no store applicability is included. An `INVALID_ARGUMENT` error is thrown if `store_applicability` is set to `ALL_STORES` and `store_codes_inclusion` or `score_code_exclusion` is set to a value.", + "enum": [ + "STORE_APPLICABILITY_UNSPECIFIED", + "ALL_STORES", + "SPECIFIC_STORES" + ], + "enumDescriptions": [ + "Which store codes the promotion applies to is unknown.", + "Promotion applies to all stores.", + "Promotion applies to only the specified stores." + ], + "type": "string" + }, + "storeCodesExclusion": { + "description": "Optional. [Store codes to exclude](https://support.google.com/merchants/answer/13859586?ref_topic=13773355\u0026sjid=17642868584668136159-NC) for the promotion. The store filter attributes only applies when the `store_applicability` attribute is set to [specific_stores](https://support.google.com/merchants/answer/13857563?ref_topic=13773355\u0026sjid=17642868584668136159-NC).", + "items": { + "type": "string" + }, + "type": "array" + }, + "storeCodesInclusion": { + "description": "Optional. [Store codes to include](https://support.google.com/merchants/answer/13857470?ref_topic=13773355\u0026sjid=17642868584668136159-NC) for the promotion. The store filter attributes only applies when the `store_applicability` attribute is set to [specific_stores](https://support.google.com/merchants/answer/13857563?ref_topic=13773355\u0026sjid=17642868584668136159-NC). Store code (the store ID from your Business Profile) of the physical store the product is sold in. See the [Local product inventory data specification](https://support.google.com/merchants/answer/3061342) for more information.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "CustomAttribute": { + "description": "A message that represents custom attributes. Exactly one of `value` or `group_values` must not be empty.", + "id": "CustomAttribute", + "properties": { + "groupValues": { + "description": "Subattributes within this attribute group. If `group_values` is not empty, `value` must be empty.", + "items": { + "$ref": "CustomAttribute" + }, + "type": "array" + }, + "name": { + "description": "The name of the attribute.", + "type": "string" + }, + "value": { + "description": "The value of the attribute. If `value` is not empty, `group_values` must be empty.", + "type": "string" + } + }, + "type": "object" + }, + "DestinationStatus": { + "description": "The status for the specified destination.", + "id": "DestinationStatus", + "properties": { + "reportingContext": { + "description": "Output only. The name of the promotion destination.", + "enum": [ + "REPORTING_CONTEXT_ENUM_UNSPECIFIED", + "SHOPPING_ADS", + "DISCOVERY_ADS", + "DEMAND_GEN_ADS", + "DEMAND_GEN_ADS_DISCOVER_SURFACE", + "VIDEO_ADS", + "DISPLAY_ADS", + "LOCAL_INVENTORY_ADS", + "VEHICLE_INVENTORY_ADS", + "FREE_LISTINGS", + "FREE_LOCAL_LISTINGS", + "FREE_LOCAL_VEHICLE_LISTINGS", + "YOUTUBE_SHOPPING", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL" + ], + "enumDeprecated": [ + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false + ], + "enumDescriptions": [ + "Not specified.", + "[Shopping ads](https://support.google.com/merchants/answer/6149970).", + "Deprecated: Use `DEMAND_GEN_ADS` instead. [Discovery and Demand Gen ads](https://support.google.com/merchants/answer/13389785).", + "[Demand Gen ads](https://support.google.com/merchants/answer/13389785).", + "[Demand Gen ads on Discover surface](https://support.google.com/merchants/answer/13389785).", + "[Video ads](https://support.google.com/google-ads/answer/6340491).", + "[Display ads](https://support.google.com/merchants/answer/6069387).", + "[Local inventory ads](https://support.google.com/merchants/answer/3271956).", + "[Vehicle inventory ads](https://support.google.com/merchants/answer/11544533).", + "[Free product listings](https://support.google.com/merchants/answer/9199328).", + "[Free local product listings](https://support.google.com/merchants/answer/9825611).", + "[Free local vehicle listings](https://support.google.com/merchants/answer/11544533).", + "[YouTube Shopping](https://support.google.com/merchants/answer/13478370).", + "[Cloud retail](https://cloud.google.com/solutions/retail).", + "[Local cloud retail](https://cloud.google.com/solutions/retail)." + ], + "readOnly": true, + "type": "string" + }, + "status": { + "description": "Output only. The status for the specified destination.", + "enum": [ + "STATE_UNSPECIFIED", + "IN_REVIEW", + "REJECTED", + "LIVE", + "STOPPED", + "EXPIRED", + "PENDING" + ], + "enumDescriptions": [ + "Unknown promotion state.", + "The promotion is under review.", + "The promotion is disapproved.", + "The promotion is approved and active.", + "The promotion is stopped by merchant.", + "The promotion is no longer active.", + "The promotion is not stopped, and all reviews are approved, but the active date is in the future." + ], + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "InsertPromotionRequest": { + "description": "Request message for the `InsertPromotion` method.", + "id": "InsertPromotionRequest", + "properties": { + "dataSource": { + "description": "Required. The data source of the [promotion](https://support.google.com/merchants/answer/6396268?sjid=5155774230887277618-NC) Format: `accounts/{account}/dataSources/{datasource}`.", + "type": "string" + }, + "promotion": { + "$ref": "Promotion", + "description": "Required. The promotion to insert." + } + }, + "type": "object" + }, + "Interval": { + "description": "Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive). The start must be less than or equal to the end. When the start equals the end, the interval is empty (matches no time). When both start and end are unspecified, the interval matches any time.", + "id": "Interval", + "properties": { + "endTime": { + "description": "Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end.", + "format": "google-datetime", + "type": "string" + }, + "startTime": { + "description": "Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, + "ItemLevelIssue": { + "description": "The issue associated with the promotion.", + "id": "ItemLevelIssue", + "properties": { + "applicableCountries": { + "description": "Output only. List of country codes (ISO 3166-1 alpha-2) where issue applies to the offer.", + "items": { + "type": "string" + }, + "readOnly": true, + "type": "array" + }, + "attribute": { + "description": "Output only. The attribute's name, if the issue is caused by a single attribute.", + "readOnly": true, + "type": "string" + }, + "code": { + "description": "Output only. The error code of the issue.", + "readOnly": true, + "type": "string" + }, + "description": { + "description": "Output only. A short issue description in English.", + "readOnly": true, + "type": "string" + }, + "detail": { + "description": "Output only. A detailed issue description in English.", + "readOnly": true, + "type": "string" + }, + "documentation": { + "description": "Output only. The URL of a web page to help with resolving this issue.", + "readOnly": true, + "type": "string" + }, + "reportingContext": { + "description": "Output only. The destination the issue applies to.", + "enum": [ + "REPORTING_CONTEXT_ENUM_UNSPECIFIED", + "SHOPPING_ADS", + "DISCOVERY_ADS", + "DEMAND_GEN_ADS", + "DEMAND_GEN_ADS_DISCOVER_SURFACE", + "VIDEO_ADS", + "DISPLAY_ADS", + "LOCAL_INVENTORY_ADS", + "VEHICLE_INVENTORY_ADS", + "FREE_LISTINGS", + "FREE_LOCAL_LISTINGS", + "FREE_LOCAL_VEHICLE_LISTINGS", + "YOUTUBE_SHOPPING", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL" + ], + "enumDeprecated": [ + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false + ], + "enumDescriptions": [ + "Not specified.", + "[Shopping ads](https://support.google.com/merchants/answer/6149970).", + "Deprecated: Use `DEMAND_GEN_ADS` instead. [Discovery and Demand Gen ads](https://support.google.com/merchants/answer/13389785).", + "[Demand Gen ads](https://support.google.com/merchants/answer/13389785).", + "[Demand Gen ads on Discover surface](https://support.google.com/merchants/answer/13389785).", + "[Video ads](https://support.google.com/google-ads/answer/6340491).", + "[Display ads](https://support.google.com/merchants/answer/6069387).", + "[Local inventory ads](https://support.google.com/merchants/answer/3271956).", + "[Vehicle inventory ads](https://support.google.com/merchants/answer/11544533).", + "[Free product listings](https://support.google.com/merchants/answer/9199328).", + "[Free local product listings](https://support.google.com/merchants/answer/9825611).", + "[Free local vehicle listings](https://support.google.com/merchants/answer/11544533).", + "[YouTube Shopping](https://support.google.com/merchants/answer/13478370).", + "[Cloud retail](https://cloud.google.com/solutions/retail).", + "[Local cloud retail](https://cloud.google.com/solutions/retail)." + ], + "readOnly": true, + "type": "string" + }, + "resolution": { + "description": "Output only. Whether the issue can be resolved by the merchant.", + "readOnly": true, + "type": "string" + }, + "severity": { + "description": "Output only. How this issue affects serving of the promotion.", + "enum": [ + "SEVERITY_UNSPECIFIED", + "NOT_IMPACTED", + "DEMOTED", + "DISAPPROVED" + ], + "enumDescriptions": [ + "Not specified.", + "This issue represents a warning and does not have a direct affect on the promotion.", + "The promotion is demoted and most likely have limited performance in search results", + "Issue disapproves the promotion." + ], + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "ListPromotionsResponse": { + "description": "Response message for the `ListPromotions` method.", + "id": "ListPromotionsResponse", + "properties": { + "nextPageToken": { + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "type": "string" + }, + "promotions": { + "description": "The processed promotions from the specified account.", + "items": { + "$ref": "Promotion" + }, + "type": "array" + } + }, + "type": "object" + }, + "Price": { + "description": "The price represented as a number and currency.", + "id": "Price", + "properties": { + "amountMicros": { + "description": "The price represented as a number in micros (1 million micros is an equivalent to one's currency standard unit, for example, 1 USD = 1000000 micros).", + "format": "int64", + "type": "string" + }, + "currencyCode": { + "description": "The currency of the price using three-letter acronyms according to [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217).", + "type": "string" + } + }, + "type": "object" + }, + "ProductChange": { + "description": "The change that happened to the product including old value, new value, country code as the region code and reporting context.", + "id": "ProductChange", + "properties": { + "newValue": { + "description": "The new value of the changed resource or attribute.", + "type": "string" + }, + "oldValue": { + "description": "The old value of the changed resource or attribute.", + "type": "string" + }, + "regionCode": { + "description": "Countries that have the change (if applicable)", + "type": "string" + }, + "reportingContext": { + "description": "Reporting contexts that have the change (if applicable)", + "enum": [ + "REPORTING_CONTEXT_ENUM_UNSPECIFIED", + "SHOPPING_ADS", + "DISCOVERY_ADS", + "DEMAND_GEN_ADS", + "DEMAND_GEN_ADS_DISCOVER_SURFACE", + "VIDEO_ADS", + "DISPLAY_ADS", + "LOCAL_INVENTORY_ADS", + "VEHICLE_INVENTORY_ADS", + "FREE_LISTINGS", + "FREE_LOCAL_LISTINGS", + "FREE_LOCAL_VEHICLE_LISTINGS", + "YOUTUBE_SHOPPING", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL" + ], + "enumDeprecated": [ + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false + ], + "enumDescriptions": [ + "Not specified.", + "[Shopping ads](https://support.google.com/merchants/answer/6149970).", + "Deprecated: Use `DEMAND_GEN_ADS` instead. [Discovery and Demand Gen ads](https://support.google.com/merchants/answer/13389785).", + "[Demand Gen ads](https://support.google.com/merchants/answer/13389785).", + "[Demand Gen ads on Discover surface](https://support.google.com/merchants/answer/13389785).", + "[Video ads](https://support.google.com/google-ads/answer/6340491).", + "[Display ads](https://support.google.com/merchants/answer/6069387).", + "[Local inventory ads](https://support.google.com/merchants/answer/3271956).", + "[Vehicle inventory ads](https://support.google.com/merchants/answer/11544533).", + "[Free product listings](https://support.google.com/merchants/answer/9199328).", + "[Free local product listings](https://support.google.com/merchants/answer/9825611).", + "[Free local vehicle listings](https://support.google.com/merchants/answer/11544533).", + "[YouTube Shopping](https://support.google.com/merchants/answer/13478370).", + "[Cloud retail](https://cloud.google.com/solutions/retail).", + "[Local cloud retail](https://cloud.google.com/solutions/retail)." + ], + "type": "string" + } + }, + "type": "object" + }, + "ProductStatusChangeMessage": { + "description": "The message that the merchant will receive to notify about product status change event", + "id": "ProductStatusChangeMessage", + "properties": { + "account": { + "description": "The target account that owns the entity that changed. Format : `accounts/{merchant_id}`", + "type": "string" + }, + "attribute": { + "description": "The attribute in the resource that changed, in this case it will be always `Status`.", + "enum": [ + "ATTRIBUTE_UNSPECIFIED", + "STATUS" + ], + "enumDescriptions": [ + "Unspecified attribute", + "Status of the changed entity" + ], + "type": "string" + }, + "changes": { + "description": "A message to describe the change that happened to the product", + "items": { + "$ref": "ProductChange" + }, + "type": "array" + }, + "managingAccount": { + "description": "The account that manages the merchant's account. can be the same as merchant id if it is standalone account. Format : `accounts/{service_provider_id}`", + "type": "string" + }, + "resource": { + "description": "The product name. Format: `{product.name=accounts/{account}/products/{product}}`", + "type": "string" + }, + "resourceId": { + "description": "The product id.", + "type": "string" + }, + "resourceType": { + "description": "The resource that changed, in this case it will always be `Product`.", + "enum": [ + "RESOURCE_UNSPECIFIED", + "PRODUCT" + ], + "enumDescriptions": [ + "Unspecified resource", + "Resource type : product" + ], + "type": "string" + } + }, + "type": "object" + }, + "Promotion": { + "description": "Represents a promotion. See the following articles for more details. Required promotion input attributes to pass data validation checks are primarily defined below: * [Promotions data specification](https://support.google.com/merchants/answer/2906014) * [Local promotions data specification](https://support.google.com/merchants/answer/10146130) After inserting, updating a promotion input, it may take several minutes before the final promotion can be retrieved.", + "id": "Promotion", + "properties": { + "attributes": { + "$ref": "Attributes", + "description": "Optional. A list of promotion attributes." + }, + "contentLanguage": { + "description": "Required. The two-letter [ISO 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the promotion. Promotions is only for [selected languages](https://support.google.com/merchants/answer/4588281?ref_topic=6396150\u0026sjid=18314938579342094533-NC#option3\u0026zippy=).", + "type": "string" + }, + "customAttributes": { + "description": "Optional. A list of custom (merchant-provided) attributes. It can also be used for submitting any attribute of the data specification in its generic form (for example, `{ \"name\": \"size type\", \"value\": \"regular\" }`). This is useful for submitting attributes not explicitly exposed by the API.", + "items": { + "$ref": "CustomAttribute" + }, + "type": "array" + }, + "dataSource": { + "description": "Output only. The primary data source of the promotion.", + "readOnly": true, + "type": "string" + }, + "name": { + "description": "Identifier. The name of the promotion. Format: `accounts/{account}/promotions/{promotion}`", + "type": "string" + }, + "promotionId": { + "description": "Required. The user provided promotion ID to uniquely identify the promotion. Follow [minimum requirements](https://support.google.com/merchants/answer/7050148?ref_topic=7322920\u0026sjid=871860036916537104-NC#minimum_requirements) to prevent promotion disapprovals.", + "type": "string" + }, + "promotionStatus": { + "$ref": "PromotionStatus", + "description": "Output only. The [status of a promotion](https://support.google.com/merchants/answer/3398326?ref_topic=7322924\u0026sjid=5155774230887277618-NC), data validation issues, that is, information about a promotion computed asynchronously.", + "readOnly": true + }, + "redemptionChannel": { + "description": "Required. [Redemption channel](https://support.google.com/merchants/answer/13837674?ref_topic=13773355\u0026sjid=17642868584668136159-NC) for the promotion. At least one channel is required.", + "items": { + "enum": [ + "REDEMPTION_CHANNEL_UNSPECIFIED", + "IN_STORE", + "ONLINE" + ], + "enumDescriptions": [ + "Indicates that the channel is unspecified.", + "Indicates that the channel is in store. This is same as `local` channel used for `products`.", + "Indicates that the channel is online." + ], + "type": "string" + }, + "type": "array" + }, + "targetCountry": { + "description": "Required. The target country used as part of the unique identifier. Represented as a [CLDR territory code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml). Promotions are only available in selected countries, [Free Listings and Shopping ads](https://support.google.com/merchants/answer/4588460) [Local Inventory ads](https://support.google.com/merchants/answer/10146326)", + "type": "string" + }, + "versionNumber": { + "description": "Optional. Represents the existing version (freshness) of the promotion, which can be used to preserve the right order when multiple updates are done at the same time. If set, the insertion is prevented when version number is lower than the current version number of the existing promotion. Re-insertion (for example, promotion refresh after 30 days) can be performed with the current `version_number`. If the operation is prevented, the aborted exception will be thrown.", + "format": "int64", + "type": "string" + } + }, + "type": "object" + }, + "PromotionStatus": { + "description": "The status of the promotion.", + "id": "PromotionStatus", + "properties": { + "creationDate": { + "description": "Output only. Date on which the promotion has been created in [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) format: Date, time, and offset, for example `2020-01-02T09:00:00+01:00` or `2020-01-02T09:00:00Z`", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "destinationStatuses": { + "description": "Output only. The intended destinations for the promotion.", + "items": { + "$ref": "DestinationStatus" + }, + "readOnly": true, + "type": "array" + }, + "itemLevelIssues": { + "description": "Output only. A list of issues associated with the promotion.", + "items": { + "$ref": "ItemLevelIssue" + }, + "readOnly": true, + "type": "array" + }, + "lastUpdateDate": { + "description": "Output only. Date on which the promotion status has been last updated in [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) format: Date, time, and offset, for example `2020-01-02T09:00:00+01:00` or `2020-01-02T09:00:00Z`", + "format": "google-datetime", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + } + }, + "servicePath": "", + "title": "Merchant API", + "version": "promotions_v1beta", + "version_module": true +} \ No newline at end of file diff --git a/merchantapi/promotions_v1beta/merchantapi-gen.go b/merchantapi/promotions_v1beta/merchantapi-gen.go new file mode 100644 index 00000000000..21c2d1586b4 --- /dev/null +++ b/merchantapi/promotions_v1beta/merchantapi-gen.go @@ -0,0 +1,1295 @@ +// Copyright 2024 Google LLC. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Code generated file. DO NOT EDIT. + +// Package merchantapi provides access to the Merchant API. +// +// For product documentation, see: https://developers.devsite.corp.google.com/merchant/api +// +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// +// # Creating a client +// +// Usage example: +// +// import "google.golang.org/api/merchantapi/promotions_v1beta" +// ... +// ctx := context.Background() +// merchantapiService, err := merchantapi.NewService(ctx) +// +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// +// # Other authentication options +// +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: +// +// merchantapiService, err := merchantapi.NewService(ctx, option.WithAPIKey("AIza...")) +// +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: +// +// config := &oauth2.Config{...} +// // ... +// token, err := config.Exchange(ctx, ...) +// merchantapiService, err := merchantapi.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) +// +// See [google.golang.org/api/option.ClientOption] for details on options. +package merchantapi // import "google.golang.org/api/merchantapi/promotions_v1beta" + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strconv" + "strings" + + googleapi "google.golang.org/api/googleapi" + internal "google.golang.org/api/internal" + gensupport "google.golang.org/api/internal/gensupport" + option "google.golang.org/api/option" + internaloption "google.golang.org/api/option/internaloption" + htransport "google.golang.org/api/transport/http" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = gensupport.MarshalJSON +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = context.Canceled +var _ = internaloption.WithDefaultEndpoint +var _ = internal.Version + +const apiId = "merchantapi:promotions_v1beta" +const apiName = "merchantapi" +const apiVersion = "promotions_v1beta" +const basePath = "https://merchantapi.googleapis.com/" +const basePathTemplate = "https://merchantapi.UNIVERSE_DOMAIN/" +const mtlsBasePath = "https://merchantapi.mtls.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // Manage your product listings and accounts for Google Shopping + ContentScope = "https://www.googleapis.com/auth/content" +) + +// NewService creates a new Service. +func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { + scopesOption := internaloption.WithDefaultScopes( + "https://www.googleapis.com/auth/content", + ) + // NOTE: prepend, so we don't override user-specified scopes. + opts = append([]option.ClientOption{scopesOption}, opts...) + opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) + opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) + opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) + opts = append(opts, internaloption.EnableNewAuthLibrary()) + client, endpoint, err := htransport.NewClient(ctx, opts...) + if err != nil { + return nil, err + } + s, err := New(client) + if err != nil { + return nil, err + } + if endpoint != "" { + s.BasePath = endpoint + } + return s, nil +} + +// New creates a new Service. It uses the provided http.Client for requests. +// +// Deprecated: please use NewService instead. +// To provide a custom HTTP client, use option.WithHTTPClient. +// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Accounts *AccountsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewAccountsService(s *Service) *AccountsService { + rs := &AccountsService{s: s} + rs.Promotions = NewAccountsPromotionsService(s) + return rs +} + +type AccountsService struct { + s *Service + + Promotions *AccountsPromotionsService +} + +func NewAccountsPromotionsService(s *Service) *AccountsPromotionsService { + rs := &AccountsPromotionsService{s: s} + return rs +} + +type AccountsPromotionsService struct { + s *Service +} + +// Attributes: Attributes. +type Attributes struct { + // BrandExclusion: Optional. Product filter by brand exclusion + // (https://support.google.com/merchants/answer/13861679?ref_topic=13773355&sjid=17642868584668136159-NC) + // for the promotion. The product filter attributes only applies when the + // products eligible for promotion product applicability + // `product_applicability` attribute is set to specific_products + // (https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + BrandExclusion []string `json:"brandExclusion,omitempty"` + // BrandInclusion: Optional. Product filter by brand for the promotion. The + // product filter attributes only applies when the products eligible for + // promotion product applicability `product_applicability` attribute is set to + // specific_products + // (https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + BrandInclusion []string `json:"brandInclusion,omitempty"` + // CouponValueType: Required. The [coupon value type] + // (https://support.google.com/merchants/answer/13861986?ref_topic=13773355&sjid=17642868584668136159-NC) + // attribute to signal the type of promotion that you are running. Depending on + // type of the selected coupon value some attributes are required + // (https://support.google.com/merchants/answer/6393006?ref_topic=7322920). + // + // Possible values: + // "COUPON_VALUE_TYPE_UNSPECIFIED" - Indicates that the coupon value type is + // unspecified. + // "MONEY_OFF" - Money off coupon value type. + // "PERCENT_OFF" - Percent off coupon value type. + // "BUY_M_GET_N_MONEY_OFF" - Buy M quantity, get N money off coupon value + // type. `minimum_purchase_quantity` and `get_this_quantity_discounted` must be + // present. `money_off_amount` must also be present. + // "BUY_M_GET_N_PERCENT_OFF" - Buy M quantity, get N percent off coupon value + // type. `minimum_purchase_quantity` and `get_this_quantity_discounted` must be + // present. `percent_off_percentage` must also be present. + // "BUY_M_GET_MONEY_OFF" - Buy M quantity, get money off. + // `minimum_purchase_quantity` and `money_off_amount` must be present. + // "BUY_M_GET_PERCENT_OFF" - Buy M quantity, get money off. + // `minimum_purchase_quantity` and `percent_off_percentage` must be present. + // "FREE_GIFT" - Free gift with description only. + // "FREE_GIFT_WITH_VALUE" - Free gift with monetary value. + // "FREE_GIFT_WITH_ITEM_ID" - Free gift with item ID. + // "FREE_SHIPPING_STANDARD" - Standard free shipping coupon value type. + // "FREE_SHIPPING_OVERNIGHT" - Overnight free shipping coupon value type. + // "FREE_SHIPPING_TWO_DAY" - Two day free shipping coupon value type. + CouponValueType string `json:"couponValueType,omitempty"` + // FreeGiftDescription: Optional. Free gift description + // (https://support.google.com/merchants/answer/13847245?ref_topic=13773355&sjid=17642868584668136159-NC) + // for the promotion. + FreeGiftDescription string `json:"freeGiftDescription,omitempty"` + // FreeGiftItemId: Optional. Free gift item ID + // (https://support.google.com/merchants/answer/13857152?ref_topic=13773355&sjid=17642868584668136159-NC) + // for the promotion. + FreeGiftItemId string `json:"freeGiftItemId,omitempty"` + // FreeGiftValue: Optional. Free gift value + // (https://support.google.com/merchants/answer/13844477?ref_topic=13773355&sjid=17642868584668136159-NC) + // for the promotion. + FreeGiftValue *Price `json:"freeGiftValue,omitempty"` + // GenericRedemptionCode: Optional. Generic redemption code for the promotion. + // To be used with the `offerType` field and must meet the minimum requirements + // (https://support.google.com/merchants/answer/13837405?ref_topic=13773355&sjid=17642868584668136159-NC). + GenericRedemptionCode string `json:"genericRedemptionCode,omitempty"` + // GetThisQuantityDiscounted: Optional. The number of items discounted in the + // promotion. The attribute is set when `couponValueType` is equal to + // `buy_m_get_n_money_off` or `buy_m_get_n_percent_off`. + GetThisQuantityDiscounted int64 `json:"getThisQuantityDiscounted,omitempty,string"` + // ItemGroupIdExclusion: Optional. Product filter by item group ID + // (https://support.google.com/merchants/answer/13837298?ref_topic=13773355&sjid=17642868584668136159-NC). + // The product filter attributes only applies when the products eligible for + // promotion product applicability `product_applicability` attribute is set to + // specific_products + // (https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + // exclusion for the promotion. + ItemGroupIdExclusion []string `json:"itemGroupIdExclusion,omitempty"` + // ItemGroupIdInclusion: Optional. Product filter by item group ID for the + // promotion. The product filter attributes only applies when the products + // eligible for promotion product applicability [product_applicability] + // attribute is set to specific_products + // (https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + ItemGroupIdInclusion []string `json:"itemGroupIdInclusion,omitempty"` + // ItemIdExclusion: Optional. Product filter by item ID exclusion + // (https://support.google.com/merchants/answer/13863524?ref_topic=13773355&sjid=17642868584668136159-NC) + // for the promotion. The product filter attributes only applies when the + // products eligible for promotion product applicability + // `product_applicability` attribute is set to specific_products + // (https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + ItemIdExclusion []string `json:"itemIdExclusion,omitempty"` + // ItemIdInclusion: Optional. Product filter by item ID + // (https://support.google.com/merchants/answer/13861565?ref_topic=13773355&sjid=17642868584668136159-NC) + // for the promotion. The product filter attributes only applies when the + // products eligible for promotion product applicability + // `product_applicability` attribute is set to specific_products + // (https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + ItemIdInclusion []string `json:"itemIdInclusion,omitempty"` + // LimitQuantity: Optional. Maximum purchase quantity + // (https://support.google.com/merchants/answer/13861564?ref_topic=13773355&sjid=17642868584668136159-NC) + // for the promotion. + LimitQuantity int64 `json:"limitQuantity,omitempty,string"` + // LimitValue: Optional. Maximum product price + // (https://support.google.com/merchants/answer/2906014) for promotion. + LimitValue *Price `json:"limitValue,omitempty"` + // LongTitle: Required. Long title + // (https://support.google.com/merchants/answer/13838102?ref_topic=13773355&sjid=17642868584668136159-NC) + // for the promotion. + LongTitle string `json:"longTitle,omitempty"` + // MinimumPurchaseAmount: Optional. Minimum purchase amount + // (https://support.google.com/merchants/answer/13837705?ref_topic=13773355&sjid=17642868584668136159-NC) + // for the promotion. + MinimumPurchaseAmount *Price `json:"minimumPurchaseAmount,omitempty"` + // MinimumPurchaseQuantity: Optional. Minimum purchase quantity + // (https://support.google.com/merchants/answer/13838182?ref_topic=13773355&sjid=17642868584668136159-NC) + // for the promotion. + MinimumPurchaseQuantity int64 `json:"minimumPurchaseQuantity,omitempty,string"` + // MoneyOffAmount: Optional. The money off amount + // (https://support.google.com/merchants/answer/13838101?ref_topic=13773355&sjid=17642868584668136159-NC) + // offered in the promotion. + MoneyOffAmount *Price `json:"moneyOffAmount,omitempty"` + // OfferType: Required. Type + // (https://support.google.com/merchants/answer/13837405?ref_topic=13773355&sjid=17642868584668136159-NC) + // of the promotion. Use this attribute to indicate whether or not customers + // need a coupon code to redeem your promotion. + // + // Possible values: + // "OFFER_TYPE_UNSPECIFIED" - Unknown offer type. + // "NO_CODE" - Offer type without a code. + // "GENERIC_CODE" - Offer type with a code. Generic redemption code for the + // promotion is required when `offerType` = `GENERIC_CODE`. + OfferType string `json:"offerType,omitempty"` + // PercentOff: Optional. The percentage discount + // (https://support.google.com/merchants/answer/13837404?sjid=17642868584668136159-NC) + // offered in the promotion. + PercentOff int64 `json:"percentOff,omitempty,string"` + // ProductApplicability: Required. Applicability of the promotion to either all + // products or only specific products + // (https://support.google.com/merchants/answer/6396257?ref_topic=6396150&sjid=17642868584668136159-NC). + // + // Possible values: + // "PRODUCT_APPLICABILITY_UNSPECIFIED" - Which products the promotion applies + // to is unknown. + // "ALL_PRODUCTS" - Applicable to all products. + // "SPECIFIC_PRODUCTS" - Applicable to only a single product or list of + // products. + ProductApplicability string `json:"productApplicability,omitempty"` + // ProductTypeExclusion: Optional. Product filter by product type exclusion + // (https://support.google.com/merchants/answer/13863746?ref_topic=13773355&sjid=17642868584668136159-NC) + // for the promotion. The product filter attributes only applies when the + // products eligible for promotion product applicability + // `product_applicability` attribute is set to specific_products + // (https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + ProductTypeExclusion []string `json:"productTypeExclusion,omitempty"` + // ProductTypeInclusion: Optional. Product filter by product type for the + // promotion. The product filter attributes only applies when the products + // eligible for promotion product applicability `product_applicability` + // attribute is set to specific_products + // (https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC). + ProductTypeInclusion []string `json:"productTypeInclusion,omitempty"` + // PromotionDestinations: Required. The list of destinations where the + // promotion applies to. If you don't specify a destination by including a + // supported value in your data source, your promotion will display in Shopping + // ads and free listings by default. You may have previously submitted the + // following values as destinations for your products: Shopping Actions, + // Surfaces across Google, Local surfaces across Google. To represent these + // values use `FREE_LISTINGS`, `FREE_LOCAL_LISTINGS`, `LOCAL_INVENTORY_ADS`. + // For more details see Promotion destination + // (https://support.google.com/merchants/answer/13837465?sjid=5155774230887277618-NC) + // + // Possible values: + // "DESTINATION_ENUM_UNSPECIFIED" - Not specified. + // "SHOPPING_ADS" - [Shopping + // ads](https://support.google.com/google-ads/answer/2454022). + // "DISPLAY_ADS" - [Display + // ads](https://support.google.com/merchants/answer/6069387). + // "LOCAL_INVENTORY_ADS" - [Local inventory + // ads](https://support.google.com/merchants/answer/3057972). + // "FREE_LISTINGS" - [Free + // listings](https://support.google.com/merchants/answer/9199328). + // "FREE_LOCAL_LISTINGS" - [Free local product + // listings](https://support.google.com/merchants/answer/9825611). + // "YOUTUBE_SHOPPING" - [YouTube + // Shopping](https://support.google.com/merchants/answer/12362804). + PromotionDestinations []string `json:"promotionDestinations,omitempty"` + // PromotionDisplayTimePeriod: Optional. `TimePeriod` representation of the + // promotion's display dates. This attribute specifies the date and time frame + // when the promotion will be live on Google.com and Shopping ads. If the + // display time period for promotion `promotion_display_time_period` attribute + // is not specified, the promotion effective time period + // `promotion_effective_time_period` determines the date and time frame when + // the promotion will be live on Google.com and Shopping ads. + PromotionDisplayTimePeriod *Interval `json:"promotionDisplayTimePeriod,omitempty"` + // PromotionEffectiveTimePeriod: Required. `TimePeriod` representation of the + // promotion's effective dates. This attribute specifies that the promotion can + // be tested on your online store during this time period. + PromotionEffectiveTimePeriod *Interval `json:"promotionEffectiveTimePeriod,omitempty"` + // PromotionUrl: Optional. URL to the page on the merchant's site where the + // promotion shows. Local Inventory ads promotions throw an error if no + // `promotion_url` is included. URL is used to confirm that the promotion is + // valid and can be redeemed. + PromotionUrl string `json:"promotionUrl,omitempty"` + // StoreApplicability: Optional. Whether the promotion applies to all stores, + // or only specified stores + // (https://support.google.com/merchants/answer/13857563?sjid=17642868584668136159-NC). + // Local Inventory ads promotions throw an error if no store applicability is + // included. An `INVALID_ARGUMENT` error is thrown if `store_applicability` is + // set to `ALL_STORES` and `store_codes_inclusion` or `score_code_exclusion` is + // set to a value. + // + // Possible values: + // "STORE_APPLICABILITY_UNSPECIFIED" - Which store codes the promotion + // applies to is unknown. + // "ALL_STORES" - Promotion applies to all stores. + // "SPECIFIC_STORES" - Promotion applies to only the specified stores. + StoreApplicability string `json:"storeApplicability,omitempty"` + // StoreCodesExclusion: Optional. Store codes to exclude + // (https://support.google.com/merchants/answer/13859586?ref_topic=13773355&sjid=17642868584668136159-NC) + // for the promotion. The store filter attributes only applies when the + // `store_applicability` attribute is set to specific_stores + // (https://support.google.com/merchants/answer/13857563?ref_topic=13773355&sjid=17642868584668136159-NC). + StoreCodesExclusion []string `json:"storeCodesExclusion,omitempty"` + // StoreCodesInclusion: Optional. Store codes to include + // (https://support.google.com/merchants/answer/13857470?ref_topic=13773355&sjid=17642868584668136159-NC) + // for the promotion. The store filter attributes only applies when the + // `store_applicability` attribute is set to specific_stores + // (https://support.google.com/merchants/answer/13857563?ref_topic=13773355&sjid=17642868584668136159-NC). + // Store code (the store ID from your Business Profile) of the physical store + // the product is sold in. See the Local product inventory data specification + // (https://support.google.com/merchants/answer/3061342) for more information. + StoreCodesInclusion []string `json:"storeCodesInclusion,omitempty"` + // ForceSendFields is a list of field names (e.g. "BrandExclusion") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "BrandExclusion") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Attributes) MarshalJSON() ([]byte, error) { + type NoMethod Attributes + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// CustomAttribute: A message that represents custom attributes. Exactly one of +// `value` or `group_values` must not be empty. +type CustomAttribute struct { + // GroupValues: Subattributes within this attribute group. If `group_values` is + // not empty, `value` must be empty. + GroupValues []*CustomAttribute `json:"groupValues,omitempty"` + // Name: The name of the attribute. + Name string `json:"name,omitempty"` + // Value: The value of the attribute. If `value` is not empty, `group_values` + // must be empty. + Value string `json:"value,omitempty"` + // ForceSendFields is a list of field names (e.g. "GroupValues") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "GroupValues") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *CustomAttribute) MarshalJSON() ([]byte, error) { + type NoMethod CustomAttribute + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// DestinationStatus: The status for the specified destination. +type DestinationStatus struct { + // ReportingContext: Output only. The name of the promotion destination. + // + // Possible values: + // "REPORTING_CONTEXT_ENUM_UNSPECIFIED" - Not specified. + // "SHOPPING_ADS" - [Shopping + // ads](https://support.google.com/merchants/answer/6149970). + // "DISCOVERY_ADS" - Deprecated: Use `DEMAND_GEN_ADS` instead. [Discovery and + // Demand Gen ads](https://support.google.com/merchants/answer/13389785). + // "DEMAND_GEN_ADS" - [Demand Gen + // ads](https://support.google.com/merchants/answer/13389785). + // "DEMAND_GEN_ADS_DISCOVER_SURFACE" - [Demand Gen ads on Discover + // surface](https://support.google.com/merchants/answer/13389785). + // "VIDEO_ADS" - [Video + // ads](https://support.google.com/google-ads/answer/6340491). + // "DISPLAY_ADS" - [Display + // ads](https://support.google.com/merchants/answer/6069387). + // "LOCAL_INVENTORY_ADS" - [Local inventory + // ads](https://support.google.com/merchants/answer/3271956). + // "VEHICLE_INVENTORY_ADS" - [Vehicle inventory + // ads](https://support.google.com/merchants/answer/11544533). + // "FREE_LISTINGS" - [Free product + // listings](https://support.google.com/merchants/answer/9199328). + // "FREE_LOCAL_LISTINGS" - [Free local product + // listings](https://support.google.com/merchants/answer/9825611). + // "FREE_LOCAL_VEHICLE_LISTINGS" - [Free local vehicle + // listings](https://support.google.com/merchants/answer/11544533). + // "YOUTUBE_SHOPPING" - [YouTube + // Shopping](https://support.google.com/merchants/answer/13478370). + // "CLOUD_RETAIL" - [Cloud + // retail](https://cloud.google.com/solutions/retail). + // "LOCAL_CLOUD_RETAIL" - [Local cloud + // retail](https://cloud.google.com/solutions/retail). + ReportingContext string `json:"reportingContext,omitempty"` + // Status: Output only. The status for the specified destination. + // + // Possible values: + // "STATE_UNSPECIFIED" - Unknown promotion state. + // "IN_REVIEW" - The promotion is under review. + // "REJECTED" - The promotion is disapproved. + // "LIVE" - The promotion is approved and active. + // "STOPPED" - The promotion is stopped by merchant. + // "EXPIRED" - The promotion is no longer active. + // "PENDING" - The promotion is not stopped, and all reviews are approved, + // but the active date is in the future. + Status string `json:"status,omitempty"` + // ForceSendFields is a list of field names (e.g. "ReportingContext") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ReportingContext") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *DestinationStatus) MarshalJSON() ([]byte, error) { + type NoMethod DestinationStatus + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// InsertPromotionRequest: Request message for the `InsertPromotion` method. +type InsertPromotionRequest struct { + // DataSource: Required. The data source of the promotion + // (https://support.google.com/merchants/answer/6396268?sjid=5155774230887277618-NC) + // Format: `accounts/{account}/dataSources/{datasource}`. + DataSource string `json:"dataSource,omitempty"` + // Promotion: Required. The promotion to insert. + Promotion *Promotion `json:"promotion,omitempty"` + // ForceSendFields is a list of field names (e.g. "DataSource") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "DataSource") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *InsertPromotionRequest) MarshalJSON() ([]byte, error) { + type NoMethod InsertPromotionRequest + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Interval: Represents a time interval, encoded as a Timestamp start +// (inclusive) and a Timestamp end (exclusive). The start must be less than or +// equal to the end. When the start equals the end, the interval is empty +// (matches no time). When both start and end are unspecified, the interval +// matches any time. +type Interval struct { + // EndTime: Optional. Exclusive end of the interval. If specified, a Timestamp + // matching this interval will have to be before the end. + EndTime string `json:"endTime,omitempty"` + // StartTime: Optional. Inclusive start of the interval. If specified, a + // Timestamp matching this interval will have to be the same or after the + // start. + StartTime string `json:"startTime,omitempty"` + // ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "EndTime") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Interval) MarshalJSON() ([]byte, error) { + type NoMethod Interval + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ItemLevelIssue: The issue associated with the promotion. +type ItemLevelIssue struct { + // ApplicableCountries: Output only. List of country codes (ISO 3166-1 alpha-2) + // where issue applies to the offer. + ApplicableCountries []string `json:"applicableCountries,omitempty"` + // Attribute: Output only. The attribute's name, if the issue is caused by a + // single attribute. + Attribute string `json:"attribute,omitempty"` + // Code: Output only. The error code of the issue. + Code string `json:"code,omitempty"` + // Description: Output only. A short issue description in English. + Description string `json:"description,omitempty"` + // Detail: Output only. A detailed issue description in English. + Detail string `json:"detail,omitempty"` + // Documentation: Output only. The URL of a web page to help with resolving + // this issue. + Documentation string `json:"documentation,omitempty"` + // ReportingContext: Output only. The destination the issue applies to. + // + // Possible values: + // "REPORTING_CONTEXT_ENUM_UNSPECIFIED" - Not specified. + // "SHOPPING_ADS" - [Shopping + // ads](https://support.google.com/merchants/answer/6149970). + // "DISCOVERY_ADS" - Deprecated: Use `DEMAND_GEN_ADS` instead. [Discovery and + // Demand Gen ads](https://support.google.com/merchants/answer/13389785). + // "DEMAND_GEN_ADS" - [Demand Gen + // ads](https://support.google.com/merchants/answer/13389785). + // "DEMAND_GEN_ADS_DISCOVER_SURFACE" - [Demand Gen ads on Discover + // surface](https://support.google.com/merchants/answer/13389785). + // "VIDEO_ADS" - [Video + // ads](https://support.google.com/google-ads/answer/6340491). + // "DISPLAY_ADS" - [Display + // ads](https://support.google.com/merchants/answer/6069387). + // "LOCAL_INVENTORY_ADS" - [Local inventory + // ads](https://support.google.com/merchants/answer/3271956). + // "VEHICLE_INVENTORY_ADS" - [Vehicle inventory + // ads](https://support.google.com/merchants/answer/11544533). + // "FREE_LISTINGS" - [Free product + // listings](https://support.google.com/merchants/answer/9199328). + // "FREE_LOCAL_LISTINGS" - [Free local product + // listings](https://support.google.com/merchants/answer/9825611). + // "FREE_LOCAL_VEHICLE_LISTINGS" - [Free local vehicle + // listings](https://support.google.com/merchants/answer/11544533). + // "YOUTUBE_SHOPPING" - [YouTube + // Shopping](https://support.google.com/merchants/answer/13478370). + // "CLOUD_RETAIL" - [Cloud + // retail](https://cloud.google.com/solutions/retail). + // "LOCAL_CLOUD_RETAIL" - [Local cloud + // retail](https://cloud.google.com/solutions/retail). + ReportingContext string `json:"reportingContext,omitempty"` + // Resolution: Output only. Whether the issue can be resolved by the merchant. + Resolution string `json:"resolution,omitempty"` + // Severity: Output only. How this issue affects serving of the promotion. + // + // Possible values: + // "SEVERITY_UNSPECIFIED" - Not specified. + // "NOT_IMPACTED" - This issue represents a warning and does not have a + // direct affect on the promotion. + // "DEMOTED" - The promotion is demoted and most likely have limited + // performance in search results + // "DISAPPROVED" - Issue disapproves the promotion. + Severity string `json:"severity,omitempty"` + // ForceSendFields is a list of field names (e.g. "ApplicableCountries") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ApplicableCountries") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ItemLevelIssue) MarshalJSON() ([]byte, error) { + type NoMethod ItemLevelIssue + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ListPromotionsResponse: Response message for the `ListPromotions` method. +type ListPromotionsResponse struct { + // NextPageToken: A token, which can be sent as `page_token` to retrieve the + // next page. If this field is omitted, there are no subsequent pages. + NextPageToken string `json:"nextPageToken,omitempty"` + // Promotions: The processed promotions from the specified account. + Promotions []*Promotion `json:"promotions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "NextPageToken") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ListPromotionsResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListPromotionsResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Price: The price represented as a number and currency. +type Price struct { + // AmountMicros: The price represented as a number in micros (1 million micros + // is an equivalent to one's currency standard unit, for example, 1 USD = + // 1000000 micros). + AmountMicros int64 `json:"amountMicros,omitempty,string"` + // CurrencyCode: The currency of the price using three-letter acronyms + // according to ISO 4217 (http://en.wikipedia.org/wiki/ISO_4217). + CurrencyCode string `json:"currencyCode,omitempty"` + // ForceSendFields is a list of field names (e.g. "AmountMicros") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AmountMicros") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Price) MarshalJSON() ([]byte, error) { + type NoMethod Price + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ProductChange: The change that happened to the product including old value, +// new value, country code as the region code and reporting context. +type ProductChange struct { + // NewValue: The new value of the changed resource or attribute. + NewValue string `json:"newValue,omitempty"` + // OldValue: The old value of the changed resource or attribute. + OldValue string `json:"oldValue,omitempty"` + // RegionCode: Countries that have the change (if applicable) + RegionCode string `json:"regionCode,omitempty"` + // ReportingContext: Reporting contexts that have the change (if applicable) + // + // Possible values: + // "REPORTING_CONTEXT_ENUM_UNSPECIFIED" - Not specified. + // "SHOPPING_ADS" - [Shopping + // ads](https://support.google.com/merchants/answer/6149970). + // "DISCOVERY_ADS" - Deprecated: Use `DEMAND_GEN_ADS` instead. [Discovery and + // Demand Gen ads](https://support.google.com/merchants/answer/13389785). + // "DEMAND_GEN_ADS" - [Demand Gen + // ads](https://support.google.com/merchants/answer/13389785). + // "DEMAND_GEN_ADS_DISCOVER_SURFACE" - [Demand Gen ads on Discover + // surface](https://support.google.com/merchants/answer/13389785). + // "VIDEO_ADS" - [Video + // ads](https://support.google.com/google-ads/answer/6340491). + // "DISPLAY_ADS" - [Display + // ads](https://support.google.com/merchants/answer/6069387). + // "LOCAL_INVENTORY_ADS" - [Local inventory + // ads](https://support.google.com/merchants/answer/3271956). + // "VEHICLE_INVENTORY_ADS" - [Vehicle inventory + // ads](https://support.google.com/merchants/answer/11544533). + // "FREE_LISTINGS" - [Free product + // listings](https://support.google.com/merchants/answer/9199328). + // "FREE_LOCAL_LISTINGS" - [Free local product + // listings](https://support.google.com/merchants/answer/9825611). + // "FREE_LOCAL_VEHICLE_LISTINGS" - [Free local vehicle + // listings](https://support.google.com/merchants/answer/11544533). + // "YOUTUBE_SHOPPING" - [YouTube + // Shopping](https://support.google.com/merchants/answer/13478370). + // "CLOUD_RETAIL" - [Cloud + // retail](https://cloud.google.com/solutions/retail). + // "LOCAL_CLOUD_RETAIL" - [Local cloud + // retail](https://cloud.google.com/solutions/retail). + ReportingContext string `json:"reportingContext,omitempty"` + // ForceSendFields is a list of field names (e.g. "NewValue") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "NewValue") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ProductChange) MarshalJSON() ([]byte, error) { + type NoMethod ProductChange + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ProductStatusChangeMessage: The message that the merchant will receive to +// notify about product status change event +type ProductStatusChangeMessage struct { + // Account: The target account that owns the entity that changed. Format : + // `accounts/{merchant_id}` + Account string `json:"account,omitempty"` + // Attribute: The attribute in the resource that changed, in this case it will + // be always `Status`. + // + // Possible values: + // "ATTRIBUTE_UNSPECIFIED" - Unspecified attribute + // "STATUS" - Status of the changed entity + Attribute string `json:"attribute,omitempty"` + // Changes: A message to describe the change that happened to the product + Changes []*ProductChange `json:"changes,omitempty"` + // ManagingAccount: The account that manages the merchant's account. can be the + // same as merchant id if it is standalone account. Format : + // `accounts/{service_provider_id}` + ManagingAccount string `json:"managingAccount,omitempty"` + // Resource: The product name. Format: + // `{product.name=accounts/{account}/products/{product}}` + Resource string `json:"resource,omitempty"` + // ResourceId: The product id. + ResourceId string `json:"resourceId,omitempty"` + // ResourceType: The resource that changed, in this case it will always be + // `Product`. + // + // Possible values: + // "RESOURCE_UNSPECIFIED" - Unspecified resource + // "PRODUCT" - Resource type : product + ResourceType string `json:"resourceType,omitempty"` + // ForceSendFields is a list of field names (e.g. "Account") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Account") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ProductStatusChangeMessage) MarshalJSON() ([]byte, error) { + type NoMethod ProductStatusChangeMessage + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// Promotion: Represents a promotion. See the following articles for more +// details. Required promotion input attributes to pass data validation checks +// are primarily defined below: * Promotions data specification +// (https://support.google.com/merchants/answer/2906014) * Local promotions +// data specification (https://support.google.com/merchants/answer/10146130) +// After inserting, updating a promotion input, it may take several minutes +// before the final promotion can be retrieved. +type Promotion struct { + // Attributes: Optional. A list of promotion attributes. + Attributes *Attributes `json:"attributes,omitempty"` + // ContentLanguage: Required. The two-letter ISO 639-1 + // (http://en.wikipedia.org/wiki/ISO_639-1) language code for the promotion. + // Promotions is only for selected languages + // (https://support.google.com/merchants/answer/4588281?ref_topic=6396150&sjid=18314938579342094533-NC#option3&zippy=). + ContentLanguage string `json:"contentLanguage,omitempty"` + // CustomAttributes: Optional. A list of custom (merchant-provided) attributes. + // It can also be used for submitting any attribute of the data specification + // in its generic form (for example, `{ "name": "size type", "value": "regular" + // }`). This is useful for submitting attributes not explicitly exposed by the + // API. + CustomAttributes []*CustomAttribute `json:"customAttributes,omitempty"` + // DataSource: Output only. The primary data source of the promotion. + DataSource string `json:"dataSource,omitempty"` + // Name: Identifier. The name of the promotion. Format: + // `accounts/{account}/promotions/{promotion}` + Name string `json:"name,omitempty"` + // PromotionId: Required. The user provided promotion ID to uniquely identify + // the promotion. Follow minimum requirements + // (https://support.google.com/merchants/answer/7050148?ref_topic=7322920&sjid=871860036916537104-NC#minimum_requirements) + // to prevent promotion disapprovals. + PromotionId string `json:"promotionId,omitempty"` + // PromotionStatus: Output only. The status of a promotion + // (https://support.google.com/merchants/answer/3398326?ref_topic=7322924&sjid=5155774230887277618-NC), + // data validation issues, that is, information about a promotion computed + // asynchronously. + PromotionStatus *PromotionStatus `json:"promotionStatus,omitempty"` + // RedemptionChannel: Required. Redemption channel + // (https://support.google.com/merchants/answer/13837674?ref_topic=13773355&sjid=17642868584668136159-NC) + // for the promotion. At least one channel is required. + // + // Possible values: + // "REDEMPTION_CHANNEL_UNSPECIFIED" - Indicates that the channel is + // unspecified. + // "IN_STORE" - Indicates that the channel is in store. This is same as + // `local` channel used for `products`. + // "ONLINE" - Indicates that the channel is online. + RedemptionChannel []string `json:"redemptionChannel,omitempty"` + // TargetCountry: Required. The target country used as part of the unique + // identifier. Represented as a CLDR territory code + // (https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml). + // Promotions are only available in selected countries, Free Listings and + // Shopping ads (https://support.google.com/merchants/answer/4588460) [Local + // Inventory ads](https://support.google.com/merchants/answer/10146326) + TargetCountry string `json:"targetCountry,omitempty"` + // VersionNumber: Optional. Represents the existing version (freshness) of the + // promotion, which can be used to preserve the right order when multiple + // updates are done at the same time. If set, the insertion is prevented when + // version number is lower than the current version number of the existing + // promotion. Re-insertion (for example, promotion refresh after 30 days) can + // be performed with the current `version_number`. If the operation is + // prevented, the aborted exception will be thrown. + VersionNumber int64 `json:"versionNumber,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "Attributes") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Attributes") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Promotion) MarshalJSON() ([]byte, error) { + type NoMethod Promotion + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// PromotionStatus: The status of the promotion. +type PromotionStatus struct { + // CreationDate: Output only. Date on which the promotion has been created in + // ISO 8601 (http://en.wikipedia.org/wiki/ISO_8601) format: Date, time, and + // offset, for example `2020-01-02T09:00:00+01:00` or `2020-01-02T09:00:00Z` + CreationDate string `json:"creationDate,omitempty"` + // DestinationStatuses: Output only. The intended destinations for the + // promotion. + DestinationStatuses []*DestinationStatus `json:"destinationStatuses,omitempty"` + // ItemLevelIssues: Output only. A list of issues associated with the + // promotion. + ItemLevelIssues []*ItemLevelIssue `json:"itemLevelIssues,omitempty"` + // LastUpdateDate: Output only. Date on which the promotion status has been + // last updated in ISO 8601 (http://en.wikipedia.org/wiki/ISO_8601) format: + // Date, time, and offset, for example `2020-01-02T09:00:00+01:00` or + // `2020-01-02T09:00:00Z` + LastUpdateDate string `json:"lastUpdateDate,omitempty"` + // ForceSendFields is a list of field names (e.g. "CreationDate") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "CreationDate") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *PromotionStatus) MarshalJSON() ([]byte, error) { + type NoMethod PromotionStatus + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +type AccountsPromotionsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Retrieves the promotion from your Merchant Center account. After +// inserting or updating a promotion input, it may take several minutes before +// the updated promotion can be retrieved. +// +// - name: The name of the promotion to retrieve. Format: +// `accounts/{account}/promotions/{promotions}`. +func (r *AccountsPromotionsService) Get(name string) *AccountsPromotionsGetCall { + c := &AccountsPromotionsGetCall{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 +// details. +func (c *AccountsPromotionsGetCall) Fields(s ...googleapi.Field) *AccountsPromotionsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsPromotionsGetCall) IfNoneMatch(entityTag string) *AccountsPromotionsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsPromotionsGetCall) Context(ctx context.Context) *AccountsPromotionsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsPromotionsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsPromotionsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "promotions/v1beta/{+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 "merchantapi.accounts.promotions.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *Promotion.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 *AccountsPromotionsGetCall) Do(opts ...googleapi.CallOption) (*Promotion, 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 := &Promotion{ + 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 +} + +type AccountsPromotionsInsertCall struct { + s *Service + parent string + insertpromotionrequest *InsertPromotionRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Insert: Inserts a promotion for your Merchant Center account. If the +// promotion already exists, then it updates the promotion instead. +// +// - parent: The account where the promotion will be inserted. Format: +// accounts/{account}. +func (r *AccountsPromotionsService) Insert(parent string, insertpromotionrequest *InsertPromotionRequest) *AccountsPromotionsInsertCall { + c := &AccountsPromotionsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.insertpromotionrequest = insertpromotionrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *AccountsPromotionsInsertCall) Fields(s ...googleapi.Field) *AccountsPromotionsInsertCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsPromotionsInsertCall) Context(ctx context.Context) *AccountsPromotionsInsertCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsPromotionsInsertCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsPromotionsInsertCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.insertpromotionrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "promotions/v1beta/{+parent}/promotions:insert") + 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 "merchantapi.accounts.promotions.insert" call. +// Any non-2xx status code is an error. Response headers are in either +// *Promotion.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 *AccountsPromotionsInsertCall) Do(opts ...googleapi.CallOption) (*Promotion, 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 := &Promotion{ + 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 +} + +type AccountsPromotionsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists the promotions in your Merchant Center account. The response +// might contain fewer items than specified by `pageSize`. Rely on `pageToken` +// to determine if there are more items to be requested. After inserting or +// updating a promotion, it may take several minutes before the updated +// processed promotion can be retrieved. +// +// - parent: The account to list processed promotions for. Format: +// `accounts/{account}`. +func (r *AccountsPromotionsService) List(parent string) *AccountsPromotionsListCall { + c := &AccountsPromotionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": Output only. The maximum +// number of promotions to return. The service may return fewer than this +// value. The maximum value is 1000; values above 1000 will be coerced to 1000. +// If unspecified, the maximum number of promotions will be returned. +func (c *AccountsPromotionsListCall) PageSize(pageSize int64) *AccountsPromotionsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": Output only. A page +// token, received from a previous `ListPromotions` call. Provide this to +// retrieve the subsequent page. When paginating, all other parameters provided +// to `ListPromotions` must match the call that provided the page token. +func (c *AccountsPromotionsListCall) PageToken(pageToken string) *AccountsPromotionsListCall { + 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 +// details. +func (c *AccountsPromotionsListCall) Fields(s ...googleapi.Field) *AccountsPromotionsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsPromotionsListCall) IfNoneMatch(entityTag string) *AccountsPromotionsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsPromotionsListCall) Context(ctx context.Context) *AccountsPromotionsListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsPromotionsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsPromotionsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "promotions/v1beta/{+parent}/promotions") + 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 "merchantapi.accounts.promotions.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *ListPromotionsResponse.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 *AccountsPromotionsListCall) Do(opts ...googleapi.CallOption) (*ListPromotionsResponse, 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 := &ListPromotionsResponse{ + 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 +} + +// 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 *AccountsPromotionsListCall) Pages(ctx context.Context, f func(*ListPromotionsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + 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) + } +} diff --git a/merchantapi/quota_v1beta/merchantapi-api.json b/merchantapi/quota_v1beta/merchantapi-api.json new file mode 100644 index 00000000000..184a2e7d814 --- /dev/null +++ b/merchantapi/quota_v1beta/merchantapi-api.json @@ -0,0 +1,371 @@ +{ + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/content": { + "description": "Manage your product listings and accounts for Google Shopping" + } + } + } + }, + "basePath": "", + "baseUrl": "https://merchantapi.googleapis.com/", + "batchPath": "batch", + "canonicalName": "Merchant", + "description": "Programmatically manage your Merchant Center Accounts.", + "discoveryVersion": "v1", + "documentationLink": "https://developers.devsite.corp.google.com/merchant/api", + "fullyEncodeReservedExpansion": true, + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "id": "merchantapi:quota_v1beta", + "kind": "discovery#restDescription", + "mtlsRootUrl": "https://merchantapi.mtls.googleapis.com/", + "name": "merchantapi", + "ownerDomain": "google.com", + "ownerName": "Google", + "parameters": { + "$.xgafv": { + "description": "V1 error format.", + "enum": [ + "1", + "2" + ], + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "type": "string" + }, + "access_token": { + "description": "OAuth access token.", + "location": "query", + "type": "string" + }, + "alt": { + "default": "json", + "description": "Data format for response.", + "enum": [ + "json", + "media", + "proto" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query", + "type": "string" + }, + "callback": { + "description": "JSONP", + "location": "query", + "type": "string" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "location": "query", + "type": "string" + }, + "key": { + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query", + "type": "string" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "location": "query", + "type": "string" + }, + "prettyPrint": { + "default": "true", + "description": "Returns response with indentations and line breaks.", + "location": "query", + "type": "boolean" + }, + "quotaUser": { + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query", + "type": "string" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query", + "type": "string" + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query", + "type": "string" + } + }, + "protocol": "rest", + "resources": { + "accounts": { + "resources": { + "quotas": { + "methods": { + "list": { + "description": "Lists the daily call quota and usage per group for your Merchant Center account.", + "flatPath": "quota/v1beta/accounts/{accountsId}/quotas", + "httpMethod": "GET", + "id": "merchantapi.accounts.quotas.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of quotas to return in the response, used for paging. Defaults to 500; values above 1000 will be coerced to 1000.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. Token (if provided) to retrieve the subsequent page. All other parameters must match the original call that provided the page token.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The merchant account who owns the collection of method quotas Format: accounts/{account}", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "quota/v1beta/{+parent}/quotas", + "response": { + "$ref": "ListQuotaGroupsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + } + } + } + }, + "revision": "20240613", + "rootUrl": "https://merchantapi.googleapis.com/", + "schemas": { + "ListQuotaGroupsResponse": { + "description": "Response message for the ListMethodGroups method.", + "id": "ListQuotaGroupsResponse", + "properties": { + "nextPageToken": { + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "type": "string" + }, + "quotaGroups": { + "description": "The methods, current quota usage and limits per each group. The quota is shared between all methods in the group. The groups are sorted in descending order based on quotaUsage.", + "items": { + "$ref": "QuotaGroup" + }, + "type": "array" + } + }, + "type": "object" + }, + "MethodDetails": { + "description": "The method details per method in the Merchant API.", + "id": "MethodDetails", + "properties": { + "method": { + "description": "Output only. The name of the method for example `products.list`.", + "readOnly": true, + "type": "string" + }, + "path": { + "description": "Output only. The path for the method such as `products/v1/productInputs.insert`", + "readOnly": true, + "type": "string" + }, + "subapi": { + "description": "Output only. The sub-API that the method belongs to.", + "readOnly": true, + "type": "string" + }, + "version": { + "description": "Output only. The API version that the method belongs to.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "ProductChange": { + "description": "The change that happened to the product including old value, new value, country code as the region code and reporting context.", + "id": "ProductChange", + "properties": { + "newValue": { + "description": "The new value of the changed resource or attribute.", + "type": "string" + }, + "oldValue": { + "description": "The old value of the changed resource or attribute.", + "type": "string" + }, + "regionCode": { + "description": "Countries that have the change (if applicable)", + "type": "string" + }, + "reportingContext": { + "description": "Reporting contexts that have the change (if applicable)", + "enum": [ + "REPORTING_CONTEXT_ENUM_UNSPECIFIED", + "SHOPPING_ADS", + "DISCOVERY_ADS", + "DEMAND_GEN_ADS", + "DEMAND_GEN_ADS_DISCOVER_SURFACE", + "VIDEO_ADS", + "DISPLAY_ADS", + "LOCAL_INVENTORY_ADS", + "VEHICLE_INVENTORY_ADS", + "FREE_LISTINGS", + "FREE_LOCAL_LISTINGS", + "FREE_LOCAL_VEHICLE_LISTINGS", + "YOUTUBE_SHOPPING", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL" + ], + "enumDeprecated": [ + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false + ], + "enumDescriptions": [ + "Not specified.", + "[Shopping ads](https://support.google.com/merchants/answer/6149970).", + "Deprecated: Use `DEMAND_GEN_ADS` instead. [Discovery and Demand Gen ads](https://support.google.com/merchants/answer/13389785).", + "[Demand Gen ads](https://support.google.com/merchants/answer/13389785).", + "[Demand Gen ads on Discover surface](https://support.google.com/merchants/answer/13389785).", + "[Video ads](https://support.google.com/google-ads/answer/6340491).", + "[Display ads](https://support.google.com/merchants/answer/6069387).", + "[Local inventory ads](https://support.google.com/merchants/answer/3271956).", + "[Vehicle inventory ads](https://support.google.com/merchants/answer/11544533).", + "[Free product listings](https://support.google.com/merchants/answer/9199328).", + "[Free local product listings](https://support.google.com/merchants/answer/9825611).", + "[Free local vehicle listings](https://support.google.com/merchants/answer/11544533).", + "[YouTube Shopping](https://support.google.com/merchants/answer/13478370).", + "[Cloud retail](https://cloud.google.com/solutions/retail).", + "[Local cloud retail](https://cloud.google.com/solutions/retail)." + ], + "type": "string" + } + }, + "type": "object" + }, + "ProductStatusChangeMessage": { + "description": "The message that the merchant will receive to notify about product status change event", + "id": "ProductStatusChangeMessage", + "properties": { + "account": { + "description": "The target account that owns the entity that changed. Format : `accounts/{merchant_id}`", + "type": "string" + }, + "attribute": { + "description": "The attribute in the resource that changed, in this case it will be always `Status`.", + "enum": [ + "ATTRIBUTE_UNSPECIFIED", + "STATUS" + ], + "enumDescriptions": [ + "Unspecified attribute", + "Status of the changed entity" + ], + "type": "string" + }, + "changes": { + "description": "A message to describe the change that happened to the product", + "items": { + "$ref": "ProductChange" + }, + "type": "array" + }, + "managingAccount": { + "description": "The account that manages the merchant's account. can be the same as merchant id if it is standalone account. Format : `accounts/{service_provider_id}`", + "type": "string" + }, + "resource": { + "description": "The product name. Format: `{product.name=accounts/{account}/products/{product}}`", + "type": "string" + }, + "resourceId": { + "description": "The product id.", + "type": "string" + }, + "resourceType": { + "description": "The resource that changed, in this case it will always be `Product`.", + "enum": [ + "RESOURCE_UNSPECIFIED", + "PRODUCT" + ], + "enumDescriptions": [ + "Unspecified resource", + "Resource type : product" + ], + "type": "string" + } + }, + "type": "object" + }, + "QuotaGroup": { + "description": "The group information for methods in the Merchant API. The quota is shared between all methods in the group. Even if none of the methods within the group have usage the information for the group is returned.", + "id": "QuotaGroup", + "properties": { + "methodDetails": { + "description": "Output only. List of all methods group quota applies to.", + "items": { + "$ref": "MethodDetails" + }, + "readOnly": true, + "type": "array" + }, + "name": { + "description": "Identifier. The resource name of the quota group. Format: accounts/{account}/quotas/{group} Note: There is no guarantee on the format of {group}", + "type": "string" + }, + "quotaLimit": { + "description": "Output only. The maximum number of calls allowed per day for the group.", + "format": "int64", + "readOnly": true, + "type": "string" + }, + "quotaMinuteLimit": { + "description": "Output only. The maximum number of calls allowed per minute for the group.", + "format": "int64", + "readOnly": true, + "type": "string" + }, + "quotaUsage": { + "description": "Output only. The current quota usage, meaning the number of calls already made on a given day to the methods in the group. The daily quota limits reset at at 12:00 PM midday UTC.", + "format": "int64", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + } + }, + "servicePath": "", + "title": "Merchant API", + "version": "quota_v1beta", + "version_module": true +} \ No newline at end of file diff --git a/merchantapi/quota_v1beta/merchantapi-gen.go b/merchantapi/quota_v1beta/merchantapi-gen.go new file mode 100644 index 00000000000..c44dddc0640 --- /dev/null +++ b/merchantapi/quota_v1beta/merchantapi-gen.go @@ -0,0 +1,528 @@ +// Copyright 2024 Google LLC. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Code generated file. DO NOT EDIT. + +// Package merchantapi provides access to the Merchant API. +// +// For product documentation, see: https://developers.devsite.corp.google.com/merchant/api +// +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// +// # Creating a client +// +// Usage example: +// +// import "google.golang.org/api/merchantapi/quota_v1beta" +// ... +// ctx := context.Background() +// merchantapiService, err := merchantapi.NewService(ctx) +// +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// +// # Other authentication options +// +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: +// +// merchantapiService, err := merchantapi.NewService(ctx, option.WithAPIKey("AIza...")) +// +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: +// +// config := &oauth2.Config{...} +// // ... +// token, err := config.Exchange(ctx, ...) +// merchantapiService, err := merchantapi.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) +// +// See [google.golang.org/api/option.ClientOption] for details on options. +package merchantapi // import "google.golang.org/api/merchantapi/quota_v1beta" + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strconv" + "strings" + + googleapi "google.golang.org/api/googleapi" + internal "google.golang.org/api/internal" + gensupport "google.golang.org/api/internal/gensupport" + option "google.golang.org/api/option" + internaloption "google.golang.org/api/option/internaloption" + htransport "google.golang.org/api/transport/http" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = gensupport.MarshalJSON +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = context.Canceled +var _ = internaloption.WithDefaultEndpoint +var _ = internal.Version + +const apiId = "merchantapi:quota_v1beta" +const apiName = "merchantapi" +const apiVersion = "quota_v1beta" +const basePath = "https://merchantapi.googleapis.com/" +const basePathTemplate = "https://merchantapi.UNIVERSE_DOMAIN/" +const mtlsBasePath = "https://merchantapi.mtls.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // Manage your product listings and accounts for Google Shopping + ContentScope = "https://www.googleapis.com/auth/content" +) + +// NewService creates a new Service. +func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { + scopesOption := internaloption.WithDefaultScopes( + "https://www.googleapis.com/auth/content", + ) + // NOTE: prepend, so we don't override user-specified scopes. + opts = append([]option.ClientOption{scopesOption}, opts...) + opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) + opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) + opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) + opts = append(opts, internaloption.EnableNewAuthLibrary()) + client, endpoint, err := htransport.NewClient(ctx, opts...) + if err != nil { + return nil, err + } + s, err := New(client) + if err != nil { + return nil, err + } + if endpoint != "" { + s.BasePath = endpoint + } + return s, nil +} + +// New creates a new Service. It uses the provided http.Client for requests. +// +// Deprecated: please use NewService instead. +// To provide a custom HTTP client, use option.WithHTTPClient. +// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Accounts *AccountsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewAccountsService(s *Service) *AccountsService { + rs := &AccountsService{s: s} + rs.Quotas = NewAccountsQuotasService(s) + return rs +} + +type AccountsService struct { + s *Service + + Quotas *AccountsQuotasService +} + +func NewAccountsQuotasService(s *Service) *AccountsQuotasService { + rs := &AccountsQuotasService{s: s} + return rs +} + +type AccountsQuotasService struct { + s *Service +} + +// ListQuotaGroupsResponse: Response message for the ListMethodGroups method. +type ListQuotaGroupsResponse struct { + // NextPageToken: A token, which can be sent as `page_token` to retrieve the + // next page. If this field is omitted, there are no subsequent pages. + NextPageToken string `json:"nextPageToken,omitempty"` + // QuotaGroups: The methods, current quota usage and limits per each group. The + // quota is shared between all methods in the group. The groups are sorted in + // descending order based on quotaUsage. + QuotaGroups []*QuotaGroup `json:"quotaGroups,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "NextPageToken") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ListQuotaGroupsResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListQuotaGroupsResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// MethodDetails: The method details per method in the Merchant API. +type MethodDetails struct { + // Method: Output only. The name of the method for example `products.list`. + Method string `json:"method,omitempty"` + // Path: Output only. The path for the method such as + // `products/v1/productInputs.insert` + Path string `json:"path,omitempty"` + // Subapi: Output only. The sub-API that the method belongs to. + Subapi string `json:"subapi,omitempty"` + // Version: Output only. The API version that the method belongs to. + Version string `json:"version,omitempty"` + // ForceSendFields is a list of field names (e.g. "Method") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Method") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *MethodDetails) MarshalJSON() ([]byte, error) { + type NoMethod MethodDetails + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ProductChange: The change that happened to the product including old value, +// new value, country code as the region code and reporting context. +type ProductChange struct { + // NewValue: The new value of the changed resource or attribute. + NewValue string `json:"newValue,omitempty"` + // OldValue: The old value of the changed resource or attribute. + OldValue string `json:"oldValue,omitempty"` + // RegionCode: Countries that have the change (if applicable) + RegionCode string `json:"regionCode,omitempty"` + // ReportingContext: Reporting contexts that have the change (if applicable) + // + // Possible values: + // "REPORTING_CONTEXT_ENUM_UNSPECIFIED" - Not specified. + // "SHOPPING_ADS" - [Shopping + // ads](https://support.google.com/merchants/answer/6149970). + // "DISCOVERY_ADS" - Deprecated: Use `DEMAND_GEN_ADS` instead. [Discovery and + // Demand Gen ads](https://support.google.com/merchants/answer/13389785). + // "DEMAND_GEN_ADS" - [Demand Gen + // ads](https://support.google.com/merchants/answer/13389785). + // "DEMAND_GEN_ADS_DISCOVER_SURFACE" - [Demand Gen ads on Discover + // surface](https://support.google.com/merchants/answer/13389785). + // "VIDEO_ADS" - [Video + // ads](https://support.google.com/google-ads/answer/6340491). + // "DISPLAY_ADS" - [Display + // ads](https://support.google.com/merchants/answer/6069387). + // "LOCAL_INVENTORY_ADS" - [Local inventory + // ads](https://support.google.com/merchants/answer/3271956). + // "VEHICLE_INVENTORY_ADS" - [Vehicle inventory + // ads](https://support.google.com/merchants/answer/11544533). + // "FREE_LISTINGS" - [Free product + // listings](https://support.google.com/merchants/answer/9199328). + // "FREE_LOCAL_LISTINGS" - [Free local product + // listings](https://support.google.com/merchants/answer/9825611). + // "FREE_LOCAL_VEHICLE_LISTINGS" - [Free local vehicle + // listings](https://support.google.com/merchants/answer/11544533). + // "YOUTUBE_SHOPPING" - [YouTube + // Shopping](https://support.google.com/merchants/answer/13478370). + // "CLOUD_RETAIL" - [Cloud + // retail](https://cloud.google.com/solutions/retail). + // "LOCAL_CLOUD_RETAIL" - [Local cloud + // retail](https://cloud.google.com/solutions/retail). + ReportingContext string `json:"reportingContext,omitempty"` + // ForceSendFields is a list of field names (e.g. "NewValue") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "NewValue") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ProductChange) MarshalJSON() ([]byte, error) { + type NoMethod ProductChange + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ProductStatusChangeMessage: The message that the merchant will receive to +// notify about product status change event +type ProductStatusChangeMessage struct { + // Account: The target account that owns the entity that changed. Format : + // `accounts/{merchant_id}` + Account string `json:"account,omitempty"` + // Attribute: The attribute in the resource that changed, in this case it will + // be always `Status`. + // + // Possible values: + // "ATTRIBUTE_UNSPECIFIED" - Unspecified attribute + // "STATUS" - Status of the changed entity + Attribute string `json:"attribute,omitempty"` + // Changes: A message to describe the change that happened to the product + Changes []*ProductChange `json:"changes,omitempty"` + // ManagingAccount: The account that manages the merchant's account. can be the + // same as merchant id if it is standalone account. Format : + // `accounts/{service_provider_id}` + ManagingAccount string `json:"managingAccount,omitempty"` + // Resource: The product name. Format: + // `{product.name=accounts/{account}/products/{product}}` + Resource string `json:"resource,omitempty"` + // ResourceId: The product id. + ResourceId string `json:"resourceId,omitempty"` + // ResourceType: The resource that changed, in this case it will always be + // `Product`. + // + // Possible values: + // "RESOURCE_UNSPECIFIED" - Unspecified resource + // "PRODUCT" - Resource type : product + ResourceType string `json:"resourceType,omitempty"` + // ForceSendFields is a list of field names (e.g. "Account") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Account") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ProductStatusChangeMessage) MarshalJSON() ([]byte, error) { + type NoMethod ProductStatusChangeMessage + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// QuotaGroup: The group information for methods in the Merchant API. The quota +// is shared between all methods in the group. Even if none of the methods +// within the group have usage the information for the group is returned. +type QuotaGroup struct { + // MethodDetails: Output only. List of all methods group quota applies to. + MethodDetails []*MethodDetails `json:"methodDetails,omitempty"` + // Name: Identifier. The resource name of the quota group. Format: + // accounts/{account}/quotas/{group} Note: There is no guarantee on the format + // of {group} + Name string `json:"name,omitempty"` + // QuotaLimit: Output only. The maximum number of calls allowed per day for the + // group. + QuotaLimit int64 `json:"quotaLimit,omitempty,string"` + // QuotaMinuteLimit: Output only. The maximum number of calls allowed per + // minute for the group. + QuotaMinuteLimit int64 `json:"quotaMinuteLimit,omitempty,string"` + // QuotaUsage: Output only. The current quota usage, meaning the number of + // calls already made on a given day to the methods in the group. The daily + // quota limits reset at at 12:00 PM midday UTC. + QuotaUsage int64 `json:"quotaUsage,omitempty,string"` + // ForceSendFields is a list of field names (e.g. "MethodDetails") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "MethodDetails") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *QuotaGroup) MarshalJSON() ([]byte, error) { + type NoMethod QuotaGroup + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +type AccountsQuotasListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists the daily call quota and usage per group for your Merchant +// Center account. +// +// - parent: The merchant account who owns the collection of method quotas +// Format: accounts/{account}. +func (r *AccountsQuotasService) List(parent string) *AccountsQuotasListCall { + c := &AccountsQuotasListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number of +// quotas to return in the response, used for paging. Defaults to 500; values +// above 1000 will be coerced to 1000. +func (c *AccountsQuotasListCall) PageSize(pageSize int64) *AccountsQuotasListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": Token (if provided) to +// retrieve the subsequent page. All other parameters must match the original +// call that provided the page token. +func (c *AccountsQuotasListCall) PageToken(pageToken string) *AccountsQuotasListCall { + 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 +// details. +func (c *AccountsQuotasListCall) Fields(s ...googleapi.Field) *AccountsQuotasListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *AccountsQuotasListCall) IfNoneMatch(entityTag string) *AccountsQuotasListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsQuotasListCall) Context(ctx context.Context) *AccountsQuotasListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsQuotasListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsQuotasListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "quota/v1beta/{+parent}/quotas") + 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 "merchantapi.accounts.quotas.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *ListQuotaGroupsResponse.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 *AccountsQuotasListCall) Do(opts ...googleapi.CallOption) (*ListQuotaGroupsResponse, 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 := &ListQuotaGroupsResponse{ + 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 +} + +// 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 *AccountsQuotasListCall) Pages(ctx context.Context, f func(*ListQuotaGroupsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + 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) + } +} diff --git a/merchantapi/reports_v1beta/merchantapi-api.json b/merchantapi/reports_v1beta/merchantapi-api.json new file mode 100644 index 00000000000..43ed5ffeb21 --- /dev/null +++ b/merchantapi/reports_v1beta/merchantapi-api.json @@ -0,0 +1,1516 @@ +{ + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/content": { + "description": "Manage your product listings and accounts for Google Shopping" + } + } + } + }, + "basePath": "", + "baseUrl": "https://merchantapi.googleapis.com/", + "batchPath": "batch", + "canonicalName": "Merchant", + "description": "Programmatically manage your Merchant Center Accounts.", + "discoveryVersion": "v1", + "documentationLink": "https://developers.devsite.corp.google.com/merchant/api", + "fullyEncodeReservedExpansion": true, + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "id": "merchantapi:reports_v1beta", + "kind": "discovery#restDescription", + "mtlsRootUrl": "https://merchantapi.mtls.googleapis.com/", + "name": "merchantapi", + "ownerDomain": "google.com", + "ownerName": "Google", + "parameters": { + "$.xgafv": { + "description": "V1 error format.", + "enum": [ + "1", + "2" + ], + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query", + "type": "string" + }, + "access_token": { + "description": "OAuth access token.", + "location": "query", + "type": "string" + }, + "alt": { + "default": "json", + "description": "Data format for response.", + "enum": [ + "json", + "media", + "proto" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query", + "type": "string" + }, + "callback": { + "description": "JSONP", + "location": "query", + "type": "string" + }, + "fields": { + "description": "Selector specifying which fields to include in a partial response.", + "location": "query", + "type": "string" + }, + "key": { + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query", + "type": "string" + }, + "oauth_token": { + "description": "OAuth 2.0 token for the current user.", + "location": "query", + "type": "string" + }, + "prettyPrint": { + "default": "true", + "description": "Returns response with indentations and line breaks.", + "location": "query", + "type": "boolean" + }, + "quotaUser": { + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query", + "type": "string" + }, + "uploadType": { + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query", + "type": "string" + }, + "upload_protocol": { + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query", + "type": "string" + } + }, + "protocol": "rest", + "resources": { + "accounts": { + "resources": { + "reports": { + "methods": { + "search": { + "description": "Retrieves a report defined by a search query. The response might contain fewer rows than specified by `page_size`. Rely on `next_page_token` to determine if there are more rows to be requested.", + "flatPath": "reports/v1beta/accounts/{accountsId}/reports:search", + "httpMethod": "POST", + "id": "merchantapi.accounts.reports.search", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. Id of the account making the call. Must be a standalone account or an MCA subaccount. Format: accounts/{account}", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "reports/v1beta/{+parent}/reports:search", + "request": { + "$ref": "SearchRequest" + }, + "response": { + "$ref": "SearchResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + } + } + } + }, + "revision": "20240613", + "rootUrl": "https://merchantapi.googleapis.com/", + "schemas": { + "BestSellersBrandView": { + "description": "Fields available for query in `best_sellers_brand_view` table. [Best sellers](https://support.google.com/merchants/answer/9488679) report with top brands. Values are only set for fields requested explicitly in the request's search query.", + "id": "BestSellersBrandView", + "properties": { + "brand": { + "description": "Name of the brand.", + "type": "string" + }, + "previousRank": { + "description": "Popularity rank in the previous week or month.", + "format": "int64", + "type": "string" + }, + "previousRelativeDemand": { + "description": "Estimated demand in relation to the brand with the highest popularity rank in the same category and country in the previous week or month.", + "enum": [ + "RELATIVE_DEMAND_ENUM_UNSPECIFIED", + "VERY_LOW", + "LOW", + "MEDIUM", + "HIGH", + "VERY_HIGH" + ], + "enumDescriptions": [ + "Not specified.", + "Demand is 0-5% of the demand of the highest ranked product cluster or brand.", + "Demand is 6-10% of the demand of the highest ranked product cluster or brand.", + "Demand is 11-20% of the demand of the highest ranked product cluster or brand.", + "Demand is 21-50% of the demand of the highest ranked product cluster or brand.", + "Demand is 51-100% of the demand of the highest ranked product cluster or brand." + ], + "type": "string" + }, + "rank": { + "description": "Popularity of the brand on Ads and organic surfaces, in the selected category and country, based on the estimated number of units sold.", + "format": "int64", + "type": "string" + }, + "relativeDemand": { + "description": "Estimated demand in relation to the brand with the highest popularity rank in the same category and country.", + "enum": [ + "RELATIVE_DEMAND_ENUM_UNSPECIFIED", + "VERY_LOW", + "LOW", + "MEDIUM", + "HIGH", + "VERY_HIGH" + ], + "enumDescriptions": [ + "Not specified.", + "Demand is 0-5% of the demand of the highest ranked product cluster or brand.", + "Demand is 6-10% of the demand of the highest ranked product cluster or brand.", + "Demand is 11-20% of the demand of the highest ranked product cluster or brand.", + "Demand is 21-50% of the demand of the highest ranked product cluster or brand.", + "Demand is 51-100% of the demand of the highest ranked product cluster or brand." + ], + "type": "string" + }, + "relativeDemandChange": { + "description": "Change in the estimated demand. Whether it rose, sank or remained flat.", + "enum": [ + "RELATIVE_DEMAND_CHANGE_TYPE_ENUM_UNSPECIFIED", + "SINKER", + "FLAT", + "RISER" + ], + "enumDescriptions": [ + "Not specified.", + "Relative demand is lower than the previous time period.", + "Relative demand is equal to the previous time period.", + "Relative demand is higher than the previous time period." + ], + "type": "string" + }, + "reportCategoryId": { + "description": "Google product category ID to calculate the ranking for, represented in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436). Required in the `SELECT` clause. If a `WHERE` condition on `report_category_id` is not specified in the query, rankings for all top-level categories are returned.", + "format": "int64", + "type": "string" + }, + "reportCountryCode": { + "description": "Country where the ranking is calculated. Represented in the ISO 3166 format. Required in the `SELECT` clause. Condition on `report_country_code` is required in the `WHERE` clause.", + "type": "string" + }, + "reportDate": { + "$ref": "Date", + "description": "Report date. The value of this field can only be one of the following: * The first day of the week (Monday) for weekly reports, * The first day of the month for monthly reports. Required in the `SELECT` clause. If a `WHERE` condition on `report_date` is not specified in the query, the latest available weekly or monthly report is returned." + }, + "reportGranularity": { + "description": "Granularity of the report. The ranking can be done over a week or a month timeframe. Required in the `SELECT` clause. Condition on `report_granularity` is required in the `WHERE` clause.", + "enum": [ + "REPORT_GRANULARITY_ENUM_UNSPECIFIED", + "WEEKLY", + "MONTHLY" + ], + "enumDescriptions": [ + "Not specified.", + "Report is computed over a week timeframe.", + "Report is computed over a month timeframe." + ], + "type": "string" + } + }, + "type": "object" + }, + "BestSellersProductClusterView": { + "description": "Fields available for query in `best_sellers_product_cluster_view` table. [Best sellers](https://support.google.com/merchants/answer/9488679) report with top product clusters. A product cluster is a grouping for different offers and variants that represent the same product, for example, Google Pixel 7. Values are only set for fields requested explicitly in the request's search query.", + "id": "BestSellersProductClusterView", + "properties": { + "brand": { + "description": "Brand of the product cluster.", + "type": "string" + }, + "brandInventoryStatus": { + "description": "Whether there is at least one product of the brand currently `IN_STOCK` in your product data source in at least one of the countries, all products are `OUT_OF_STOCK` in your product data source in all countries, or `NOT_IN_INVENTORY`. The field doesn't take the Best sellers report country filter into account.", + "enum": [ + "INVENTORY_STATUS_UNSPECIFIED", + "IN_STOCK", + "OUT_OF_STOCK", + "NOT_IN_INVENTORY" + ], + "enumDescriptions": [ + "Not specified.", + "You have a product for this product cluster or brand in stock.", + "You have a product for this product cluster or brand in inventory but it is currently out of stock.", + "You do not have a product for this product cluster or brand in inventory." + ], + "type": "string" + }, + "categoryL1": { + "description": "Product category (1st level) of the product cluster, represented in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436).", + "type": "string" + }, + "categoryL2": { + "description": "Product category (2nd level) of the product cluster, represented in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436).", + "type": "string" + }, + "categoryL3": { + "description": "Product category (3rd level) of the product cluster, represented in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436).", + "type": "string" + }, + "categoryL4": { + "description": "Product category (4th level) of the product cluster, represented in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436).", + "type": "string" + }, + "categoryL5": { + "description": "Product category (5th level) of the product cluster, represented in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436).", + "type": "string" + }, + "inventoryStatus": { + "description": "Whether the product cluster is `IN_STOCK` in your product data source in at least one of the countries, `OUT_OF_STOCK` in your product data source in all countries, or `NOT_IN_INVENTORY` at all. The field doesn't take the Best sellers report country filter into account.", + "enum": [ + "INVENTORY_STATUS_UNSPECIFIED", + "IN_STOCK", + "OUT_OF_STOCK", + "NOT_IN_INVENTORY" + ], + "enumDescriptions": [ + "Not specified.", + "You have a product for this product cluster or brand in stock.", + "You have a product for this product cluster or brand in inventory but it is currently out of stock.", + "You do not have a product for this product cluster or brand in inventory." + ], + "type": "string" + }, + "previousRank": { + "description": "Popularity rank in the previous week or month.", + "format": "int64", + "type": "string" + }, + "previousRelativeDemand": { + "description": "Estimated demand in relation to the product cluster with the highest popularity rank in the same category and country in the previous week or month.", + "enum": [ + "RELATIVE_DEMAND_ENUM_UNSPECIFIED", + "VERY_LOW", + "LOW", + "MEDIUM", + "HIGH", + "VERY_HIGH" + ], + "enumDescriptions": [ + "Not specified.", + "Demand is 0-5% of the demand of the highest ranked product cluster or brand.", + "Demand is 6-10% of the demand of the highest ranked product cluster or brand.", + "Demand is 11-20% of the demand of the highest ranked product cluster or brand.", + "Demand is 21-50% of the demand of the highest ranked product cluster or brand.", + "Demand is 51-100% of the demand of the highest ranked product cluster or brand." + ], + "type": "string" + }, + "rank": { + "description": "Popularity of the product cluster on Ads and organic surfaces, in the selected category and country, based on the estimated number of units sold.", + "format": "int64", + "type": "string" + }, + "relativeDemand": { + "description": "Estimated demand in relation to the product cluster with the highest popularity rank in the same category and country.", + "enum": [ + "RELATIVE_DEMAND_ENUM_UNSPECIFIED", + "VERY_LOW", + "LOW", + "MEDIUM", + "HIGH", + "VERY_HIGH" + ], + "enumDescriptions": [ + "Not specified.", + "Demand is 0-5% of the demand of the highest ranked product cluster or brand.", + "Demand is 6-10% of the demand of the highest ranked product cluster or brand.", + "Demand is 11-20% of the demand of the highest ranked product cluster or brand.", + "Demand is 21-50% of the demand of the highest ranked product cluster or brand.", + "Demand is 51-100% of the demand of the highest ranked product cluster or brand." + ], + "type": "string" + }, + "relativeDemandChange": { + "description": "Change in the estimated demand. Whether it rose, sank or remained flat.", + "enum": [ + "RELATIVE_DEMAND_CHANGE_TYPE_ENUM_UNSPECIFIED", + "SINKER", + "FLAT", + "RISER" + ], + "enumDescriptions": [ + "Not specified.", + "Relative demand is lower than the previous time period.", + "Relative demand is equal to the previous time period.", + "Relative demand is higher than the previous time period." + ], + "type": "string" + }, + "reportCategoryId": { + "description": "Google product category ID to calculate the ranking for, represented in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436). Required in the `SELECT` clause. If a `WHERE` condition on `report_category_id` is not specified in the query, rankings for all top-level categories are returned.", + "format": "int64", + "type": "string" + }, + "reportCountryCode": { + "description": "Country where the ranking is calculated. Represented in the ISO 3166 format. Required in the `SELECT` clause. Condition on `report_country_code` is required in the `WHERE` clause.", + "type": "string" + }, + "reportDate": { + "$ref": "Date", + "description": "Report date. The value of this field can only be one of the following: * The first day of the week (Monday) for weekly reports, * The first day of the month for monthly reports. Required in the `SELECT` clause. If a `WHERE` condition on `report_date` is not specified in the query, the latest available weekly or monthly report is returned." + }, + "reportGranularity": { + "description": "Granularity of the report. The ranking can be done over a week or a month timeframe. Required in the `SELECT` clause. Condition on `report_granularity` is required in the `WHERE` clause.", + "enum": [ + "REPORT_GRANULARITY_ENUM_UNSPECIFIED", + "WEEKLY", + "MONTHLY" + ], + "enumDescriptions": [ + "Not specified.", + "Report is computed over a week timeframe.", + "Report is computed over a month timeframe." + ], + "type": "string" + }, + "title": { + "description": "Title of the product cluster.", + "type": "string" + }, + "variantGtins": { + "description": "GTINs of example variants of the product cluster.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "CompetitiveVisibilityBenchmarkView": { + "description": "Fields available for query in `competitive_visibility_benchmark_view` table. [Competitive visibility](https://support.google.com/merchants/answer/11366442) report with the category benchmark. Values are only set for fields requested explicitly in the request's search query.", + "id": "CompetitiveVisibilityBenchmarkView", + "properties": { + "categoryBenchmarkVisibilityTrend": { + "description": "Change in visibility based on impressions with respect to the start of the selected time range (or first day with non-zero impressions) for a combined set of merchants with highest visibility approximating the market. Cannot be filtered on in the 'WHERE' clause.", + "format": "double", + "type": "number" + }, + "date": { + "$ref": "Date", + "description": "Date of this row. Required in the `SELECT` clause. A condition on `date` is required in the `WHERE` clause." + }, + "reportCategoryId": { + "description": "Google product category ID to calculate the report for, represented in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436). Required in the `SELECT` clause. A condition on `report_category_id` is required in the `WHERE` clause.", + "format": "int64", + "type": "string" + }, + "reportCountryCode": { + "description": "Country where impressions appeared. Required in the `SELECT` clause. A condition on `report_country_code` is required in the `WHERE` clause.", + "type": "string" + }, + "trafficSource": { + "description": "Traffic source of impressions. Required in the `SELECT` clause.", + "enum": [ + "TRAFFIC_SOURCE_ENUM_UNSPECIFIED", + "ORGANIC", + "ADS", + "ALL" + ], + "enumDescriptions": [ + "Not specified.", + "Organic traffic.", + "Traffic from ads.", + "Organic and ads traffic." + ], + "type": "string" + }, + "yourDomainVisibilityTrend": { + "description": "Change in visibility based on impressions for your domain with respect to the start of the selected time range (or first day with non-zero impressions). Cannot be filtered on in the 'WHERE' clause.", + "format": "double", + "type": "number" + } + }, + "type": "object" + }, + "CompetitiveVisibilityCompetitorView": { + "description": "Fields available for query in `competitive_visibility_competitor_view` table. [Competitive visibility](https://support.google.com/merchants/answer/11366442) report with businesses with similar visibility. Values are only set for fields requested explicitly in the request's search query.", + "id": "CompetitiveVisibilityCompetitorView", + "properties": { + "adsOrganicRatio": { + "description": "[Ads / organic ratio] (https://support.google.com/merchants/answer/11366442#zippy=%2Cads-free-ratio) shows how often the domain receives impressions from Shopping ads compared to organic traffic. The number is rounded and bucketed. Cannot be filtered on in the 'WHERE' clause.", + "format": "double", + "type": "number" + }, + "date": { + "$ref": "Date", + "description": "Date of this row. A condition on `date` is required in the `WHERE` clause." + }, + "domain": { + "description": "Domain of your competitor or your domain, if 'is_your_domain' is true. Required in the `SELECT` clause. Cannot be filtered on in the 'WHERE' clause.", + "type": "string" + }, + "higherPositionRate": { + "description": "[Higher position rate] (https://support.google.com/merchants/answer/11366442#zippy=%2Chigher-position-rate) shows how often a competitor’s offer got placed in a higher position on the page than your offer. Cannot be filtered on in the 'WHERE' clause.", + "format": "double", + "type": "number" + }, + "isYourDomain": { + "description": "True if this row contains data for your domain. Cannot be filtered on in the 'WHERE' clause.", + "type": "boolean" + }, + "pageOverlapRate": { + "description": "[Page overlap rate] (https://support.google.com/merchants/answer/11366442#zippy=%2Cpage-overlap-rate) shows how frequently competing retailers’ offers are shown together with your offers on the same page. Cannot be filtered on in the 'WHERE' clause.", + "format": "double", + "type": "number" + }, + "rank": { + "description": "Position of the domain in the similar businesses ranking for the selected keys (`date`, `report_category_id`, `report_country_code`, `traffic_source`) based on impressions. 1 is the highest. Cannot be filtered on in the 'WHERE' clause.", + "format": "int64", + "type": "string" + }, + "relativeVisibility": { + "description": "[Relative visibility] (https://support.google.com/merchants/answer/11366442#zippy=%2Crelative-visibility) shows how often your competitors’ offers are shown compared to your offers. In other words, this is the number of displayed impressions of a competitor retailer divided by the number of your displayed impressions during a selected time range for a selected product category and country. Cannot be filtered on in the 'WHERE' clause.", + "format": "double", + "type": "number" + }, + "reportCategoryId": { + "description": "Google product category ID to calculate the report for, represented in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436). Required in the `SELECT` clause. A condition on `report_category_id` is required in the `WHERE` clause.", + "format": "int64", + "type": "string" + }, + "reportCountryCode": { + "description": "Country where impressions appeared. Required in the `SELECT` clause. A condition on `report_country_code` is required in the `WHERE` clause.", + "type": "string" + }, + "trafficSource": { + "description": "Traffic source of impressions. Required in the `SELECT` clause.", + "enum": [ + "TRAFFIC_SOURCE_ENUM_UNSPECIFIED", + "ORGANIC", + "ADS", + "ALL" + ], + "enumDescriptions": [ + "Not specified.", + "Organic traffic.", + "Traffic from ads.", + "Organic and ads traffic." + ], + "type": "string" + } + }, + "type": "object" + }, + "CompetitiveVisibilityTopMerchantView": { + "description": "Fields available for query in `competitive_visibility_top_merchant_view` table. [Competitive visibility](https://support.google.com/merchants/answer/11366442) report with business with highest visibility. Values are only set for fields requested explicitly in the request's search query.", + "id": "CompetitiveVisibilityTopMerchantView", + "properties": { + "adsOrganicRatio": { + "description": "[Ads / organic ratio] (https://support.google.com/merchants/answer/11366442#zippy=%2Cads-free-ratio) shows how often the domain receives impressions from Shopping ads compared to organic traffic. The number is rounded and bucketed. Cannot be filtered on in the 'WHERE' clause.", + "format": "double", + "type": "number" + }, + "date": { + "$ref": "Date", + "description": "Date of this row. Cannot be selected in the `SELECT` clause. A condition on `date` is required in the `WHERE` clause." + }, + "domain": { + "description": "Domain of your competitor or your domain, if 'is_your_domain' is true. Required in the `SELECT` clause. Cannot be filtered on in the 'WHERE' clause.", + "type": "string" + }, + "higherPositionRate": { + "description": "[Higher position rate] (https://support.google.com/merchants/answer/11366442#zippy=%2Chigher-position-rate) shows how often a competitor’s offer got placed in a higher position on the page than your offer. Cannot be filtered on in the 'WHERE' clause.", + "format": "double", + "type": "number" + }, + "isYourDomain": { + "description": "True if this row contains data for your domain. Cannot be filtered on in the 'WHERE' clause.", + "type": "boolean" + }, + "pageOverlapRate": { + "description": "[Page overlap rate] (https://support.google.com/merchants/answer/11366442#zippy=%2Cpage-overlap-rate) shows how frequently competing retailers’ offers are shown together with your offers on the same page. Cannot be filtered on in the 'WHERE' clause.", + "format": "double", + "type": "number" + }, + "rank": { + "description": "Position of the domain in the top merchants ranking for the selected keys (`date`, `report_category_id`, `report_country_code`, `traffic_source`) based on impressions. 1 is the highest. Cannot be filtered on in the 'WHERE' clause.", + "format": "int64", + "type": "string" + }, + "reportCategoryId": { + "description": "Google product category ID to calculate the report for, represented in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436). Required in the `SELECT` clause. A condition on `report_category_id` is required in the `WHERE` clause.", + "format": "int64", + "type": "string" + }, + "reportCountryCode": { + "description": "Country where impressions appeared. Required in the `SELECT` clause. A condition on `report_country_code` is required in the `WHERE` clause.", + "type": "string" + }, + "trafficSource": { + "description": "Traffic source of impressions. Required in the `SELECT` clause.", + "enum": [ + "TRAFFIC_SOURCE_ENUM_UNSPECIFIED", + "ORGANIC", + "ADS", + "ALL" + ], + "enumDescriptions": [ + "Not specified.", + "Organic traffic.", + "Traffic from ads.", + "Organic and ads traffic." + ], + "type": "string" + } + }, + "type": "object" + }, + "Date": { + "description": "Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp", + "id": "Date", + "properties": { + "day": { + "description": "Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.", + "format": "int32", + "type": "integer" + }, + "month": { + "description": "Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.", + "format": "int32", + "type": "integer" + }, + "year": { + "description": "Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.", + "format": "int32", + "type": "integer" + } + }, + "type": "object" + }, + "IssueSeverityPerReportingContext": { + "description": "Issue severity per reporting context.", + "id": "IssueSeverityPerReportingContext", + "properties": { + "demotedCountries": { + "description": "List of demoted countries in the reporting context, represented in ISO 3166 format.", + "items": { + "type": "string" + }, + "type": "array" + }, + "disapprovedCountries": { + "description": "List of disapproved countries in the reporting context, represented in ISO 3166 format.", + "items": { + "type": "string" + }, + "type": "array" + }, + "reportingContext": { + "description": "Reporting context the issue applies to.", + "enum": [ + "REPORTING_CONTEXT_ENUM_UNSPECIFIED", + "SHOPPING_ADS", + "DISCOVERY_ADS", + "DEMAND_GEN_ADS", + "DEMAND_GEN_ADS_DISCOVER_SURFACE", + "VIDEO_ADS", + "DISPLAY_ADS", + "LOCAL_INVENTORY_ADS", + "VEHICLE_INVENTORY_ADS", + "FREE_LISTINGS", + "FREE_LOCAL_LISTINGS", + "FREE_LOCAL_VEHICLE_LISTINGS", + "YOUTUBE_SHOPPING", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL" + ], + "enumDeprecated": [ + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false + ], + "enumDescriptions": [ + "Not specified.", + "[Shopping ads](https://support.google.com/merchants/answer/6149970).", + "Deprecated: Use `DEMAND_GEN_ADS` instead. [Discovery and Demand Gen ads](https://support.google.com/merchants/answer/13389785).", + "[Demand Gen ads](https://support.google.com/merchants/answer/13389785).", + "[Demand Gen ads on Discover surface](https://support.google.com/merchants/answer/13389785).", + "[Video ads](https://support.google.com/google-ads/answer/6340491).", + "[Display ads](https://support.google.com/merchants/answer/6069387).", + "[Local inventory ads](https://support.google.com/merchants/answer/3271956).", + "[Vehicle inventory ads](https://support.google.com/merchants/answer/11544533).", + "[Free product listings](https://support.google.com/merchants/answer/9199328).", + "[Free local product listings](https://support.google.com/merchants/answer/9825611).", + "[Free local vehicle listings](https://support.google.com/merchants/answer/11544533).", + "[YouTube Shopping](https://support.google.com/merchants/answer/13478370).", + "[Cloud retail](https://cloud.google.com/solutions/retail).", + "[Local cloud retail](https://cloud.google.com/solutions/retail)." + ], + "type": "string" + } + }, + "type": "object" + }, + "ItemIssue": { + "description": "Item issue associated with the product.", + "id": "ItemIssue", + "properties": { + "resolution": { + "description": "Item issue resolution.", + "enum": [ + "ITEM_ISSUE_RESOLUTION_UNSPECIFIED", + "MERCHANT_ACTION", + "PENDING_PROCESSING" + ], + "enumDescriptions": [ + "Not specified.", + "The merchant has to fix the issue.", + "The issue will be resolved automatically (for example, image crawl) or through a Google review. No merchant action is required now. Resolution might lead to another issue (for example, if crawl fails)." + ], + "type": "string" + }, + "severity": { + "$ref": "ItemIssueSeverity", + "description": "Item issue severity." + }, + "type": { + "$ref": "ItemIssueType", + "description": "Item issue type." + } + }, + "type": "object" + }, + "ItemIssueSeverity": { + "description": "How the issue affects the serving of the product.", + "id": "ItemIssueSeverity", + "properties": { + "aggregatedSeverity": { + "description": "Aggregated severity of the issue for all reporting contexts it affects. **This field can be used for filtering the results.**", + "enum": [ + "AGGREGATED_ISSUE_SEVERITY_UNSPECIFIED", + "DISAPPROVED", + "DEMOTED", + "PENDING" + ], + "enumDescriptions": [ + "Not specified.", + "Issue disapproves the product in at least one reporting context.", + "Issue demotes the product in all reporting contexts it affects.", + "Issue resolution is `PENDING_PROCESSING`." + ], + "type": "string" + }, + "severityPerReportingContext": { + "description": "Issue severity per reporting context.", + "items": { + "$ref": "IssueSeverityPerReportingContext" + }, + "type": "array" + } + }, + "type": "object" + }, + "ItemIssueType": { + "description": "Issue type.", + "id": "ItemIssueType", + "properties": { + "canonicalAttribute": { + "description": "Canonical attribute name for attribute-specific issues.", + "type": "string" + }, + "code": { + "description": "Error code of the issue, equivalent to the `code` of [Product issues](https://developers.google.com/shopping-content/guides/product-issues).", + "type": "string" + } + }, + "type": "object" + }, + "NonProductPerformanceView": { + "description": "Fields available for query in `non_product_performance_view` table. Performance data on images and online store links leading to your non-product pages. This includes performance metrics (for example, `clicks`) and dimensions according to which performance metrics are segmented (for example, `date`). Segment fields cannot be selected in queries without also selecting at least one metric field. Values are only set for fields requested explicitly in the request's search query.", + "id": "NonProductPerformanceView", + "properties": { + "clickThroughRate": { + "description": "Click-through rate - the number of clicks (`clicks`) divided by the number of impressions (`impressions`) of images and online store links leading to your non-product pages. Metric.", + "format": "double", + "type": "number" + }, + "clicks": { + "description": "Number of clicks on images and online store links leading to your non-product pages. Metric.", + "format": "int64", + "type": "string" + }, + "date": { + "$ref": "Date", + "description": "Date in the merchant timezone to which metrics apply. Segment. Condition on `date` is required in the `WHERE` clause." + }, + "impressions": { + "description": "Number of times images and online store links leading to your non-product pages were shown. Metric.", + "format": "int64", + "type": "string" + }, + "week": { + "$ref": "Date", + "description": "First day of the week (Monday) of the metrics date in the merchant timezone. Segment." + } + }, + "type": "object" + }, + "Price": { + "description": "The price represented as a number and currency.", + "id": "Price", + "properties": { + "amountMicros": { + "description": "The price represented as a number in micros (1 million micros is an equivalent to one's currency standard unit, for example, 1 USD = 1000000 micros).", + "format": "int64", + "type": "string" + }, + "currencyCode": { + "description": "The currency of the price using three-letter acronyms according to [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217).", + "type": "string" + } + }, + "type": "object" + }, + "PriceCompetitivenessProductView": { + "description": "Fields available for query in `price_competitiveness_product_view` table. [Price competitiveness](https://support.google.com/merchants/answer/9626903) report. Values are only set for fields requested explicitly in the request's search query.", + "id": "PriceCompetitivenessProductView", + "properties": { + "benchmarkPrice": { + "$ref": "Price", + "description": "Latest available price benchmark for the product's catalog in the benchmark country." + }, + "brand": { + "description": "Brand of the product.", + "type": "string" + }, + "categoryL1": { + "description": "Product category (1st level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436).", + "type": "string" + }, + "categoryL2": { + "description": "Product category (2nd level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436).", + "type": "string" + }, + "categoryL3": { + "description": "Product category (3rd level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436).", + "type": "string" + }, + "categoryL4": { + "description": "Product category (4th level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436).", + "type": "string" + }, + "categoryL5": { + "description": "Product category (5th level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436).", + "type": "string" + }, + "id": { + "description": "REST ID of the product, in the form of `channel~languageCode~feedLabel~offerId`. Can be used to join data with the `product_view` table. Required in the `SELECT` clause.", + "type": "string" + }, + "offerId": { + "description": "Merchant-provided id of the product.", + "type": "string" + }, + "price": { + "$ref": "Price", + "description": "Current price of the product." + }, + "productTypeL1": { + "description": "Product type (1st level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406).", + "type": "string" + }, + "productTypeL2": { + "description": "Product type (2nd level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406).", + "type": "string" + }, + "productTypeL3": { + "description": "Product type (3rd level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406).", + "type": "string" + }, + "productTypeL4": { + "description": "Product type (4th level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406).", + "type": "string" + }, + "productTypeL5": { + "description": "Product type (5th level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406).", + "type": "string" + }, + "reportCountryCode": { + "description": "Country of the price benchmark. Represented in the ISO 3166 format. Required in the `SELECT` clause.", + "type": "string" + }, + "title": { + "description": "Title of the product.", + "type": "string" + } + }, + "type": "object" + }, + "PriceInsightsProductView": { + "description": "Fields available for query in `price_insights_product_view` table. [Price insights](https://support.google.com/merchants/answer/11916926) report. Values are only set for fields requested explicitly in the request's search query.", + "id": "PriceInsightsProductView", + "properties": { + "brand": { + "description": "Brand of the product.", + "type": "string" + }, + "categoryL1": { + "description": "Product category (1st level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436).", + "type": "string" + }, + "categoryL2": { + "description": "Product category (2nd level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436).", + "type": "string" + }, + "categoryL3": { + "description": "Product category (3rd level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436).", + "type": "string" + }, + "categoryL4": { + "description": "Product category (4th level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436).", + "type": "string" + }, + "categoryL5": { + "description": "Product category (5th level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436).", + "type": "string" + }, + "effectiveness": { + "description": "The predicted effectiveness of applying the price suggestion, bucketed.", + "enum": [ + "EFFECTIVENESS_UNSPECIFIED", + "LOW", + "MEDIUM", + "HIGH" + ], + "enumDescriptions": [ + "Effectiveness is unknown.", + "Effectiveness is low.", + "Effectiveness is medium.", + "Effectiveness is high." + ], + "type": "string" + }, + "id": { + "description": "REST ID of the product, in the form of `channel~languageCode~feedLabel~offerId`. Can be used to join data with the `product_view` table. Required in the `SELECT` clause.", + "type": "string" + }, + "offerId": { + "description": "Merchant-provided id of the product.", + "type": "string" + }, + "predictedClicksChangeFraction": { + "description": "Predicted change in clicks as a fraction after introducing the suggested price compared to current active price. For example, 0.05 is a 5% predicted increase in clicks.", + "format": "double", + "type": "number" + }, + "predictedConversionsChangeFraction": { + "description": "Predicted change in conversions as a fraction after introducing the suggested price compared to current active price. For example, 0.05 is a 5% predicted increase in conversions).", + "format": "double", + "type": "number" + }, + "predictedImpressionsChangeFraction": { + "description": "Predicted change in impressions as a fraction after introducing the suggested price compared to current active price. For example, 0.05 is a 5% predicted increase in impressions.", + "format": "double", + "type": "number" + }, + "price": { + "$ref": "Price", + "description": "Current price of the product." + }, + "productTypeL1": { + "description": "Product type (1st level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406).", + "type": "string" + }, + "productTypeL2": { + "description": "Product type (2nd level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406).", + "type": "string" + }, + "productTypeL3": { + "description": "Product type (3rd level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406).", + "type": "string" + }, + "productTypeL4": { + "description": "Product type (4th level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406).", + "type": "string" + }, + "productTypeL5": { + "description": "Product type (5th level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406).", + "type": "string" + }, + "suggestedPrice": { + "$ref": "Price", + "description": "Latest suggested price for the product." + }, + "title": { + "description": "Title of the product.", + "type": "string" + } + }, + "type": "object" + }, + "ProductChange": { + "description": "The change that happened to the product including old value, new value, country code as the region code and reporting context.", + "id": "ProductChange", + "properties": { + "newValue": { + "description": "The new value of the changed resource or attribute.", + "type": "string" + }, + "oldValue": { + "description": "The old value of the changed resource or attribute.", + "type": "string" + }, + "regionCode": { + "description": "Countries that have the change (if applicable)", + "type": "string" + }, + "reportingContext": { + "description": "Reporting contexts that have the change (if applicable)", + "enum": [ + "REPORTING_CONTEXT_ENUM_UNSPECIFIED", + "SHOPPING_ADS", + "DISCOVERY_ADS", + "DEMAND_GEN_ADS", + "DEMAND_GEN_ADS_DISCOVER_SURFACE", + "VIDEO_ADS", + "DISPLAY_ADS", + "LOCAL_INVENTORY_ADS", + "VEHICLE_INVENTORY_ADS", + "FREE_LISTINGS", + "FREE_LOCAL_LISTINGS", + "FREE_LOCAL_VEHICLE_LISTINGS", + "YOUTUBE_SHOPPING", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL" + ], + "enumDeprecated": [ + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false + ], + "enumDescriptions": [ + "Not specified.", + "[Shopping ads](https://support.google.com/merchants/answer/6149970).", + "Deprecated: Use `DEMAND_GEN_ADS` instead. [Discovery and Demand Gen ads](https://support.google.com/merchants/answer/13389785).", + "[Demand Gen ads](https://support.google.com/merchants/answer/13389785).", + "[Demand Gen ads on Discover surface](https://support.google.com/merchants/answer/13389785).", + "[Video ads](https://support.google.com/google-ads/answer/6340491).", + "[Display ads](https://support.google.com/merchants/answer/6069387).", + "[Local inventory ads](https://support.google.com/merchants/answer/3271956).", + "[Vehicle inventory ads](https://support.google.com/merchants/answer/11544533).", + "[Free product listings](https://support.google.com/merchants/answer/9199328).", + "[Free local product listings](https://support.google.com/merchants/answer/9825611).", + "[Free local vehicle listings](https://support.google.com/merchants/answer/11544533).", + "[YouTube Shopping](https://support.google.com/merchants/answer/13478370).", + "[Cloud retail](https://cloud.google.com/solutions/retail).", + "[Local cloud retail](https://cloud.google.com/solutions/retail)." + ], + "type": "string" + } + }, + "type": "object" + }, + "ProductPerformanceView": { + "description": "Fields available for query in `product_performance_view` table. Product performance data for your account, including performance metrics (for example, `clicks`) and dimensions according to which performance metrics are segmented (for example, `offer_id`). Values of product dimensions, such as `offer_id`, reflect the state of a product at the time of the impression. Segment fields cannot be selected in queries without also selecting at least one metric field. Values are only set for fields requested explicitly in the request's search query.", + "id": "ProductPerformanceView", + "properties": { + "brand": { + "description": "Brand of the product. Segment.", + "type": "string" + }, + "categoryL1": { + "description": "[Product category (1st level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in Google's product taxonomy. Segment.", + "type": "string" + }, + "categoryL2": { + "description": "[Product category (2nd level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in Google's product taxonomy. Segment.", + "type": "string" + }, + "categoryL3": { + "description": "[Product category (3rd level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in Google's product taxonomy. Segment.", + "type": "string" + }, + "categoryL4": { + "description": "[Product category (4th level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in Google's product taxonomy. Segment.", + "type": "string" + }, + "categoryL5": { + "description": "[Product category (5th level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in Google's product taxonomy. Segment.", + "type": "string" + }, + "clickThroughRate": { + "description": "Click-through rate - the number of clicks merchant's products receive (clicks) divided by the number of times the products are shown (impressions). Metric.", + "format": "double", + "type": "number" + }, + "clicks": { + "description": "Number of clicks. Metric.", + "format": "int64", + "type": "string" + }, + "conversionRate": { + "description": "Number of conversions divided by the number of clicks, reported on the impression date. Metric. Available only for the `FREE` traffic source.", + "format": "double", + "type": "number" + }, + "conversionValue": { + "$ref": "Price", + "description": "Value of conversions attributed to the product, reported on the conversion date. Metric. Available only for the `FREE` traffic source." + }, + "conversions": { + "description": "Number of conversions attributed to the product, reported on the conversion date. Depending on the attribution model, a conversion might be distributed across multiple clicks, where each click gets its own credit assigned. This metric is a sum of all such credits. Metric. Available only for the `FREE` traffic source.", + "format": "double", + "type": "number" + }, + "customLabel0": { + "description": "Custom label 0 for custom grouping of products. Segment.", + "type": "string" + }, + "customLabel1": { + "description": "Custom label 1 for custom grouping of products. Segment.", + "type": "string" + }, + "customLabel2": { + "description": "Custom label 2 for custom grouping of products. Segment.", + "type": "string" + }, + "customLabel3": { + "description": "Custom label 3 for custom grouping of products. Segment.", + "type": "string" + }, + "customLabel4": { + "description": "Custom label 4 for custom grouping of products. Segment.", + "type": "string" + }, + "customerCountryCode": { + "description": "Code of the country where the customer is located at the time of the event. Represented in the ISO 3166 format. Segment. If the customer country cannot be determined, a special 'ZZ' code is returned.", + "type": "string" + }, + "date": { + "$ref": "Date", + "description": "Date in the merchant timezone to which metrics apply. Segment. Condition on `date` is required in the `WHERE` clause." + }, + "impressions": { + "description": "Number of times merchant's products are shown. Metric.", + "format": "int64", + "type": "string" + }, + "marketingMethod": { + "description": "Marketing method to which metrics apply. Segment.", + "enum": [ + "MARKETING_METHOD_ENUM_UNSPECIFIED", + "ORGANIC", + "ADS" + ], + "enumDescriptions": [ + "Not specified.", + "Organic marketing.", + "Ads-based marketing." + ], + "type": "string" + }, + "offerId": { + "description": "Merchant-provided id of the product. Segment.", + "type": "string" + }, + "productTypeL1": { + "description": "[Product type (1st level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in merchant's own product taxonomy. Segment.", + "type": "string" + }, + "productTypeL2": { + "description": "[Product type (2nd level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in merchant's own product taxonomy. Segment.", + "type": "string" + }, + "productTypeL3": { + "description": "[Product type (3rd level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in merchant's own product taxonomy. Segment.", + "type": "string" + }, + "productTypeL4": { + "description": "[Product type (4th level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in merchant's own product taxonomy. Segment.", + "type": "string" + }, + "productTypeL5": { + "description": "[Product type (5th level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in merchant's own product taxonomy. Segment.", + "type": "string" + }, + "title": { + "description": "Title of the product. Segment.", + "type": "string" + }, + "week": { + "$ref": "Date", + "description": "First day of the week (Monday) of the metrics date in the merchant timezone. Segment." + } + }, + "type": "object" + }, + "ProductStatusChangeMessage": { + "description": "The message that the merchant will receive to notify about product status change event", + "id": "ProductStatusChangeMessage", + "properties": { + "account": { + "description": "The target account that owns the entity that changed. Format : `accounts/{merchant_id}`", + "type": "string" + }, + "attribute": { + "description": "The attribute in the resource that changed, in this case it will be always `Status`.", + "enum": [ + "ATTRIBUTE_UNSPECIFIED", + "STATUS" + ], + "enumDescriptions": [ + "Unspecified attribute", + "Status of the changed entity" + ], + "type": "string" + }, + "changes": { + "description": "A message to describe the change that happened to the product", + "items": { + "$ref": "ProductChange" + }, + "type": "array" + }, + "managingAccount": { + "description": "The account that manages the merchant's account. can be the same as merchant id if it is standalone account. Format : `accounts/{service_provider_id}`", + "type": "string" + }, + "resource": { + "description": "The product name. Format: `{product.name=accounts/{account}/products/{product}}`", + "type": "string" + }, + "resourceId": { + "description": "The product id.", + "type": "string" + }, + "resourceType": { + "description": "The resource that changed, in this case it will always be `Product`.", + "enum": [ + "RESOURCE_UNSPECIFIED", + "PRODUCT" + ], + "enumDescriptions": [ + "Unspecified resource", + "Resource type : product" + ], + "type": "string" + } + }, + "type": "object" + }, + "ProductView": { + "description": "Fields available for query in `product_view` table. Products in the current inventory. Products in this table are the same as in Products sub-API but not all product attributes from Products sub-API are available for query in this table. In contrast to Products sub-API, this table allows to filter the returned list of products by product attributes. To retrieve a single product by `id` or list all products, Products sub-API should be used. Values are only set for fields requested explicitly in the request's search query. ", + "id": "ProductView", + "properties": { + "aggregatedReportingContextStatus": { + "description": "Aggregated status.", + "enum": [ + "AGGREGATED_REPORTING_CONTEXT_STATUS_UNSPECIFIED", + "NOT_ELIGIBLE_OR_DISAPPROVED", + "PENDING", + "ELIGIBLE_LIMITED", + "ELIGIBLE" + ], + "enumDescriptions": [ + "Not specified.", + "Product is not eligible or is disapproved for all reporting contexts.", + "Product's status is pending in all reporting contexts.", + "Product is eligible for some (but not all) reporting contexts.", + "Product is eligible for all reporting contexts." + ], + "type": "string" + }, + "availability": { + "description": "[Availability](https://support.google.com/merchants/answer/6324448) of the product.", + "type": "string" + }, + "brand": { + "description": "Brand of the product.", + "type": "string" + }, + "categoryL1": { + "description": "Product category (1st level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436).", + "type": "string" + }, + "categoryL2": { + "description": "Product category (2nd level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436).", + "type": "string" + }, + "categoryL3": { + "description": "Product category (3rd level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436).", + "type": "string" + }, + "categoryL4": { + "description": "Product category (4th level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436).", + "type": "string" + }, + "categoryL5": { + "description": "Product category (5th level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436).", + "type": "string" + }, + "channel": { + "description": "Channel of the product. Can be `ONLINE` or `LOCAL`.", + "enum": [ + "CHANNEL_ENUM_UNSPECIFIED", + "ONLINE", + "LOCAL" + ], + "enumDescriptions": [ + "Not specified.", + "Online product.", + "Local product." + ], + "type": "string" + }, + "clickPotential": { + "description": "Estimated performance potential compared to highest performing products of the merchant.", + "enum": [ + "CLICK_POTENTIAL_UNSPECIFIED", + "LOW", + "MEDIUM", + "HIGH" + ], + "enumDescriptions": [ + "Unknown predicted clicks impact.", + "Potential to receive a low number of clicks compared to the highest performing products of the merchant.", + "Potential to receive a moderate number of clicks compared to the highest performing products of the merchant.", + "Potential to receive a similar number of clicks as the highest performing products of the merchant." + ], + "type": "string" + }, + "clickPotentialRank": { + "description": "Rank of the product based on its click potential. A product with `click_potential_rank` 1 has the highest click potential among the merchant's products that fulfill the search query conditions.", + "format": "int64", + "type": "string" + }, + "condition": { + "description": "[Condition](https://support.google.com/merchants/answer/6324469) of the product.", + "type": "string" + }, + "creationTime": { + "description": "The time the merchant created the product in timestamp seconds.", + "format": "google-datetime", + "type": "string" + }, + "expirationDate": { + "$ref": "Date", + "description": "Expiration date for the product, specified on insertion." + }, + "feedLabel": { + "description": "Feed label of the product.", + "type": "string" + }, + "gtin": { + "description": "List of Global Trade Item Numbers (GTINs) of the product.", + "items": { + "type": "string" + }, + "type": "array" + }, + "id": { + "description": "REST ID of the product, in the form of `channel~languageCode~feedLabel~offerId`. Merchant API methods that operate on products take this as their `name` parameter. Required in the `SELECT` clause.", + "type": "string" + }, + "itemGroupId": { + "description": "Item group id provided by the merchant for grouping variants together.", + "type": "string" + }, + "itemIssues": { + "description": "List of item issues for the product. **This field cannot be used for sorting the results.** **Only selected attributes of this field (for example, `item_issues.severity.aggregated_severity`) can be used for filtering the results.**", + "items": { + "$ref": "ItemIssue" + }, + "type": "array" + }, + "languageCode": { + "description": "Language code of the product in BCP 47 format.", + "type": "string" + }, + "offerId": { + "description": "Merchant-provided id of the product.", + "type": "string" + }, + "price": { + "$ref": "Price", + "description": "Product price. Absent if the information about the price of the product is not available." + }, + "productTypeL1": { + "description": "Product type (1st level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406).", + "type": "string" + }, + "productTypeL2": { + "description": "Product type (2nd level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406).", + "type": "string" + }, + "productTypeL3": { + "description": "Product type (3rd level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406).", + "type": "string" + }, + "productTypeL4": { + "description": "Product type (4th level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406).", + "type": "string" + }, + "productTypeL5": { + "description": "Product type (5th level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406).", + "type": "string" + }, + "shippingLabel": { + "description": "Normalized [shipping label](https://support.google.com/merchants/answer/6324504) specified in the data source.", + "type": "string" + }, + "thumbnailLink": { + "description": "Link to the processed image of the product, hosted on the Google infrastructure.", + "type": "string" + }, + "title": { + "description": "Title of the product.", + "type": "string" + } + }, + "type": "object" + }, + "ReportRow": { + "description": "Result row returned from the search query. Only the message corresponding to the queried table is populated in the response. Within the populated message, only the fields requested explicitly in the query are populated.", + "id": "ReportRow", + "properties": { + "bestSellersBrandView": { + "$ref": "BestSellersBrandView", + "description": "Fields available for query in `best_sellers_brand_view` table." + }, + "bestSellersProductClusterView": { + "$ref": "BestSellersProductClusterView", + "description": "Fields available for query in `best_sellers_product_cluster_view` table." + }, + "competitiveVisibilityBenchmarkView": { + "$ref": "CompetitiveVisibilityBenchmarkView", + "description": "Fields available for query in `competitive_visibility_benchmark_view` table." + }, + "competitiveVisibilityCompetitorView": { + "$ref": "CompetitiveVisibilityCompetitorView", + "description": "Fields available for query in `competitive_visibility_competitor_view` table." + }, + "competitiveVisibilityTopMerchantView": { + "$ref": "CompetitiveVisibilityTopMerchantView", + "description": "Fields available for query in `competitive_visibility_top_merchant_view` table." + }, + "nonProductPerformanceView": { + "$ref": "NonProductPerformanceView", + "description": "Fields available for query in `non_product_performance_view` table." + }, + "priceCompetitivenessProductView": { + "$ref": "PriceCompetitivenessProductView", + "description": "Fields available for query in `price_competitiveness_product_view` table." + }, + "priceInsightsProductView": { + "$ref": "PriceInsightsProductView", + "description": "Fields available for query in `price_insights_product_view` table." + }, + "productPerformanceView": { + "$ref": "ProductPerformanceView", + "description": "Fields available for query in `product_performance_view` table." + }, + "productView": { + "$ref": "ProductView", + "description": "Fields available for query in `product_view` table." + } + }, + "type": "object" + }, + "SearchRequest": { + "description": "Request message for the `ReportService.Search` method.", + "id": "SearchRequest", + "properties": { + "pageSize": { + "description": "Optional. Number of `ReportRows` to retrieve in a single page. Defaults to 1000. Values above 5000 are coerced to 5000.", + "format": "int32", + "type": "integer" + }, + "pageToken": { + "description": "Optional. Token of the page to retrieve. If not specified, the first page of results is returned. In order to request the next page of results, the value obtained from `next_page_token` in the previous response should be used.", + "type": "string" + }, + "query": { + "description": "Required. Query that defines a report to be retrieved. For details on how to construct your query, see the Query Language guide. For the full list of available tables and fields, see the Available fields.", + "type": "string" + } + }, + "type": "object" + }, + "SearchResponse": { + "description": "Response message for the `ReportService.Search` method.", + "id": "SearchResponse", + "properties": { + "nextPageToken": { + "description": "Token which can be sent as `page_token` to retrieve the next page. If omitted, there are no subsequent pages.", + "type": "string" + }, + "results": { + "description": "Rows that matched the search query.", + "items": { + "$ref": "ReportRow" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "servicePath": "", + "title": "Merchant API", + "version": "reports_v1beta", + "version_module": true +} \ No newline at end of file diff --git a/merchantapi/reports_v1beta/merchantapi-gen.go b/merchantapi/reports_v1beta/merchantapi-gen.go new file mode 100644 index 00000000000..f618a4b2043 --- /dev/null +++ b/merchantapi/reports_v1beta/merchantapi-gen.go @@ -0,0 +1,1768 @@ +// Copyright 2024 Google LLC. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Code generated file. DO NOT EDIT. + +// Package merchantapi provides access to the Merchant API. +// +// For product documentation, see: https://developers.devsite.corp.google.com/merchant/api +// +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// +// # Creating a client +// +// Usage example: +// +// import "google.golang.org/api/merchantapi/reports_v1beta" +// ... +// ctx := context.Background() +// merchantapiService, err := merchantapi.NewService(ctx) +// +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// +// # Other authentication options +// +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: +// +// merchantapiService, err := merchantapi.NewService(ctx, option.WithAPIKey("AIza...")) +// +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: +// +// config := &oauth2.Config{...} +// // ... +// token, err := config.Exchange(ctx, ...) +// merchantapiService, err := merchantapi.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) +// +// See [google.golang.org/api/option.ClientOption] for details on options. +package merchantapi // import "google.golang.org/api/merchantapi/reports_v1beta" + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strconv" + "strings" + + googleapi "google.golang.org/api/googleapi" + internal "google.golang.org/api/internal" + gensupport "google.golang.org/api/internal/gensupport" + option "google.golang.org/api/option" + internaloption "google.golang.org/api/option/internaloption" + htransport "google.golang.org/api/transport/http" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = gensupport.MarshalJSON +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = context.Canceled +var _ = internaloption.WithDefaultEndpoint +var _ = internal.Version + +const apiId = "merchantapi:reports_v1beta" +const apiName = "merchantapi" +const apiVersion = "reports_v1beta" +const basePath = "https://merchantapi.googleapis.com/" +const basePathTemplate = "https://merchantapi.UNIVERSE_DOMAIN/" +const mtlsBasePath = "https://merchantapi.mtls.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // Manage your product listings and accounts for Google Shopping + ContentScope = "https://www.googleapis.com/auth/content" +) + +// NewService creates a new Service. +func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { + scopesOption := internaloption.WithDefaultScopes( + "https://www.googleapis.com/auth/content", + ) + // NOTE: prepend, so we don't override user-specified scopes. + opts = append([]option.ClientOption{scopesOption}, opts...) + opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) + opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) + opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) + opts = append(opts, internaloption.EnableNewAuthLibrary()) + client, endpoint, err := htransport.NewClient(ctx, opts...) + if err != nil { + return nil, err + } + s, err := New(client) + if err != nil { + return nil, err + } + if endpoint != "" { + s.BasePath = endpoint + } + return s, nil +} + +// New creates a new Service. It uses the provided http.Client for requests. +// +// Deprecated: please use NewService instead. +// To provide a custom HTTP client, use option.WithHTTPClient. +// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Accounts = NewAccountsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Accounts *AccountsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewAccountsService(s *Service) *AccountsService { + rs := &AccountsService{s: s} + rs.Reports = NewAccountsReportsService(s) + return rs +} + +type AccountsService struct { + s *Service + + Reports *AccountsReportsService +} + +func NewAccountsReportsService(s *Service) *AccountsReportsService { + rs := &AccountsReportsService{s: s} + return rs +} + +type AccountsReportsService struct { + s *Service +} + +// BestSellersBrandView: Fields available for query in +// `best_sellers_brand_view` table. Best sellers +// (https://support.google.com/merchants/answer/9488679) report with top +// brands. Values are only set for fields requested explicitly in the request's +// search query. +type BestSellersBrandView struct { + // Brand: Name of the brand. + Brand string `json:"brand,omitempty"` + // PreviousRank: Popularity rank in the previous week or month. + PreviousRank int64 `json:"previousRank,omitempty,string"` + // PreviousRelativeDemand: Estimated demand in relation to the brand with the + // highest popularity rank in the same category and country in the previous + // week or month. + // + // Possible values: + // "RELATIVE_DEMAND_ENUM_UNSPECIFIED" - Not specified. + // "VERY_LOW" - Demand is 0-5% of the demand of the highest ranked product + // cluster or brand. + // "LOW" - Demand is 6-10% of the demand of the highest ranked product + // cluster or brand. + // "MEDIUM" - Demand is 11-20% of the demand of the highest ranked product + // cluster or brand. + // "HIGH" - Demand is 21-50% of the demand of the highest ranked product + // cluster or brand. + // "VERY_HIGH" - Demand is 51-100% of the demand of the highest ranked + // product cluster or brand. + PreviousRelativeDemand string `json:"previousRelativeDemand,omitempty"` + // Rank: Popularity of the brand on Ads and organic surfaces, in the selected + // category and country, based on the estimated number of units sold. + Rank int64 `json:"rank,omitempty,string"` + // RelativeDemand: Estimated demand in relation to the brand with the highest + // popularity rank in the same category and country. + // + // Possible values: + // "RELATIVE_DEMAND_ENUM_UNSPECIFIED" - Not specified. + // "VERY_LOW" - Demand is 0-5% of the demand of the highest ranked product + // cluster or brand. + // "LOW" - Demand is 6-10% of the demand of the highest ranked product + // cluster or brand. + // "MEDIUM" - Demand is 11-20% of the demand of the highest ranked product + // cluster or brand. + // "HIGH" - Demand is 21-50% of the demand of the highest ranked product + // cluster or brand. + // "VERY_HIGH" - Demand is 51-100% of the demand of the highest ranked + // product cluster or brand. + RelativeDemand string `json:"relativeDemand,omitempty"` + // RelativeDemandChange: Change in the estimated demand. Whether it rose, sank + // or remained flat. + // + // Possible values: + // "RELATIVE_DEMAND_CHANGE_TYPE_ENUM_UNSPECIFIED" - Not specified. + // "SINKER" - Relative demand is lower than the previous time period. + // "FLAT" - Relative demand is equal to the previous time period. + // "RISER" - Relative demand is higher than the previous time period. + RelativeDemandChange string `json:"relativeDemandChange,omitempty"` + // ReportCategoryId: Google product category ID to calculate the ranking for, + // represented in Google's product taxonomy + // (https://support.google.com/merchants/answer/6324436). Required in the + // `SELECT` clause. If a `WHERE` condition on `report_category_id` is not + // specified in the query, rankings for all top-level categories are returned. + ReportCategoryId int64 `json:"reportCategoryId,omitempty,string"` + // ReportCountryCode: Country where the ranking is calculated. Represented in + // the ISO 3166 format. Required in the `SELECT` clause. Condition on + // `report_country_code` is required in the `WHERE` clause. + ReportCountryCode string `json:"reportCountryCode,omitempty"` + // ReportDate: Report date. The value of this field can only be one of the + // following: * The first day of the week (Monday) for weekly reports, * The + // first day of the month for monthly reports. Required in the `SELECT` clause. + // If a `WHERE` condition on `report_date` is not specified in the query, the + // latest available weekly or monthly report is returned. + ReportDate *Date `json:"reportDate,omitempty"` + // ReportGranularity: Granularity of the report. The ranking can be done over a + // week or a month timeframe. Required in the `SELECT` clause. Condition on + // `report_granularity` is required in the `WHERE` clause. + // + // Possible values: + // "REPORT_GRANULARITY_ENUM_UNSPECIFIED" - Not specified. + // "WEEKLY" - Report is computed over a week timeframe. + // "MONTHLY" - Report is computed over a month timeframe. + ReportGranularity string `json:"reportGranularity,omitempty"` + // ForceSendFields is a list of field names (e.g. "Brand") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Brand") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *BestSellersBrandView) MarshalJSON() ([]byte, error) { + type NoMethod BestSellersBrandView + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// BestSellersProductClusterView: Fields available for query in +// `best_sellers_product_cluster_view` table. Best sellers +// (https://support.google.com/merchants/answer/9488679) report with top +// product clusters. A product cluster is a grouping for different offers and +// variants that represent the same product, for example, Google Pixel 7. +// Values are only set for fields requested explicitly in the request's search +// query. +type BestSellersProductClusterView struct { + // Brand: Brand of the product cluster. + Brand string `json:"brand,omitempty"` + // BrandInventoryStatus: Whether there is at least one product of the brand + // currently `IN_STOCK` in your product data source in at least one of the + // countries, all products are `OUT_OF_STOCK` in your product data source in + // all countries, or `NOT_IN_INVENTORY`. The field doesn't take the Best + // sellers report country filter into account. + // + // Possible values: + // "INVENTORY_STATUS_UNSPECIFIED" - Not specified. + // "IN_STOCK" - You have a product for this product cluster or brand in + // stock. + // "OUT_OF_STOCK" - You have a product for this product cluster or brand in + // inventory but it is currently out of stock. + // "NOT_IN_INVENTORY" - You do not have a product for this product cluster or + // brand in inventory. + BrandInventoryStatus string `json:"brandInventoryStatus,omitempty"` + // CategoryL1: Product category (1st level) of the product cluster, represented + // in Google's product taxonomy + // (https://support.google.com/merchants/answer/6324436). + CategoryL1 string `json:"categoryL1,omitempty"` + // CategoryL2: Product category (2nd level) of the product cluster, represented + // in Google's product taxonomy + // (https://support.google.com/merchants/answer/6324436). + CategoryL2 string `json:"categoryL2,omitempty"` + // CategoryL3: Product category (3rd level) of the product cluster, represented + // in Google's product taxonomy + // (https://support.google.com/merchants/answer/6324436). + CategoryL3 string `json:"categoryL3,omitempty"` + // CategoryL4: Product category (4th level) of the product cluster, represented + // in Google's product taxonomy + // (https://support.google.com/merchants/answer/6324436). + CategoryL4 string `json:"categoryL4,omitempty"` + // CategoryL5: Product category (5th level) of the product cluster, represented + // in Google's product taxonomy + // (https://support.google.com/merchants/answer/6324436). + CategoryL5 string `json:"categoryL5,omitempty"` + // InventoryStatus: Whether the product cluster is `IN_STOCK` in your product + // data source in at least one of the countries, `OUT_OF_STOCK` in your product + // data source in all countries, or `NOT_IN_INVENTORY` at all. The field + // doesn't take the Best sellers report country filter into account. + // + // Possible values: + // "INVENTORY_STATUS_UNSPECIFIED" - Not specified. + // "IN_STOCK" - You have a product for this product cluster or brand in + // stock. + // "OUT_OF_STOCK" - You have a product for this product cluster or brand in + // inventory but it is currently out of stock. + // "NOT_IN_INVENTORY" - You do not have a product for this product cluster or + // brand in inventory. + InventoryStatus string `json:"inventoryStatus,omitempty"` + // PreviousRank: Popularity rank in the previous week or month. + PreviousRank int64 `json:"previousRank,omitempty,string"` + // PreviousRelativeDemand: Estimated demand in relation to the product cluster + // with the highest popularity rank in the same category and country in the + // previous week or month. + // + // Possible values: + // "RELATIVE_DEMAND_ENUM_UNSPECIFIED" - Not specified. + // "VERY_LOW" - Demand is 0-5% of the demand of the highest ranked product + // cluster or brand. + // "LOW" - Demand is 6-10% of the demand of the highest ranked product + // cluster or brand. + // "MEDIUM" - Demand is 11-20% of the demand of the highest ranked product + // cluster or brand. + // "HIGH" - Demand is 21-50% of the demand of the highest ranked product + // cluster or brand. + // "VERY_HIGH" - Demand is 51-100% of the demand of the highest ranked + // product cluster or brand. + PreviousRelativeDemand string `json:"previousRelativeDemand,omitempty"` + // Rank: Popularity of the product cluster on Ads and organic surfaces, in the + // selected category and country, based on the estimated number of units sold. + Rank int64 `json:"rank,omitempty,string"` + // RelativeDemand: Estimated demand in relation to the product cluster with the + // highest popularity rank in the same category and country. + // + // Possible values: + // "RELATIVE_DEMAND_ENUM_UNSPECIFIED" - Not specified. + // "VERY_LOW" - Demand is 0-5% of the demand of the highest ranked product + // cluster or brand. + // "LOW" - Demand is 6-10% of the demand of the highest ranked product + // cluster or brand. + // "MEDIUM" - Demand is 11-20% of the demand of the highest ranked product + // cluster or brand. + // "HIGH" - Demand is 21-50% of the demand of the highest ranked product + // cluster or brand. + // "VERY_HIGH" - Demand is 51-100% of the demand of the highest ranked + // product cluster or brand. + RelativeDemand string `json:"relativeDemand,omitempty"` + // RelativeDemandChange: Change in the estimated demand. Whether it rose, sank + // or remained flat. + // + // Possible values: + // "RELATIVE_DEMAND_CHANGE_TYPE_ENUM_UNSPECIFIED" - Not specified. + // "SINKER" - Relative demand is lower than the previous time period. + // "FLAT" - Relative demand is equal to the previous time period. + // "RISER" - Relative demand is higher than the previous time period. + RelativeDemandChange string `json:"relativeDemandChange,omitempty"` + // ReportCategoryId: Google product category ID to calculate the ranking for, + // represented in Google's product taxonomy + // (https://support.google.com/merchants/answer/6324436). Required in the + // `SELECT` clause. If a `WHERE` condition on `report_category_id` is not + // specified in the query, rankings for all top-level categories are returned. + ReportCategoryId int64 `json:"reportCategoryId,omitempty,string"` + // ReportCountryCode: Country where the ranking is calculated. Represented in + // the ISO 3166 format. Required in the `SELECT` clause. Condition on + // `report_country_code` is required in the `WHERE` clause. + ReportCountryCode string `json:"reportCountryCode,omitempty"` + // ReportDate: Report date. The value of this field can only be one of the + // following: * The first day of the week (Monday) for weekly reports, * The + // first day of the month for monthly reports. Required in the `SELECT` clause. + // If a `WHERE` condition on `report_date` is not specified in the query, the + // latest available weekly or monthly report is returned. + ReportDate *Date `json:"reportDate,omitempty"` + // ReportGranularity: Granularity of the report. The ranking can be done over a + // week or a month timeframe. Required in the `SELECT` clause. Condition on + // `report_granularity` is required in the `WHERE` clause. + // + // Possible values: + // "REPORT_GRANULARITY_ENUM_UNSPECIFIED" - Not specified. + // "WEEKLY" - Report is computed over a week timeframe. + // "MONTHLY" - Report is computed over a month timeframe. + ReportGranularity string `json:"reportGranularity,omitempty"` + // Title: Title of the product cluster. + Title string `json:"title,omitempty"` + // VariantGtins: GTINs of example variants of the product cluster. + VariantGtins []string `json:"variantGtins,omitempty"` + // ForceSendFields is a list of field names (e.g. "Brand") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Brand") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *BestSellersProductClusterView) MarshalJSON() ([]byte, error) { + type NoMethod BestSellersProductClusterView + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// CompetitiveVisibilityBenchmarkView: Fields available for query in +// `competitive_visibility_benchmark_view` table. Competitive visibility +// (https://support.google.com/merchants/answer/11366442) report with the +// category benchmark. Values are only set for fields requested explicitly in +// the request's search query. +type CompetitiveVisibilityBenchmarkView struct { + // CategoryBenchmarkVisibilityTrend: Change in visibility based on impressions + // with respect to the start of the selected time range (or first day with + // non-zero impressions) for a combined set of merchants with highest + // visibility approximating the market. Cannot be filtered on in the 'WHERE' + // clause. + CategoryBenchmarkVisibilityTrend float64 `json:"categoryBenchmarkVisibilityTrend,omitempty"` + // Date: Date of this row. Required in the `SELECT` clause. A condition on + // `date` is required in the `WHERE` clause. + Date *Date `json:"date,omitempty"` + // ReportCategoryId: Google product category ID to calculate the report for, + // represented in Google's product taxonomy + // (https://support.google.com/merchants/answer/6324436). Required in the + // `SELECT` clause. A condition on `report_category_id` is required in the + // `WHERE` clause. + ReportCategoryId int64 `json:"reportCategoryId,omitempty,string"` + // ReportCountryCode: Country where impressions appeared. Required in the + // `SELECT` clause. A condition on `report_country_code` is required in the + // `WHERE` clause. + ReportCountryCode string `json:"reportCountryCode,omitempty"` + // TrafficSource: Traffic source of impressions. Required in the `SELECT` + // clause. + // + // Possible values: + // "TRAFFIC_SOURCE_ENUM_UNSPECIFIED" - Not specified. + // "ORGANIC" - Organic traffic. + // "ADS" - Traffic from ads. + // "ALL" - Organic and ads traffic. + TrafficSource string `json:"trafficSource,omitempty"` + // YourDomainVisibilityTrend: Change in visibility based on impressions for + // your domain with respect to the start of the selected time range (or first + // day with non-zero impressions). Cannot be filtered on in the 'WHERE' clause. + YourDomainVisibilityTrend float64 `json:"yourDomainVisibilityTrend,omitempty"` + // ForceSendFields is a list of field names (e.g. + // "CategoryBenchmarkVisibilityTrend") to unconditionally include in API + // requests. By default, fields with empty or default values are omitted from + // API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. + // "CategoryBenchmarkVisibilityTrend") to include in API requests with the JSON + // null value. By default, fields with empty values are omitted from API + // requests. See https://pkg.go.dev/google.golang.org/api#hdr-NullFields for + // more details. + NullFields []string `json:"-"` +} + +func (s *CompetitiveVisibilityBenchmarkView) MarshalJSON() ([]byte, error) { + type NoMethod CompetitiveVisibilityBenchmarkView + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +func (s *CompetitiveVisibilityBenchmarkView) UnmarshalJSON(data []byte) error { + type NoMethod CompetitiveVisibilityBenchmarkView + var s1 struct { + CategoryBenchmarkVisibilityTrend gensupport.JSONFloat64 `json:"categoryBenchmarkVisibilityTrend"` + YourDomainVisibilityTrend gensupport.JSONFloat64 `json:"yourDomainVisibilityTrend"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.CategoryBenchmarkVisibilityTrend = float64(s1.CategoryBenchmarkVisibilityTrend) + s.YourDomainVisibilityTrend = float64(s1.YourDomainVisibilityTrend) + return nil +} + +// CompetitiveVisibilityCompetitorView: Fields available for query in +// `competitive_visibility_competitor_view` table. Competitive visibility +// (https://support.google.com/merchants/answer/11366442) report with +// businesses with similar visibility. Values are only set for fields requested +// explicitly in the request's search query. +type CompetitiveVisibilityCompetitorView struct { + // AdsOrganicRatio: [Ads / organic ratio] + // (https://support.google.com/merchants/answer/11366442#zippy=%2Cads-free-ratio) + // shows how often the domain receives impressions from Shopping ads compared + // to organic traffic. The number is rounded and bucketed. Cannot be filtered + // on in the 'WHERE' clause. + AdsOrganicRatio float64 `json:"adsOrganicRatio,omitempty"` + // Date: Date of this row. A condition on `date` is required in the `WHERE` + // clause. + Date *Date `json:"date,omitempty"` + // Domain: Domain of your competitor or your domain, if 'is_your_domain' is + // true. Required in the `SELECT` clause. Cannot be filtered on in the 'WHERE' + // clause. + Domain string `json:"domain,omitempty"` + // HigherPositionRate: [Higher position rate] + // (https://support.google.com/merchants/answer/11366442#zippy=%2Chigher-position-rate) + // shows how often a competitor’s offer got placed in a higher position on + // the page than your offer. Cannot be filtered on in the 'WHERE' clause. + HigherPositionRate float64 `json:"higherPositionRate,omitempty"` + // IsYourDomain: True if this row contains data for your domain. Cannot be + // filtered on in the 'WHERE' clause. + IsYourDomain bool `json:"isYourDomain,omitempty"` + // PageOverlapRate: [Page overlap rate] + // (https://support.google.com/merchants/answer/11366442#zippy=%2Cpage-overlap-rate) + // shows how frequently competing retailers’ offers are shown together with + // your offers on the same page. Cannot be filtered on in the 'WHERE' clause. + PageOverlapRate float64 `json:"pageOverlapRate,omitempty"` + // Rank: Position of the domain in the similar businesses ranking for the + // selected keys (`date`, `report_category_id`, `report_country_code`, + // `traffic_source`) based on impressions. 1 is the highest. Cannot be filtered + // on in the 'WHERE' clause. + Rank int64 `json:"rank,omitempty,string"` + // RelativeVisibility: [Relative visibility] + // (https://support.google.com/merchants/answer/11366442#zippy=%2Crelative-visibility) + // shows how often your competitors’ offers are shown compared to your + // offers. In other words, this is the number of displayed impressions of a + // competitor retailer divided by the number of your displayed impressions + // during a selected time range for a selected product category and country. + // Cannot be filtered on in the 'WHERE' clause. + RelativeVisibility float64 `json:"relativeVisibility,omitempty"` + // ReportCategoryId: Google product category ID to calculate the report for, + // represented in Google's product taxonomy + // (https://support.google.com/merchants/answer/6324436). Required in the + // `SELECT` clause. A condition on `report_category_id` is required in the + // `WHERE` clause. + ReportCategoryId int64 `json:"reportCategoryId,omitempty,string"` + // ReportCountryCode: Country where impressions appeared. Required in the + // `SELECT` clause. A condition on `report_country_code` is required in the + // `WHERE` clause. + ReportCountryCode string `json:"reportCountryCode,omitempty"` + // TrafficSource: Traffic source of impressions. Required in the `SELECT` + // clause. + // + // Possible values: + // "TRAFFIC_SOURCE_ENUM_UNSPECIFIED" - Not specified. + // "ORGANIC" - Organic traffic. + // "ADS" - Traffic from ads. + // "ALL" - Organic and ads traffic. + TrafficSource string `json:"trafficSource,omitempty"` + // ForceSendFields is a list of field names (e.g. "AdsOrganicRatio") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AdsOrganicRatio") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *CompetitiveVisibilityCompetitorView) MarshalJSON() ([]byte, error) { + type NoMethod CompetitiveVisibilityCompetitorView + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +func (s *CompetitiveVisibilityCompetitorView) UnmarshalJSON(data []byte) error { + type NoMethod CompetitiveVisibilityCompetitorView + var s1 struct { + AdsOrganicRatio gensupport.JSONFloat64 `json:"adsOrganicRatio"` + HigherPositionRate gensupport.JSONFloat64 `json:"higherPositionRate"` + PageOverlapRate gensupport.JSONFloat64 `json:"pageOverlapRate"` + RelativeVisibility gensupport.JSONFloat64 `json:"relativeVisibility"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.AdsOrganicRatio = float64(s1.AdsOrganicRatio) + s.HigherPositionRate = float64(s1.HigherPositionRate) + s.PageOverlapRate = float64(s1.PageOverlapRate) + s.RelativeVisibility = float64(s1.RelativeVisibility) + return nil +} + +// CompetitiveVisibilityTopMerchantView: Fields available for query in +// `competitive_visibility_top_merchant_view` table. Competitive visibility +// (https://support.google.com/merchants/answer/11366442) report with business +// with highest visibility. Values are only set for fields requested explicitly +// in the request's search query. +type CompetitiveVisibilityTopMerchantView struct { + // AdsOrganicRatio: [Ads / organic ratio] + // (https://support.google.com/merchants/answer/11366442#zippy=%2Cads-free-ratio) + // shows how often the domain receives impressions from Shopping ads compared + // to organic traffic. The number is rounded and bucketed. Cannot be filtered + // on in the 'WHERE' clause. + AdsOrganicRatio float64 `json:"adsOrganicRatio,omitempty"` + // Date: Date of this row. Cannot be selected in the `SELECT` clause. A + // condition on `date` is required in the `WHERE` clause. + Date *Date `json:"date,omitempty"` + // Domain: Domain of your competitor or your domain, if 'is_your_domain' is + // true. Required in the `SELECT` clause. Cannot be filtered on in the 'WHERE' + // clause. + Domain string `json:"domain,omitempty"` + // HigherPositionRate: [Higher position rate] + // (https://support.google.com/merchants/answer/11366442#zippy=%2Chigher-position-rate) + // shows how often a competitor’s offer got placed in a higher position on + // the page than your offer. Cannot be filtered on in the 'WHERE' clause. + HigherPositionRate float64 `json:"higherPositionRate,omitempty"` + // IsYourDomain: True if this row contains data for your domain. Cannot be + // filtered on in the 'WHERE' clause. + IsYourDomain bool `json:"isYourDomain,omitempty"` + // PageOverlapRate: [Page overlap rate] + // (https://support.google.com/merchants/answer/11366442#zippy=%2Cpage-overlap-rate) + // shows how frequently competing retailers’ offers are shown together with + // your offers on the same page. Cannot be filtered on in the 'WHERE' clause. + PageOverlapRate float64 `json:"pageOverlapRate,omitempty"` + // Rank: Position of the domain in the top merchants ranking for the selected + // keys (`date`, `report_category_id`, `report_country_code`, `traffic_source`) + // based on impressions. 1 is the highest. Cannot be filtered on in the 'WHERE' + // clause. + Rank int64 `json:"rank,omitempty,string"` + // ReportCategoryId: Google product category ID to calculate the report for, + // represented in Google's product taxonomy + // (https://support.google.com/merchants/answer/6324436). Required in the + // `SELECT` clause. A condition on `report_category_id` is required in the + // `WHERE` clause. + ReportCategoryId int64 `json:"reportCategoryId,omitempty,string"` + // ReportCountryCode: Country where impressions appeared. Required in the + // `SELECT` clause. A condition on `report_country_code` is required in the + // `WHERE` clause. + ReportCountryCode string `json:"reportCountryCode,omitempty"` + // TrafficSource: Traffic source of impressions. Required in the `SELECT` + // clause. + // + // Possible values: + // "TRAFFIC_SOURCE_ENUM_UNSPECIFIED" - Not specified. + // "ORGANIC" - Organic traffic. + // "ADS" - Traffic from ads. + // "ALL" - Organic and ads traffic. + TrafficSource string `json:"trafficSource,omitempty"` + // ForceSendFields is a list of field names (e.g. "AdsOrganicRatio") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AdsOrganicRatio") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *CompetitiveVisibilityTopMerchantView) MarshalJSON() ([]byte, error) { + type NoMethod CompetitiveVisibilityTopMerchantView + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +func (s *CompetitiveVisibilityTopMerchantView) UnmarshalJSON(data []byte) error { + type NoMethod CompetitiveVisibilityTopMerchantView + var s1 struct { + AdsOrganicRatio gensupport.JSONFloat64 `json:"adsOrganicRatio"` + HigherPositionRate gensupport.JSONFloat64 `json:"higherPositionRate"` + PageOverlapRate gensupport.JSONFloat64 `json:"pageOverlapRate"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.AdsOrganicRatio = float64(s1.AdsOrganicRatio) + s.HigherPositionRate = float64(s1.HigherPositionRate) + s.PageOverlapRate = float64(s1.PageOverlapRate) + return nil +} + +// Date: Represents a whole or partial calendar date, such as a birthday. The +// time of day and time zone are either specified elsewhere or are +// insignificant. The date is relative to the Gregorian Calendar. This can +// represent one of the following: * A full date, with non-zero year, month, +// and day values. * A month and day, with a zero year (for example, an +// anniversary). * A year on its own, with a zero month and a zero day. * A +// year and month, with a zero day (for example, a credit card expiration +// date). Related types: * google.type.TimeOfDay * google.type.DateTime * +// google.protobuf.Timestamp +type Date struct { + // Day: Day of a month. Must be from 1 to 31 and valid for the year and month, + // or 0 to specify a year by itself or a year and month where the day isn't + // significant. + Day int64 `json:"day,omitempty"` + // Month: Month of a year. Must be from 1 to 12, or 0 to specify a year without + // a month and day. + Month int64 `json:"month,omitempty"` + // Year: Year of the date. Must be from 1 to 9999, or 0 to specify a date + // without a year. + Year int64 `json:"year,omitempty"` + // ForceSendFields is a list of field names (e.g. "Day") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Day") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Date) MarshalJSON() ([]byte, error) { + type NoMethod Date + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// IssueSeverityPerReportingContext: Issue severity per reporting context. +type IssueSeverityPerReportingContext struct { + // DemotedCountries: List of demoted countries in the reporting context, + // represented in ISO 3166 format. + DemotedCountries []string `json:"demotedCountries,omitempty"` + // DisapprovedCountries: List of disapproved countries in the reporting + // context, represented in ISO 3166 format. + DisapprovedCountries []string `json:"disapprovedCountries,omitempty"` + // ReportingContext: Reporting context the issue applies to. + // + // Possible values: + // "REPORTING_CONTEXT_ENUM_UNSPECIFIED" - Not specified. + // "SHOPPING_ADS" - [Shopping + // ads](https://support.google.com/merchants/answer/6149970). + // "DISCOVERY_ADS" - Deprecated: Use `DEMAND_GEN_ADS` instead. [Discovery and + // Demand Gen ads](https://support.google.com/merchants/answer/13389785). + // "DEMAND_GEN_ADS" - [Demand Gen + // ads](https://support.google.com/merchants/answer/13389785). + // "DEMAND_GEN_ADS_DISCOVER_SURFACE" - [Demand Gen ads on Discover + // surface](https://support.google.com/merchants/answer/13389785). + // "VIDEO_ADS" - [Video + // ads](https://support.google.com/google-ads/answer/6340491). + // "DISPLAY_ADS" - [Display + // ads](https://support.google.com/merchants/answer/6069387). + // "LOCAL_INVENTORY_ADS" - [Local inventory + // ads](https://support.google.com/merchants/answer/3271956). + // "VEHICLE_INVENTORY_ADS" - [Vehicle inventory + // ads](https://support.google.com/merchants/answer/11544533). + // "FREE_LISTINGS" - [Free product + // listings](https://support.google.com/merchants/answer/9199328). + // "FREE_LOCAL_LISTINGS" - [Free local product + // listings](https://support.google.com/merchants/answer/9825611). + // "FREE_LOCAL_VEHICLE_LISTINGS" - [Free local vehicle + // listings](https://support.google.com/merchants/answer/11544533). + // "YOUTUBE_SHOPPING" - [YouTube + // Shopping](https://support.google.com/merchants/answer/13478370). + // "CLOUD_RETAIL" - [Cloud + // retail](https://cloud.google.com/solutions/retail). + // "LOCAL_CLOUD_RETAIL" - [Local cloud + // retail](https://cloud.google.com/solutions/retail). + ReportingContext string `json:"reportingContext,omitempty"` + // ForceSendFields is a list of field names (e.g. "DemotedCountries") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "DemotedCountries") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *IssueSeverityPerReportingContext) MarshalJSON() ([]byte, error) { + type NoMethod IssueSeverityPerReportingContext + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ItemIssue: Item issue associated with the product. +type ItemIssue struct { + // Resolution: Item issue resolution. + // + // Possible values: + // "ITEM_ISSUE_RESOLUTION_UNSPECIFIED" - Not specified. + // "MERCHANT_ACTION" - The merchant has to fix the issue. + // "PENDING_PROCESSING" - The issue will be resolved automatically (for + // example, image crawl) or through a Google review. No merchant action is + // required now. Resolution might lead to another issue (for example, if crawl + // fails). + Resolution string `json:"resolution,omitempty"` + // Severity: Item issue severity. + Severity *ItemIssueSeverity `json:"severity,omitempty"` + // Type: Item issue type. + Type *ItemIssueType `json:"type,omitempty"` + // ForceSendFields is a list of field names (e.g. "Resolution") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Resolution") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ItemIssue) MarshalJSON() ([]byte, error) { + type NoMethod ItemIssue + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ItemIssueSeverity: How the issue affects the serving of the product. +type ItemIssueSeverity struct { + // AggregatedSeverity: Aggregated severity of the issue for all reporting + // contexts it affects. **This field can be used for filtering the results.** + // + // Possible values: + // "AGGREGATED_ISSUE_SEVERITY_UNSPECIFIED" - Not specified. + // "DISAPPROVED" - Issue disapproves the product in at least one reporting + // context. + // "DEMOTED" - Issue demotes the product in all reporting contexts it + // affects. + // "PENDING" - Issue resolution is `PENDING_PROCESSING`. + AggregatedSeverity string `json:"aggregatedSeverity,omitempty"` + // SeverityPerReportingContext: Issue severity per reporting context. + SeverityPerReportingContext []*IssueSeverityPerReportingContext `json:"severityPerReportingContext,omitempty"` + // ForceSendFields is a list of field names (e.g. "AggregatedSeverity") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AggregatedSeverity") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ItemIssueSeverity) MarshalJSON() ([]byte, error) { + type NoMethod ItemIssueSeverity + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ItemIssueType: Issue type. +type ItemIssueType struct { + // CanonicalAttribute: Canonical attribute name for attribute-specific issues. + CanonicalAttribute string `json:"canonicalAttribute,omitempty"` + // Code: Error code of the issue, equivalent to the `code` of Product issues + // (https://developers.google.com/shopping-content/guides/product-issues). + Code string `json:"code,omitempty"` + // ForceSendFields is a list of field names (e.g. "CanonicalAttribute") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "CanonicalAttribute") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ItemIssueType) MarshalJSON() ([]byte, error) { + type NoMethod ItemIssueType + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// NonProductPerformanceView: Fields available for query in +// `non_product_performance_view` table. Performance data on images and online +// store links leading to your non-product pages. This includes performance +// metrics (for example, `clicks`) and dimensions according to which +// performance metrics are segmented (for example, `date`). Segment fields +// cannot be selected in queries without also selecting at least one metric +// field. Values are only set for fields requested explicitly in the request's +// search query. +type NonProductPerformanceView struct { + // ClickThroughRate: Click-through rate - the number of clicks (`clicks`) + // divided by the number of impressions (`impressions`) of images and online + // store links leading to your non-product pages. Metric. + ClickThroughRate float64 `json:"clickThroughRate,omitempty"` + // Clicks: Number of clicks on images and online store links leading to your + // non-product pages. Metric. + Clicks int64 `json:"clicks,omitempty,string"` + // Date: Date in the merchant timezone to which metrics apply. Segment. + // Condition on `date` is required in the `WHERE` clause. + Date *Date `json:"date,omitempty"` + // Impressions: Number of times images and online store links leading to your + // non-product pages were shown. Metric. + Impressions int64 `json:"impressions,omitempty,string"` + // Week: First day of the week (Monday) of the metrics date in the merchant + // timezone. Segment. + Week *Date `json:"week,omitempty"` + // ForceSendFields is a list of field names (e.g. "ClickThroughRate") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ClickThroughRate") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *NonProductPerformanceView) MarshalJSON() ([]byte, error) { + type NoMethod NonProductPerformanceView + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +func (s *NonProductPerformanceView) UnmarshalJSON(data []byte) error { + type NoMethod NonProductPerformanceView + var s1 struct { + ClickThroughRate gensupport.JSONFloat64 `json:"clickThroughRate"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.ClickThroughRate = float64(s1.ClickThroughRate) + return nil +} + +// Price: The price represented as a number and currency. +type Price struct { + // AmountMicros: The price represented as a number in micros (1 million micros + // is an equivalent to one's currency standard unit, for example, 1 USD = + // 1000000 micros). + AmountMicros int64 `json:"amountMicros,omitempty,string"` + // CurrencyCode: The currency of the price using three-letter acronyms + // according to ISO 4217 (http://en.wikipedia.org/wiki/ISO_4217). + CurrencyCode string `json:"currencyCode,omitempty"` + // ForceSendFields is a list of field names (e.g. "AmountMicros") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AmountMicros") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *Price) MarshalJSON() ([]byte, error) { + type NoMethod Price + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// PriceCompetitivenessProductView: Fields available for query in +// `price_competitiveness_product_view` table. Price competitiveness +// (https://support.google.com/merchants/answer/9626903) report. Values are +// only set for fields requested explicitly in the request's search query. +type PriceCompetitivenessProductView struct { + // BenchmarkPrice: Latest available price benchmark for the product's catalog + // in the benchmark country. + BenchmarkPrice *Price `json:"benchmarkPrice,omitempty"` + // Brand: Brand of the product. + Brand string `json:"brand,omitempty"` + // CategoryL1: Product category (1st level) in Google's product taxonomy + // (https://support.google.com/merchants/answer/6324436). + CategoryL1 string `json:"categoryL1,omitempty"` + // CategoryL2: Product category (2nd level) in Google's product taxonomy + // (https://support.google.com/merchants/answer/6324436). + CategoryL2 string `json:"categoryL2,omitempty"` + // CategoryL3: Product category (3rd level) in Google's product taxonomy + // (https://support.google.com/merchants/answer/6324436). + CategoryL3 string `json:"categoryL3,omitempty"` + // CategoryL4: Product category (4th level) in Google's product taxonomy + // (https://support.google.com/merchants/answer/6324436). + CategoryL4 string `json:"categoryL4,omitempty"` + // CategoryL5: Product category (5th level) in Google's product taxonomy + // (https://support.google.com/merchants/answer/6324436). + CategoryL5 string `json:"categoryL5,omitempty"` + // Id: REST ID of the product, in the form of + // `channel~languageCode~feedLabel~offerId`. Can be used to join data with the + // `product_view` table. Required in the `SELECT` clause. + Id string `json:"id,omitempty"` + // OfferId: Merchant-provided id of the product. + OfferId string `json:"offerId,omitempty"` + // Price: Current price of the product. + Price *Price `json:"price,omitempty"` + // ProductTypeL1: Product type (1st level) in merchant's own product taxonomy + // (https://support.google.com/merchants/answer/6324406). + ProductTypeL1 string `json:"productTypeL1,omitempty"` + // ProductTypeL2: Product type (2nd level) in merchant's own product taxonomy + // (https://support.google.com/merchants/answer/6324406). + ProductTypeL2 string `json:"productTypeL2,omitempty"` + // ProductTypeL3: Product type (3rd level) in merchant's own product taxonomy + // (https://support.google.com/merchants/answer/6324406). + ProductTypeL3 string `json:"productTypeL3,omitempty"` + // ProductTypeL4: Product type (4th level) in merchant's own product taxonomy + // (https://support.google.com/merchants/answer/6324406). + ProductTypeL4 string `json:"productTypeL4,omitempty"` + // ProductTypeL5: Product type (5th level) in merchant's own product taxonomy + // (https://support.google.com/merchants/answer/6324406). + ProductTypeL5 string `json:"productTypeL5,omitempty"` + // ReportCountryCode: Country of the price benchmark. Represented in the ISO + // 3166 format. Required in the `SELECT` clause. + ReportCountryCode string `json:"reportCountryCode,omitempty"` + // Title: Title of the product. + Title string `json:"title,omitempty"` + // ForceSendFields is a list of field names (e.g. "BenchmarkPrice") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "BenchmarkPrice") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *PriceCompetitivenessProductView) MarshalJSON() ([]byte, error) { + type NoMethod PriceCompetitivenessProductView + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// PriceInsightsProductView: Fields available for query in +// `price_insights_product_view` table. Price insights +// (https://support.google.com/merchants/answer/11916926) report. Values are +// only set for fields requested explicitly in the request's search query. +type PriceInsightsProductView struct { + // Brand: Brand of the product. + Brand string `json:"brand,omitempty"` + // CategoryL1: Product category (1st level) in Google's product taxonomy + // (https://support.google.com/merchants/answer/6324436). + CategoryL1 string `json:"categoryL1,omitempty"` + // CategoryL2: Product category (2nd level) in Google's product taxonomy + // (https://support.google.com/merchants/answer/6324436). + CategoryL2 string `json:"categoryL2,omitempty"` + // CategoryL3: Product category (3rd level) in Google's product taxonomy + // (https://support.google.com/merchants/answer/6324436). + CategoryL3 string `json:"categoryL3,omitempty"` + // CategoryL4: Product category (4th level) in Google's product taxonomy + // (https://support.google.com/merchants/answer/6324436). + CategoryL4 string `json:"categoryL4,omitempty"` + // CategoryL5: Product category (5th level) in Google's product taxonomy + // (https://support.google.com/merchants/answer/6324436). + CategoryL5 string `json:"categoryL5,omitempty"` + // Effectiveness: The predicted effectiveness of applying the price suggestion, + // bucketed. + // + // Possible values: + // "EFFECTIVENESS_UNSPECIFIED" - Effectiveness is unknown. + // "LOW" - Effectiveness is low. + // "MEDIUM" - Effectiveness is medium. + // "HIGH" - Effectiveness is high. + Effectiveness string `json:"effectiveness,omitempty"` + // Id: REST ID of the product, in the form of + // `channel~languageCode~feedLabel~offerId`. Can be used to join data with the + // `product_view` table. Required in the `SELECT` clause. + Id string `json:"id,omitempty"` + // OfferId: Merchant-provided id of the product. + OfferId string `json:"offerId,omitempty"` + // PredictedClicksChangeFraction: Predicted change in clicks as a fraction + // after introducing the suggested price compared to current active price. For + // example, 0.05 is a 5% predicted increase in clicks. + PredictedClicksChangeFraction float64 `json:"predictedClicksChangeFraction,omitempty"` + // PredictedConversionsChangeFraction: Predicted change in conversions as a + // fraction after introducing the suggested price compared to current active + // price. For example, 0.05 is a 5% predicted increase in conversions). + PredictedConversionsChangeFraction float64 `json:"predictedConversionsChangeFraction,omitempty"` + // PredictedImpressionsChangeFraction: Predicted change in impressions as a + // fraction after introducing the suggested price compared to current active + // price. For example, 0.05 is a 5% predicted increase in impressions. + PredictedImpressionsChangeFraction float64 `json:"predictedImpressionsChangeFraction,omitempty"` + // Price: Current price of the product. + Price *Price `json:"price,omitempty"` + // ProductTypeL1: Product type (1st level) in merchant's own product taxonomy + // (https://support.google.com/merchants/answer/6324406). + ProductTypeL1 string `json:"productTypeL1,omitempty"` + // ProductTypeL2: Product type (2nd level) in merchant's own product taxonomy + // (https://support.google.com/merchants/answer/6324406). + ProductTypeL2 string `json:"productTypeL2,omitempty"` + // ProductTypeL3: Product type (3rd level) in merchant's own product taxonomy + // (https://support.google.com/merchants/answer/6324406). + ProductTypeL3 string `json:"productTypeL3,omitempty"` + // ProductTypeL4: Product type (4th level) in merchant's own product taxonomy + // (https://support.google.com/merchants/answer/6324406). + ProductTypeL4 string `json:"productTypeL4,omitempty"` + // ProductTypeL5: Product type (5th level) in merchant's own product taxonomy + // (https://support.google.com/merchants/answer/6324406). + ProductTypeL5 string `json:"productTypeL5,omitempty"` + // SuggestedPrice: Latest suggested price for the product. + SuggestedPrice *Price `json:"suggestedPrice,omitempty"` + // Title: Title of the product. + Title string `json:"title,omitempty"` + // ForceSendFields is a list of field names (e.g. "Brand") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Brand") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *PriceInsightsProductView) MarshalJSON() ([]byte, error) { + type NoMethod PriceInsightsProductView + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +func (s *PriceInsightsProductView) UnmarshalJSON(data []byte) error { + type NoMethod PriceInsightsProductView + var s1 struct { + PredictedClicksChangeFraction gensupport.JSONFloat64 `json:"predictedClicksChangeFraction"` + PredictedConversionsChangeFraction gensupport.JSONFloat64 `json:"predictedConversionsChangeFraction"` + PredictedImpressionsChangeFraction gensupport.JSONFloat64 `json:"predictedImpressionsChangeFraction"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.PredictedClicksChangeFraction = float64(s1.PredictedClicksChangeFraction) + s.PredictedConversionsChangeFraction = float64(s1.PredictedConversionsChangeFraction) + s.PredictedImpressionsChangeFraction = float64(s1.PredictedImpressionsChangeFraction) + return nil +} + +// ProductChange: The change that happened to the product including old value, +// new value, country code as the region code and reporting context. +type ProductChange struct { + // NewValue: The new value of the changed resource or attribute. + NewValue string `json:"newValue,omitempty"` + // OldValue: The old value of the changed resource or attribute. + OldValue string `json:"oldValue,omitempty"` + // RegionCode: Countries that have the change (if applicable) + RegionCode string `json:"regionCode,omitempty"` + // ReportingContext: Reporting contexts that have the change (if applicable) + // + // Possible values: + // "REPORTING_CONTEXT_ENUM_UNSPECIFIED" - Not specified. + // "SHOPPING_ADS" - [Shopping + // ads](https://support.google.com/merchants/answer/6149970). + // "DISCOVERY_ADS" - Deprecated: Use `DEMAND_GEN_ADS` instead. [Discovery and + // Demand Gen ads](https://support.google.com/merchants/answer/13389785). + // "DEMAND_GEN_ADS" - [Demand Gen + // ads](https://support.google.com/merchants/answer/13389785). + // "DEMAND_GEN_ADS_DISCOVER_SURFACE" - [Demand Gen ads on Discover + // surface](https://support.google.com/merchants/answer/13389785). + // "VIDEO_ADS" - [Video + // ads](https://support.google.com/google-ads/answer/6340491). + // "DISPLAY_ADS" - [Display + // ads](https://support.google.com/merchants/answer/6069387). + // "LOCAL_INVENTORY_ADS" - [Local inventory + // ads](https://support.google.com/merchants/answer/3271956). + // "VEHICLE_INVENTORY_ADS" - [Vehicle inventory + // ads](https://support.google.com/merchants/answer/11544533). + // "FREE_LISTINGS" - [Free product + // listings](https://support.google.com/merchants/answer/9199328). + // "FREE_LOCAL_LISTINGS" - [Free local product + // listings](https://support.google.com/merchants/answer/9825611). + // "FREE_LOCAL_VEHICLE_LISTINGS" - [Free local vehicle + // listings](https://support.google.com/merchants/answer/11544533). + // "YOUTUBE_SHOPPING" - [YouTube + // Shopping](https://support.google.com/merchants/answer/13478370). + // "CLOUD_RETAIL" - [Cloud + // retail](https://cloud.google.com/solutions/retail). + // "LOCAL_CLOUD_RETAIL" - [Local cloud + // retail](https://cloud.google.com/solutions/retail). + ReportingContext string `json:"reportingContext,omitempty"` + // ForceSendFields is a list of field names (e.g. "NewValue") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "NewValue") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ProductChange) MarshalJSON() ([]byte, error) { + type NoMethod ProductChange + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ProductPerformanceView: Fields available for query in +// `product_performance_view` table. Product performance data for your account, +// including performance metrics (for example, `clicks`) and dimensions +// according to which performance metrics are segmented (for example, +// `offer_id`). Values of product dimensions, such as `offer_id`, reflect the +// state of a product at the time of the impression. Segment fields cannot be +// selected in queries without also selecting at least one metric field. Values +// are only set for fields requested explicitly in the request's search query. +type ProductPerformanceView struct { + // Brand: Brand of the product. Segment. + Brand string `json:"brand,omitempty"` + // CategoryL1: Product category (1st level) + // (https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) + // in Google's product taxonomy. Segment. + CategoryL1 string `json:"categoryL1,omitempty"` + // CategoryL2: Product category (2nd level) + // (https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) + // in Google's product taxonomy. Segment. + CategoryL2 string `json:"categoryL2,omitempty"` + // CategoryL3: Product category (3rd level) + // (https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) + // in Google's product taxonomy. Segment. + CategoryL3 string `json:"categoryL3,omitempty"` + // CategoryL4: Product category (4th level) + // (https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) + // in Google's product taxonomy. Segment. + CategoryL4 string `json:"categoryL4,omitempty"` + // CategoryL5: Product category (5th level) + // (https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) + // in Google's product taxonomy. Segment. + CategoryL5 string `json:"categoryL5,omitempty"` + // ClickThroughRate: Click-through rate - the number of clicks merchant's + // products receive (clicks) divided by the number of times the products are + // shown (impressions). Metric. + ClickThroughRate float64 `json:"clickThroughRate,omitempty"` + // Clicks: Number of clicks. Metric. + Clicks int64 `json:"clicks,omitempty,string"` + // ConversionRate: Number of conversions divided by the number of clicks, + // reported on the impression date. Metric. Available only for the `FREE` + // traffic source. + ConversionRate float64 `json:"conversionRate,omitempty"` + // ConversionValue: Value of conversions attributed to the product, reported on + // the conversion date. Metric. Available only for the `FREE` traffic source. + ConversionValue *Price `json:"conversionValue,omitempty"` + // Conversions: Number of conversions attributed to the product, reported on + // the conversion date. Depending on the attribution model, a conversion might + // be distributed across multiple clicks, where each click gets its own credit + // assigned. This metric is a sum of all such credits. Metric. Available only + // for the `FREE` traffic source. + Conversions float64 `json:"conversions,omitempty"` + // CustomLabel0: Custom label 0 for custom grouping of products. Segment. + CustomLabel0 string `json:"customLabel0,omitempty"` + // CustomLabel1: Custom label 1 for custom grouping of products. Segment. + CustomLabel1 string `json:"customLabel1,omitempty"` + // CustomLabel2: Custom label 2 for custom grouping of products. Segment. + CustomLabel2 string `json:"customLabel2,omitempty"` + // CustomLabel3: Custom label 3 for custom grouping of products. Segment. + CustomLabel3 string `json:"customLabel3,omitempty"` + // CustomLabel4: Custom label 4 for custom grouping of products. Segment. + CustomLabel4 string `json:"customLabel4,omitempty"` + // CustomerCountryCode: Code of the country where the customer is located at + // the time of the event. Represented in the ISO 3166 format. Segment. If the + // customer country cannot be determined, a special 'ZZ' code is returned. + CustomerCountryCode string `json:"customerCountryCode,omitempty"` + // Date: Date in the merchant timezone to which metrics apply. Segment. + // Condition on `date` is required in the `WHERE` clause. + Date *Date `json:"date,omitempty"` + // Impressions: Number of times merchant's products are shown. Metric. + Impressions int64 `json:"impressions,omitempty,string"` + // MarketingMethod: Marketing method to which metrics apply. Segment. + // + // Possible values: + // "MARKETING_METHOD_ENUM_UNSPECIFIED" - Not specified. + // "ORGANIC" - Organic marketing. + // "ADS" - Ads-based marketing. + MarketingMethod string `json:"marketingMethod,omitempty"` + // OfferId: Merchant-provided id of the product. Segment. + OfferId string `json:"offerId,omitempty"` + // ProductTypeL1: Product type (1st level) + // (https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) + // in merchant's own product taxonomy. Segment. + ProductTypeL1 string `json:"productTypeL1,omitempty"` + // ProductTypeL2: Product type (2nd level) + // (https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) + // in merchant's own product taxonomy. Segment. + ProductTypeL2 string `json:"productTypeL2,omitempty"` + // ProductTypeL3: Product type (3rd level) + // (https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) + // in merchant's own product taxonomy. Segment. + ProductTypeL3 string `json:"productTypeL3,omitempty"` + // ProductTypeL4: Product type (4th level) + // (https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) + // in merchant's own product taxonomy. Segment. + ProductTypeL4 string `json:"productTypeL4,omitempty"` + // ProductTypeL5: Product type (5th level) + // (https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) + // in merchant's own product taxonomy. Segment. + ProductTypeL5 string `json:"productTypeL5,omitempty"` + // Title: Title of the product. Segment. + Title string `json:"title,omitempty"` + // Week: First day of the week (Monday) of the metrics date in the merchant + // timezone. Segment. + Week *Date `json:"week,omitempty"` + // ForceSendFields is a list of field names (e.g. "Brand") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Brand") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ProductPerformanceView) MarshalJSON() ([]byte, error) { + type NoMethod ProductPerformanceView + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +func (s *ProductPerformanceView) UnmarshalJSON(data []byte) error { + type NoMethod ProductPerformanceView + var s1 struct { + ClickThroughRate gensupport.JSONFloat64 `json:"clickThroughRate"` + ConversionRate gensupport.JSONFloat64 `json:"conversionRate"` + Conversions gensupport.JSONFloat64 `json:"conversions"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.ClickThroughRate = float64(s1.ClickThroughRate) + s.ConversionRate = float64(s1.ConversionRate) + s.Conversions = float64(s1.Conversions) + return nil +} + +// ProductStatusChangeMessage: The message that the merchant will receive to +// notify about product status change event +type ProductStatusChangeMessage struct { + // Account: The target account that owns the entity that changed. Format : + // `accounts/{merchant_id}` + Account string `json:"account,omitempty"` + // Attribute: The attribute in the resource that changed, in this case it will + // be always `Status`. + // + // Possible values: + // "ATTRIBUTE_UNSPECIFIED" - Unspecified attribute + // "STATUS" - Status of the changed entity + Attribute string `json:"attribute,omitempty"` + // Changes: A message to describe the change that happened to the product + Changes []*ProductChange `json:"changes,omitempty"` + // ManagingAccount: The account that manages the merchant's account. can be the + // same as merchant id if it is standalone account. Format : + // `accounts/{service_provider_id}` + ManagingAccount string `json:"managingAccount,omitempty"` + // Resource: The product name. Format: + // `{product.name=accounts/{account}/products/{product}}` + Resource string `json:"resource,omitempty"` + // ResourceId: The product id. + ResourceId string `json:"resourceId,omitempty"` + // ResourceType: The resource that changed, in this case it will always be + // `Product`. + // + // Possible values: + // "RESOURCE_UNSPECIFIED" - Unspecified resource + // "PRODUCT" - Resource type : product + ResourceType string `json:"resourceType,omitempty"` + // ForceSendFields is a list of field names (e.g. "Account") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Account") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ProductStatusChangeMessage) MarshalJSON() ([]byte, error) { + type NoMethod ProductStatusChangeMessage + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ProductView: Fields available for query in `product_view` table. Products in +// the current inventory. Products in this table are the same as in Products +// sub-API but not all product attributes from Products sub-API are available +// for query in this table. In contrast to Products sub-API, this table allows +// to filter the returned list of products by product attributes. To retrieve a +// single product by `id` or list all products, Products sub-API should be +// used. Values are only set for fields requested explicitly in the request's +// search query. +type ProductView struct { + // AggregatedReportingContextStatus: Aggregated status. + // + // Possible values: + // "AGGREGATED_REPORTING_CONTEXT_STATUS_UNSPECIFIED" - Not specified. + // "NOT_ELIGIBLE_OR_DISAPPROVED" - Product is not eligible or is disapproved + // for all reporting contexts. + // "PENDING" - Product's status is pending in all reporting contexts. + // "ELIGIBLE_LIMITED" - Product is eligible for some (but not all) reporting + // contexts. + // "ELIGIBLE" - Product is eligible for all reporting contexts. + AggregatedReportingContextStatus string `json:"aggregatedReportingContextStatus,omitempty"` + // Availability: Availability + // (https://support.google.com/merchants/answer/6324448) of the product. + Availability string `json:"availability,omitempty"` + // Brand: Brand of the product. + Brand string `json:"brand,omitempty"` + // CategoryL1: Product category (1st level) in Google's product taxonomy + // (https://support.google.com/merchants/answer/6324436). + CategoryL1 string `json:"categoryL1,omitempty"` + // CategoryL2: Product category (2nd level) in Google's product taxonomy + // (https://support.google.com/merchants/answer/6324436). + CategoryL2 string `json:"categoryL2,omitempty"` + // CategoryL3: Product category (3rd level) in Google's product taxonomy + // (https://support.google.com/merchants/answer/6324436). + CategoryL3 string `json:"categoryL3,omitempty"` + // CategoryL4: Product category (4th level) in Google's product taxonomy + // (https://support.google.com/merchants/answer/6324436). + CategoryL4 string `json:"categoryL4,omitempty"` + // CategoryL5: Product category (5th level) in Google's product taxonomy + // (https://support.google.com/merchants/answer/6324436). + CategoryL5 string `json:"categoryL5,omitempty"` + // Channel: Channel of the product. Can be `ONLINE` or `LOCAL`. + // + // Possible values: + // "CHANNEL_ENUM_UNSPECIFIED" - Not specified. + // "ONLINE" - Online product. + // "LOCAL" - Local product. + Channel string `json:"channel,omitempty"` + // ClickPotential: Estimated performance potential compared to highest + // performing products of the merchant. + // + // Possible values: + // "CLICK_POTENTIAL_UNSPECIFIED" - Unknown predicted clicks impact. + // "LOW" - Potential to receive a low number of clicks compared to the + // highest performing products of the merchant. + // "MEDIUM" - Potential to receive a moderate number of clicks compared to + // the highest performing products of the merchant. + // "HIGH" - Potential to receive a similar number of clicks as the highest + // performing products of the merchant. + ClickPotential string `json:"clickPotential,omitempty"` + // ClickPotentialRank: Rank of the product based on its click potential. A + // product with `click_potential_rank` 1 has the highest click potential among + // the merchant's products that fulfill the search query conditions. + ClickPotentialRank int64 `json:"clickPotentialRank,omitempty,string"` + // Condition: Condition (https://support.google.com/merchants/answer/6324469) + // of the product. + Condition string `json:"condition,omitempty"` + // CreationTime: The time the merchant created the product in timestamp + // seconds. + CreationTime string `json:"creationTime,omitempty"` + // ExpirationDate: Expiration date for the product, specified on insertion. + ExpirationDate *Date `json:"expirationDate,omitempty"` + // FeedLabel: Feed label of the product. + FeedLabel string `json:"feedLabel,omitempty"` + // Gtin: List of Global Trade Item Numbers (GTINs) of the product. + Gtin []string `json:"gtin,omitempty"` + // Id: REST ID of the product, in the form of + // `channel~languageCode~feedLabel~offerId`. Merchant API methods that operate + // on products take this as their `name` parameter. Required in the `SELECT` + // clause. + Id string `json:"id,omitempty"` + // ItemGroupId: Item group id provided by the merchant for grouping variants + // together. + ItemGroupId string `json:"itemGroupId,omitempty"` + // ItemIssues: List of item issues for the product. **This field cannot be used + // for sorting the results.** **Only selected attributes of this field (for + // example, `item_issues.severity.aggregated_severity`) can be used for + // filtering the results.** + ItemIssues []*ItemIssue `json:"itemIssues,omitempty"` + // LanguageCode: Language code of the product in BCP 47 format. + LanguageCode string `json:"languageCode,omitempty"` + // OfferId: Merchant-provided id of the product. + OfferId string `json:"offerId,omitempty"` + // Price: Product price. Absent if the information about the price of the + // product is not available. + Price *Price `json:"price,omitempty"` + // ProductTypeL1: Product type (1st level) in merchant's own product taxonomy + // (https://support.google.com/merchants/answer/6324406). + ProductTypeL1 string `json:"productTypeL1,omitempty"` + // ProductTypeL2: Product type (2nd level) in merchant's own product taxonomy + // (https://support.google.com/merchants/answer/6324406). + ProductTypeL2 string `json:"productTypeL2,omitempty"` + // ProductTypeL3: Product type (3rd level) in merchant's own product taxonomy + // (https://support.google.com/merchants/answer/6324406). + ProductTypeL3 string `json:"productTypeL3,omitempty"` + // ProductTypeL4: Product type (4th level) in merchant's own product taxonomy + // (https://support.google.com/merchants/answer/6324406). + ProductTypeL4 string `json:"productTypeL4,omitempty"` + // ProductTypeL5: Product type (5th level) in merchant's own product taxonomy + // (https://support.google.com/merchants/answer/6324406). + ProductTypeL5 string `json:"productTypeL5,omitempty"` + // ShippingLabel: Normalized shipping label + // (https://support.google.com/merchants/answer/6324504) specified in the data + // source. + ShippingLabel string `json:"shippingLabel,omitempty"` + // ThumbnailLink: Link to the processed image of the product, hosted on the + // Google infrastructure. + ThumbnailLink string `json:"thumbnailLink,omitempty"` + // Title: Title of the product. + Title string `json:"title,omitempty"` + // ForceSendFields is a list of field names (e.g. + // "AggregatedReportingContextStatus") to unconditionally include in API + // requests. By default, fields with empty or default values are omitted from + // API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. + // "AggregatedReportingContextStatus") to include in API requests with the JSON + // null value. By default, fields with empty values are omitted from API + // requests. See https://pkg.go.dev/google.golang.org/api#hdr-NullFields for + // more details. + NullFields []string `json:"-"` +} + +func (s *ProductView) MarshalJSON() ([]byte, error) { + type NoMethod ProductView + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// ReportRow: Result row returned from the search query. Only the message +// corresponding to the queried table is populated in the response. Within the +// populated message, only the fields requested explicitly in the query are +// populated. +type ReportRow struct { + // BestSellersBrandView: Fields available for query in + // `best_sellers_brand_view` table. + BestSellersBrandView *BestSellersBrandView `json:"bestSellersBrandView,omitempty"` + // BestSellersProductClusterView: Fields available for query in + // `best_sellers_product_cluster_view` table. + BestSellersProductClusterView *BestSellersProductClusterView `json:"bestSellersProductClusterView,omitempty"` + // CompetitiveVisibilityBenchmarkView: Fields available for query in + // `competitive_visibility_benchmark_view` table. + CompetitiveVisibilityBenchmarkView *CompetitiveVisibilityBenchmarkView `json:"competitiveVisibilityBenchmarkView,omitempty"` + // CompetitiveVisibilityCompetitorView: Fields available for query in + // `competitive_visibility_competitor_view` table. + CompetitiveVisibilityCompetitorView *CompetitiveVisibilityCompetitorView `json:"competitiveVisibilityCompetitorView,omitempty"` + // CompetitiveVisibilityTopMerchantView: Fields available for query in + // `competitive_visibility_top_merchant_view` table. + CompetitiveVisibilityTopMerchantView *CompetitiveVisibilityTopMerchantView `json:"competitiveVisibilityTopMerchantView,omitempty"` + // NonProductPerformanceView: Fields available for query in + // `non_product_performance_view` table. + NonProductPerformanceView *NonProductPerformanceView `json:"nonProductPerformanceView,omitempty"` + // PriceCompetitivenessProductView: Fields available for query in + // `price_competitiveness_product_view` table. + PriceCompetitivenessProductView *PriceCompetitivenessProductView `json:"priceCompetitivenessProductView,omitempty"` + // PriceInsightsProductView: Fields available for query in + // `price_insights_product_view` table. + PriceInsightsProductView *PriceInsightsProductView `json:"priceInsightsProductView,omitempty"` + // ProductPerformanceView: Fields available for query in + // `product_performance_view` table. + ProductPerformanceView *ProductPerformanceView `json:"productPerformanceView,omitempty"` + // ProductView: Fields available for query in `product_view` table. + ProductView *ProductView `json:"productView,omitempty"` + // ForceSendFields is a list of field names (e.g. "BestSellersBrandView") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "BestSellersBrandView") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *ReportRow) MarshalJSON() ([]byte, error) { + type NoMethod ReportRow + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// SearchRequest: Request message for the `ReportService.Search` method. +type SearchRequest struct { + // PageSize: Optional. Number of `ReportRows` to retrieve in a single page. + // Defaults to 1000. Values above 5000 are coerced to 5000. + PageSize int64 `json:"pageSize,omitempty"` + // PageToken: Optional. Token of the page to retrieve. If not specified, the + // first page of results is returned. In order to request the next page of + // results, the value obtained from `next_page_token` in the previous response + // should be used. + PageToken string `json:"pageToken,omitempty"` + // Query: Required. Query that defines a report to be retrieved. For details on + // how to construct your query, see the Query Language guide. For the full list + // of available tables and fields, see the Available fields. + Query string `json:"query,omitempty"` + // ForceSendFields is a list of field names (e.g. "PageSize") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "PageSize") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *SearchRequest) MarshalJSON() ([]byte, error) { + type NoMethod SearchRequest + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// SearchResponse: Response message for the `ReportService.Search` method. +type SearchResponse struct { + // NextPageToken: Token which can be sent as `page_token` to retrieve the next + // page. If omitted, there are no subsequent pages. + NextPageToken string `json:"nextPageToken,omitempty"` + // Results: Rows that matched the search query. + Results []*ReportRow `json:"results,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "NextPageToken") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *SearchResponse) MarshalJSON() ([]byte, error) { + type NoMethod SearchResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +type AccountsReportsSearchCall struct { + s *Service + parent string + searchrequest *SearchRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Search: Retrieves a report defined by a search query. The response might +// contain fewer rows than specified by `page_size`. Rely on `next_page_token` +// to determine if there are more rows to be requested. +// +// - parent: Id of the account making the call. Must be a standalone account or +// an MCA subaccount. Format: accounts/{account}. +func (r *AccountsReportsService) Search(parent string, searchrequest *SearchRequest) *AccountsReportsSearchCall { + c := &AccountsReportsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.searchrequest = searchrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *AccountsReportsSearchCall) Fields(s ...googleapi.Field) *AccountsReportsSearchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsReportsSearchCall) Context(ctx context.Context) *AccountsReportsSearchCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *AccountsReportsSearchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsReportsSearchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "reports/v1beta/{+parent}/reports:search") + 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 "merchantapi.accounts.reports.search" call. +// Any non-2xx status code is an error. Response headers are in either +// *SearchResponse.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 *AccountsReportsSearchCall) Do(opts ...googleapi.CallOption) (*SearchResponse, 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 := &SearchResponse{ + 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 +} + +// 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 *AccountsReportsSearchCall) Pages(ctx context.Context, f func(*SearchResponse) error) error { + c.ctx_ = ctx + defer func(pt string) { c.searchrequest.PageToken = pt }(c.searchrequest.PageToken) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.searchrequest.PageToken = x.NextPageToken + } +} diff --git a/migrationcenter/v1alpha1/migrationcenter-api.json b/migrationcenter/v1alpha1/migrationcenter-api.json index d548833f951..df8e7624600 100644 --- a/migrationcenter/v1alpha1/migrationcenter-api.json +++ b/migrationcenter/v1alpha1/migrationcenter-api.json @@ -2473,7 +2473,7 @@ } } }, - "revision": "20240523", + "revision": "20240606", "rootUrl": "https://migrationcenter.googleapis.com/", "schemas": { "AddAssetsToGroupRequest": { @@ -3446,6 +3446,10 @@ "$ref": "MachinePreferences", "description": "Preferences concerning the machine types to consider on Compute Engine." }, + "osPricingPreferences": { + "$ref": "OperatingSystemPricingPreferences", + "description": "Optional. Pricing options for OS images." + }, "persistentDiskType": { "description": "Persistent disk type to use. If unspecified (default), all types are considered, based on available usage data.", "enum": [ @@ -3901,13 +3905,17 @@ "COMMITMENT_PLAN_UNSPECIFIED", "COMMITMENT_PLAN_NONE", "COMMITMENT_PLAN_ONE_YEAR", - "COMMITMENT_PLAN_THREE_YEARS" + "COMMITMENT_PLAN_THREE_YEARS", + "COMMITMENT_PLAN_FLEXIBLE_ONE_YEAR", + "COMMITMENT_PLAN_FLEXIBLE_THREE_YEARS" ], "enumDescriptions": [ "Unspecified commitment plan.", "No commitment plan.", "1-year regular committed use discount.", - "3-year regular committed use discount." + "3-year regular committed use discount.", + "1-year flexible committed use discount. While not supported in the v1 API, this value is converted to UNSPECIFIED in conversions to the v1 API.", + "3-year flexible committed use discount. While not supported in the v1 API, this value is converted to UNSPECIFIED in conversions to the v1 API." ], "type": "string" }, @@ -4032,14 +4040,12 @@ "enum": [ "MULTITHREADING_UNSPECIFIED", "MULTITHREADING_DISABLED", - "MULTITHREADING_ENABLED", - "MULTITHREADING_AUTO_SELECT" + "MULTITHREADING_ENABLED" ], "enumDescriptions": [ - "Same as MULTITHREADING_AUTO_SELECT.", - "No multithreading support.", - "Allow multithreading support.", - "Choose to enable/disable multithreading according to which is lowest cost for your workload." + "Same as MULTITHREADING_DISABLED_WITH_COMPENSATION.", + "Disable simultaneous multithreading if doing so is lower cost.", + "Always enable simultaneous multithreading." ], "type": "string" }, @@ -5696,7 +5702,7 @@ "type": "object" }, "MachinePreferences": { - "description": "The type of machines to consider when calculating virtual machine migration insights and recommendations. Not all machine types are available in all zones and regions.", + "description": "The type of machines to consider when calculating virtual machine migration insights and recommendations for GCE. Not all machine types are available in all zones and regions.", "id": "MachinePreferences", "properties": { "allowedMachineSeries": { @@ -6177,6 +6183,66 @@ }, "type": "object" }, + "OperatingSystemPricingPreferences": { + "description": "Pricing options for OS images.", + "id": "OperatingSystemPricingPreferences", + "properties": { + "rhel": { + "$ref": "OperatingSystemPricingPreferencesOperatingSystemPricing", + "description": "Optional. Pricing options for RHEL images." + }, + "sles": { + "$ref": "OperatingSystemPricingPreferencesOperatingSystemPricing", + "description": "Optional. Pricing options for SLES images." + }, + "slesForSap": { + "$ref": "OperatingSystemPricingPreferencesOperatingSystemPricing", + "description": "Optional. Pricing options for SLES for SAP images." + }, + "windows": { + "$ref": "OperatingSystemPricingPreferencesOperatingSystemPricing", + "description": "Optional. Pricing options for Windows images. No commitment plans are available, set it to unspecified." + } + }, + "type": "object" + }, + "OperatingSystemPricingPreferencesOperatingSystemPricing": { + "description": "Pricing options of an OS image.", + "id": "OperatingSystemPricingPreferencesOperatingSystemPricing", + "properties": { + "commitmentPlan": { + "description": "Optional. The plan of commitments for committed use discounts (CUD).", + "enum": [ + "COMMITMENT_PLAN_UNSPECIFIED", + "COMMITMENT_PLAN_ON_DEMAND", + "COMMITMENT_PLAN_1_YEAR", + "COMMITMENT_PLAN_3_YEAR" + ], + "enumDescriptions": [ + "Unspecified commitment plan.", + "No commitment plan (on-demand usage).", + "1-year committed use discount.", + "3-year committed use discount." + ], + "type": "string" + }, + "licenseType": { + "description": "Optional. License type of the OS image.", + "enum": [ + "LICENSE_TYPE_UNSPECIFIED", + "LICENSE_TYPE_DEFAULT", + "LICENSE_TYPE_BRING_YOUR_OWN_LICENSE" + ], + "enumDescriptions": [ + "Unspecified (default value).", + "Default Google Cloud licensing plan. Licensing is charged per usage. This a good value to start with.", + "Bring-your-own-license (BYOL) plan. User provides the OS license." + ], + "type": "string" + } + }, + "type": "object" + }, "Operation": { "description": "This resource represents a long-running operation that is the result of a network API call.", "id": "Operation", @@ -7440,13 +7506,17 @@ "COMMITMENT_PLAN_UNSPECIFIED", "ON_DEMAND", "COMMITMENT_1_YEAR", - "COMMITMENT_3_YEAR" + "COMMITMENT_3_YEAR", + "COMMITMENT_FLEXIBLE_1_YEAR", + "COMMITMENT_FLEXIBLE_3_YEAR" ], "enumDescriptions": [ "Unspecified commitment plan.", "No commitment plan (on-demand usage).", "1-year regular committed use discount.", - "3-year regular committed use discount." + "3-year regular committed use discount.", + "1-year flexible committed use discount. While not supported in the v1 API, this value is converted to UNSPECIFIED in conversions to the v1 API.", + "3-year flexible committed use discount. While not supported in the v1 API, this value is converted to UNSPECIFIED in conversions to the v1 API." ], "type": "string" }, @@ -7477,6 +7547,10 @@ "$ref": "SoleTenantNodeType" }, "type": "array" + }, + "osPricingPreferences": { + "$ref": "OperatingSystemPricingPreferences", + "description": "Optional. Pricing options for OS images." } }, "type": "object" @@ -8004,13 +8078,17 @@ "COMMITMENT_PLAN_UNSPECIFIED", "COMMITMENT_PLAN_NONE", "COMMITMENT_PLAN_ONE_YEAR", - "COMMITMENT_PLAN_THREE_YEARS" + "COMMITMENT_PLAN_THREE_YEARS", + "COMMITMENT_PLAN_FLEXIBLE_ONE_YEAR", + "COMMITMENT_PLAN_FLEXIBLE_THREE_YEARS" ], "enumDescriptions": [ "Unspecified commitment plan.", "No commitment plan.", "1-year regular committed use discount.", - "3-year regular committed use discount." + "3-year regular committed use discount.", + "1-year flexible committed use discount. While not supported in the v1 API, this value is converted to UNSPECIFIED in conversions to the v1 API.", + "3-year flexible committed use discount. While not supported in the v1 API, this value is converted to UNSPECIFIED in conversions to the v1 API." ], "type": "string" }, diff --git a/migrationcenter/v1alpha1/migrationcenter-gen.go b/migrationcenter/v1alpha1/migrationcenter-gen.go index 39400635336..185642bc0dc 100644 --- a/migrationcenter/v1alpha1/migrationcenter-gen.go +++ b/migrationcenter/v1alpha1/migrationcenter-gen.go @@ -1427,6 +1427,8 @@ type ComputeEnginePreferences struct { // MachinePreferences: Preferences concerning the machine types to consider on // Compute Engine. MachinePreferences *MachinePreferences `json:"machinePreferences,omitempty"` + // OsPricingPreferences: Optional. Pricing options for OS images. + OsPricingPreferences *OperatingSystemPricingPreferences `json:"osPricingPreferences,omitempty"` // PersistentDiskType: Persistent disk type to use. If unspecified (default), // all types are considered, based on available usage data. // @@ -1996,6 +1998,12 @@ type DatabasePreferencesCloudSqlCommon struct { // "COMMITMENT_PLAN_NONE" - No commitment plan. // "COMMITMENT_PLAN_ONE_YEAR" - 1-year regular committed use discount. // "COMMITMENT_PLAN_THREE_YEARS" - 3-year regular committed use discount. + // "COMMITMENT_PLAN_FLEXIBLE_ONE_YEAR" - 1-year flexible committed use + // discount. While not supported in the v1 API, this value is converted to + // UNSPECIFIED in conversions to the v1 API. + // "COMMITMENT_PLAN_FLEXIBLE_THREE_YEARS" - 3-year flexible committed use + // discount. While not supported in the v1 API, this value is converted to + // UNSPECIFIED in conversions to the v1 API. CommitmentPlan string `json:"commitmentPlan,omitempty"` // Edition: Optional. Cloud SQL edition. For SQL Server, only Enterprise is // available. @@ -2158,11 +2166,11 @@ type DatabasePreferencesCloudSqlSqlServer struct { // Multithreading: Optional. Preferences for multithreading support. // // Possible values: - // "MULTITHREADING_UNSPECIFIED" - Same as MULTITHREADING_AUTO_SELECT. - // "MULTITHREADING_DISABLED" - No multithreading support. - // "MULTITHREADING_ENABLED" - Allow multithreading support. - // "MULTITHREADING_AUTO_SELECT" - Choose to enable/disable multithreading - // according to which is lowest cost for your workload. + // "MULTITHREADING_UNSPECIFIED" - Same as + // MULTITHREADING_DISABLED_WITH_COMPENSATION. + // "MULTITHREADING_DISABLED" - Disable simultaneous multithreading if doing + // so is lower cost. + // "MULTITHREADING_ENABLED" - Always enable simultaneous multithreading. Multithreading string `json:"multithreading,omitempty"` // VersionType: Optional. Edition of Microsoft SQL version that is used on a // Cloud SQL for SQL server instance. @@ -4007,8 +4015,8 @@ func (s *Location) MarshalJSON() ([]byte, error) { } // MachinePreferences: The type of machines to consider when calculating -// virtual machine migration insights and recommendations. Not all machine -// types are available in all zones and regions. +// virtual machine migration insights and recommendations for GCE. Not all +// machine types are available in all zones and regions. type MachinePreferences struct { // AllowedMachineSeries: Compute Engine machine series to consider for insights // and recommendations. If empty, no restriction is applied on the machine @@ -4632,6 +4640,74 @@ func (s *OpenFileList) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// OperatingSystemPricingPreferences: Pricing options for OS images. +type OperatingSystemPricingPreferences struct { + // Rhel: Optional. Pricing options for RHEL images. + Rhel *OperatingSystemPricingPreferencesOperatingSystemPricing `json:"rhel,omitempty"` + // Sles: Optional. Pricing options for SLES images. + Sles *OperatingSystemPricingPreferencesOperatingSystemPricing `json:"sles,omitempty"` + // SlesForSap: Optional. Pricing options for SLES for SAP images. + SlesForSap *OperatingSystemPricingPreferencesOperatingSystemPricing `json:"slesForSap,omitempty"` + // Windows: Optional. Pricing options for Windows images. No commitment plans + // are available, set it to unspecified. + Windows *OperatingSystemPricingPreferencesOperatingSystemPricing `json:"windows,omitempty"` + // ForceSendFields is a list of field names (e.g. "Rhel") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Rhel") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *OperatingSystemPricingPreferences) MarshalJSON() ([]byte, error) { + type NoMethod OperatingSystemPricingPreferences + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + +// OperatingSystemPricingPreferencesOperatingSystemPricing: Pricing options of +// an OS image. +type OperatingSystemPricingPreferencesOperatingSystemPricing struct { + // CommitmentPlan: Optional. The plan of commitments for committed use + // discounts (CUD). + // + // Possible values: + // "COMMITMENT_PLAN_UNSPECIFIED" - Unspecified commitment plan. + // "COMMITMENT_PLAN_ON_DEMAND" - No commitment plan (on-demand usage). + // "COMMITMENT_PLAN_1_YEAR" - 1-year committed use discount. + // "COMMITMENT_PLAN_3_YEAR" - 3-year committed use discount. + CommitmentPlan string `json:"commitmentPlan,omitempty"` + // LicenseType: Optional. License type of the OS image. + // + // Possible values: + // "LICENSE_TYPE_UNSPECIFIED" - Unspecified (default value). + // "LICENSE_TYPE_DEFAULT" - Default Google Cloud licensing plan. Licensing is + // charged per usage. This a good value to start with. + // "LICENSE_TYPE_BRING_YOUR_OWN_LICENSE" - Bring-your-own-license (BYOL) + // plan. User provides the OS license. + LicenseType string `json:"licenseType,omitempty"` + // ForceSendFields is a list of field names (e.g. "CommitmentPlan") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "CommitmentPlan") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *OperatingSystemPricingPreferencesOperatingSystemPricing) MarshalJSON() ([]byte, error) { + type NoMethod OperatingSystemPricingPreferencesOperatingSystemPricing + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // Operation: This resource represents a long-running operation that is the // result of a network API call. type Operation struct { @@ -6158,6 +6234,12 @@ type SoleTenancyPreferences struct { // "ON_DEMAND" - No commitment plan (on-demand usage). // "COMMITMENT_1_YEAR" - 1-year regular committed use discount. // "COMMITMENT_3_YEAR" - 3-year regular committed use discount. + // "COMMITMENT_FLEXIBLE_1_YEAR" - 1-year flexible committed use discount. + // While not supported in the v1 API, this value is converted to UNSPECIFIED in + // conversions to the v1 API. + // "COMMITMENT_FLEXIBLE_3_YEAR" - 3-year flexible committed use discount. + // While not supported in the v1 API, this value is converted to UNSPECIFIED in + // conversions to the v1 API. CommitmentPlan string `json:"commitmentPlan,omitempty"` // CpuOvercommitRatio: CPU overcommit ratio. Acceptable values are between 1.0 // and 2.0 inclusive. @@ -6176,6 +6258,8 @@ type SoleTenancyPreferences struct { // NodeTypes: A list of sole tenant node types. An empty list means that all // possible node types will be considered. NodeTypes []*SoleTenantNodeType `json:"nodeTypes,omitempty"` + // OsPricingPreferences: Optional. Pricing options for OS images. + OsPricingPreferences *OperatingSystemPricingPreferences `json:"osPricingPreferences,omitempty"` // ForceSendFields is a list of field names (e.g. "CommitmentPlan") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See @@ -6770,6 +6854,12 @@ type VirtualMachinePreferences struct { // "COMMITMENT_PLAN_NONE" - No commitment plan. // "COMMITMENT_PLAN_ONE_YEAR" - 1-year regular committed use discount. // "COMMITMENT_PLAN_THREE_YEARS" - 3-year regular committed use discount. + // "COMMITMENT_PLAN_FLEXIBLE_ONE_YEAR" - 1-year flexible committed use + // discount. While not supported in the v1 API, this value is converted to + // UNSPECIFIED in conversions to the v1 API. + // "COMMITMENT_PLAN_FLEXIBLE_THREE_YEARS" - 3-year flexible committed use + // discount. While not supported in the v1 API, this value is converted to + // UNSPECIFIED in conversions to the v1 API. CommitmentPlan string `json:"commitmentPlan,omitempty"` // ComputeEnginePreferences: Compute Engine preferences concern insights and // recommendations for Compute Engine target. diff --git a/pubsub/v1/pubsub-api.json b/pubsub/v1/pubsub-api.json index ea24c9fb6fd..ed38964e05c 100644 --- a/pubsub/v1/pubsub-api.json +++ b/pubsub/v1/pubsub-api.json @@ -1583,7 +1583,7 @@ } } }, - "revision": "20240430", + "revision": "20240607", "rootUrl": "https://pubsub.googleapis.com/", "schemas": { "AcknowledgeRequest": { @@ -1604,6 +1604,10 @@ "description": "Configuration for writing message data in Avro format. Message payloads and metadata will be written to files as an Avro binary.", "id": "AvroConfig", "properties": { + "useTopicSchema": { + "description": "Optional. When true, the output Cloud Storage file will be serialized using the topic schema, if it exists.", + "type": "boolean" + }, "writeMetadata": { "description": "Optional. When true, write the subscription name, message_id, publish_time, attributes, and ordering_key as additional fields in the output. The subscription name, message_id, and publish_time fields are put in their own fields while all other message properties other than data (for example, an ordering_key, if present) are added as entries in the attributes map.", "type": "boolean" diff --git a/pubsub/v1/pubsub-gen.go b/pubsub/v1/pubsub-gen.go index 5e1b73c33f0..5a27833f3b3 100644 --- a/pubsub/v1/pubsub-gen.go +++ b/pubsub/v1/pubsub-gen.go @@ -273,6 +273,9 @@ func (s *AcknowledgeRequest) MarshalJSON() ([]byte, error) { // AvroConfig: Configuration for writing message data in Avro format. Message // payloads and metadata will be written to files as an Avro binary. type AvroConfig struct { + // UseTopicSchema: Optional. When true, the output Cloud Storage file will be + // serialized using the topic schema, if it exists. + UseTopicSchema bool `json:"useTopicSchema,omitempty"` // WriteMetadata: Optional. When true, write the subscription name, message_id, // publish_time, attributes, and ordering_key as additional fields in the // output. The subscription name, message_id, and publish_time fields are put @@ -280,15 +283,15 @@ type AvroConfig struct { // example, an ordering_key, if present) are added as entries in the attributes // map. WriteMetadata bool `json:"writeMetadata,omitempty"` - // ForceSendFields is a list of field names (e.g. "WriteMetadata") to + // ForceSendFields is a list of field names (e.g. "UseTopicSchema") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "WriteMetadata") to include in API - // requests with the JSON null value. By default, fields with empty values are - // omitted from API requests. See + // NullFields is a list of field names (e.g. "UseTopicSchema") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` } diff --git a/serviceconsumermanagement/v1beta1/serviceconsumermanagement-api.json b/serviceconsumermanagement/v1beta1/serviceconsumermanagement-api.json index 74986d4b07d..4771bdc8d15 100644 --- a/serviceconsumermanagement/v1beta1/serviceconsumermanagement-api.json +++ b/serviceconsumermanagement/v1beta1/serviceconsumermanagement-api.json @@ -206,6 +206,34 @@ "https://www.googleapis.com/auth/cloud-platform" ] }, + "importProducerQuotaPolicies": { + "description": "Create or update multiple producer quota policies atomically, all on the same ancestor, but on many different metrics or limits. The name field in the quota policy message should not be set.", + "flatPath": "v1beta1/services/{servicesId}/{servicesId1}/{servicesId2}/consumerQuotaMetrics:importProducerQuotaPolicies", + "httpMethod": "POST", + "id": "serviceconsumermanagement.services.consumerQuotaMetrics.importProducerQuotaPolicies", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "The resource name of the consumer. An example name would be: `services/compute.googleapis.com/organizations/123`", + "location": "path", + "pattern": "^services/[^/]+/[^/]+/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta1/{+parent}/consumerQuotaMetrics:importProducerQuotaPolicies", + "request": { + "$ref": "V1Beta1ImportProducerQuotaPoliciesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "list": { "description": "Retrieves a summary of all quota information about this consumer that is visible to the service producer, for each quota metric defined by the service. Each metric includes information about all of its defined limits. Each limit includes the limit configuration (quota unit, preciseness, default value), the current effective limit value, and all of the overrides applied to the limit.", "flatPath": "v1beta1/services/{servicesId}/{servicesId1}/{servicesId2}/consumerQuotaMetrics", @@ -507,6 +535,178 @@ ] } } + }, + "producerQuotaPolicies": { + "methods": { + "create": { + "description": "Creates a producer quota policy. A producer quota policy is applied by the owner or administrator of a service at an org or folder node to set the default quota limit for all consumers under the node where the policy is created. To create multiple policies at once, use ImportProducerQuotaPolicies instead. If a policy with the specified dimensions already exists, this call will fail. To overwrite an existing policy if one is already present (\"upsert\" semantics), use ImportProducerQuotaPolicies instead.", + "flatPath": "v1beta1/services/{servicesId}/{servicesId1}/{servicesId2}/consumerQuotaMetrics/{consumerQuotaMetricsId}/limits/{limitsId}/producerQuotaPolicies", + "httpMethod": "POST", + "id": "serviceconsumermanagement.services.consumerQuotaMetrics.limits.producerQuotaPolicies.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "force": { + "description": "Whether to force the creation of the quota policy. If the policy creation would decrease the default limit of any consumer tier by more than 10 percent, the call is rejected, as a safety measure to avoid accidentally decreasing quota too quickly. Setting the force parameter to true ignores this restriction.", + "location": "query", + "type": "boolean" + }, + "forceJustification": { + "description": "If force option is set to true, force_justification is suggested to be set to log the reason in audit logs.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The resource name of the parent quota limit. An example name would be: `services/compute.googleapis.com/organizations/123/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion`", + "location": "path", + "pattern": "^services/[^/]+/[^/]+/[^/]+/consumerQuotaMetrics/[^/]+/limits/[^/]+$", + "required": true, + "type": "string" + }, + "validateOnly": { + "description": "If set to true, validate the request, but do not actually update.", + "location": "query", + "type": "boolean" + } + }, + "path": "v1beta1/{+parent}/producerQuotaPolicies", + "request": { + "$ref": "V1Beta1ProducerQuotaPolicy" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "description": "Deletes a producer quota policy.", + "flatPath": "v1beta1/services/{servicesId}/{servicesId1}/{servicesId2}/consumerQuotaMetrics/{consumerQuotaMetricsId}/limits/{limitsId}/producerQuotaPolicies/{producerQuotaPoliciesId}", + "httpMethod": "DELETE", + "id": "serviceconsumermanagement.services.consumerQuotaMetrics.limits.producerQuotaPolicies.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "force": { + "description": "Whether to force the deletion of the quota policy. If the policy deletion would decrease the default limit of any consumer tier by more than 10 percent, the call is rejected, as a safety measure to avoid accidentally decreasing quota too quickly. Setting the force parameter to true ignores this restriction.", + "location": "query", + "type": "boolean" + }, + "forceJustification": { + "description": "If force option is set to true, force_justification is suggested to be set to log the reason in audit logs.", + "location": "query", + "type": "string" + }, + "name": { + "description": "Required. The resource name of the policy to delete. An example name would be: `services/compute.googleapis.com/organizations/123/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/producerQuotaPolicies/4a3f2c1d`", + "location": "path", + "pattern": "^services/[^/]+/[^/]+/[^/]+/consumerQuotaMetrics/[^/]+/limits/[^/]+/producerQuotaPolicies/[^/]+$", + "required": true, + "type": "string" + }, + "validateOnly": { + "description": "If set to true, validate the request, but do not actually update.", + "location": "query", + "type": "boolean" + } + }, + "path": "v1beta1/{+name}", + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Lists all producer policies created at current consumer node for a limit.", + "flatPath": "v1beta1/services/{servicesId}/{servicesId1}/{servicesId2}/consumerQuotaMetrics/{consumerQuotaMetricsId}/limits/{limitsId}/producerQuotaPolicies", + "httpMethod": "GET", + "id": "serviceconsumermanagement.services.consumerQuotaMetrics.limits.producerQuotaPolicies.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Requested size of the next page of data.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Token identifying which result to start with; returned by a previous list call.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The resource name of the parent quota limit. An example name would be: `services/compute.googleapis.com/organizations/123/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion`", + "location": "path", + "pattern": "^services/[^/]+/[^/]+/[^/]+/consumerQuotaMetrics/[^/]+/limits/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta1/{+parent}/producerQuotaPolicies", + "response": { + "$ref": "V1Beta1ListProducerQuotaPoliciesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "patch": { + "description": "Updates a producer quota policy.", + "flatPath": "v1beta1/services/{servicesId}/{servicesId1}/{servicesId2}/consumerQuotaMetrics/{consumerQuotaMetricsId}/limits/{limitsId}/producerQuotaPolicies/{producerQuotaPoliciesId}", + "httpMethod": "PATCH", + "id": "serviceconsumermanagement.services.consumerQuotaMetrics.limits.producerQuotaPolicies.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "force": { + "description": "Whether to force the update of the quota policy. If the policy update would decrease the default limit of any consumer tier by more than 10 percent, the call is rejected, as a safety measure to avoid accidentally decreasing quota too quickly. Setting the force parameter to true ignores this restriction.", + "location": "query", + "type": "boolean" + }, + "forceJustification": { + "description": "If force option is set to true, force_justification is suggested to be set to log the reason in audit logs.", + "location": "query", + "type": "string" + }, + "name": { + "description": "The resource name of the producer policy. An example name would be: `services/compute.googleapis.com/organizations/123/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/producerQuotaPolicies/4a3f2c1d`", + "location": "path", + "pattern": "^services/[^/]+/[^/]+/[^/]+/consumerQuotaMetrics/[^/]+/limits/[^/]+/producerQuotaPolicies/[^/]+$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Update only the specified fields. If unset, all modifiable fields will be updated.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + }, + "validateOnly": { + "description": "If set to true, validate the request, but do not actually update.", + "location": "query", + "type": "boolean" + } + }, + "path": "v1beta1/{+name}", + "request": { + "$ref": "V1Beta1ProducerQuotaPolicy" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } } } } @@ -515,7 +715,7 @@ } } }, - "revision": "20240602", + "revision": "20240609", "rootUrl": "https://serviceconsumermanagement.googleapis.com/", "schemas": { "Api": { @@ -2755,6 +2955,29 @@ }, "type": "object" }, + "V1Beta1ImportProducerQuotaPoliciesRequest": { + "description": "Request message for ImportProducerQuotaPolicies", + "id": "V1Beta1ImportProducerQuotaPoliciesRequest", + "properties": { + "force": { + "description": "Whether to force the import of the quota policies. If the policy import would decrease the default limit of any consumer tier by more than 10 percent, the call is rejected, as a safety measure to avoid accidentally decreasing quota too quickly. Setting the force parameter to true ignores this restriction.", + "type": "boolean" + }, + "forceJustification": { + "description": "If force option is set to true, force_justification is suggested to be set to log the reason in audit logs.", + "type": "string" + }, + "inlineSource": { + "$ref": "V1Beta1PolicyInlineSource", + "description": "The import data is specified in the request message itself" + }, + "validateOnly": { + "description": "If set to true, validate the request, but do not actually update.", + "type": "boolean" + } + }, + "type": "object" + }, "V1Beta1ImportProducerQuotaPoliciesResponse": { "description": "Response message for ImportProducerQuotaPolicies", "id": "V1Beta1ImportProducerQuotaPoliciesResponse", @@ -2805,6 +3028,24 @@ }, "type": "object" }, + "V1Beta1ListProducerQuotaPoliciesResponse": { + "description": "Response message for ListProducerQuotaPolicies.", + "id": "V1Beta1ListProducerQuotaPoliciesResponse", + "properties": { + "nextPageToken": { + "description": "Token identifying which result to start with; returned by a previous list call.", + "type": "string" + }, + "producerQuotaPolicies": { + "description": "Producer policies on this limit.", + "items": { + "$ref": "V1Beta1ProducerQuotaPolicy" + }, + "type": "array" + } + }, + "type": "object" + }, "V1Beta1OverrideInlineSource": { "description": "Import data embedded in the request message", "id": "V1Beta1OverrideInlineSource", @@ -2819,6 +3060,20 @@ }, "type": "object" }, + "V1Beta1PolicyInlineSource": { + "description": "Import data embedded in the request message", + "id": "V1Beta1PolicyInlineSource", + "properties": { + "policies": { + "description": "The policies to create. Each policy must have a value for 'metric' and 'unit', to specify which metric and which limit the policy should be applied to.", + "items": { + "$ref": "V1Beta1ProducerQuotaPolicy" + }, + "type": "array" + } + }, + "type": "object" + }, "V1Beta1ProducerQuotaPolicy": { "description": "Quota policy created by service producer.", "id": "V1Beta1ProducerQuotaPolicy", diff --git a/serviceconsumermanagement/v1beta1/serviceconsumermanagement-gen.go b/serviceconsumermanagement/v1beta1/serviceconsumermanagement-gen.go index be8a0b806e6..e1205304d3c 100644 --- a/serviceconsumermanagement/v1beta1/serviceconsumermanagement-gen.go +++ b/serviceconsumermanagement/v1beta1/serviceconsumermanagement-gen.go @@ -193,6 +193,7 @@ type ServicesConsumerQuotaMetricsService struct { func NewServicesConsumerQuotaMetricsLimitsService(s *APIService) *ServicesConsumerQuotaMetricsLimitsService { rs := &ServicesConsumerQuotaMetricsLimitsService{s: s} rs.ProducerOverrides = NewServicesConsumerQuotaMetricsLimitsProducerOverridesService(s) + rs.ProducerQuotaPolicies = NewServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesService(s) return rs } @@ -200,6 +201,8 @@ type ServicesConsumerQuotaMetricsLimitsService struct { s *APIService ProducerOverrides *ServicesConsumerQuotaMetricsLimitsProducerOverridesService + + ProducerQuotaPolicies *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesService } func NewServicesConsumerQuotaMetricsLimitsProducerOverridesService(s *APIService) *ServicesConsumerQuotaMetricsLimitsProducerOverridesService { @@ -211,6 +214,15 @@ type ServicesConsumerQuotaMetricsLimitsProducerOverridesService struct { s *APIService } +func NewServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesService(s *APIService) *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesService { + rs := &ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesService{s: s} + return rs +} + +type ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesService struct { + s *APIService +} + // Api: Api is a light-weight descriptor for an API Interface. Interfaces are // also described as "protocol buffer services" in some contexts, such as by // the "service" keyword in a .proto file, but they are different from API @@ -3500,6 +3512,41 @@ func (s *V1Beta1ImportProducerOverridesResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// V1Beta1ImportProducerQuotaPoliciesRequest: Request message for +// ImportProducerQuotaPolicies +type V1Beta1ImportProducerQuotaPoliciesRequest struct { + // Force: Whether to force the import of the quota policies. If the policy + // import would decrease the default limit of any consumer tier by more than 10 + // percent, the call is rejected, as a safety measure to avoid accidentally + // decreasing quota too quickly. Setting the force parameter to true ignores + // this restriction. + Force bool `json:"force,omitempty"` + // ForceJustification: If force option is set to true, force_justification is + // suggested to be set to log the reason in audit logs. + ForceJustification string `json:"forceJustification,omitempty"` + // InlineSource: The import data is specified in the request message itself + InlineSource *V1Beta1PolicyInlineSource `json:"inlineSource,omitempty"` + // ValidateOnly: If set to true, validate the request, but do not actually + // update. + ValidateOnly bool `json:"validateOnly,omitempty"` + // ForceSendFields is a list of field names (e.g. "Force") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Force") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *V1Beta1ImportProducerQuotaPoliciesRequest) MarshalJSON() ([]byte, error) { + type NoMethod V1Beta1ImportProducerQuotaPoliciesRequest + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // V1Beta1ImportProducerQuotaPoliciesResponse: Response message for // ImportProducerQuotaPolicies type V1Beta1ImportProducerQuotaPoliciesResponse struct { @@ -3581,6 +3628,35 @@ func (s *V1Beta1ListProducerOverridesResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// V1Beta1ListProducerQuotaPoliciesResponse: Response message for +// ListProducerQuotaPolicies. +type V1Beta1ListProducerQuotaPoliciesResponse struct { + // NextPageToken: Token identifying which result to start with; returned by a + // previous list call. + NextPageToken string `json:"nextPageToken,omitempty"` + // ProducerQuotaPolicies: Producer policies on this limit. + ProducerQuotaPolicies []*V1Beta1ProducerQuotaPolicy `json:"producerQuotaPolicies,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "NextPageToken") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *V1Beta1ListProducerQuotaPoliciesResponse) MarshalJSON() ([]byte, error) { + type NoMethod V1Beta1ListProducerQuotaPoliciesResponse + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // V1Beta1OverrideInlineSource: Import data embedded in the request message type V1Beta1OverrideInlineSource struct { // Overrides: The overrides to create. Each override must have a value for @@ -3606,6 +3682,30 @@ func (s *V1Beta1OverrideInlineSource) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// V1Beta1PolicyInlineSource: Import data embedded in the request message +type V1Beta1PolicyInlineSource struct { + // Policies: The policies to create. Each policy must have a value for 'metric' + // and 'unit', to specify which metric and which limit the policy should be + // applied to. + Policies []*V1Beta1ProducerQuotaPolicy `json:"policies,omitempty"` + // ForceSendFields is a list of field names (e.g. "Policies") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Policies") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s *V1Beta1PolicyInlineSource) MarshalJSON() ([]byte, error) { + type NoMethod V1Beta1PolicyInlineSource + return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) +} + // V1Beta1ProducerQuotaPolicy: Quota policy created by service producer. type V1Beta1ProducerQuotaPolicy struct { // Container: The cloud resource container at which the quota policy is @@ -4374,6 +4474,110 @@ func (c *ServicesConsumerQuotaMetricsImportProducerOverridesCall) Do(opts ...goo return ret, nil } +type ServicesConsumerQuotaMetricsImportProducerQuotaPoliciesCall struct { + s *APIService + parent string + v1beta1importproducerquotapoliciesrequest *V1Beta1ImportProducerQuotaPoliciesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// ImportProducerQuotaPolicies: Create or update multiple producer quota +// policies atomically, all on the same ancestor, but on many different metrics +// or limits. The name field in the quota policy message should not be set. +// +// - parent: The resource name of the consumer. An example name would be: +// `services/compute.googleapis.com/organizations/123`. +func (r *ServicesConsumerQuotaMetricsService) ImportProducerQuotaPolicies(parent string, v1beta1importproducerquotapoliciesrequest *V1Beta1ImportProducerQuotaPoliciesRequest) *ServicesConsumerQuotaMetricsImportProducerQuotaPoliciesCall { + c := &ServicesConsumerQuotaMetricsImportProducerQuotaPoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.v1beta1importproducerquotapoliciesrequest = v1beta1importproducerquotapoliciesrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ServicesConsumerQuotaMetricsImportProducerQuotaPoliciesCall) Fields(s ...googleapi.Field) *ServicesConsumerQuotaMetricsImportProducerQuotaPoliciesCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ServicesConsumerQuotaMetricsImportProducerQuotaPoliciesCall) Context(ctx context.Context) *ServicesConsumerQuotaMetricsImportProducerQuotaPoliciesCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ServicesConsumerQuotaMetricsImportProducerQuotaPoliciesCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ServicesConsumerQuotaMetricsImportProducerQuotaPoliciesCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.v1beta1importproducerquotapoliciesrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/consumerQuotaMetrics:importProducerQuotaPolicies") + 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 "serviceconsumermanagement.services.consumerQuotaMetrics.importProducerQuotaPolicies" call. +// 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 *ServicesConsumerQuotaMetricsImportProducerQuotaPoliciesCall) 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 +} + type ServicesConsumerQuotaMetricsListCall struct { s *APIService parent string @@ -5267,3 +5471,545 @@ func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesPatchCall) Do(opts . } return ret, nil } + +type ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesCreateCall struct { + s *APIService + parent string + v1beta1producerquotapolicy *V1Beta1ProducerQuotaPolicy + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a producer quota policy. A producer quota policy is applied +// by the owner or administrator of a service at an org or folder node to set +// the default quota limit for all consumers under the node where the policy is +// created. To create multiple policies at once, use +// ImportProducerQuotaPolicies instead. If a policy with the specified +// dimensions already exists, this call will fail. To overwrite an existing +// policy if one is already present ("upsert" semantics), use +// ImportProducerQuotaPolicies instead. +// +// - parent: The resource name of the parent quota limit. An example name would +// be: +// `services/compute.googleapis.com/organizations/123/consumerQuotaMetrics/com +// pute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion`. +func (r *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesService) Create(parent string, v1beta1producerquotapolicy *V1Beta1ProducerQuotaPolicy) *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesCreateCall { + c := &ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.v1beta1producerquotapolicy = v1beta1producerquotapolicy + return c +} + +// Force sets the optional parameter "force": Whether to force the creation of +// the quota policy. If the policy creation would decrease the default limit of +// any consumer tier by more than 10 percent, the call is rejected, as a safety +// measure to avoid accidentally decreasing quota too quickly. Setting the +// force parameter to true ignores this restriction. +func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesCreateCall) Force(force bool) *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesCreateCall { + c.urlParams_.Set("force", fmt.Sprint(force)) + return c +} + +// ForceJustification sets the optional parameter "forceJustification": If +// force option is set to true, force_justification is suggested to be set to +// log the reason in audit logs. +func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesCreateCall) ForceJustification(forceJustification string) *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesCreateCall { + c.urlParams_.Set("forceJustification", forceJustification) + return c +} + +// ValidateOnly sets the optional parameter "validateOnly": If set to true, +// validate the request, but do not actually update. +func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesCreateCall) ValidateOnly(validateOnly bool) *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesCreateCall { + c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesCreateCall) Fields(s ...googleapi.Field) *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesCreateCall) Context(ctx context.Context) *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.v1beta1producerquotapolicy) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/producerQuotaPolicies") + 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 "serviceconsumermanagement.services.consumerQuotaMetrics.limits.producerQuotaPolicies.create" call. +// 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 *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesCreateCall) 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 +} + +type ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesDeleteCall struct { + s *APIService + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a producer quota policy. +// +// - name: The resource name of the policy to delete. An example name would be: +// `services/compute.googleapis.com/organizations/123/consumerQuotaMetrics/com +// pute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/producerQuotaPolicies +// /4a3f2c1d`. +func (r *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesService) Delete(name string) *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesDeleteCall { + c := &ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Force sets the optional parameter "force": Whether to force the deletion of +// the quota policy. If the policy deletion would decrease the default limit of +// any consumer tier by more than 10 percent, the call is rejected, as a safety +// measure to avoid accidentally decreasing quota too quickly. Setting the +// force parameter to true ignores this restriction. +func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesDeleteCall) Force(force bool) *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesDeleteCall { + c.urlParams_.Set("force", fmt.Sprint(force)) + return c +} + +// ForceJustification sets the optional parameter "forceJustification": If +// force option is set to true, force_justification is suggested to be set to +// log the reason in audit logs. +func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesDeleteCall) ForceJustification(forceJustification string) *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesDeleteCall { + c.urlParams_.Set("forceJustification", forceJustification) + return c +} + +// ValidateOnly sets the optional parameter "validateOnly": If set to true, +// validate the request, but do not actually update. +func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesDeleteCall) ValidateOnly(validateOnly bool) *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesDeleteCall { + c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesDeleteCall) Fields(s ...googleapi.Field) *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesDeleteCall) Context(ctx context.Context) *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+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 "serviceconsumermanagement.services.consumerQuotaMetrics.limits.producerQuotaPolicies.delete" call. +// 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 *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesDeleteCall) 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 +} + +type ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesListCall struct { + s *APIService + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists all producer policies created at current consumer node for a +// limit. +// +// - parent: The resource name of the parent quota limit. An example name would +// be: +// `services/compute.googleapis.com/organizations/123/consumerQuotaMetrics/com +// pute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion`. +func (r *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesService) List(parent string) *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesListCall { + c := &ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": Requested size of the next +// page of data. +func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesListCall) PageSize(pageSize int64) *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": Token identifying which +// result to start with; returned by a previous list call. +func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesListCall) PageToken(pageToken string) *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesListCall { + 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 +// details. +func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesListCall) Fields(s ...googleapi.Field) *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an 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. +func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesListCall) IfNoneMatch(entityTag string) *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesListCall) Context(ctx context.Context) *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + 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, "v1beta1/{+parent}/producerQuotaPolicies") + 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 "serviceconsumermanagement.services.consumerQuotaMetrics.limits.producerQuotaPolicies.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *V1Beta1ListProducerQuotaPoliciesResponse.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 *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesListCall) Do(opts ...googleapi.CallOption) (*V1Beta1ListProducerQuotaPoliciesResponse, 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 := &V1Beta1ListProducerQuotaPoliciesResponse{ + 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 +} + +// 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 *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesListCall) Pages(ctx context.Context, f func(*V1Beta1ListProducerQuotaPoliciesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + 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) + } +} + +type ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesPatchCall struct { + s *APIService + name string + v1beta1producerquotapolicy *V1Beta1ProducerQuotaPolicy + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates a producer quota policy. +// +// - name: The resource name of the producer policy. An example name would be: +// `services/compute.googleapis.com/organizations/123/consumerQuotaMetrics/com +// pute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/producerQuotaPolicies +// /4a3f2c1d`. +func (r *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesService) Patch(name string, v1beta1producerquotapolicy *V1Beta1ProducerQuotaPolicy) *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesPatchCall { + c := &ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.v1beta1producerquotapolicy = v1beta1producerquotapolicy + return c +} + +// Force sets the optional parameter "force": Whether to force the update of +// the quota policy. If the policy update would decrease the default limit of +// any consumer tier by more than 10 percent, the call is rejected, as a safety +// measure to avoid accidentally decreasing quota too quickly. Setting the +// force parameter to true ignores this restriction. +func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesPatchCall) Force(force bool) *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesPatchCall { + c.urlParams_.Set("force", fmt.Sprint(force)) + return c +} + +// ForceJustification sets the optional parameter "forceJustification": If +// force option is set to true, force_justification is suggested to be set to +// log the reason in audit logs. +func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesPatchCall) ForceJustification(forceJustification string) *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesPatchCall { + c.urlParams_.Set("forceJustification", forceJustification) + return c +} + +// UpdateMask sets the optional parameter "updateMask": Update only the +// specified fields. If unset, all modifiable fields will be updated. +func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesPatchCall) UpdateMask(updateMask string) *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesPatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// ValidateOnly sets the optional parameter "validateOnly": If set to true, +// validate the request, but do not actually update. +func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesPatchCall) ValidateOnly(validateOnly bool) *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesPatchCall { + c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesPatchCall) Fields(s ...googleapi.Field) *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesPatchCall) Context(ctx context.Context) *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.v1beta1producerquotapolicy) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+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 "serviceconsumermanagement.services.consumerQuotaMetrics.limits.producerQuotaPolicies.patch" call. +// 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 *ServicesConsumerQuotaMetricsLimitsProducerQuotaPoliciesPatchCall) 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 +} diff --git a/spanner/v1/spanner-api.json b/spanner/v1/spanner-api.json index defaa691eaa..356e00a76d6 100644 --- a/spanner/v1/spanner-api.json +++ b/spanner/v1/spanner-api.json @@ -260,7 +260,7 @@ ] }, "list": { - "description": "Lists the supported instance configurations for a given project.", + "description": "Lists the supported instance configurations for a given project. Returns both Google managed configs and user managed configs.", "flatPath": "v1/projects/{projectsId}/instanceConfigs", "httpMethod": "GET", "id": "spanner.projects.instanceConfigs.list", @@ -306,7 +306,7 @@ ], "parameters": { "name": { - "description": "A unique identifier for the instance configuration. Values are of the form `projects//instanceConfigs/a-z*`.", + "description": "A unique identifier for the instance configuration. Values are of the form `projects//instanceConfigs/a-z*`. User instance config must start with `custom-`.", "location": "path", "pattern": "^projects/[^/]+/instanceConfigs/[^/]+$", "required": true, @@ -3005,7 +3005,7 @@ } } }, - "revision": "20240527", + "revision": "20240605", "rootUrl": "https://spanner.googleapis.com/", "schemas": { "AutoscalingConfig": { @@ -4521,7 +4521,7 @@ "type": "array" }, "name": { - "description": "A unique identifier for the instance configuration. Values are of the form `projects//instanceConfigs/a-z*`.", + "description": "A unique identifier for the instance configuration. Values are of the form `projects//instanceConfigs/a-z*`. User instance config must start with `custom-`.", "type": "string" }, "optionalReplicas": { @@ -4555,7 +4555,7 @@ "type": "boolean" }, "replicas": { - "description": "The geographic placement of nodes in this instance configuration and their replication properties.", + "description": "The geographic placement of nodes in this instance configuration and their replication properties. To create user managed configurations, input `replicas` must include all replicas in `replicas` of the `base_config` and include one or more replicas in the `optional_replicas` of the `base_config`.", "items": { "$ref": "ReplicaInfo" }, @@ -5748,6 +5748,34 @@ "format": "int64", "type": "string" }, + "lockHint": { + "description": "Optional. Lock Hint for the request, it can only be used with read-write transactions.", + "enum": [ + "LOCK_HINT_UNSPECIFIED", + "LOCK_HINT_SHARED", + "LOCK_HINT_EXCLUSIVE" + ], + "enumDescriptions": [ + "Default value. LOCK_HINT_UNSPECIFIED is equivalent to LOCK_HINT_SHARED.", + "Acquire shared locks. By default when you perform a read as part of a read-write transaction, Spanner acquires shared read locks, which allows other reads to still access the data until your transaction is ready to commit. When your transaction is committing and writes are being applied, the transaction attempts to upgrade to an exclusive lock for any data you are writing. For more information about locks, see [Lock modes](https://cloud.google.com/spanner/docs/introspection/lock-statistics#explain-lock-modes).", + "Acquire exclusive locks. Requesting exclusive locks is beneficial if you observe high write contention, which means you notice that multiple transactions are concurrently trying to read and write to the same data, resulting in a large number of aborts. This problem occurs when two transactions initially acquire shared locks and then both try to upgrade to exclusive locks at the same time. In this situation both transactions are waiting for the other to give up their lock, resulting in a deadlocked situation. Spanner is able to detect this occurring and force one of the transactions to abort. However, this is a slow and expensive operation and results in lower performance. In this case it makes sense to acquire exclusive locks at the start of the transaction because then when multiple transactions try to act on the same data, they automatically get serialized. Each transaction waits its turn to acquire the lock and avoids getting into deadlock situations. Because the exclusive lock hint is just a hint, it should not be considered equivalent to a mutex. In other words, you should not use Spanner exclusive locks as a mutual exclusion mechanism for the execution of code outside of Spanner. **Note:** Request exclusive locks judiciously because they block others from reading that data for the entire transaction, rather than just when the writes are being performed. Unless you observe high write contention, you should use the default of shared read locks so you don't prematurely block other clients from reading the data that you're writing to." + ], + "type": "string" + }, + "orderBy": { + "description": "Optional. Order for the returned rows. By default, Spanner will return result rows in primary key order except for PartitionRead requests. For applications that do not require rows to be returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval, resulting in lower latencies in certain cases (e.g. bulk point lookups).", + "enum": [ + "ORDER_BY_UNSPECIFIED", + "ORDER_BY_PRIMARY_KEY", + "ORDER_BY_NO_ORDER" + ], + "enumDescriptions": [ + "Default value. ORDER_BY_UNSPECIFIED is equivalent to ORDER_BY_PRIMARY_KEY.", + "Read rows are returned in primary key order. In the event that this option is used in conjunction with the `partition_token` field, the API will return an `INVALID_ARGUMENT` error.", + "Read rows are returned in any order." + ], + "type": "string" + }, "partitionToken": { "description": "If present, results will be restricted to the specified partition previously created using PartitionRead(). There must be an exact match for the values of fields common to this message and the PartitionReadRequest message used to create this partition_token.", "format": "byte", @@ -6164,7 +6192,7 @@ "type": "object" }, "multiplexed": { - "description": "Optional. If true, specifies a multiplexed session. A multiplexed session may be used for multiple, concurrent read-only operations but can not be used for read-write transactions, partitioned reads, or partitioned queries. Multiplexed sessions can be created via CreateSession but not via BatchCreateSessions. Multiplexed sessions may not be deleted nor listed.", + "description": "Optional. If true, specifies a multiplexed session. Use a multiplexed session for multiple, concurrent read-only operations. Don't use them for read-write transactions, partitioned reads, or partitioned queries. Use CreateSession to create multiplexed sessions. Don't use BatchCreateSessions to create a multiplexed session. You can't delete or list multiplexed sessions.", "type": "boolean" }, "name": { diff --git a/spanner/v1/spanner-gen.go b/spanner/v1/spanner-gen.go index 92783f498f9..8d33865594e 100644 --- a/spanner/v1/spanner-gen.go +++ b/spanner/v1/spanner-gen.go @@ -2657,7 +2657,8 @@ type InstanceConfig struct { // databases in instances that use this instance configuration. LeaderOptions []string `json:"leaderOptions,omitempty"` // Name: A unique identifier for the instance configuration. Values are of the - // form `projects//instanceConfigs/a-z*`. + // form `projects//instanceConfigs/a-z*`. User instance config must start with + // `custom-`. Name string `json:"name,omitempty"` // OptionalReplicas: Output only. The available optional replicas to choose // from for user managed configurations. Populated for Google managed @@ -2681,7 +2682,10 @@ type InstanceConfig struct { // updated. If false, there are no ongoing operations for the instance config. Reconciling bool `json:"reconciling,omitempty"` // Replicas: The geographic placement of nodes in this instance configuration - // and their replication properties. + // and their replication properties. To create user managed configurations, + // input `replicas` must include all replicas in `replicas` of the + // `base_config` and include one or more replicas in the `optional_replicas` of + // the `base_config`. Replicas []*ReplicaInfo `json:"replicas,omitempty"` // State: Output only. The current instance config state. Applicable only for // USER_MANAGED configs. @@ -4466,6 +4470,59 @@ type ReadRequest struct { // `limit` is zero, the default is no limit. A limit cannot be specified if // `partition_token` is set. Limit int64 `json:"limit,omitempty,string"` + // LockHint: Optional. Lock Hint for the request, it can only be used with + // read-write transactions. + // + // Possible values: + // "LOCK_HINT_UNSPECIFIED" - Default value. LOCK_HINT_UNSPECIFIED is + // equivalent to LOCK_HINT_SHARED. + // "LOCK_HINT_SHARED" - Acquire shared locks. By default when you perform a + // read as part of a read-write transaction, Spanner acquires shared read + // locks, which allows other reads to still access the data until your + // transaction is ready to commit. When your transaction is committing and + // writes are being applied, the transaction attempts to upgrade to an + // exclusive lock for any data you are writing. For more information about + // locks, see [Lock + // modes](https://cloud.google.com/spanner/docs/introspection/lock-statistics#ex + // plain-lock-modes). + // "LOCK_HINT_EXCLUSIVE" - Acquire exclusive locks. Requesting exclusive + // locks is beneficial if you observe high write contention, which means you + // notice that multiple transactions are concurrently trying to read and write + // to the same data, resulting in a large number of aborts. This problem occurs + // when two transactions initially acquire shared locks and then both try to + // upgrade to exclusive locks at the same time. In this situation both + // transactions are waiting for the other to give up their lock, resulting in a + // deadlocked situation. Spanner is able to detect this occurring and force one + // of the transactions to abort. However, this is a slow and expensive + // operation and results in lower performance. In this case it makes sense to + // acquire exclusive locks at the start of the transaction because then when + // multiple transactions try to act on the same data, they automatically get + // serialized. Each transaction waits its turn to acquire the lock and avoids + // getting into deadlock situations. Because the exclusive lock hint is just a + // hint, it should not be considered equivalent to a mutex. In other words, you + // should not use Spanner exclusive locks as a mutual exclusion mechanism for + // the execution of code outside of Spanner. **Note:** Request exclusive locks + // judiciously because they block others from reading that data for the entire + // transaction, rather than just when the writes are being performed. Unless + // you observe high write contention, you should use the default of shared read + // locks so you don't prematurely block other clients from reading the data + // that you're writing to. + LockHint string `json:"lockHint,omitempty"` + // OrderBy: Optional. Order for the returned rows. By default, Spanner will + // return result rows in primary key order except for PartitionRead requests. + // For applications that do not require rows to be returned in primary key + // (`ORDER_BY_PRIMARY_KEY`) order, setting `ORDER_BY_NO_ORDER` option allows + // Spanner to optimize row retrieval, resulting in lower latencies in certain + // cases (e.g. bulk point lookups). + // + // Possible values: + // "ORDER_BY_UNSPECIFIED" - Default value. ORDER_BY_UNSPECIFIED is equivalent + // to ORDER_BY_PRIMARY_KEY. + // "ORDER_BY_PRIMARY_KEY" - Read rows are returned in primary key order. In + // the event that this option is used in conjunction with the `partition_token` + // field, the API will return an `INVALID_ARGUMENT` error. + // "ORDER_BY_NO_ORDER" - Read rows are returned in any order. + OrderBy string `json:"orderBy,omitempty"` // PartitionToken: If present, results will be restricted to the specified // partition previously created using PartitionRead(). There must be an exact // match for the values of fields common to this message and the @@ -5040,12 +5097,12 @@ type Session struct { // with a given session. See https://goo.gl/xmQnxf for more information on and // examples of labels. Labels map[string]string `json:"labels,omitempty"` - // Multiplexed: Optional. If true, specifies a multiplexed session. A - // multiplexed session may be used for multiple, concurrent read-only - // operations but can not be used for read-write transactions, partitioned - // reads, or partitioned queries. Multiplexed sessions can be created via - // CreateSession but not via BatchCreateSessions. Multiplexed sessions may not - // be deleted nor listed. + // Multiplexed: Optional. If true, specifies a multiplexed session. Use a + // multiplexed session for multiple, concurrent read-only operations. Don't use + // them for read-write transactions, partitioned reads, or partitioned queries. + // Use CreateSession to create multiplexed sessions. Don't use + // BatchCreateSessions to create a multiplexed session. You can't delete or + // list multiplexed sessions. Multiplexed bool `json:"multiplexed,omitempty"` // Name: Output only. The name of the session. This is always system-assigned. Name string `json:"name,omitempty"` @@ -6671,6 +6728,7 @@ type ProjectsInstanceConfigsListCall struct { } // List: Lists the supported instance configurations for a given project. +// Returns both Google managed configs and user managed configs. // // - parent: The name of the project for which a list of supported instance // configurations is requested. Values are of the form `projects/`. @@ -6836,7 +6894,8 @@ type ProjectsInstanceConfigsPatchCall struct { // permission on the resource name. // // - name: A unique identifier for the instance configuration. Values are of -// the form `projects//instanceConfigs/a-z*`. +// the form `projects//instanceConfigs/a-z*`. User instance config must start +// with `custom-`. func (r *ProjectsInstanceConfigsService) Patch(nameid string, updateinstanceconfigrequest *UpdateInstanceConfigRequest) *ProjectsInstanceConfigsPatchCall { c := &ProjectsInstanceConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.nameid = nameid diff --git a/vault/v1/vault-api.json b/vault/v1/vault-api.json index 7355d6b3004..e7e551c7dd8 100644 --- a/vault/v1/vault-api.json +++ b/vault/v1/vault-api.json @@ -1203,7 +1203,7 @@ } } }, - "revision": "20240226", + "revision": "20240603", "rootUrl": "https://vault.googleapis.com/", "schemas": { "AccountCount": { @@ -1478,6 +1478,10 @@ "description": "Service-specific options for holds.", "id": "CorpusQuery", "properties": { + "calendarQuery": { + "$ref": "HeldCalendarQuery", + "description": "Service-specific options for Calendar holds. If set, **CorpusType** must be **CALENDAR**." + }, "driveQuery": { "$ref": "HeldDriveQuery", "description": "Service-specific options for Drive holds. If set, **CorpusType** must be **DRIVE**." @@ -1896,6 +1900,12 @@ }, "type": "object" }, + "HeldCalendarQuery": { + "description": "Options for Calendar holds.", + "id": "HeldCalendarQuery", + "properties": {}, + "type": "object" + }, "HeldDriveQuery": { "description": "Options for Drive holds.", "id": "HeldDriveQuery", diff --git a/vault/v1/vault-gen.go b/vault/v1/vault-gen.go index 7c6b8700a6b..a40f6021e4b 100644 --- a/vault/v1/vault-gen.go +++ b/vault/v1/vault-gen.go @@ -594,6 +594,9 @@ func (s *CloudStorageSink) MarshalJSON() ([]byte, error) { // CorpusQuery: Service-specific options for holds. type CorpusQuery struct { + // CalendarQuery: Service-specific options for Calendar holds. If set, + // **CorpusType** must be **CALENDAR**. + CalendarQuery *HeldCalendarQuery `json:"calendarQuery,omitempty"` // DriveQuery: Service-specific options for Drive holds. If set, **CorpusType** // must be **DRIVE**. DriveQuery *HeldDriveQuery `json:"driveQuery,omitempty"` @@ -609,13 +612,13 @@ type CorpusQuery struct { // VoiceQuery: Service-specific options for Voice holds. If set, **CorpusType** // must be **VOICE**. VoiceQuery *HeldVoiceQuery `json:"voiceQuery,omitempty"` - // ForceSendFields is a list of field names (e.g. "DriveQuery") to + // ForceSendFields is a list of field names (e.g. "CalendarQuery") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DriveQuery") to include in API + // NullFields is a list of field names (e.g. "CalendarQuery") to include in API // requests with the JSON null value. By default, fields with empty values are // omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. @@ -1098,6 +1101,10 @@ func (s *HeldAccount) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } +// HeldCalendarQuery: Options for Calendar holds. +type HeldCalendarQuery struct { +} + // HeldDriveQuery: Options for Drive holds. type HeldDriveQuery struct { // IncludeSharedDriveFiles: To include files in shared drives in the hold, set