diff --git a/admin/directory/v1/admin-api.json b/admin/directory/v1/admin-api.json index 7fb5bb566ee..fcd5e05dbce 100644 --- a/admin/directory/v1/admin-api.json +++ b/admin/directory/v1/admin-api.json @@ -4671,7 +4671,7 @@ } } }, - "revision": "20250707", + "revision": "20250804", "rootUrl": "https://admin.googleapis.com/", "schemas": { "Alias": { @@ -5840,6 +5840,23 @@ "description": "The Chrome device's operating system version.", "type": "string" }, + "osVersionCompliance": { + "description": "Output only. Compliance status of the OS version.", + "enum": [ + "complianceUnspecified", + "compliant", + "pending", + "notCompliant" + ], + "enumDescriptions": [ + "Compliance status unspecified.", + "Compliance status compliant.", + "Compliance status pending.", + "Compliance status not compliant." + ], + "readOnly": true, + "type": "string" + }, "platformVersion": { "description": "The Chrome device's platform version.", "type": "string" diff --git a/admin/directory/v1/admin-gen.go b/admin/directory/v1/admin-gen.go index 9e5f7da14a4..f089c196787 100644 --- a/admin/directory/v1/admin-gen.go +++ b/admin/directory/v1/admin-gen.go @@ -1719,6 +1719,14 @@ type ChromeOsDevice struct { OsUpdateStatus *OsUpdateStatus `json:"osUpdateStatus,omitempty"` // OsVersion: The Chrome device's operating system version. OsVersion string `json:"osVersion,omitempty"` + // OsVersionCompliance: Output only. Compliance status of the OS version. + // + // Possible values: + // "complianceUnspecified" - Compliance status unspecified. + // "compliant" - Compliance status compliant. + // "pending" - Compliance status pending. + // "notCompliant" - Compliance status not compliant. + OsVersionCompliance string `json:"osVersionCompliance,omitempty"` // PlatformVersion: The Chrome device's platform version. PlatformVersion string `json:"platformVersion,omitempty"` // RecentUsers: A list of recent device users, in descending order, by last diff --git a/apigee/v1/apigee-api.json b/apigee/v1/apigee-api.json index fea4e5a73c1..ac1b5491f2c 100644 --- a/apigee/v1/apigee-api.json +++ b/apigee/v1/apigee-api.json @@ -2422,7 +2422,7 @@ "type": "string" }, "pageSize": { - "description": "Optional. Count of apps a single page can have in the response. If unspecified, at most 100 apps will be returned. The maximum value is 100; values above 100 will be coerced to 100. \"page_size\" is supported from ver 1.10.0 and above.", + "description": "Optional. Count of apps a single page can have in the response. If unspecified, at most 1000 apps will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. \"page_size\" is supported from ver 1.10.0 and above.", "format": "int32", "location": "query", "type": "integer" @@ -2440,7 +2440,7 @@ "type": "string" }, "rows": { - "description": "Optional. Maximum number of app IDs to return. Defaults to 1000.", + "description": "Optional. Maximum number of app IDs to return. Defaults to 1000, which is also the upper limit. To get more than 1000, use pagination with 'pageSize' and 'pageToken' parameters.", "format": "int64", "location": "query", "type": "string" @@ -11127,7 +11127,7 @@ } } }, - "revision": "20250722", + "revision": "20250731", "rootUrl": "https://apigee.googleapis.com/", "schemas": { "EdgeConfigstoreBundleBadBundle": { @@ -15248,6 +15248,10 @@ "description": "Required. Flag that specifies whether entry values will be encrypted. This field is retained for backward compatibility and the value of encrypted will always be `true`. Apigee X and hybrid do not support unencrypted key value maps.", "type": "boolean" }, + "maskedValues": { + "description": "Required. Flag that specifies whether entry values will be masked when returned.", + "type": "boolean" + }, "name": { "description": "Required. ID of the key value map.", "type": "string" diff --git a/apigee/v1/apigee-gen.go b/apigee/v1/apigee-gen.go index a619bee14bd..6732e75f3d9 100644 --- a/apigee/v1/apigee-gen.go +++ b/apigee/v1/apigee-gen.go @@ -6017,6 +6017,9 @@ type GoogleCloudApigeeV1KeyValueMap struct { // of encrypted will always be `true`. Apigee X and hybrid do not support // unencrypted key value maps. Encrypted bool `json:"encrypted,omitempty"` + // MaskedValues: Required. Flag that specifies whether entry values will be + // masked when returned. + MaskedValues bool `json:"maskedValues,omitempty"` // Name: Required. ID of the key value map. Name string `json:"name,omitempty"` @@ -21055,9 +21058,9 @@ func (c *OrganizationsAppsListCall) KeyStatus(keyStatus string) *OrganizationsAp } // PageSize sets the optional parameter "pageSize": Count of apps a single page -// can have in the response. If unspecified, at most 100 apps will be returned. -// The maximum value is 100; values above 100 will be coerced to 100. -// "page_size" is supported from ver 1.10.0 and above. +// can have in the response. If unspecified, at most 1000 apps will be +// returned. The maximum value is 1000; values above 1000 will be coerced to +// 1000. "page_size" is supported from ver 1.10.0 and above. func (c *OrganizationsAppsListCall) PageSize(pageSize int64) *OrganizationsAppsListCall { c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) return c @@ -21072,7 +21075,8 @@ func (c *OrganizationsAppsListCall) PageToken(pageToken string) *OrganizationsAp } // Rows sets the optional parameter "rows": Maximum number of app IDs to -// return. Defaults to 1000. +// return. Defaults to 1000, which is also the upper limit. To get more than +// 1000, use pagination with 'pageSize' and 'pageToken' parameters. func (c *OrganizationsAppsListCall) Rows(rows int64) *OrganizationsAppsListCall { c.urlParams_.Set("rows", fmt.Sprint(rows)) return c diff --git a/apim/v1alpha/apim-api.json b/apim/v1alpha/apim-api.json index 7efbf7facda..af1c546e3f1 100644 --- a/apim/v1alpha/apim-api.json +++ b/apim/v1alpha/apim-api.json @@ -134,6 +134,31 @@ "https://www.googleapis.com/auth/cloud-platform" ] }, + "getEntitlement": { + "description": "GetEntitlement returns the entitlement for the provided project.", + "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/entitlement", + "httpMethod": "GET", + "id": "apim.projects.locations.getEntitlement", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The entitlement resource name Format: projects/{project}/locations/{location}/entitlement", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/entitlement$", + "required": true, + "type": "string" + } + }, + "path": "v1alpha/{+name}", + "response": { + "$ref": "Entitlement" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "list": { "description": "Lists information about the supported locations for this service.", "flatPath": "v1alpha/projects/{projectsId}/locations", @@ -821,7 +846,7 @@ } } }, - "revision": "20250521", + "revision": "20250730", "rootUrl": "https://apim.googleapis.com/", "schemas": { "ApiObservation": { @@ -996,6 +1021,38 @@ "properties": {}, "type": "object" }, + "Entitlement": { + "description": "Entitlement stores data related to API Observation entitlement for a given project", + "id": "Entitlement", + "properties": { + "apiObservationEntitled": { + "description": "Whether API Observation is entitled.", + "type": "boolean" + }, + "billingProjectNumber": { + "description": "Project number of associated billing project that has Apigee and Advanced API Security entitled.", + "format": "int64", + "type": "string" + }, + "createTime": { + "description": "Output only. The time of the entitlement creation.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "name": { + "description": "Identifier. The entitlement resource name `projects/{project}/locations/{location}/entitlement`", + "type": "string" + }, + "updateTime": { + "description": "Output only. The time of the entitlement update.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, "GclbObservationSource": { "description": "The GCLB observation source.", "id": "GclbObservationSource", diff --git a/apim/v1alpha/apim-gen.go b/apim/v1alpha/apim-gen.go index 88e303be135..3a7bfcfb503 100644 --- a/apim/v1alpha/apim-gen.go +++ b/apim/v1alpha/apim-gen.go @@ -417,6 +417,42 @@ type Empty struct { type EnableObservationJobRequest struct { } +// Entitlement: Entitlement stores data related to API Observation entitlement +// for a given project +type Entitlement struct { + // ApiObservationEntitled: Whether API Observation is entitled. + ApiObservationEntitled bool `json:"apiObservationEntitled,omitempty"` + // BillingProjectNumber: Project number of associated billing project that has + // Apigee and Advanced API Security entitled. + BillingProjectNumber int64 `json:"billingProjectNumber,omitempty,string"` + // CreateTime: Output only. The time of the entitlement creation. + CreateTime string `json:"createTime,omitempty"` + // Name: Identifier. The entitlement resource name + // `projects/{project}/locations/{location}/entitlement` + Name string `json:"name,omitempty"` + // UpdateTime: Output only. The time of the entitlement update. + UpdateTime string `json:"updateTime,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "ApiObservationEntitled") 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. "ApiObservationEntitled") 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 Entitlement) MarshalJSON() ([]byte, error) { + type NoMethod Entitlement + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + // GclbObservationSource: The GCLB observation source. type GclbObservationSource struct { // PscNetworkConfigs: Required. The VPC networks where traffic will be @@ -1246,6 +1282,117 @@ func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, return ret, nil } +type ProjectsLocationsGetEntitlementCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// GetEntitlement: GetEntitlement returns the entitlement for the provided +// project. +// +// - name: The entitlement resource name Format: +// projects/{project}/locations/{location}/entitlement. +func (r *ProjectsLocationsService) GetEntitlement(name string) *ProjectsLocationsGetEntitlementCall { + c := &ProjectsLocationsGetEntitlementCall{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 *ProjectsLocationsGetEntitlementCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetEntitlementCall { + 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 *ProjectsLocationsGetEntitlementCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetEntitlementCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ProjectsLocationsGetEntitlementCall) Context(ctx context.Context) *ProjectsLocationsGetEntitlementCall { + 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 *ProjectsLocationsGetEntitlementCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsGetEntitlementCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apim.projects.locations.getEntitlement", "request", internallog.HTTPRequest(req, nil)) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "apim.projects.locations.getEntitlement" call. +// Any non-2xx status code is an error. Response headers are in either +// *Entitlement.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 *ProjectsLocationsGetEntitlementCall) Do(opts ...googleapi.CallOption) (*Entitlement, 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 := &Entitlement{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apim.projects.locations.getEntitlement", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + type ProjectsLocationsListCall struct { s *Service name string diff --git a/backupdr/v1/backupdr-api.json b/backupdr/v1/backupdr-api.json index d87ec1d0a42..14a8b4e9334 100644 --- a/backupdr/v1/backupdr-api.json +++ b/backupdr/v1/backupdr-api.json @@ -2060,7 +2060,7 @@ } } }, - "revision": "20250723", + "revision": "20250730", "rootUrl": "https://backupdr.googleapis.com/", "schemas": { "AbandonBackupRequest": { @@ -4029,6 +4029,10 @@ "description": "DiskBackupProperties represents the properties of a Disk backup.", "id": "DiskBackupProperties", "properties": { + "accessMode": { + "description": "The access mode of the source disk.", + "type": "string" + }, "architecture": { "description": "The architecture of the source disk. Valid values are ARM64 or X86_64.", "enum": [ @@ -4047,6 +4051,10 @@ "description": "A description of the source disk.", "type": "string" }, + "enableConfidentialCompute": { + "description": "Indicates whether the source disk is using confidential compute mode.", + "type": "boolean" + }, "guestOsFeature": { "description": "A list of guest OS features that are applicable to this backup.", "items": { @@ -4054,6 +4062,13 @@ }, "type": "array" }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "The labels of the source disk.", + "type": "object" + }, "licenses": { "description": "A list of publicly available licenses that are applicable to this backup. This is applicable if the original image had licenses attached, e.g. Windows image.", "items": { @@ -4061,6 +4076,21 @@ }, "type": "array" }, + "physicalBlockSizeBytes": { + "description": "The physical block size of the source disk.", + "format": "int64", + "type": "string" + }, + "provisionedIops": { + "description": "The number of IOPS provisioned for the source disk.", + "format": "int64", + "type": "string" + }, + "provisionedThroughput": { + "description": "The number of throughput provisioned for the source disk.", + "format": "int64", + "type": "string" + }, "region": { "description": "Region and zone are mutually exclusive fields. The URL of the region of the source disk.", "type": "string" @@ -4081,6 +4111,10 @@ "description": "The source disk used to create this backup.", "type": "string" }, + "storagePool": { + "description": "The storage pool of the source disk.", + "type": "string" + }, "type": { "description": "The URL of the type of the disk.", "type": "string" @@ -4931,6 +4965,28 @@ }, "type": "object" }, + "LocationMetadata": { + "id": "LocationMetadata", + "properties": { + "unsupportedFeatures": { + "items": { + "enum": [ + "FEATURE_UNSPECIFIED", + "MANAGEMENT_SERVER", + "COMPUTE_INSTANCE" + ], + "enumDescriptions": [ + "", + "", + "" + ], + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, "ManagementServer": { "description": "ManagementServer describes a single BackupDR ManagementServer instance.", "id": "ManagementServer", diff --git a/backupdr/v1/backupdr-gen.go b/backupdr/v1/backupdr-gen.go index 9cc170b5ea4..7853bc1829a 100644 --- a/backupdr/v1/backupdr-gen.go +++ b/backupdr/v1/backupdr-gen.go @@ -2381,6 +2381,8 @@ func (s DataSourceReference) MarshalJSON() ([]byte, error) { // DiskBackupProperties: DiskBackupProperties represents the properties of a // Disk backup. type DiskBackupProperties struct { + // AccessMode: The access mode of the source disk. + AccessMode string `json:"accessMode,omitempty"` // Architecture: The architecture of the source disk. Valid values are ARM64 or // X86_64. // @@ -2391,13 +2393,25 @@ type DiskBackupProperties struct { Architecture string `json:"architecture,omitempty"` // Description: A description of the source disk. Description string `json:"description,omitempty"` + // EnableConfidentialCompute: Indicates whether the source disk is using + // confidential compute mode. + EnableConfidentialCompute bool `json:"enableConfidentialCompute,omitempty"` // GuestOsFeature: A list of guest OS features that are applicable to this // backup. GuestOsFeature []*GuestOsFeature `json:"guestOsFeature,omitempty"` + // Labels: The labels of the source disk. + Labels map[string]string `json:"labels,omitempty"` // Licenses: A list of publicly available licenses that are applicable to this // backup. This is applicable if the original image had licenses attached, e.g. // Windows image. Licenses []string `json:"licenses,omitempty"` + // PhysicalBlockSizeBytes: The physical block size of the source disk. + PhysicalBlockSizeBytes int64 `json:"physicalBlockSizeBytes,omitempty,string"` + // ProvisionedIops: The number of IOPS provisioned for the source disk. + ProvisionedIops int64 `json:"provisionedIops,omitempty,string"` + // ProvisionedThroughput: The number of throughput provisioned for the source + // disk. + ProvisionedThroughput int64 `json:"provisionedThroughput,omitempty,string"` // Region: Region and zone are mutually exclusive fields. The URL of the region // of the source disk. Region string `json:"region,omitempty"` @@ -2408,17 +2422,19 @@ type DiskBackupProperties struct { SizeGb int64 `json:"sizeGb,omitempty,string"` // SourceDisk: The source disk used to create this backup. SourceDisk string `json:"sourceDisk,omitempty"` + // StoragePool: The storage pool of the source disk. + StoragePool string `json:"storagePool,omitempty"` // Type: The URL of the type of the disk. Type string `json:"type,omitempty"` // Zone: The URL of the Zone where the source disk. Zone string `json:"zone,omitempty"` - // ForceSendFields is a list of field names (e.g. "Architecture") to + // ForceSendFields is a list of field names (e.g. "AccessMode") 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. "Architecture") to include in API + // NullFields is a list of field names (e.g. "AccessMode") 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. @@ -3597,6 +3613,30 @@ func (s Location) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) } +type LocationMetadata struct { + // Possible values: + // "FEATURE_UNSPECIFIED" + // "MANAGEMENT_SERVER" + // "COMPUTE_INSTANCE" + UnsupportedFeatures []string `json:"unsupportedFeatures,omitempty"` + // ForceSendFields is a list of field names (e.g. "UnsupportedFeatures") 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. "UnsupportedFeatures") 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 LocationMetadata) MarshalJSON() ([]byte, error) { + type NoMethod LocationMetadata + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + // ManagementServer: ManagementServer describes a single BackupDR // ManagementServer instance. type ManagementServer struct { diff --git a/dialogflow/v3beta1/dialogflow-api.json b/dialogflow/v3beta1/dialogflow-api.json index 16a0e6a7370..86407df7316 100644 --- a/dialogflow/v3beta1/dialogflow-api.json +++ b/dialogflow/v3beta1/dialogflow-api.json @@ -5436,7 +5436,7 @@ } } }, - "revision": "20250627", + "revision": "20250804", "rootUrl": "https://dialogflow.googleapis.com/", "schemas": { "GoogleCloudDialogflowCxV3AdvancedSettings": { @@ -10664,6 +10664,13 @@ }, "type": "array" }, + "inputParameterDefinitions": { + "description": "Optional. Defined structured input parameters for this flow.", + "items": { + "$ref": "GoogleCloudDialogflowCxV3beta1ParameterDefinition" + }, + "type": "array" + }, "knowledgeConnectorSettings": { "$ref": "GoogleCloudDialogflowCxV3beta1KnowledgeConnectorSettings", "description": "Optional. Knowledge connector configuration." @@ -10684,6 +10691,13 @@ "$ref": "GoogleCloudDialogflowCxV3beta1NluSettings", "description": "NLU related settings of the flow." }, + "outputParameterDefinitions": { + "description": "Optional. Defined structured output parameters for this flow.", + "items": { + "$ref": "GoogleCloudDialogflowCxV3beta1ParameterDefinition" + }, + "type": "array" + }, "transitionRouteGroups": { "description": "A flow's transition route group serve two purposes: * They are responsible for matching the user's first utterances in the flow. * They are inherited by every page's transition route groups. Transition route groups defined in the page have higher priority than those defined in the flow. Format:`projects//locations//agents//flows//transitionRouteGroups/` or `projects//locations//agents//transitionRouteGroups/` for agent-level groups.", "items": { diff --git a/dialogflow/v3beta1/dialogflow-gen.go b/dialogflow/v3beta1/dialogflow-gen.go index cdf4c964d09..39ffdc5e98f 100644 --- a/dialogflow/v3beta1/dialogflow-gen.go +++ b/dialogflow/v3beta1/dialogflow-gen.go @@ -7686,6 +7686,9 @@ type GoogleCloudDialogflowCxV3beta1Flow struct { // transition_routes, these handlers are evaluated on a first-match basis. The // first one that matches the event get executed, with the rest being ignored. EventHandlers []*GoogleCloudDialogflowCxV3beta1EventHandler `json:"eventHandlers,omitempty"` + // InputParameterDefinitions: Optional. Defined structured input parameters for + // this flow. + InputParameterDefinitions []*GoogleCloudDialogflowCxV3beta1ParameterDefinition `json:"inputParameterDefinitions,omitempty"` // KnowledgeConnectorSettings: Optional. Knowledge connector configuration. KnowledgeConnectorSettings *GoogleCloudDialogflowCxV3beta1KnowledgeConnectorSettings `json:"knowledgeConnectorSettings,omitempty"` // Locked: Indicates whether the flow is locked for changes. If the flow is @@ -7698,6 +7701,9 @@ type GoogleCloudDialogflowCxV3beta1Flow struct { Name string `json:"name,omitempty"` // NluSettings: NLU related settings of the flow. NluSettings *GoogleCloudDialogflowCxV3beta1NluSettings `json:"nluSettings,omitempty"` + // OutputParameterDefinitions: Optional. Defined structured output parameters + // for this flow. + OutputParameterDefinitions []*GoogleCloudDialogflowCxV3beta1ParameterDefinition `json:"outputParameterDefinitions,omitempty"` // TransitionRouteGroups: A flow's transition route group serve two purposes: * // They are responsible for matching the user's first utterances in the flow. * // They are inherited by every page's transition route groups. Transition route diff --git a/displayvideo/v4/displayvideo-api.json b/displayvideo/v4/displayvideo-api.json index 94f3efe6e6a..9792fd06bff 100644 --- a/displayvideo/v4/displayvideo-api.json +++ b/displayvideo/v4/displayvideo-api.json @@ -9302,7 +9302,7 @@ } } }, - "revision": "20250729", + "revision": "20250803", "rootUrl": "https://displayvideo.googleapis.com/", "schemas": { "ActiveViewVideoViewabilityMetricConfig": { @@ -14079,6 +14079,20 @@ "type": "string" }, "type": "array" + }, + "thirdPartyOptimizationPartner": { + "description": "Optional. Immutable. Designates the third party optimization partner that manages this algorithm.", + "enum": [ + "UNKNOWN", + "SCIBIDS", + "ADELAIDE" + ], + "enumDescriptions": [ + "Type value is not specified or is unknown in this version.", + "Third party data science service provider that DV3 partners/advertisers can partner with.", + "Third party attention measurement service provider that DV3 partners/advertisers can partner with." + ], + "type": "string" } }, "type": "object" diff --git a/displayvideo/v4/displayvideo-gen.go b/displayvideo/v4/displayvideo-gen.go index d81a66fef61..59d4c1b0b34 100644 --- a/displayvideo/v4/displayvideo-gen.go +++ b/displayvideo/v4/displayvideo-gen.go @@ -6433,6 +6433,16 @@ type CustomBiddingAlgorithm struct { // (/display-video/api/reference/rest/v1/customBiddingAlgorithms/list#body.QUERY // _PARAMETERS.oneof_accessor). SharedAdvertiserIds googleapi.Int64s `json:"sharedAdvertiserIds,omitempty"` + // ThirdPartyOptimizationPartner: Optional. Immutable. Designates the third + // party optimization partner that manages this algorithm. + // + // Possible values: + // "UNKNOWN" - Type value is not specified or is unknown in this version. + // "SCIBIDS" - Third party data science service provider that DV3 + // partners/advertisers can partner with. + // "ADELAIDE" - Third party attention measurement service provider that DV3 + // partners/advertisers can partner with. + ThirdPartyOptimizationPartner string `json:"thirdPartyOptimizationPartner,omitempty"` // ServerResponse contains the HTTP response code and headers from the server. googleapi.ServerResponse `json:"-"` diff --git a/merchantapi/accounts/v1/merchantapi-api.json b/merchantapi/accounts/v1/merchantapi-api.json new file mode 100644 index 00000000000..0f9b152ce85 --- /dev/null +++ b/merchantapi/accounts/v1/merchantapi-api.json @@ -0,0 +1,5402 @@ +{ + "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.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_v1", + "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 Merchant Center account with additional configuration. Adds the user that makes the request as an admin for the new account.", + "flatPath": "accounts/v1/accounts:createAndConfigure", + "httpMethod": "POST", + "id": "merchantapi.accounts.createAndConfigure", + "parameterOrder": [], + "parameters": {}, + "path": "accounts/v1/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, advanced account or sub-account. Deleting an advanced account leads to the deletion of all of its sub-accounts. Executing this method requires admin access. The deletion succeeds only if the account does not provide services to any other account and has no processed offers. You can use the `force` parameter to override this.", + "flatPath": "accounts/v1/accounts/{accountsId}", + "httpMethod": "DELETE", + "id": "merchantapi.accounts.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "force": { + "description": "Optional. If set to `true`, the account is deleted even if it provides services to other accounts or has processed offers.", + "location": "query", + "type": "boolean" + }, + "name": { + "description": "Required. The name of the account to delete. Format: `accounts/{account}`", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+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/v1/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/v1/{+name}", + "response": { + "$ref": "Account" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "description": "Note: For the `accounts.list` method, quota and limits usage are charged for each user, and not for the Merchant Center ID or the advanced account ID. To list several sub-accounts, you should use the `accounts.listSubaccounts` method, which is more suitable for advanced accounts use case.", + "flatPath": "accounts/v1/accounts", + "httpMethod": "GET", + "id": "merchantapi.accounts.list", + "parameterOrder": [], + "parameters": { + "filter": { + "description": "Optional. Returns only accounts that match the [filter](https://developers.google.com/merchant/api/guides/accounts/filter). For more details, see the [filter syntax reference](https://developers.google.com/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 `accounts.list` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided in the `accounts.list` request must match the call that provided the page token.", + "location": "query", + "type": "string" + } + }, + "path": "accounts/v1/accounts", + "response": { + "$ref": "ListAccountsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "listSubaccounts": { + "description": "List all sub-accounts for a given advanced account. This is a convenience wrapper for the more powerful `accounts.list` 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/v1/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 `accounts.list` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided in the `accounts.list` request must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "provider": { + "description": "Required. The aggregation service provider. Format: `accounts/{accountId}`", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+provider}:listSubaccounts", + "response": { + "$ref": "ListSubAccountsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "patch": { + "description": "Updates an account regardless of its type: standalone, advanced account or sub-account. Executing this method requires admin access.", + "flatPath": "accounts/v1/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": "Optional. List of fields being updated. The following fields are supported (in both `snake_case` and `lowerCamelCase`): - `account_name` - `adult_content` - `language_code` - `time_zone`", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "accounts/v1/{+name}", + "request": { + "$ref": "Account" + }, + "response": { + "$ref": "Account" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + }, + "resources": { + "autofeedSettings": { + "methods": { + "getAutofeedSettings": { + "description": "Retrieves the autofeed settings of an account.", + "flatPath": "accounts/v1/accounts/{accountsId}/autofeedSettings", + "httpMethod": "GET", + "id": "merchantapi.accounts.autofeedSettings.getAutofeedSettings", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the autofeed settings. Format: `accounts/{account}/autofeedSettings`", + "location": "path", + "pattern": "^accounts/[^/]+/autofeedSettings$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+name}", + "response": { + "$ref": "AutofeedSettings" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "updateAutofeedSettings": { + "description": "Updates the autofeed settings of an account.", + "flatPath": "accounts/v1/accounts/{accountsId}/autofeedSettings", + "httpMethod": "PATCH", + "id": "merchantapi.accounts.autofeedSettings.updateAutofeedSettings", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Identifier. The resource name of the autofeed settings. Format: `accounts/{account}/autofeedSettings`.", + "location": "path", + "pattern": "^accounts/[^/]+/autofeedSettings$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Required. List of fields being updated.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "accounts/v1/{+name}", + "request": { + "$ref": "AutofeedSettings" + }, + "response": { + "$ref": "AutofeedSettings" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + }, + "automaticImprovements": { + "methods": { + "getAutomaticImprovements": { + "description": "Retrieves the automatic improvements of an account.", + "flatPath": "accounts/v1/accounts/{accountsId}/automaticImprovements", + "httpMethod": "GET", + "id": "merchantapi.accounts.automaticImprovements.getAutomaticImprovements", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the automatic improvements. Format: `accounts/{account}/automaticImprovements`", + "location": "path", + "pattern": "^accounts/[^/]+/automaticImprovements$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+name}", + "response": { + "$ref": "AutomaticImprovements" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "updateAutomaticImprovements": { + "description": "Updates the automatic improvements of an account.", + "flatPath": "accounts/v1/accounts/{accountsId}/automaticImprovements", + "httpMethod": "PATCH", + "id": "merchantapi.accounts.automaticImprovements.updateAutomaticImprovements", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Identifier. The resource name of the automatic improvements. Format: `accounts/{account}/automaticImprovements`.", + "location": "path", + "pattern": "^accounts/[^/]+/automaticImprovements$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Required. List of fields being updated. The following fields are supported (in both `snake_case` and `lowerCamelCase`): - `item_updates` - `item_updates.account_level_settings` - `image_improvements` - `image_improvements.account_level_settings` - `shipping_improvements` - `shipping_improvements.allow_shipping_improvements`", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "accounts/v1/{+name}", + "request": { + "$ref": "AutomaticImprovements" + }, + "response": { + "$ref": "AutomaticImprovements" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + }, + "businessIdentity": { + "methods": { + "getBusinessIdentity": { + "description": "Retrieves the business identity of an account.", + "flatPath": "accounts/v1/accounts/{accountsId}/businessIdentity", + "httpMethod": "GET", + "id": "merchantapi.accounts.businessIdentity.getBusinessIdentity", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the business identity. Format: `accounts/{account}/businessIdentity`. For example, `accounts/123456/businessIdentity`.", + "location": "path", + "pattern": "^accounts/[^/]+/businessIdentity$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+name}", + "response": { + "$ref": "BusinessIdentity" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "updateBusinessIdentity": { + "description": "Updates the business identity of an account. Executing this method requires admin access.", + "flatPath": "accounts/v1/accounts/{accountsId}/businessIdentity", + "httpMethod": "PATCH", + "id": "merchantapi.accounts.businessIdentity.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": "Optional. List of fields being updated. The following fields are supported (in both `snake_case` and `lowerCamelCase`): - `black_owned` - `latino_owned` - `promotions_consent` - `small_business` - `veteran_owned` - `women_owned`", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "accounts/v1/{+name}", + "request": { + "$ref": "BusinessIdentity" + }, + "response": { + "$ref": "BusinessIdentity" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + }, + "businessInfo": { + "methods": { + "getBusinessInfo": { + "description": "Retrieves the business info of an account.", + "flatPath": "accounts/v1/accounts/{accountsId}/businessInfo", + "httpMethod": "GET", + "id": "merchantapi.accounts.businessInfo.getBusinessInfo", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the business info. Format: `accounts/{account}/businessInfo`. For example, `accounts/123456/businessInfo`.", + "location": "path", + "pattern": "^accounts/[^/]+/businessInfo$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+name}", + "response": { + "$ref": "BusinessInfo" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "updateBusinessInfo": { + "description": "Updates the business info of an account. Executing this method requires admin access.", + "flatPath": "accounts/v1/accounts/{accountsId}/businessInfo", + "httpMethod": "PATCH", + "id": "merchantapi.accounts.businessInfo.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": "Optional. List of fields being updated. The following fields are supported (in both `snake_case` and `lowerCamelCase`): - `address` - `customer_service` - `korean_business_registration_number`", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "accounts/v1/{+name}", + "request": { + "$ref": "BusinessInfo" + }, + "response": { + "$ref": "BusinessInfo" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + }, + "developerRegistration": { + "methods": { + "getDeveloperRegistration": { + "description": "Retrieves a developer registration for a merchant.", + "flatPath": "accounts/v1/accounts/{accountsId}/developerRegistration", + "httpMethod": "GET", + "id": "merchantapi.accounts.developerRegistration.getDeveloperRegistration", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The `name` (ID) of the developer registration.", + "location": "path", + "pattern": "^accounts/[^/]+/developerRegistration$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+name}", + "response": { + "$ref": "DeveloperRegistration" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "registerGcp": { + "description": "Registers the GCP used for the API call to the shopping account passed in the request. Will create a user with an \"API developer\" and add the \"developer_email\" as a contact with \"API notifications\" email preference on.", + "flatPath": "accounts/v1/accounts/{accountsId}/developerRegistration:registerGcp", + "httpMethod": "POST", + "id": "merchantapi.accounts.developerRegistration.registerGcp", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the developer registration to be created for the merchant account that the GCP will be registered with. Format: `accounts/{account}/developerRegistration`", + "location": "path", + "pattern": "^accounts/[^/]+/developerRegistration$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+name}:registerGcp", + "request": { + "$ref": "RegisterGcpRequest" + }, + "response": { + "$ref": "DeveloperRegistration" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "unregisterGcp": { + "description": "Unregister the calling GCP from the calling shopping account. Note that the GCP will still be able to access the API for at most 1 day from the unregister succussful call.", + "flatPath": "accounts/v1/accounts/{accountsId}/developerRegistration:unregisterGcp", + "httpMethod": "POST", + "id": "merchantapi.accounts.developerRegistration.unregisterGcp", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the developer registration to be created for the merchant account that the GCP will be registered with. Format: `accounts/{account}/developerRegistration`", + "location": "path", + "pattern": "^accounts/[^/]+/developerRegistration$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+name}:unregisterGcp", + "request": { + "$ref": "UnregisterGcpRequest" + }, + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + }, + "emailPreferences": { + "methods": { + "getEmailPreferences": { + "description": "Returns the email preferences for a Merchant Center account user. This service only permits retrieving and updating email preferences for the authenticated user. Use the name=accounts/*/users/me/emailPreferences alias to get preferences for the authenticated user.", + "flatPath": "accounts/v1/accounts/{accountsId}/users/{usersId}/emailPreferences", + "httpMethod": "GET", + "id": "merchantapi.accounts.emailPreferences.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/v1/{+name}", + "response": { + "$ref": "EmailPreferences" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "updateEmailPreferences": { + "description": "Updates the email preferences for a Merchant Center account user. Advanced account users should specify the advanced account rather than a sub-account of the advanced account. 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/v1/accounts/{accountsId}/users/{usersId}/emailPreferences", + "httpMethod": "PATCH", + "id": "merchantapi.accounts.emailPreferences.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. The following fields are supported (in both `snake_case` and `lowerCamelCase`): - `news_and_tips`", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "accounts/v1/{+name}", + "request": { + "$ref": "EmailPreferences" + }, + "response": { + "$ref": "EmailPreferences" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + }, + "gbpAccounts": { + "methods": { + "linkGbpAccount": { + "description": "Link the specified merchant to a GBP account for all countries. To run this method, you must have admin access to the Merchant Center account. If you don't have admin access, the request fails with the error message `User is not an administrator of account {ACCOUNT_ID}`.", + "flatPath": "accounts/v1/accounts/{accountsId}/gbpAccounts:linkGbpAccount", + "httpMethod": "POST", + "id": "merchantapi.accounts.gbpAccounts.linkGbpAccount", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The name of the parent resource to which the GBP account is linked. Format: `accounts/{account}`.", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+parent}/gbpAccounts:linkGbpAccount", + "request": { + "$ref": "LinkGbpAccountRequest" + }, + "response": { + "$ref": "LinkGbpAccountResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "description": "List the GBP accounts for a given merchant.", + "flatPath": "accounts/v1/accounts/{accountsId}/gbpAccounts", + "httpMethod": "GET", + "id": "merchantapi.accounts.gbpAccounts.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of `GbpAccount` resources to return. The service returns fewer than this value if the number of gbp accounts is less that than the `pageSize`. The default value is 50. 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 `ListGbpAccounts` call. Provide the page token to retrieve the subsequent page. When paginating, all other parameters provided to `ListGbpAccounts` must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The name of the parent resource under which the GBP accounts are listed. Format: `accounts/{account}`.", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+parent}/gbpAccounts", + "response": { + "$ref": "ListGbpAccountsResponse" + }, + "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 business 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 is returned: * PERMISSION_DENIED: User doesn't have the necessary permissions on this Merchant Center account. * FAILED_PRECONDITION: - The account is not a Merchant Center account. - Merchant Center account doesn't have a homepage. - Claiming failed (in this case the error message contains more details).", + "flatPath": "accounts/v1/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/v1/{+name}:claim", + "request": { + "$ref": "ClaimHomepageRequest" + }, + "response": { + "$ref": "Homepage" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "getHomepage": { + "description": "Retrieves a store's homepage.", + "flatPath": "accounts/v1/accounts/{accountsId}/homepage", + "httpMethod": "GET", + "id": "merchantapi.accounts.homepage.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/v1/{+name}", + "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/v1/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/v1/{+name}:unclaim", + "request": { + "$ref": "UnclaimHomepageRequest" + }, + "response": { + "$ref": "Homepage" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "updateHomepage": { + "description": "Updates a store's homepage. Executing this method requires admin access.", + "flatPath": "accounts/v1/accounts/{accountsId}/homepage", + "httpMethod": "PATCH", + "id": "merchantapi.accounts.homepage.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": "Optional. List of fields being updated. The following fields are supported (in both `snake_case` and `lowerCamelCase`): - `uri`", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "accounts/v1/{+name}", + "request": { + "$ref": "Homepage" + }, + "response": { + "$ref": "Homepage" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + }, + "issues": { + "methods": { + "list": { + "description": "Lists all account issues of a Merchant Center account. When called on a multi-client account, this method only returns issues belonging to that account, not its sub-accounts. To retrieve issues for sub-accounts, you must first call the accounts.listSubaccounts method to obtain a list of sub-accounts, and then call `accounts.issues.list` for each sub-account individually.", + "flatPath": "accounts/v1/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 issues 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": { + "description": "Optional. The [IANA](https://www.iana.org/time-zones) timezone used to localize times in human-readable fields. For example 'America/Los_Angeles'. If not set, 'America/Los_Angeles' will be used.", + "location": "query", + "type": "string" + } + }, + "path": "accounts/v1/{+parent}/issues", + "response": { + "$ref": "ListAccountIssuesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + }, + "omnichannelSettings": { + "methods": { + "create": { + "description": "Create the omnichannel settings for a given merchant.", + "flatPath": "accounts/v1/accounts/{accountsId}/omnichannelSettings", + "httpMethod": "POST", + "id": "merchantapi.accounts.omnichannelSettings.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The parent resource where this omnichannel setting will be created. Format: `accounts/{account}`", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+parent}/omnichannelSettings", + "request": { + "$ref": "OmnichannelSetting" + }, + "response": { + "$ref": "OmnichannelSetting" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "get": { + "description": "Get the omnichannel settings for a given merchant.", + "flatPath": "accounts/v1/accounts/{accountsId}/omnichannelSettings/{omnichannelSettingsId}", + "httpMethod": "GET", + "id": "merchantapi.accounts.omnichannelSettings.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the omnichannel setting to retrieve. Format: `accounts/{account}/omnichannelSettings/{omnichannel_setting}`", + "location": "path", + "pattern": "^accounts/[^/]+/omnichannelSettings/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+name}", + "response": { + "$ref": "OmnichannelSetting" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "description": "List all the omnichannel settings for a given merchant.", + "flatPath": "accounts/v1/accounts/{accountsId}/omnichannelSettings", + "httpMethod": "GET", + "id": "merchantapi.accounts.omnichannelSettings.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of omnichannel settings to return. The service may return fewer than this value. If unspecified, at most 50 omnichannel settings 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 `ListOmnichannelSettings` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListOmnichannelSettings` must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The parent, which owns this collection of omnichannel settings. Format: `accounts/{account}`", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+parent}/omnichannelSettings", + "response": { + "$ref": "ListOmnichannelSettingsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "patch": { + "description": "Update the omnichannel setting for a given merchant in a given country.", + "flatPath": "accounts/v1/accounts/{accountsId}/omnichannelSettings/{omnichannelSettingsId}", + "httpMethod": "PATCH", + "id": "merchantapi.accounts.omnichannelSettings.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Identifier. The resource name of the omnichannel setting. Format: `accounts/{account}/omnichannelSettings/{omnichannel_setting}`", + "location": "path", + "pattern": "^accounts/[^/]+/omnichannelSettings/[^/]+$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Required. The list of fields to be updated. The following fields are supported in snake_case only: - `lsf_type` - `in_stock` - `pickup` - `odo` - `about` - `inventory_verification` Full replacement with wildcard `*`is supported, while empty/implied update mask is not.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "accounts/v1/{+name}", + "request": { + "$ref": "OmnichannelSetting" + }, + "response": { + "$ref": "OmnichannelSetting" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "requestInventoryVerification": { + "description": "Requests inventory verification for a given merchant in a given country.", + "flatPath": "accounts/v1/accounts/{accountsId}/omnichannelSettings/{omnichannelSettingsId}:requestInventoryVerification", + "httpMethod": "POST", + "id": "merchantapi.accounts.omnichannelSettings.requestInventoryVerification", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the omnichannel setting to request inventory verification. Format: `accounts/{account}/omnichannelSettings/{omnichannel_setting}`", + "location": "path", + "pattern": "^accounts/[^/]+/omnichannelSettings/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+name}:requestInventoryVerification", + "request": { + "$ref": "RequestInventoryVerificationRequest" + }, + "response": { + "$ref": "RequestInventoryVerificationResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + }, + "resources": { + "lfpProviders": { + "methods": { + "find": { + "description": "Find the LFP provider candidates in a given country.", + "flatPath": "accounts/v1/accounts/{accountsId}/omnichannelSettings/{omnichannelSettingsId}/lfpProviders:find", + "httpMethod": "GET", + "id": "merchantapi.accounts.omnichannelSettings.lfpProviders.find", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of `LfpProvider` resources to return. The service returns fewer than this value if the number of lfp providers is less that than the `pageSize`. The default value is 50. 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 `FindLfpProviders` call. Provide the page token to retrieve the subsequent page. When paginating, all other parameters provided to `FindLfpProviders` must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The name of the parent resource under which the LFP providers are found. Format: `accounts/{account}/omnichannelSettings/{omnichannel_setting}`.", + "location": "path", + "pattern": "^accounts/[^/]+/omnichannelSettings/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+parent}/lfpProviders:find", + "response": { + "$ref": "FindLfpProvidersResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "linkLfpProvider": { + "description": "Link the specified merchant to a LFP provider for the specified country.", + "flatPath": "accounts/v1/accounts/{accountsId}/omnichannelSettings/{omnichannelSettingsId}/lfpProviders/{lfpProvidersId}:linkLfpProvider", + "httpMethod": "POST", + "id": "merchantapi.accounts.omnichannelSettings.lfpProviders.linkLfpProvider", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the LFP provider resource to link. Format: `accounts/{account}/omnichannelSettings/{omnichannel_setting}/lfpProviders/{lfp_provider}`. The `lfp_provider` is the LFP provider ID.", + "location": "path", + "pattern": "^accounts/[^/]+/omnichannelSettings/[^/]+/lfpProviders/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+name}:linkLfpProvider", + "request": { + "$ref": "LinkLfpProviderRequest" + }, + "response": { + "$ref": "LinkLfpProviderResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + } + } + }, + "onlineReturnPolicies": { + "methods": { + "create": { + "description": "Creates a new return policy for a given business.", + "flatPath": "accounts/v1/accounts/{accountsId}/onlineReturnPolicies", + "httpMethod": "POST", + "id": "merchantapi.accounts.onlineReturnPolicies.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The Merchant Center account for which the return policy will be created. Format: `accounts/{account}`", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+parent}/onlineReturnPolicies", + "request": { + "$ref": "OnlineReturnPolicy" + }, + "response": { + "$ref": "OnlineReturnPolicy" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "delete": { + "description": "Deletes an existing return policy.", + "flatPath": "accounts/v1/accounts/{accountsId}/onlineReturnPolicies/{onlineReturnPoliciesId}", + "httpMethod": "DELETE", + "id": "merchantapi.accounts.onlineReturnPolicies.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the return policy to delete. Format: `accounts/{account}/onlineReturnPolicies/{return_policy}`", + "location": "path", + "pattern": "^accounts/[^/]+/onlineReturnPolicies/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "get": { + "description": "Gets an existing return policy for a given business.", + "flatPath": "accounts/v1/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/v1/{+name}", + "response": { + "$ref": "OnlineReturnPolicy" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "description": "Lists all existing return policies for a given business.", + "flatPath": "accounts/v1/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 business 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 Center account for which to list return policies. Format: `accounts/{account}`", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+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.", + "flatPath": "accounts/v1/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}`. For example, `accounts/123456/programs/free-listings`.", + "location": "path", + "pattern": "^accounts/[^/]+/programs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+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.", + "flatPath": "accounts/v1/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}`. For example, `accounts/123456/programs/free-listings`.", + "location": "path", + "pattern": "^accounts/[^/]+/programs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+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/v1/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}`. For example, `accounts/123456/programs/free-listings`.", + "location": "path", + "pattern": "^accounts/[^/]+/programs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+name}", + "response": { + "$ref": "Program" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "description": "Retrieves all programs for the account.", + "flatPath": "accounts/v1/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/v1/{+parent}/programs", + "response": { + "$ref": "ListProgramsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + }, + "resources": { + "checkoutSettings": { + "methods": { + "create": { + "description": "Creates `CheckoutSettings` for the given merchant.", + "flatPath": "accounts/v1/accounts/{accountsId}/programs/{programsId}/checkoutSettings", + "httpMethod": "POST", + "id": "merchantapi.accounts.programs.checkoutSettings.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The merchant account for which the `CheckoutSettings` will be created.", + "location": "path", + "pattern": "^accounts/[^/]+/programs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+parent}/checkoutSettings", + "request": { + "$ref": "CheckoutSettings" + }, + "response": { + "$ref": "CheckoutSettings" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "deleteCheckoutSettings": { + "description": "Deletes `CheckoutSettings` and unenrolls merchant from `Checkout` program.", + "flatPath": "accounts/v1/accounts/{accountsId}/programs/{programsId}/checkoutSettings", + "httpMethod": "DELETE", + "id": "merchantapi.accounts.programs.checkoutSettings.deleteCheckoutSettings", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name/identifier of the merchant account. Format: `accounts/{account}/programs/{program}/checkoutSettings`", + "location": "path", + "pattern": "^accounts/[^/]+/programs/[^/]+/checkoutSettings$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "getCheckoutSettings": { + "description": "Gets `CheckoutSettings` for the given merchant. This includes information about review state, enrollment state and URL settings.", + "flatPath": "accounts/v1/accounts/{accountsId}/programs/{programsId}/checkoutSettings", + "httpMethod": "GET", + "id": "merchantapi.accounts.programs.checkoutSettings.getCheckoutSettings", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name/identifier of the merchant account. Format: `accounts/{account}/programs/{program}/checkoutSettings`", + "location": "path", + "pattern": "^accounts/[^/]+/programs/[^/]+/checkoutSettings$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+name}", + "response": { + "$ref": "CheckoutSettings" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "updateCheckoutSettings": { + "description": "Updates `CheckoutSettings` for the given merchant.", + "flatPath": "accounts/v1/accounts/{accountsId}/programs/{programsId}/checkoutSettings", + "httpMethod": "PATCH", + "id": "merchantapi.accounts.programs.checkoutSettings.updateCheckoutSettings", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Identifier. The resource name of the program configuration settings. Format: `accounts/{account}/programs/{program}/checkoutSettings`", + "location": "path", + "pattern": "^accounts/[^/]+/programs/[^/]+/checkoutSettings$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Required. List of fields being updated. The following fields are supported (in both `snake_case` and `lowerCamelCase`): - `eligible_destinations` - `uri_settings`", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "accounts/v1/{+name}", + "request": { + "$ref": "CheckoutSettings" + }, + "response": { + "$ref": "CheckoutSettings" + }, + "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/v1/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/v1/{+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/v1/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/v1/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "get": { + "description": "Retrieves a region defined in your Merchant Center account.", + "flatPath": "accounts/v1/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/v1/{+name}", + "response": { + "$ref": "Region" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "description": "Lists the regions in your Merchant Center account.", + "flatPath": "accounts/v1/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/v1/{+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/v1/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/v1/{+name}", + "request": { + "$ref": "Region" + }, + "response": { + "$ref": "Region" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + }, + "relationships": { + "methods": { + "get": { + "description": "Retrieve an account relationship.", + "flatPath": "accounts/v1/accounts/{accountsId}/relationships/{relationshipsId}", + "httpMethod": "GET", + "id": "merchantapi.accounts.relationships.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the account relationship to get. Format: `accounts/{account}/relationships/{relationship}`. For example, `accounts/123456/relationships/567890`.", + "location": "path", + "pattern": "^accounts/[^/]+/relationships/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+name}", + "response": { + "$ref": "AccountRelationship" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "description": "List account relationships for the specified account.", + "flatPath": "accounts/v1/accounts/{accountsId}/relationships", + "httpMethod": "GET", + "id": "merchantapi.accounts.relationships.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of elements to return in the response. Use for paging. If no `page_size` is specified, `100` is used as the default value. The maximum allowed value is `1000`.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. The token returned by the previous `list` request.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The parent account of the account relationship to filter by. Format: `accounts/{account}`", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+parent}/relationships", + "response": { + "$ref": "ListAccountRelationshipsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "patch": { + "description": "Updates the account relationship. Executing this method requires admin access.", + "flatPath": "accounts/v1/accounts/{accountsId}/relationships/{relationshipsId}", + "httpMethod": "PATCH", + "id": "merchantapi.accounts.relationships.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Identifier. The resource name of the account relationship. Format: `accounts/{account}/relationships/{relationship}`. For example, `accounts/123456/relationships/567890`.", + "location": "path", + "pattern": "^accounts/[^/]+/relationships/[^/]+$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Optional. List of fields being updated. The following fields are supported (in both `snake_case` and `lowerCamelCase`): - `account_id_alias`", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "accounts/v1/{+name}", + "request": { + "$ref": "AccountRelationship" + }, + "response": { + "$ref": "AccountRelationship" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + }, + "services": { + "methods": { + "approve": { + "description": "Approve an account service proposal.", + "flatPath": "accounts/v1/accounts/{accountsId}/services/{servicesId}:approve", + "httpMethod": "POST", + "id": "merchantapi.accounts.services.approve", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the account service to approve. Format: `accounts/{account}/services/{service}`", + "location": "path", + "pattern": "^accounts/[^/]+/services/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+name}:approve", + "request": { + "$ref": "ApproveAccountServiceRequest" + }, + "response": { + "$ref": "AccountService" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "get": { + "description": "Retrieve an account service.", + "flatPath": "accounts/v1/accounts/{accountsId}/services/{servicesId}", + "httpMethod": "GET", + "id": "merchantapi.accounts.services.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the account service to get. Format: `accounts/{account}/services/{service}`", + "location": "path", + "pattern": "^accounts/[^/]+/services/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+name}", + "response": { + "$ref": "AccountService" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "description": "List account services for the specified accounts. Supports filtering.", + "flatPath": "accounts/v1/accounts/{accountsId}/services", + "httpMethod": "GET", + "id": "merchantapi.accounts.services.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of elements to return in the response. Use for paging. If no `page_size` is specified, `100` is used as the default value. The maximum allowed value is `1000`.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. The token returned by the previous `list` request.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The parent account of the account service to filter by. Format: `accounts/{account}`", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+parent}/services", + "response": { + "$ref": "ListAccountServicesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "propose": { + "description": "Propose an account service.", + "flatPath": "accounts/v1/accounts/{accountsId}/services:propose", + "httpMethod": "POST", + "id": "merchantapi.accounts.services.propose", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The resource name of the parent account for the service. Format: `accounts/{account}`", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+parent}/services:propose", + "request": { + "$ref": "ProposeAccountServiceRequest" + }, + "response": { + "$ref": "AccountService" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "reject": { + "description": "Reject an account service (both proposed and approve services can be rejected).", + "flatPath": "accounts/v1/accounts/{accountsId}/services/{servicesId}:reject", + "httpMethod": "POST", + "id": "merchantapi.accounts.services.reject", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the account service to reject. Format: `accounts/{account}/services/{service}`", + "location": "path", + "pattern": "^accounts/[^/]+/services/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+name}:reject", + "request": { + "$ref": "RejectAccountServiceRequest" + }, + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + }, + "shippingSettings": { + "methods": { + "getShippingSettings": { + "description": "Retrieve shipping setting information.", + "flatPath": "accounts/v1/accounts/{accountsId}/shippingSettings", + "httpMethod": "GET", + "id": "merchantapi.accounts.shippingSettings.getShippingSettings", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the shipping setting to retrieve. Format: `accounts/{account}/shippingsettings`", + "location": "path", + "pattern": "^accounts/[^/]+/shippingSettings$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+name}", + "response": { + "$ref": "ShippingSettings" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "insert": { + "description": "Replace the shipping setting of a business with the request shipping setting. Executing this method requires admin access.", + "flatPath": "accounts/v1/accounts/{accountsId}/shippingSettings:insert", + "httpMethod": "POST", + "id": "merchantapi.accounts.shippingSettings.insert", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The account for which this shipping setting will be inserted. If you are using an advanced account, you must specify the unique identifier of the sub-account for which you want to insert the shipping setting. Format: `accounts/{ACCOUNT_ID}`", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+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/v1/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}/termsOfServiceAgreementStates/{identifier}` The identifier format is: `{TermsOfServiceKind}-{country}`", + "location": "path", + "pattern": "^accounts/[^/]+/termsOfServiceAgreementStates/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "accounts/v1/{+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. Application terms of service covers permissions related to the usage of data provided through Merchant Center, CSS Center, Manufacturer Center, and more.", + "flatPath": "accounts/v1/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/v1/{+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/v1/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/v1/{+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. The user to be deleted can't be the last admin user of that account. Also a user is protected from deletion if it is managed by Business Manager\"", + "flatPath": "accounts/v1/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/v1/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "get": { + "description": "Retrieves a Merchant Center account user.", + "flatPath": "accounts/v1/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/v1/{+name}", + "response": { + "$ref": "User" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "description": "Lists all users of a Merchant Center account.", + "flatPath": "accounts/v1/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/v1/{+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/v1/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": "Optional. List of fields being updated. The following fields are supported (in both `snake_case` and `lowerCamelCase`): - `access_rights`", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "accounts/v1/{+name}", + "request": { + "$ref": "User" + }, + "response": { + "$ref": "User" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + } + } + }, + "termsOfService": { + "methods": { + "accept": { + "description": "Accepts a `TermsOfService`. Executing this method requires admin access.", + "flatPath": "accounts/v1/termsOfService/{termsOfServiceId}:accept", + "httpMethod": "POST", + "id": "merchantapi.termsOfService.accept", + "parameterOrder": [ + "name" + ], + "parameters": { + "account": { + "description": "Required. The account for which to accept the ToS. Format: `accounts/{account}`", + "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/v1/{+name}:accept", + "response": { + "$ref": "AcceptTermsOfServiceResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "get": { + "description": "Retrieves the `TermsOfService` associated with the provided version.", + "flatPath": "accounts/v1/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/v1/{+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/v1/termsOfService:retrieveLatest", + "httpMethod": "GET", + "id": "merchantapi.termsOfService.retrieveLatest", + "parameterOrder": [], + "parameters": { + "kind": { + "description": "Required. 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": "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/v1/termsOfService:retrieveLatest", + "response": { + "$ref": "TermsOfService" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + } + }, + "revision": "20250804", + "rootUrl": "https://merchantapi.googleapis.com/", + "schemas": { + "About": { + "description": "Collection of information related to the about page ([impressum](https://support.google.com/merchants/answer/14675634?ref_topic=15145634\u0026sjid=6892280366904591178-NC)).", + "id": "About", + "properties": { + "state": { + "description": "Output only. The state of the URI.", + "enum": [ + "STATE_UNSPECIFIED", + "ACTIVE", + "FAILED", + "RUNNING", + "ACTION_REQUIRED" + ], + "enumDescriptions": [ + "Default value. This value is unused.", + "The review process has concluded successfully. The reviewed item is active.", + "The review process failed.", + "The review process is running.", + "The review process is waiting for the merchant to take action." + ], + "readOnly": true, + "type": "string" + }, + "uri": { + "description": "Required. The about page URI.", + "type": "string" + } + }, + "type": "object" + }, + "AcceptTermsOfServiceResponse": { + "description": "Response message for the `AcceptTermsOfService` method.", + "id": "AcceptTermsOfServiceResponse", + "properties": { + "termsOfServiceAgreementState": { + "$ref": "TermsOfServiceAgreementState", + "description": "The agreement state after accepting the ToS." + } + }, + "type": "object" + }, + "Accepted": { + "description": "Describes the [accepted terms of service](https://developers.google.com/merchant/api/guides/accounts/create-and-configure#accept_the_merchant_center_terms_of_service).", + "id": "Accepted", + "properties": { + "acceptedBy": { + "description": "Required. The account where the acceptance was recorded. This can be the account itself or, in the case of subaccounts, the advanced account.", + "type": "string" + }, + "termsOfService": { + "description": "Required. The accepted termsOfService.", + "type": "string" + }, + "validUntil": { + "$ref": "Date", + "description": "Optional. When set, it states that the accepted `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` is found in the `Required` message." + } + }, + "type": "object" + }, + "Account": { + "description": "The `Account` message represents a business's account within Shopping Ads. It's the primary entity for managing product data, settings, and interactions with Google's services and external providers. Accounts can operate as standalone entities or be part of a advanced account structure. In an advanced account setup the parent account manages multiple sub-accounts. Establishing an account involves configuring attributes like the account name, time zone, and language preferences. The `Account` message is the parent entity for many other resources, for example, `AccountRelationship`, `Homepage`, `BusinessInfo` and so on.", + "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": "Optional. 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. The `version` field is not supported, won't be set in responses and will be silently ignored if specified in requests." + } + }, + "type": "object" + }, + "AccountAggregation": { + "description": "`AccountAggregation` payload.", + "id": "AccountAggregation", + "properties": {}, + "type": "object" + }, + "AccountIssue": { + "description": "Issues with your Merchant Center account that can impact all your products. For more information, see [Account-level issues in Merchant Center](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}`. For example, `accounts/123456/issues/misrepresentation-of-self-or-products-unacceptable-business-practice-policy`.", + "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" + }, + "AccountManagement": { + "description": "`AccountManagement` payload.", + "id": "AccountManagement", + "properties": {}, + "type": "object" + }, + "AccountRelationship": { + "description": "The `AccountRelationship` message defines a formal connection between a merchant's account and a service provider's account. This relationship enables the provider to offer specific services to the business, such as product management or campaign management. It specifies the access rights and permissions to the business's data relevant to those services. Establishing an account relationship involves linking the merchant's account with a provider's account. The provider could be another Google account (like Google Ads or Google My Business) or a third-party platform (such as Shopify or WooCommerce).", + "id": "AccountRelationship", + "properties": { + "accountIdAlias": { + "description": "Optional. An optional alias you can assign to this account relationship. This alias acts as a convenient identifier for your own reference and management. It must be unique among all your account relationships with the same provider. For example, you might use `account_id_alias` to assign a friendly name to this relationship for easier identification in your systems.", + "type": "string" + }, + "name": { + "description": "Identifier. The resource name of the account relationship. Format: `accounts/{account}/relationships/{relationship}`. For example, `accounts/123456/relationships/567890`.", + "type": "string" + }, + "provider": { + "description": "Immutable. The provider of the service. Either the reference to an account such as `providers/123` or a well-known service provider (one of `providers/GOOGLE_ADS` or `providers/GOOGLE_BUSINESS_PROFILE`).", + "type": "string" + }, + "providerDisplayName": { + "description": "Output only. The human-readable display name of the provider account.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "AccountService": { + "description": "The `AccountService` message represents a specific service that a provider account offers to a Merchant Center account. `AccountService` defines the permissions and capabilities granted to the provider, allowing for operations such as product management or campaign management. The lifecycle of an `AccountService` involves a proposal phase, where one party suggests the service, and an approval phase, where the other party accepts or rejects it. This handshake mechanism ensures mutual consent before any access is granted. This mechanism safeguards both parties by ensuring that access rights are granted appropriately and that both the business and provider are aware of the services enabled. In scenarios where a user is an admin of both accounts, the approval can happen automatically. The mutability of a service is also managed through `AccountService`. Some services might be immutable, for example, if they were established through other systems or APIs, and you cannot alter them through this API.", + "id": "AccountService", + "properties": { + "accountAggregation": { + "$ref": "AccountAggregation", + "description": "Service type for account aggregation. This enables the provider, which is an advanced account, to manage multiple sub-accounts (client accounts). Through this service, the advanced account provider can perform administrative and operational tasks across all linked sub-accounts. This is useful for agencies, aggregators, or large retailers that need centralized control over many Merchant Center accounts." + }, + "accountManagement": { + "$ref": "AccountManagement", + "description": "Service type for account management. Enables the provider to perform administrative actions on the business's account, such as configuring account settings, managing users, or updating business information." + }, + "campaignsManagement": { + "$ref": "CampaignsManagement", + "description": "Service type for managing advertising campaigns. Grants the provider access to create and manage the business's ad campaigns, including setting up campaigns, adjusting bids, and optimizing performance." + }, + "externalAccountId": { + "description": "Immutable. An optional, immutable identifier that Google uses to refer to this account when communicating with the provider. This should be the unique account ID within the provider's system (for example, your shop ID in Shopify). If you have multiple accounts with the same provider - for instance, different accounts for various regions — the `external_account_id` differentiates between them, ensuring accurate linking and integration between Google and the provider.", + "type": "string" + }, + "handshake": { + "$ref": "Handshake", + "description": "Output only. Information about the state of the service in terms of establishing it (e.g. is it pending approval or approved).", + "readOnly": true + }, + "localListingManagement": { + "$ref": "LocalListingManagement", + "description": "Service type for local listings management. The business group associated with the external account id will be used to provide local inventory to this Merchant Center account." + }, + "mutability": { + "description": "Output only. Whether the service is mutable (e.g. through Approve / Reject RPCs). A service that was created through another system or API might be immutable.", + "enum": [ + "MUTABILITY_UNSPECIFIED", + "MUTABLE", + "IMMUTABLE" + ], + "enumDescriptions": [ + "Unused default value", + "The service can be mutated without restrictions.", + "The service is read-only and must not be mutated." + ], + "readOnly": true, + "type": "string" + }, + "name": { + "description": "Identifier. The resource name of the account service. Format: `accounts/{account}/services/{service}`", + "type": "string" + }, + "productsManagement": { + "$ref": "ProductsManagement", + "description": "Service type for managing products. This allows the provider to handle product data on behalf of the business, including reading and writing product listings. It's commonly used when the provider offers inventory management or catalog synchronization services to keep the business's product information up-to-date across platforms." + }, + "provider": { + "description": "Output only. The provider of the service. Either the reference to an account such as `providers/123` or a well-known service provider (one of `providers/GOOGLE_ADS` or `providers/GOOGLE_BUSINESS_PROFILE`).", + "readOnly": true, + "type": "string" + }, + "providerDisplayName": { + "description": "Output only. The human-readable display name of the provider account.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "AddAccountService": { + "description": "Additional instructions to add account services during creation of the account.", + "id": "AddAccountService", + "properties": { + "accountAggregation": { + "$ref": "AccountAggregation", + "description": "The provider is an [aggregator](https://support.google.com/merchants/answer/188487) for the account. Payload for service type Account Aggregation." + }, + "provider": { + "description": "Required. The provider of the service. Either the reference to an account such as `providers/123` or a well-known service provider (one of `providers/GOOGLE_ADS` or `providers/GOOGLE_BUSINESS_PROFILE`).", + "type": "string" + } + }, + "type": "object" + }, + "AddUser": { + "description": "Instruction for adding a user to the account during creation.", + "id": "AddUser", + "properties": { + "user": { + "$ref": "User", + "description": "Optional. Details about the user to be added. At the moment, only access rights may be specified." + }, + "userId": { + "description": "Required. The email address of the user (for example, `john.doe@gmail.com`).", + "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" + }, + "ApproveAccountServiceRequest": { + "description": "Request to approve an account service.", + "id": "ApproveAccountServiceRequest", + "properties": {}, + "type": "object" + }, + "AutofeedSettings": { + "description": "Collection of information related to the [autofeed](https://support.google.com/merchants/answer/7538732) settings.", + "id": "AutofeedSettings", + "properties": { + "eligible": { + "description": "Output only. Determines whether the business is eligible for being enrolled into an autofeed.", + "readOnly": true, + "type": "boolean" + }, + "enableProducts": { + "description": "Required. Enables or disables product crawling through the autofeed for the given account. Autofeed accounts must meet [certain conditions](https://support.google.com/merchants/answer/7538732#Configure_automated_feeds_Standard_Experience), which can be checked through the `eligible` field. The account must **not** be a marketplace. When the autofeed is enabled for the first time, the products usually appear instantly. When re-enabling, it might take up to 24 hours for products to appear.", + "type": "boolean" + }, + "name": { + "description": "Identifier. The resource name of the autofeed settings. Format: `accounts/{account}/autofeedSettings`.", + "type": "string" + } + }, + "type": "object" + }, + "AutomaticImageImprovements": { + "description": "This improvement will attempt to automatically correct submitted images if they don't meet the [image requirements](https://support.google.com/merchants/answer/6324350), for example, removing overlays. If successful, the image will be replaced and approved. This improvement is only applied to images of disapproved offers. For more information see: [Automatic image improvements](https://support.google.com/merchants/answer/9242973)", + "id": "AutomaticImageImprovements", + "properties": { + "accountImageImprovementsSettings": { + "$ref": "ImageImprovementsAccountLevelSettings", + "description": "Optional. Determines how the images should be automatically updated. If this field is not present and provided in the update mask, then the settings will be deleted. If there are no settings for subaccount, they are inherited from aggregator." + }, + "effectiveAllowAutomaticImageImprovements": { + "description": "Output only. The effective value of allow_automatic_image_improvements. If account_image_improvements_settings is present, then this value is the same. Otherwise, it represents the inherited value of the parent account. Read-only.", + "readOnly": true, + "type": "boolean" + } + }, + "type": "object" + }, + "AutomaticImprovements": { + "description": "Collection of information related to the [automatic improvements](https://developers.google.com/shopping-content/guides/automatic-improvements) of an account.", + "id": "AutomaticImprovements", + "properties": { + "imageImprovements": { + "$ref": "AutomaticImageImprovements", + "description": "This improvement will attempt to automatically correct submitted images if they don't meet the [image requirements](https://support.google.com/merchants/answer/6324350), for example, removing overlays. If successful, the image will be replaced and approved. This improvement is only applied to images of disapproved offers. For more information see: [Automatic image improvements](https://support.google.com/merchants/answer/9242973) This field is only updated (cleared) if provided in the update mask." + }, + "itemUpdates": { + "$ref": "AutomaticItemUpdates", + "description": "Turning on [item updates](https://support.google.com/merchants/answer/3246284) allows Google to automatically update items for you. When item updates are on, Google uses the structured data markup on the website and advanced data extractors to update the price and availability of the items. When the item updates are off, items with mismatched data aren't shown. This field is only updated (cleared) if provided in the update mask." + }, + "name": { + "description": "Identifier. The resource name of the automatic improvements. Format: `accounts/{account}/automaticImprovements`.", + "type": "string" + }, + "shippingImprovements": { + "$ref": "AutomaticShippingImprovements", + "description": "Not available for [advanced accounts](https://support.google.com/merchants/answer/188487). By turning on [automatic shipping improvements](https://support.google.com/merchants/answer/10027038), you are allowing Google to improve the accuracy of your delivery times shown to shoppers using Google. More accurate delivery times, especially when faster, typically lead to better conversion rates. Google will improve your estimated delivery times based on various factors: * Delivery address of an order * Current handling time and shipping time settings * Estimated weekdays or business days * Parcel tracking data This field is only updated (cleared) if provided in the update mask." + } + }, + "type": "object" + }, + "AutomaticItemUpdates": { + "description": "Turning on [item updates](https://support.google.com/merchants/answer/3246284) allows Google to automatically update items for you. When item updates are on, Google uses the structured data markup on the website and advanced data extractors to update the price and availability of the items. When the item updates are off, items with mismatched data aren't shown.", + "id": "AutomaticItemUpdates", + "properties": { + "accountItemUpdatesSettings": { + "$ref": "ItemUpdatesAccountLevelSettings", + "description": "Optional. Determines which attributes of the items should be automatically updated. If this field is not present and provided in the update mask, then the settings will be deleted. If there are no settings for subaccount, they are inherited from aggregator." + }, + "effectiveAllowAvailabilityUpdates": { + "description": "Output only. The effective value of allow_availability_updates. If account_item_updates_settings is present, then this value is the same. Otherwise, it represents the inherited value of the parent account. The default value is true if no settings are present. Read-only.", + "readOnly": true, + "type": "boolean" + }, + "effectiveAllowConditionUpdates": { + "description": "Output only. The effective value of allow_condition_updates. If account_item_updates_settings is present, then this value is the same. Otherwise, it represents the inherited value of the parent account. The default value is true if no settings are present. Read-only.", + "readOnly": true, + "type": "boolean" + }, + "effectiveAllowPriceUpdates": { + "description": "Output only. The effective value of allow_price_updates. If account_item_updates_settings is present, then this value is the same. Otherwise, it represents the inherited value of the parent account. The default value is true if no settings are present. Read-only.", + "readOnly": true, + "type": "boolean" + }, + "effectiveAllowStrictAvailabilityUpdates": { + "description": "Output only. The effective value of allow_strict_availability_updates. If account_item_updates_settings is present, then this value is the same. Otherwise, it represents the inherited value of the parent account. The default value is true if no settings are present. Read-only.", + "readOnly": true, + "type": "boolean" + } + }, + "type": "object" + }, + "AutomaticShippingImprovements": { + "description": "Not available for [advanced accounts](https://support.google.com/merchants/answer/188487). By turning on [automatic shipping improvements](https://support.google.com/merchants/answer/10027038), you are allowing Google to improve the accuracy of your delivery times shown to shoppers using Google. More accurate delivery times, especially when faster, typically lead to better conversion rates. Google will improve your estimated delivery times based on various factors: * Delivery address of an order * Current handling time and shipping time settings * Estimated weekdays or business days * Parcel tracking data", + "id": "AutomaticShippingImprovements", + "properties": { + "allowShippingImprovements": { + "description": "Enables automatic shipping improvements.", + "type": "boolean" + } + }, + "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 businesses with the 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 businesses with the 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": "Required. 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 businesses 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 businesses 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 businesses with a business country set to `US`. It is also not applicable for marketplaces or marketplace sellers." + } + }, + "type": "object" + }, + "BusinessInfo": { + "description": "The `BusinessInfo` message contains essential information about a business. This message captures key business details such as physical address, customer service contacts, and region-specific identifiers.", + "id": "BusinessInfo", + "properties": { + "address": { + "$ref": "PostalAddress", + "description": "Optional. The address of the business. Only `region_code`, `address_lines`, `postal_code`, `administrative_area` and `locality` fields are supported. All other fields are ignored." + }, + "customerService": { + "$ref": "CustomerService", + "description": "Optional. The customer service of the business." + }, + "koreanBusinessRegistrationNumber": { + "description": "Optional. The 10-digit [Korean business registration number](https://support.google.com/merchants/answer/9037766) separated with dashes in the format: XXX-XX-XXXXX.", + "type": "string" + }, + "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" + }, + "CampaignsManagement": { + "description": "`CampaignManagement` payload.", + "id": "CampaignsManagement", + "properties": {}, + "type": "object" + }, + "CarrierRate": { + "description": "A list of carrier rates that can be referred to by `main_table` or `single_value`. Supported carrier services are defined in https://support.google.com/merchants/answer/12577710?ref_topic=12570808\u0026sjid=10662598224319463032-NC#zippy=%2Cdelivery-cost-rate-type%2Ccarrier-rate-au-de-uk-and-us-only.", + "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" + }, + "CheckoutSettings": { + "description": "[CheckoutSettings](https://support.google.com/merchants/answer/13945960) for a specific merchant.", + "id": "CheckoutSettings", + "properties": { + "effectiveEnrollmentState": { + "description": "Output only. The effective value of enrollment_state for a given merchant ID. If account level settings are present then this value will be a copy of the account level settings. Otherwise, it will have the value of the parent account (for only marketplace sellers).", + "enum": [ + "CHECKOUT_ENROLLMENT_STATE_UNSPECIFIED", + "INACTIVE", + "ENROLLED", + "OPTED_OUT" + ], + "enumDescriptions": [ + "Default enrollment state when enrollment state is not specified.", + "Merchant has not enrolled into the program.", + "Merchant has enrolled into the program by providing either an account level URL or checkout URLs as part of their feed.", + "Merchant has previously enrolled but opted out of the program." + ], + "readOnly": true, + "type": "string" + }, + "effectiveReviewState": { + "description": "Output only. The effective value of `review_state` for a given merchant ID. If account level settings are present then this value will be a copy of the account level settings. Otherwise, it will have the value of the parent account (for only marketplace sellers).", + "enum": [ + "CHECKOUT_REVIEW_STATE_UNSPECIFIED", + "IN_REVIEW", + "APPROVED", + "DISAPPROVED" + ], + "enumDescriptions": [ + "Default review state when review state is not specified.", + "Merchant provided URLs are being reviewed for data quality issues.", + "Merchant account has been approved. Indicates the data quality checks have passed.", + "Merchant account has been disapproved due to data quality issues." + ], + "readOnly": true, + "type": "string" + }, + "effectiveUriSettings": { + "$ref": "UriSettings", + "description": "Output only. The effective value of `uri_settings` for a given merchant. If account level settings are present then this value will be a copy of url settings. Otherwise, it will have the value of the parent account (for only marketplace sellers).", + "readOnly": true + }, + "eligibleDestinations": { + "description": "Optional. The destinations (also known as [Marketing methods](https://support.google.com/merchants/answer/15130232)) to which the checkout program applies, valid destination values are `SHOPPING_ADS`, `FREE_LISTINGS`", + "items": { + "enum": [ + "DESTINATION_ENUM_UNSPECIFIED", + "SHOPPING_ADS", + "DISPLAY_ADS", + "LOCAL_INVENTORY_ADS", + "FREE_LISTINGS", + "FREE_LOCAL_LISTINGS", + "YOUTUBE_SHOPPING", + "YOUTUBE_SHOPPING_CHECKOUT", + "YOUTUBE_AFFILIATE", + "FREE_VEHICLE_LISTINGS", + "VEHICLE_ADS", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL" + ], + "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).", + "Youtube shopping checkout.", + "[Youtube Affiliate](https://support.google.com/youtube/answer/13376398).", + "[Free vehicle listings](https://support.google.com/merchants/answer/11189169).", + "[Vehicle ads](https://support.google.com/merchants/answer/11189169).", + "[Cloud retail](https://cloud.google.com/solutions/retail).", + "[Local cloud retail](https://cloud.google.com/solutions/retail)." + ], + "type": "string" + }, + "type": "array" + }, + "enrollmentState": { + "description": "Output only. Reflects the merchant enrollment state in `Checkout` program.", + "enum": [ + "CHECKOUT_ENROLLMENT_STATE_UNSPECIFIED", + "INACTIVE", + "ENROLLED", + "OPTED_OUT" + ], + "enumDescriptions": [ + "Default enrollment state when enrollment state is not specified.", + "Merchant has not enrolled into the program.", + "Merchant has enrolled into the program by providing either an account level URL or checkout URLs as part of their feed.", + "Merchant has previously enrolled but opted out of the program." + ], + "readOnly": true, + "type": "string" + }, + "name": { + "description": "Identifier. The resource name of the program configuration settings. Format: `accounts/{account}/programs/{program}/checkoutSettings`", + "type": "string" + }, + "reviewState": { + "description": "Output only. Reflects the merchant review state in `Checkout` program. This is set based on the data quality reviews of the URL provided by the merchant. A merchant with enrollment state as `ENROLLED` can be in the following review states: `IN_REVIEW`, `APPROVED` or `DISAPPROVED`. A merchant must be in an `enrollment_state` of `ENROLLED` before a review can begin for the merchant.For more details, check the help center doc.", + "enum": [ + "CHECKOUT_REVIEW_STATE_UNSPECIFIED", + "IN_REVIEW", + "APPROVED", + "DISAPPROVED" + ], + "enumDescriptions": [ + "Default review state when review state is not specified.", + "Merchant provided URLs are being reviewed for data quality issues.", + "Merchant account has been approved. Indicates the data quality checks have passed.", + "Merchant account has been disapproved due to data quality issues." + ], + "readOnly": true, + "type": "string" + }, + "uriSettings": { + "$ref": "UriSettings", + "description": "URI settings for cart or checkout URL." + } + }, + "type": "object" + }, + "ClaimHomepageRequest": { + "description": "Request message for the `ClaimHomepage` method.", + "id": "ClaimHomepageRequest", + "properties": { + "overwrite": { + "description": "Optional. When set to `true`, this option removes any existing claim on the requested website from any other account to the account making the request, effectively replacing the previous claim.", + "type": "boolean" + } + }, + "type": "object" + }, + "CreateAndConfigureAccountRequest": { + "description": "Request message for the `CreateAndConfigureAccount` method.", + "id": "CreateAndConfigureAccountRequest", + "properties": { + "account": { + "$ref": "Account", + "description": "Required. The account to be created." + }, + "service": { + "description": "Required. An account service between the account to be created and the provider account is initialized as part of the creation. At least one such service needs to be provided. Currently exactly one of these needs to be `account_aggregation` and `accounts.createAndConfigure` method can be used to create a sub-account under an existing advanced account through this method. Additional `account_management` or `product_management` services may be provided.", + "items": { + "$ref": "AddAccountService" + }, + "type": "array" + }, + "user": { + "description": "Optional. Users to be added to the account.", + "items": { + "$ref": "AddUser" + }, + "type": "array" + } + }, + "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": "Businesses 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`. 'min_handling_days' and 'max_handling_days' should be either set or not set at the same time.", + "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. 'min_handling_days' and 'max_handling_days' should be either set or not set at the same time.", + "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" + }, + "DeveloperRegistration": { + "description": "Represents a developer registration owned by a Merchant account.", + "id": "DeveloperRegistration", + "properties": { + "gcpIds": { + "description": "Output only. The GCP ids attached to this developer registration", + "items": { + "type": "string" + }, + "readOnly": true, + "type": "array" + }, + "name": { + "description": "Identifier. The `name` (ID) of the developer registration. Generated by the Content API upon creation of a new `DeveloperRegistration`. The `account` represents the merchant ID of the merchant that owns the registration.", + "type": "string" + } + }, + "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" + }, + "FindLfpProvidersResponse": { + "description": "Response message for the FindLfpProviders method.", + "id": "FindLfpProvidersResponse", + "properties": { + "lfpProviders": { + "description": "The LFP providers from the specified merchant in the specified country.", + "items": { + "$ref": "LfpProvider" + }, + "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" + }, + "GbpAccount": { + "description": "Collection of information related to a Google Business Profile (GBP) account.", + "id": "GbpAccount", + "properties": { + "gbpAccountId": { + "description": "The id of the GBP account.", + "type": "string" + }, + "gbpAccountName": { + "description": "The name of the Business Profile. For personal accounts: Email id of the owner. For Business accounts: Name of the Business Account.", + "type": "string" + }, + "listingCount": { + "description": "Number of listings under this account.", + "format": "int64", + "type": "string" + }, + "name": { + "description": "Identifier. The resource name of the GBP account. Format: `accounts/{account}/gbpAccount/{gbp_account}`", + "type": "string" + }, + "type": { + "description": "The type of the Business Profile.", + "enum": [ + "TYPE_UNSPECIFIED", + "USER", + "BUSINESS_ACCOUNT" + ], + "enumDescriptions": [ + "Default value. This value is unused.", + "The GBP account is a user account.", + "The GBP account is a business account." + ], + "type": "string" + } + }, + "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" + }, + "Handshake": { + "description": "The current status of establishing of the service. (for example, pending approval or approved).", + "id": "Handshake", + "properties": { + "actor": { + "description": "Output only. The most recent account to modify the account service's `approval_status`.", + "enum": [ + "ACTOR_UNSPECIFIED", + "ACCOUNT", + "OTHER_PARTY" + ], + "enumDescriptions": [ + "Unspecified actor.", + "The last change was done by the account who has this service.", + "The last change was done by the other party who this service points to." + ], + "readOnly": true, + "type": "string" + }, + "approvalState": { + "description": "Output only. The approval state of this handshake.", + "enum": [ + "APPROVAL_STATE_UNSPECIFIED", + "PENDING", + "ESTABLISHED", + "REJECTED" + ], + "enumDescriptions": [ + "Unspecified approval status.", + "The service was proposed and is waiting to be confirmed.", + "Both parties have confirmed the service.", + "The service proposal was rejected." + ], + "readOnly": true, + "type": "string" + } + }, + "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": "The `Homepage` message represents a business's store homepage within the system. A business's homepage is the primary domain where customers interact with their store. The homepage can be claimed and verified as a proof of ownership and allows the business to unlock features that require a verified website. For more information, see [Understanding online store URL verification](//support.google.com/merchants/answer/176793).", + "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" + }, + "ImageImprovementsAccountLevelSettings": { + "description": "Settings for the Automatic Image Improvements.", + "id": "ImageImprovementsAccountLevelSettings", + "properties": { + "allowAutomaticImageImprovements": { + "description": "Enables automatic image improvements.", + "type": "boolean" + } + }, + "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_AFFILIATE", + "YOUTUBE_SHOPPING", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL", + "PRODUCT_REVIEWS", + "MERCHANT_REVIEWS", + "YOUTUBE_CHECKOUT" + ], + "enumDeprecated": [ + false, + false, + true, + false, + false, + false, + false, + 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 Affiliate](https://support.google.com/youtube/answer/13376398).", + "[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).", + "[Product Reviews](https://support.google.com/merchants/answer/14620732).", + "[Merchant Reviews](https://developers.google.com/merchant-review-feeds).", + "YouTube Checkout ." + ], + "type": "string" + } + }, + "type": "object" + }, + "InStock": { + "description": "Collection of information related to InStock.", + "id": "InStock", + "properties": { + "state": { + "description": "Output only. The state of the in-stock serving.", + "enum": [ + "STATE_UNSPECIFIED", + "ACTIVE", + "FAILED", + "RUNNING", + "ACTION_REQUIRED" + ], + "enumDescriptions": [ + "Default value. This value is unused.", + "The review process has concluded successfully. The reviewed item is active.", + "The review process failed.", + "The review process is running.", + "The review process is waiting for the merchant to take action." + ], + "readOnly": true, + "type": "string" + }, + "uri": { + "description": "Optional. Product landing page URI. It is only used for the review of MHLSF in-stock serving. This URI domain should match with the business's homepage. Required to be empty if the lsf_type is GHLSF, and required when the lsf_type is MHLSF_FULL or MHLSF_BASIC.", + "type": "string" + } + }, + "type": "object" + }, + "InventoryVerification": { + "description": "Collection of information related to [inventory verification](https://support.google.com/merchants/answer/14684499?ref_topic=15145634\u0026sjid=6892280366904591178-NC).", + "id": "InventoryVerification", + "properties": { + "contact": { + "description": "Required. The name of the contact for the inventory verification process.", + "type": "string" + }, + "contactEmail": { + "description": "Required. The email address of the contact for the inventory verification process.", + "type": "string" + }, + "contactState": { + "description": "Output only. The state of the contact verification.", + "enum": [ + "STATE_UNSPECIFIED", + "ACTIVE", + "FAILED", + "RUNNING", + "ACTION_REQUIRED" + ], + "enumDescriptions": [ + "Default value. This value is unused.", + "The review process has concluded successfully. The reviewed item is active.", + "The review process failed.", + "The review process is running.", + "The review process is waiting for the merchant to take action." + ], + "readOnly": true, + "type": "string" + }, + "state": { + "description": "Output only. The state of the inventory verification process.", + "enum": [ + "STATE_UNSPECIFIED", + "ACTION_REQUIRED", + "INACTIVE", + "RUNNING", + "SUCCEEDED", + "SUSPENDED" + ], + "enumDescriptions": [ + "Default value. This value is unused.", + "When the merchant needs to initiate the inventory verification process. The next state is INACTIVE.", + "When the merchant is ready to request inventory verification.", + "The inventory verification process is running. If the merchant is rejected, the next state is INACTIVE.", + "The inventory verification process succeeded.", + "When merchant fails the inventory verification process and all attempts are exhausted." + ], + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "ItemUpdatesAccountLevelSettings": { + "description": "Settings for the Automatic Item Updates.", + "id": "ItemUpdatesAccountLevelSettings", + "properties": { + "allowAvailabilityUpdates": { + "description": "If availability updates are enabled, any previous availability values get overwritten if Google finds an out-of-stock annotation on the offer's page. If additionally `allow_strict_availability_updates` field is set to true, values get overwritten if Google finds an in-stock annotation on the offer’s page.", + "type": "boolean" + }, + "allowConditionUpdates": { + "description": "If condition updates are enabled, Google always updates item condition with the condition detected from the details of your product.", + "type": "boolean" + }, + "allowPriceUpdates": { + "description": "If price updates are enabled, Google always updates the active price with the crawled information.", + "type": "boolean" + }, + "allowStrictAvailabilityUpdates": { + "description": "If `allow_availability_updates` is enabled, items are automatically updated in all your Shopping target countries. By default, availability updates will only be applied to items that are 'out of stock' on your website but 'in stock' on Shopping. Set this to true to also update items that are 'in stock' on your website, but 'out of stock' on Google Shopping. In order for this field to have an effect, you must also set `allow_availability_updates`.", + "type": "boolean" + } + }, + "type": "object" + }, + "LfpLink": { + "description": "Collection of information related to the LFP link.", + "id": "LfpLink", + "properties": { + "externalAccountId": { + "description": "Required. The account ID by which this merchant is known to the LFP provider.", + "type": "string" + }, + "lfpProvider": { + "description": "Required. The resource name of the LFP provider. Format: `lfpProviders/{lfp_provider}`", + "type": "string" + }, + "state": { + "description": "Output only. The state of the LFP link.", + "enum": [ + "STATE_UNSPECIFIED", + "ACTIVE", + "FAILED", + "RUNNING", + "ACTION_REQUIRED" + ], + "enumDescriptions": [ + "Default value. This value is unused.", + "The review process has concluded successfully. The reviewed item is active.", + "The review process failed.", + "The review process is running.", + "The review process is waiting for the merchant to take action." + ], + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "LfpProvider": { + "description": "Collection of information related to a Local Feed Partnership (LFP) provider.", + "id": "LfpProvider", + "properties": { + "displayName": { + "description": "The display name of the LFP provider.", + "type": "string" + }, + "name": { + "description": "Identifier. The resource name of the LFP provider. Format: `accounts/{account}/omnichannelSettings/{omnichannel_setting}/lfpProviders/{lfp_provider}`", + "type": "string" + }, + "regionCode": { + "description": "Output only. Region code defined by [CLDR](https://cldr.unicode.org/).", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "LinkGbpAccountRequest": { + "description": "Request message for the LinkGbpAccount method.", + "id": "LinkGbpAccountRequest", + "properties": { + "gbpEmail": { + "description": "Required. The email address of the Business Profile account.", + "type": "string" + } + }, + "type": "object" + }, + "LinkGbpAccountResponse": { + "description": "Response message for the LinkGbpAccount method.", + "id": "LinkGbpAccountResponse", + "properties": { + "response": { + "$ref": "Empty", + "description": "Empty response." + } + }, + "type": "object" + }, + "LinkLfpProviderRequest": { + "description": "Request message for the LinkLfpProvider method.", + "id": "LinkLfpProviderRequest", + "properties": { + "externalAccountId": { + "description": "Required. The external account ID by which this merchant is known to the LFP provider.", + "type": "string" + } + }, + "type": "object" + }, + "LinkLfpProviderResponse": { + "description": "Response message for the LinkLfpProvider method.", + "id": "LinkLfpProviderResponse", + "properties": { + "response": { + "$ref": "Empty", + "description": "Empty response." + } + }, + "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" + }, + "ListAccountRelationshipsResponse": { + "description": "Response after trying to list account relationships.", + "id": "ListAccountRelationshipsResponse", + "properties": { + "accountRelationships": { + "description": "The account relationships that match your filter.", + "items": { + "$ref": "AccountRelationship" + }, + "type": "array" + }, + "nextPageToken": { + "description": "A page token. You can send the `page_token` to get the next page. Only included in the `list` response if there are more pages.", + "type": "string" + } + }, + "type": "object" + }, + "ListAccountServicesResponse": { + "description": "Response after trying to list account services.", + "id": "ListAccountServicesResponse", + "properties": { + "accountServices": { + "description": "The account services that match your filter.", + "items": { + "$ref": "AccountService" + }, + "type": "array" + }, + "nextPageToken": { + "description": "A page token. You can send the `page_token` to get the next page. Only included in the `list` response if there are more pages.", + "type": "string" + } + }, + "type": "object" + }, + "ListAccountsResponse": { + "description": "Response message for the `accounts.list` 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" + }, + "ListGbpAccountsResponse": { + "description": "Response message for the ListGbpAccounts method.", + "id": "ListGbpAccountsResponse", + "properties": { + "gbpAccounts": { + "description": "The GBP accounts from the specified merchant in the specified country.", + "items": { + "$ref": "GbpAccount" + }, + "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" + }, + "ListOmnichannelSettingsResponse": { + "description": "Response message for the ListOmnichannelSettings method.", + "id": "ListOmnichannelSettingsResponse", + "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" + }, + "omnichannelSettings": { + "description": "The omnichannel settings from the specified merchant.", + "items": { + "$ref": "OmnichannelSetting" + }, + "type": "array" + } + }, + "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 business.", + "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" + }, + "LocalListingManagement": { + "description": "`LocalListingManagement` payload.", + "id": "LocalListingManagement", + "properties": {}, + "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 business.", + "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 business's 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" + }, + "OmnichannelSetting": { + "description": "Collection of information related to the omnichannel settings of a merchant.", + "id": "OmnichannelSetting", + "properties": { + "about": { + "$ref": "About", + "description": "Optional. The about page URI and state for this country." + }, + "inStock": { + "$ref": "InStock", + "description": "Optional. The InStock URI and state for this country." + }, + "inventoryVerification": { + "$ref": "InventoryVerification", + "description": "Optional. The inventory verification contact and state for this country." + }, + "lfpLink": { + "$ref": "LfpLink", + "description": "Output only. The established link to a LFP provider.", + "readOnly": true + }, + "lsfType": { + "description": "Required. The Local Store Front type for this country.", + "enum": [ + "LSF_TYPE_UNSPECIFIED", + "GHLSF", + "MHLSF_BASIC", + "MHLSF_FULL" + ], + "enumDescriptions": [ + "Default value. This value is unused.", + "Google-Hosted Local Store Front. Check the [HC article](https://support.google.com/merchants/answer/14869424) for more details.", + "Merchant-Hosted Local Store Front Basic. Check the [HC article](https://support.google.com/merchants/answer/14615867) for more details.", + "Merchant-Hosted Local Store Front Full. Check the [HC article](https://support.google.com/merchants/answer/14617076) for more details." + ], + "type": "string" + }, + "name": { + "description": "Identifier. The resource name of the omnichannel setting. Format: `accounts/{account}/omnichannelSettings/{omnichannel_setting}`", + "type": "string" + }, + "odo": { + "$ref": "OnDisplayToOrder", + "description": "Optional. The On Display to Order (ODO) policy URI and state for this country." + }, + "pickup": { + "$ref": "Pickup", + "description": "Optional. The Pickup URI and state for this country." + }, + "regionCode": { + "description": "Required. Immutable. Region code defined by [CLDR](https://cldr.unicode.org/). Must be provided in the Create method, and is immutable.", + "type": "string" + } + }, + "type": "object" + }, + "OnDisplayToOrder": { + "description": "Collection of information related to the on display to order ([ODO](https://support.google.com/merchants/answer/14615056?ref_topic=15145747\u0026sjid=6892280366904591178-NC)).", + "id": "OnDisplayToOrder", + "properties": { + "state": { + "description": "Output only. The state of the URI.", + "enum": [ + "STATE_UNSPECIFIED", + "ACTIVE", + "FAILED", + "RUNNING", + "ACTION_REQUIRED" + ], + "enumDescriptions": [ + "Default value. This value is unused.", + "The review process has concluded successfully. The reviewed item is active.", + "The review process failed.", + "The review process is running.", + "The review process is waiting for the merchant to take action." + ], + "readOnly": true, + "type": "string" + }, + "uri": { + "description": "Required. The on display to order (ODO) policy URI.", + "type": "string" + } + }, + "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": "Optional. This field specifies if business only accepts defective products for returns.", + "type": "boolean" + }, + "acceptExchange": { + "description": "Optional. This field specifies if business allows customers to exchange products.", + "type": "boolean" + }, + "countries": { + "description": "Required. Immutable. 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": "Optional. 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": "Optional. Immutable. This field represents the unique user-defined label of the return policy for the given country. It is important to note that the same label cannot be used in different return policies for the same country. If not given, policies will be automatically treated as the 'default' for the country. When using label, you are creating an exception policy in that country 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": "Optional. The return policy." + }, + "processRefundDays": { + "description": "Optional. The field specifies the number of days it takes for business to process refunds.", + "format": "int32", + "type": "integer" + }, + "restockingFee": { + "$ref": "RestockingFee", + "description": "Optional. 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." + }, + "returnLabelSource": { + "description": "Optional. The field specifies the return label source.", + "enum": [ + "RETURN_LABEL_SOURCE_UNSPECIFIED", + "DOWNLOAD_AND_PRINT", + "IN_THE_PACKAGE", + "CUSTOMER_RESPONSIBILITY" + ], + "enumDescriptions": [ + "Default value. This value is unused.", + "Download and print.", + "Label include in the package.", + "Customer to provide." + ], + "type": "string" + }, + "returnMethods": { + "description": "Optional. 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": "Required. 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": "Optional. The return shipping fee. Should be set only when customer need to download and print the return label." + }, + "seasonalOverrides": { + "description": "Optional. Overrides to the general policy for orders placed during a specific set of time intervals.", + "items": { + "$ref": "SeasonalOverride" + }, + "type": "array" + } + }, + "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. For example: - 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://wikipedia.org/wiki/Short_code" + } + }, + "type": "object" + }, + "Pickup": { + "description": "Collection of information related to Pickup.", + "id": "Pickup", + "properties": { + "state": { + "description": "Output only. The state of the pickup serving.", + "enum": [ + "STATE_UNSPECIFIED", + "ACTIVE", + "FAILED", + "RUNNING", + "ACTION_REQUIRED" + ], + "enumDescriptions": [ + "Default value. This value is unused.", + "The review process has concluded successfully. The reviewed item is active.", + "The review process failed.", + "The review process is running.", + "The review process is waiting for the merchant to take action." + ], + "readOnly": true, + "type": "string" + }, + "uri": { + "description": "Required. Pickup product page URI. It is only used for the review of pickup serving. This URI domain should match with the business's homepage.", + "type": "string" + } + }, + "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, such as for postal delivery or payments addresses. With a postal address, a postal service can deliver items to a premise, P.O. box, or similar. A postal address is not intended to model geographical locations like roads, towns, or mountains. In typical usage, an address would be created by user input or from importing existing data, depending on the type of process. Advice on address input or 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, 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 (for example, \"Austin, TX\"), it is important that the line order is clear. The order of address lines should be \"envelope order\" for the country or region of the address. In places where this can vary (for example, Japan), `address_language` is used to make it explicit (for example, \"ja\" for large-to-small ordering and \"ja-Latn\" or \"en\" for small-to-large). In 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. For Spain, this is the province and not the autonomous community (for example, \"Barcelona\" and not \"Catalonia\"). Many countries don't use an administrative area in postal addresses. For example, 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 or 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 (for example, state or zip code validation in the United States).", + "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 (for example, \"CEDEX 7\"), or just a number alone, representing the \"sector code\" (Jamaica), \"delivery area indicator\" (Malawi) or \"post office indicator\" (Côte d'Ivoire).", + "type": "string" + }, + "sublocality": { + "description": "Optional. Sublocality of the address. For example, this can be a neighborhood, borough, or district.", + "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. If empty, it means that the product was deleted. Will have one of these values : (`approved`, `pending`, `disapproved`, ``)", + "type": "string" + }, + "oldValue": { + "description": "The old value of the changed resource or attribute. If empty, it means that the product was created. Will have one of these values : (`approved`, `pending`, `disapproved`, ``)", + "type": "string" + }, + "regionCode": { + "description": "Countries that have the change (if applicable). Represented in the ISO 3166 format.", + "type": "string" + }, + "reportingContext": { + "description": "Reporting contexts that have the change (if applicable). Currently this field supports only (`SHOPPING_ADS`, `LOCAL_INVENTORY_ADS`, `YOUTUBE_SHOPPING`, `YOUTUBE_CHECKOUT`, `YOUTUBE_AFFILIATE`) from the enum value [ReportingContextEnum](/merchant/api/reference/rest/Shared.Types/ReportingContextEnum)", + "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_AFFILIATE", + "YOUTUBE_SHOPPING", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL", + "PRODUCT_REVIEWS", + "MERCHANT_REVIEWS", + "YOUTUBE_CHECKOUT" + ], + "enumDeprecated": [ + false, + false, + true, + false, + false, + false, + false, + 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 Affiliate](https://support.google.com/youtube/answer/13376398).", + "[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).", + "[Product Reviews](https://support.google.com/merchants/answer/14620732).", + "[Merchant Reviews](https://developers.google.com/merchant-review-feeds).", + "YouTube Checkout ." + ], + "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" + }, + "eventTime": { + "description": "The time at which the event was generated. If you want to order the notification messages you receive you should rely on this field not on the order of receiving the notifications.", + "format": "google-datetime", + "type": "string" + }, + "expirationTime": { + "description": "Optional. The product expiration time. This field will not be set if the notification is sent for a product deletion event.", + "format": "google-datetime", + "type": "string" + }, + "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: `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" + }, + "ProductsManagement": { + "description": "`ProductsManagement` payload.", + "id": "ProductsManagement", + "properties": {}, + "type": "object" + }, + "Program": { + "description": "Defines participation in a given program for the specified account. Programs provide a mechanism for adding functionality to a Merchant Center accounts. A typical example of this is the [Free product listings](https://support.google.com/merchants/answer/13889434) program, which enables products from a business's store to be shown across Google for free. The following list is the available set of program resource IDs accessible through the API: * `free-listings` * `shopping-ads` * `youtube-shopping-checkout`", + "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" + }, + "ProposeAccountServiceRequest": { + "description": "Request to propose an account service.", + "id": "ProposeAccountServiceRequest", + "properties": { + "accountService": { + "$ref": "AccountService", + "description": "Required. The account service to propose." + }, + "provider": { + "description": "Required. The provider of the service. Either the reference to an account such as `providers/123` or a well-known service provider (one of `providers/GOOGLE_ADS` or `providers/GOOGLE_BUSINESS_PROFILE`).", + "type": "string" + } + }, + "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" + }, + "RegisterGcpRequest": { + "description": "Request message for the RegisterGCP method.", + "id": "RegisterGcpRequest", + "properties": { + "developerEmail": { + "description": "Immutable. If the developer email provided is associated with a user in the merchant account provided, the user will be updated to have \"API developer\" access type and the email preference corresponding to that user will be updated to have the new \"API notifications\" preference. If the developer email provided is not associated with any user we will just add it as a contact. The email preference corresponding to that contact will have the new \"API notifications\" preference", + "type": "string" + } + }, + "type": "object" + }, + "RejectAccountServiceRequest": { + "description": "Request to reject an account service.", + "id": "RejectAccountServiceRequest", + "properties": {}, + "type": "object" + }, + "RequestInventoryVerificationRequest": { + "description": "Request message for the RequestInventoryVerification method.", + "id": "RequestInventoryVerificationRequest", + "properties": {}, + "type": "object" + }, + "RequestInventoryVerificationResponse": { + "description": "Response message for the RequestInventoryVerification method.", + "id": "RequestInventoryVerificationResponse", + "properties": { + "omnichannelSetting": { + "$ref": "OmnichannelSetting", + "description": "The omnichannel setting that was updated." + } + }, + "type": "object" + }, + "Required": { + "description": "Describes the terms of service which are required to be accepted.", + "id": "Required", + "properties": { + "termsOfService": { + "description": "Required. The `TermsOfService` that need to be accepted.", + "type": "string" + }, + "tosFileUri": { + "description": "Required. Full URL to the terms of service file. This field is the same as `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": "Required. 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" + }, + "SeasonalOverride": { + "id": "SeasonalOverride", + "properties": { + "endDate": { + "$ref": "Date", + "description": "Required. seasonal override end date (inclusive)." + }, + "label": { + "description": "Required. Display name of this seasonal override in Merchant Center.", + "type": "string" + }, + "returnDays": { + "description": "Number of days (from the delivery date) that the product can be returned.", + "format": "int32", + "type": "integer" + }, + "returnUntilDate": { + "$ref": "Date", + "description": "Fixed end date until which the product can be returned." + }, + "startDate": { + "$ref": "Date", + "description": "Required. Defines the date range when this seasonal override applies. Both start_date and end_date are inclusive. The dates of the seasonal overrides should not overlap." + } + }, + "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": "Required. 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": "Optional. 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": "Optional. 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": "Optional. 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 Center account's [shipping settings](https://support.google.com/merchants/answer/6069284). The `ShippingSettings` resource lets you retrieve and update the shipping settings of your advanced account and all its associated sub-accounts.", + "id": "ShippingSettings", + "properties": { + "etag": { + "description": "Required. This field helps avoid async issues. It ensures that the shipping setting data doesn't change between the `get` call and the `insert` call. The user should follow these steps: 1. Set the etag field as an empty string for the initial shipping setting creation. 2. After the initial creation, call the `get` method to obtain an etag and the current shipping setting data before calling `insert`. 3. Modify the shipping setting information. 4. Call the `insert` method with the shipping setting information and the etag obtained in step 2. 5. If the shipping setting data changes between step 2 and step 4, the insert request will fail because the etag changes every time the shipping setting data changes. In this case, the user should repeat steps 2-4 with the new etag.", + "type": "string" + }, + "name": { + "description": "Identifier. The resource name of the shipping settings. Format: `accounts/{account}/shippingSettings`. For example, `accounts/123456/shippingSettings`.", + "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 (For example \"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 (For example: US and CA).", + "id": "ShortCode", + "properties": { + "number": { + "description": "Required. The short code digits, without a leading plus ('+') or country calling code. For example \"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 business 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 business 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" + }, + "TermsOfService": { + "description": "The `TermsOfService` message represents a specific version of the terms of service that merchants must accept to access certain features or services. For more information, see [Terms of Service](https://support.google.com/merchants/answer/160173). This message is important for the onboarding process, ensuring that merchants agree to the necessary legal agreements for using the service. Merchants can retrieve the latest terms of service for a given `kind` and `region` through `RetrieveLatestTermsOfService`, and accept them as required through `AcceptTermsOfService`.", + "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 business has accepted a terms of service, `accepted` will be populated, otherwise it will be empty * If the business must sign a terms of service, `required` will be populated, otherwise it will be empty. Note that both `required` and `accepted` can be present. In this case the `accepted` terms of services will have an expiration date set in the `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 third-party providers 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`). The actual acceptance of the terms of service is done by calling accept on the `TermsOfService` resource. `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 third-party providers 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`. The actual acceptance of the terms of service is done by calling accept on the `TermsOfService` resource.", + "id": "TermsOfServiceAgreementState", + "properties": { + "accepted": { + "$ref": "Accepted", + "description": "Optional. 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}` The identifier format is: `{TermsOfServiceKind}-{country}` For example, an identifier could be: `MERCHANT_CENTER-EU` or `MERCHANT_CENTER-US`.", + "type": "string" + }, + "regionCode": { + "description": "Required. Region code as defined by https://cldr.unicode.org/. This is the country the current state applies to.", + "type": "string" + }, + "required": { + "$ref": "Required", + "description": "Optional. The required terms of service" + }, + "termsOfServiceKind": { + "description": "Required. 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. For example \"America/New_York\".", + "type": "string" + }, + "version": { + "description": "Optional. IANA Time Zone Database version number. For example \"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" + }, + "UnregisterGcpRequest": { + "description": "Request message for the UnregisterGCP method.", + "id": "UnregisterGcpRequest", + "properties": {}, + "type": "object" + }, + "UriSettings": { + "description": "URL settings for cart or checkout URL.", + "id": "UriSettings", + "properties": { + "cartUriTemplate": { + "description": "Cart URL template. When the placeholders are expanded will redirect the buyer to the cart page on the merchant website with the selected item in cart. For more details, check the [help center doc](https://support.google.com/merchants/answer/13945960#method1\u0026zippy=%2Cproduct-level-url-formatting%2Caccount-level-url-formatting)", + "type": "string" + }, + "checkoutUriTemplate": { + "description": "Checkout URL template. When the placeholders are expanded will redirect the buyer to the merchant checkout page with the item in the cart. For more details, check the [help center doc](https://support.google.com/merchants/answer/13945960#method1\u0026zippy=%2Cproduct-level-url-formatting%2Caccount-level-url-formatting)", + "type": "string" + } + }, + "type": "object" + }, + "User": { + "description": "The `User` message represents a user associated with a Merchant Center account. It is used to manage user permissions and access rights within the account. For more information, see [Frequently asked questions about people and access levels](//support.google.com/merchants/answer/12160472).", + "id": "User", + "properties": { + "accessRights": { + "description": "Required. The [access rights](https://support.google.com/merchants/answer/12160472?sjid=6789834943175119429-EU#accesstypes) the user has.", + "items": { + "enum": [ + "ACCESS_RIGHT_UNSPECIFIED", + "STANDARD", + "READ_ONLY", + "ADMIN", + "PERFORMANCE_REPORTING", + "API_DEVELOPER" + ], + "enumDescriptions": [ + "Default value. This value is unused.", + "Standard access rights.", + "Has access to the same read-only methods as STANDARD, but no access to any mutating methods.", + "Admin access rights.", + "Users with this right have access to performance and insights.", + "Users with this right have access to Merchant API and its notifications. This role is only accessible to accounts that has a developer registration." + ], + "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.", + "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\"`. [supported carriers](https://support.google.com/merchants/answer/7050921#zippy=%2Ccarrier-rates-au-de-uk-and-us-only)", + "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_v1", + "version_module": true +} \ No newline at end of file diff --git a/merchantapi/accounts/v1/merchantapi-gen.go b/merchantapi/accounts/v1/merchantapi-gen.go new file mode 100644 index 00000000000..a77172685a5 --- /dev/null +++ b/merchantapi/accounts/v1/merchantapi-gen.go @@ -0,0 +1,12831 @@ +// Copyright 2025 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.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/v1" +// ... +// 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/v1" + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "log/slog" + "net/http" + "net/url" + "strconv" + "strings" + + "github.com/googleapis/gax-go/v2/internallog" + 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 +var _ = internallog.New + +const apiId = "merchantapi:accounts_v1" +const apiName = "merchantapi" +const apiVersion = "accounts_v1" +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 := &APIService{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)} + s.Accounts = NewAccountsService(s) + s.TermsOfService = NewTermsOfServiceService(s) + 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") + } + return NewService(context.TODO(), option.WithHTTPClient(client)) +} + +type APIService struct { + client *http.Client + logger *slog.Logger + 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.AutofeedSettings = NewAccountsAutofeedSettingsService(s) + rs.AutomaticImprovements = NewAccountsAutomaticImprovementsService(s) + rs.BusinessIdentity = NewAccountsBusinessIdentityService(s) + rs.BusinessInfo = NewAccountsBusinessInfoService(s) + rs.DeveloperRegistration = NewAccountsDeveloperRegistrationService(s) + rs.EmailPreferences = NewAccountsEmailPreferencesService(s) + rs.GbpAccounts = NewAccountsGbpAccountsService(s) + rs.Homepage = NewAccountsHomepageService(s) + rs.Issues = NewAccountsIssuesService(s) + rs.OmnichannelSettings = NewAccountsOmnichannelSettingsService(s) + rs.OnlineReturnPolicies = NewAccountsOnlineReturnPoliciesService(s) + rs.Programs = NewAccountsProgramsService(s) + rs.Regions = NewAccountsRegionsService(s) + rs.Relationships = NewAccountsRelationshipsService(s) + rs.Services = NewAccountsServicesService(s) + rs.ShippingSettings = NewAccountsShippingSettingsService(s) + rs.TermsOfServiceAgreementStates = NewAccountsTermsOfServiceAgreementStatesService(s) + rs.Users = NewAccountsUsersService(s) + return rs +} + +type AccountsService struct { + s *APIService + + AutofeedSettings *AccountsAutofeedSettingsService + + AutomaticImprovements *AccountsAutomaticImprovementsService + + BusinessIdentity *AccountsBusinessIdentityService + + BusinessInfo *AccountsBusinessInfoService + + DeveloperRegistration *AccountsDeveloperRegistrationService + + EmailPreferences *AccountsEmailPreferencesService + + GbpAccounts *AccountsGbpAccountsService + + Homepage *AccountsHomepageService + + Issues *AccountsIssuesService + + OmnichannelSettings *AccountsOmnichannelSettingsService + + OnlineReturnPolicies *AccountsOnlineReturnPoliciesService + + Programs *AccountsProgramsService + + Regions *AccountsRegionsService + + Relationships *AccountsRelationshipsService + + Services *AccountsServicesService + + ShippingSettings *AccountsShippingSettingsService + + TermsOfServiceAgreementStates *AccountsTermsOfServiceAgreementStatesService + + Users *AccountsUsersService +} + +func NewAccountsAutofeedSettingsService(s *APIService) *AccountsAutofeedSettingsService { + rs := &AccountsAutofeedSettingsService{s: s} + return rs +} + +type AccountsAutofeedSettingsService struct { + s *APIService +} + +func NewAccountsAutomaticImprovementsService(s *APIService) *AccountsAutomaticImprovementsService { + rs := &AccountsAutomaticImprovementsService{s: s} + return rs +} + +type AccountsAutomaticImprovementsService struct { + s *APIService +} + +func NewAccountsBusinessIdentityService(s *APIService) *AccountsBusinessIdentityService { + rs := &AccountsBusinessIdentityService{s: s} + return rs +} + +type AccountsBusinessIdentityService struct { + s *APIService +} + +func NewAccountsBusinessInfoService(s *APIService) *AccountsBusinessInfoService { + rs := &AccountsBusinessInfoService{s: s} + return rs +} + +type AccountsBusinessInfoService struct { + s *APIService +} + +func NewAccountsDeveloperRegistrationService(s *APIService) *AccountsDeveloperRegistrationService { + rs := &AccountsDeveloperRegistrationService{s: s} + return rs +} + +type AccountsDeveloperRegistrationService struct { + s *APIService +} + +func NewAccountsEmailPreferencesService(s *APIService) *AccountsEmailPreferencesService { + rs := &AccountsEmailPreferencesService{s: s} + return rs +} + +type AccountsEmailPreferencesService struct { + s *APIService +} + +func NewAccountsGbpAccountsService(s *APIService) *AccountsGbpAccountsService { + rs := &AccountsGbpAccountsService{s: s} + return rs +} + +type AccountsGbpAccountsService 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 NewAccountsOmnichannelSettingsService(s *APIService) *AccountsOmnichannelSettingsService { + rs := &AccountsOmnichannelSettingsService{s: s} + rs.LfpProviders = NewAccountsOmnichannelSettingsLfpProvidersService(s) + return rs +} + +type AccountsOmnichannelSettingsService struct { + s *APIService + + LfpProviders *AccountsOmnichannelSettingsLfpProvidersService +} + +func NewAccountsOmnichannelSettingsLfpProvidersService(s *APIService) *AccountsOmnichannelSettingsLfpProvidersService { + rs := &AccountsOmnichannelSettingsLfpProvidersService{s: s} + return rs +} + +type AccountsOmnichannelSettingsLfpProvidersService 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} + rs.CheckoutSettings = NewAccountsProgramsCheckoutSettingsService(s) + return rs +} + +type AccountsProgramsService struct { + s *APIService + + CheckoutSettings *AccountsProgramsCheckoutSettingsService +} + +func NewAccountsProgramsCheckoutSettingsService(s *APIService) *AccountsProgramsCheckoutSettingsService { + rs := &AccountsProgramsCheckoutSettingsService{s: s} + return rs +} + +type AccountsProgramsCheckoutSettingsService struct { + s *APIService +} + +func NewAccountsRegionsService(s *APIService) *AccountsRegionsService { + rs := &AccountsRegionsService{s: s} + return rs +} + +type AccountsRegionsService struct { + s *APIService +} + +func NewAccountsRelationshipsService(s *APIService) *AccountsRelationshipsService { + rs := &AccountsRelationshipsService{s: s} + return rs +} + +type AccountsRelationshipsService struct { + s *APIService +} + +func NewAccountsServicesService(s *APIService) *AccountsServicesService { + rs := &AccountsServicesService{s: s} + return rs +} + +type AccountsServicesService 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 +} + +// About: Collection of information related to the about page (impressum +// (https://support.google.com/merchants/answer/14675634?ref_topic=15145634&sjid=6892280366904591178-NC)). +type About struct { + // State: Output only. The state of the URI. + // + // Possible values: + // "STATE_UNSPECIFIED" - Default value. This value is unused. + // "ACTIVE" - The review process has concluded successfully. The reviewed + // item is active. + // "FAILED" - The review process failed. + // "RUNNING" - The review process is running. + // "ACTION_REQUIRED" - The review process is waiting for the merchant to take + // action. + State string `json:"state,omitempty"` + // Uri: Required. The about page URI. + Uri string `json:"uri,omitempty"` + // ForceSendFields is a list of field names (e.g. "State") 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. "State") 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 About) MarshalJSON() ([]byte, error) { + type NoMethod About + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// AcceptTermsOfServiceResponse: Response message for the +// `AcceptTermsOfService` method. +type AcceptTermsOfServiceResponse struct { + // TermsOfServiceAgreementState: The agreement state after accepting the ToS. + TermsOfServiceAgreementState *TermsOfServiceAgreementState `json:"termsOfServiceAgreementState,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. + // "TermsOfServiceAgreementState") 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. "TermsOfServiceAgreementState") 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 AcceptTermsOfServiceResponse) MarshalJSON() ([]byte, error) { + type NoMethod AcceptTermsOfServiceResponse + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// Accepted: Describes the accepted terms of service +// (https://developers.google.com/merchant/api/guides/accounts/create-and-configure#accept_the_merchant_center_terms_of_service). +type Accepted struct { + // AcceptedBy: Required. The account where the acceptance was recorded. This + // can be the account itself or, in the case of subaccounts, the advanced + // account. + AcceptedBy string `json:"acceptedBy,omitempty"` + // TermsOfService: Required. The accepted termsOfService. + TermsOfService string `json:"termsOfService,omitempty"` + // ValidUntil: Optional. When set, it states that the accepted `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` is + // found in the `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: The `Account` message represents a business's account within +// Shopping Ads. It's the primary entity for managing product data, settings, +// and interactions with Google's services and external providers. Accounts can +// operate as standalone entities or be part of a advanced account structure. +// In an advanced account setup the parent account manages multiple +// sub-accounts. Establishing an account involves configuring attributes like +// the account name, time zone, and language preferences. The `Account` message +// is the parent entity for many other resources, for example, +// `AccountRelationship`, `Homepage`, `BusinessInfo` and so on. +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: Optional. 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. The `version` field is + // not supported, won't be set in responses and will be silently ignored if + // specified in requests. + 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) +} + +// AccountAggregation: `AccountAggregation` payload. +type AccountAggregation struct { +} + +// AccountIssue: Issues with your Merchant Center account that can impact all +// your products. For more information, see Account-level issues in Merchant +// Center +// (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}`. For example, + // `accounts/123456/issues/misrepresentation-of-self-or-products-unacceptable-bu + // siness-practice-policy`. + 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) +} + +// AccountManagement: `AccountManagement` payload. +type AccountManagement struct { +} + +// AccountRelationship: The `AccountRelationship` message defines a formal +// connection between a merchant's account and a service provider's account. +// This relationship enables the provider to offer specific services to the +// business, such as product management or campaign management. It specifies +// the access rights and permissions to the business's data relevant to those +// services. Establishing an account relationship involves linking the +// merchant's account with a provider's account. The provider could be another +// Google account (like Google Ads or Google My Business) or a third-party +// platform (such as Shopify or WooCommerce). +type AccountRelationship struct { + // AccountIdAlias: Optional. An optional alias you can assign to this account + // relationship. This alias acts as a convenient identifier for your own + // reference and management. It must be unique among all your account + // relationships with the same provider. For example, you might use + // `account_id_alias` to assign a friendly name to this relationship for easier + // identification in your systems. + AccountIdAlias string `json:"accountIdAlias,omitempty"` + // Name: Identifier. The resource name of the account relationship. Format: + // `accounts/{account}/relationships/{relationship}`. For example, + // `accounts/123456/relationships/567890`. + Name string `json:"name,omitempty"` + // Provider: Immutable. The provider of the service. Either the reference to an + // account such as `providers/123` or a well-known service provider (one of + // `providers/GOOGLE_ADS` or `providers/GOOGLE_BUSINESS_PROFILE`). + Provider string `json:"provider,omitempty"` + // ProviderDisplayName: Output only. The human-readable display name of the + // provider account. + ProviderDisplayName string `json:"providerDisplayName,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "AccountIdAlias") 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. "AccountIdAlias") 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 AccountRelationship) MarshalJSON() ([]byte, error) { + type NoMethod AccountRelationship + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// AccountService: The `AccountService` message represents a specific service +// that a provider account offers to a Merchant Center account. +// `AccountService` defines the permissions and capabilities granted to the +// provider, allowing for operations such as product management or campaign +// management. The lifecycle of an `AccountService` involves a proposal phase, +// where one party suggests the service, and an approval phase, where the other +// party accepts or rejects it. This handshake mechanism ensures mutual consent +// before any access is granted. This mechanism safeguards both parties by +// ensuring that access rights are granted appropriately and that both the +// business and provider are aware of the services enabled. In scenarios where +// a user is an admin of both accounts, the approval can happen automatically. +// The mutability of a service is also managed through `AccountService`. Some +// services might be immutable, for example, if they were established through +// other systems or APIs, and you cannot alter them through this API. +type AccountService struct { + // AccountAggregation: Service type for account aggregation. This enables the + // provider, which is an advanced account, to manage multiple sub-accounts + // (client accounts). Through this service, the advanced account provider can + // perform administrative and operational tasks across all linked sub-accounts. + // This is useful for agencies, aggregators, or large retailers that need + // centralized control over many Merchant Center accounts. + AccountAggregation *AccountAggregation `json:"accountAggregation,omitempty"` + // AccountManagement: Service type for account management. Enables the provider + // to perform administrative actions on the business's account, such as + // configuring account settings, managing users, or updating business + // information. + AccountManagement *AccountManagement `json:"accountManagement,omitempty"` + // CampaignsManagement: Service type for managing advertising campaigns. Grants + // the provider access to create and manage the business's ad campaigns, + // including setting up campaigns, adjusting bids, and optimizing performance. + CampaignsManagement *CampaignsManagement `json:"campaignsManagement,omitempty"` + // ExternalAccountId: Immutable. An optional, immutable identifier that Google + // uses to refer to this account when communicating with the provider. This + // should be the unique account ID within the provider's system (for example, + // your shop ID in Shopify). If you have multiple accounts with the same + // provider - for instance, different accounts for various regions — the + // `external_account_id` differentiates between them, ensuring accurate linking + // and integration between Google and the provider. + ExternalAccountId string `json:"externalAccountId,omitempty"` + // Handshake: Output only. Information about the state of the service in terms + // of establishing it (e.g. is it pending approval or approved). + Handshake *Handshake `json:"handshake,omitempty"` + // LocalListingManagement: Service type for local listings management. The + // business group associated with the external account id will be used to + // provide local inventory to this Merchant Center account. + LocalListingManagement *LocalListingManagement `json:"localListingManagement,omitempty"` + // Mutability: Output only. Whether the service is mutable (e.g. through + // Approve / Reject RPCs). A service that was created through another system or + // API might be immutable. + // + // Possible values: + // "MUTABILITY_UNSPECIFIED" - Unused default value + // "MUTABLE" - The service can be mutated without restrictions. + // "IMMUTABLE" - The service is read-only and must not be mutated. + Mutability string `json:"mutability,omitempty"` + // Name: Identifier. The resource name of the account service. Format: + // `accounts/{account}/services/{service}` + Name string `json:"name,omitempty"` + // ProductsManagement: Service type for managing products. This allows the + // provider to handle product data on behalf of the business, including reading + // and writing product listings. It's commonly used when the provider offers + // inventory management or catalog synchronization services to keep the + // business's product information up-to-date across platforms. + ProductsManagement *ProductsManagement `json:"productsManagement,omitempty"` + // Provider: Output only. The provider of the service. Either the reference to + // an account such as `providers/123` or a well-known service provider (one of + // `providers/GOOGLE_ADS` or `providers/GOOGLE_BUSINESS_PROFILE`). + Provider string `json:"provider,omitempty"` + // ProviderDisplayName: Output only. The human-readable display name of the + // provider account. + ProviderDisplayName string `json:"providerDisplayName,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // 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 AccountService) MarshalJSON() ([]byte, error) { + type NoMethod AccountService + 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 + // (https://support.google.com/merchants/answer/188487) for the account. + // Payload for service type Account Aggregation. + AccountAggregation *AccountAggregation `json:"accountAggregation,omitempty"` + // Provider: Required. The provider of the service. Either the reference to an + // account such as `providers/123` or a well-known service provider (one of + // `providers/GOOGLE_ADS` or `providers/GOOGLE_BUSINESS_PROFILE`). + 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) +} + +// AddUser: Instruction for adding a user to the account during creation. +type AddUser struct { + // User: Optional. Details about the user to be added. At the moment, only + // access rights may be specified. + 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. "User") 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. "User") 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 AddUser) MarshalJSON() ([]byte, error) { + type NoMethod AddUser + 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) +} + +// ApproveAccountServiceRequest: Request to approve an account service. +type ApproveAccountServiceRequest struct { +} + +// AutofeedSettings: Collection of information related to the autofeed +// (https://support.google.com/merchants/answer/7538732) settings. +type AutofeedSettings struct { + // Eligible: Output only. Determines whether the business is eligible for being + // enrolled into an autofeed. + Eligible bool `json:"eligible,omitempty"` + // EnableProducts: Required. Enables or disables product crawling through the + // autofeed for the given account. Autofeed accounts must meet certain + // conditions + // (https://support.google.com/merchants/answer/7538732#Configure_automated_feeds_Standard_Experience), + // which can be checked through the `eligible` field. The account must **not** + // be a marketplace. When the autofeed is enabled for the first time, the + // products usually appear instantly. When re-enabling, it might take up to 24 + // hours for products to appear. + EnableProducts bool `json:"enableProducts,omitempty"` + // Name: Identifier. The resource name of the autofeed settings. Format: + // `accounts/{account}/autofeedSettings`. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "Eligible") 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. "Eligible") 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 AutofeedSettings) MarshalJSON() ([]byte, error) { + type NoMethod AutofeedSettings + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// AutomaticImageImprovements: This improvement will attempt to automatically +// correct submitted images if they don't meet the image requirements +// (https://support.google.com/merchants/answer/6324350), for example, removing +// overlays. If successful, the image will be replaced and approved. This +// improvement is only applied to images of disapproved offers. For more +// information see: Automatic image improvements +// (https://support.google.com/merchants/answer/9242973) +type AutomaticImageImprovements struct { + // AccountImageImprovementsSettings: Optional. Determines how the images should + // be automatically updated. If this field is not present and provided in the + // update mask, then the settings will be deleted. If there are no settings for + // subaccount, they are inherited from aggregator. + AccountImageImprovementsSettings *ImageImprovementsAccountLevelSettings `json:"accountImageImprovementsSettings,omitempty"` + // EffectiveAllowAutomaticImageImprovements: Output only. The effective value + // of allow_automatic_image_improvements. If + // account_image_improvements_settings is present, then this value is the same. + // Otherwise, it represents the inherited value of the parent account. + // Read-only. + EffectiveAllowAutomaticImageImprovements bool `json:"effectiveAllowAutomaticImageImprovements,omitempty"` + // ForceSendFields is a list of field names (e.g. + // "AccountImageImprovementsSettings") 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. + // "AccountImageImprovementsSettings") 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 AutomaticImageImprovements) MarshalJSON() ([]byte, error) { + type NoMethod AutomaticImageImprovements + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// AutomaticImprovements: Collection of information related to the automatic +// improvements +// (https://developers.google.com/shopping-content/guides/automatic-improvements) +// of an account. +type AutomaticImprovements struct { + // ImageImprovements: This improvement will attempt to automatically correct + // submitted images if they don't meet the image requirements + // (https://support.google.com/merchants/answer/6324350), for example, removing + // overlays. If successful, the image will be replaced and approved. This + // improvement is only applied to images of disapproved offers. For more + // information see: Automatic image improvements + // (https://support.google.com/merchants/answer/9242973) This field is only + // updated (cleared) if provided in the update mask. + ImageImprovements *AutomaticImageImprovements `json:"imageImprovements,omitempty"` + // ItemUpdates: Turning on item updates + // (https://support.google.com/merchants/answer/3246284) allows Google to + // automatically update items for you. When item updates are on, Google uses + // the structured data markup on the website and advanced data extractors to + // update the price and availability of the items. When the item updates are + // off, items with mismatched data aren't shown. This field is only updated + // (cleared) if provided in the update mask. + ItemUpdates *AutomaticItemUpdates `json:"itemUpdates,omitempty"` + // Name: Identifier. The resource name of the automatic improvements. Format: + // `accounts/{account}/automaticImprovements`. + Name string `json:"name,omitempty"` + // ShippingImprovements: Not available for advanced accounts + // (https://support.google.com/merchants/answer/188487). By turning on + // automatic shipping improvements + // (https://support.google.com/merchants/answer/10027038), you are allowing + // Google to improve the accuracy of your delivery times shown to shoppers + // using Google. More accurate delivery times, especially when faster, + // typically lead to better conversion rates. Google will improve your + // estimated delivery times based on various factors: * Delivery address of an + // order * Current handling time and shipping time settings * Estimated + // weekdays or business days * Parcel tracking data This field is only updated + // (cleared) if provided in the update mask. + ShippingImprovements *AutomaticShippingImprovements `json:"shippingImprovements,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "ImageImprovements") 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. "ImageImprovements") 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 AutomaticImprovements) MarshalJSON() ([]byte, error) { + type NoMethod AutomaticImprovements + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// AutomaticItemUpdates: Turning on item updates +// (https://support.google.com/merchants/answer/3246284) allows Google to +// automatically update items for you. When item updates are on, Google uses +// the structured data markup on the website and advanced data extractors to +// update the price and availability of the items. When the item updates are +// off, items with mismatched data aren't shown. +type AutomaticItemUpdates struct { + // AccountItemUpdatesSettings: Optional. Determines which attributes of the + // items should be automatically updated. If this field is not present and + // provided in the update mask, then the settings will be deleted. If there are + // no settings for subaccount, they are inherited from aggregator. + AccountItemUpdatesSettings *ItemUpdatesAccountLevelSettings `json:"accountItemUpdatesSettings,omitempty"` + // EffectiveAllowAvailabilityUpdates: Output only. The effective value of + // allow_availability_updates. If account_item_updates_settings is present, + // then this value is the same. Otherwise, it represents the inherited value of + // the parent account. The default value is true if no settings are present. + // Read-only. + EffectiveAllowAvailabilityUpdates bool `json:"effectiveAllowAvailabilityUpdates,omitempty"` + // EffectiveAllowConditionUpdates: Output only. The effective value of + // allow_condition_updates. If account_item_updates_settings is present, then + // this value is the same. Otherwise, it represents the inherited value of the + // parent account. The default value is true if no settings are present. + // Read-only. + EffectiveAllowConditionUpdates bool `json:"effectiveAllowConditionUpdates,omitempty"` + // EffectiveAllowPriceUpdates: Output only. The effective value of + // allow_price_updates. If account_item_updates_settings is present, then this + // value is the same. Otherwise, it represents the inherited value of the + // parent account. The default value is true if no settings are present. + // Read-only. + EffectiveAllowPriceUpdates bool `json:"effectiveAllowPriceUpdates,omitempty"` + // EffectiveAllowStrictAvailabilityUpdates: Output only. The effective value of + // allow_strict_availability_updates. If account_item_updates_settings is + // present, then this value is the same. Otherwise, it represents the inherited + // value of the parent account. The default value is true if no settings are + // present. Read-only. + EffectiveAllowStrictAvailabilityUpdates bool `json:"effectiveAllowStrictAvailabilityUpdates,omitempty"` + // ForceSendFields is a list of field names (e.g. "AccountItemUpdatesSettings") + // 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. "AccountItemUpdatesSettings") 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 AutomaticItemUpdates) MarshalJSON() ([]byte, error) { + type NoMethod AutomaticItemUpdates + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// AutomaticShippingImprovements: Not available for advanced accounts +// (https://support.google.com/merchants/answer/188487). By turning on +// automatic shipping improvements +// (https://support.google.com/merchants/answer/10027038), you are allowing +// Google to improve the accuracy of your delivery times shown to shoppers +// using Google. More accurate delivery times, especially when faster, +// typically lead to better conversion rates. Google will improve your +// estimated delivery times based on various factors: * Delivery address of an +// order * Current handling time and shipping time settings * Estimated +// weekdays or business days * Parcel tracking data +type AutomaticShippingImprovements struct { + // AllowShippingImprovements: Enables automatic shipping improvements. + AllowShippingImprovements bool `json:"allowShippingImprovements,omitempty"` + // ForceSendFields is a list of field names (e.g. "AllowShippingImprovements") + // 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. "AllowShippingImprovements") 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 AutomaticShippingImprovements) MarshalJSON() ([]byte, error) { + type NoMethod AutomaticShippingImprovements + 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 businesses + // with the 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 + // businesses with the 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: Required. 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 businesses + // 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 + // businesses 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 businesses + // 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: The `BusinessInfo` message contains essential information +// about a business. This message captures key business details such as +// physical address, customer service contacts, and region-specific +// identifiers. +type BusinessInfo struct { + // Address: Optional. The address of the business. Only `region_code`, + // `address_lines`, `postal_code`, `administrative_area` and `locality` fields + // are supported. All other fields are ignored. + Address *PostalAddress `json:"address,omitempty"` + // CustomerService: Optional. The customer service of the business. + CustomerService *CustomerService `json:"customerService,omitempty"` + // KoreanBusinessRegistrationNumber: Optional. The 10-digit Korean business + // registration number (https://support.google.com/merchants/answer/9037766) + // separated with dashes in the format: XXX-XX-XXXXX. + KoreanBusinessRegistrationNumber string `json:"koreanBusinessRegistrationNumber,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) +} + +// CampaignsManagement: `CampaignManagement` payload. +type CampaignsManagement struct { +} + +// CarrierRate: A list of carrier rates that can be referred to by `main_table` +// or `single_value`. Supported carrier services are defined in +// https://support.google.com/merchants/answer/12577710?ref_topic=12570808&sjid=10662598224319463032-NC#zippy=%2Cdelivery-cost-rate-type%2Ccarrier-rate-au-de-uk-and-us-only. +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) +} + +// CheckoutSettings: CheckoutSettings +// (https://support.google.com/merchants/answer/13945960) for a specific +// merchant. +type CheckoutSettings struct { + // EffectiveEnrollmentState: Output only. The effective value of + // enrollment_state for a given merchant ID. If account level settings are + // present then this value will be a copy of the account level settings. + // Otherwise, it will have the value of the parent account (for only + // marketplace sellers). + // + // Possible values: + // "CHECKOUT_ENROLLMENT_STATE_UNSPECIFIED" - Default enrollment state when + // enrollment state is not specified. + // "INACTIVE" - Merchant has not enrolled into the program. + // "ENROLLED" - Merchant has enrolled into the program by providing either an + // account level URL or checkout URLs as part of their feed. + // "OPTED_OUT" - Merchant has previously enrolled but opted out of the + // program. + EffectiveEnrollmentState string `json:"effectiveEnrollmentState,omitempty"` + // EffectiveReviewState: Output only. The effective value of `review_state` for + // a given merchant ID. If account level settings are present then this value + // will be a copy of the account level settings. Otherwise, it will have the + // value of the parent account (for only marketplace sellers). + // + // Possible values: + // "CHECKOUT_REVIEW_STATE_UNSPECIFIED" - Default review state when review + // state is not specified. + // "IN_REVIEW" - Merchant provided URLs are being reviewed for data quality + // issues. + // "APPROVED" - Merchant account has been approved. Indicates the data + // quality checks have passed. + // "DISAPPROVED" - Merchant account has been disapproved due to data quality + // issues. + EffectiveReviewState string `json:"effectiveReviewState,omitempty"` + // EffectiveUriSettings: Output only. The effective value of `uri_settings` for + // a given merchant. If account level settings are present then this value will + // be a copy of url settings. Otherwise, it will have the value of the parent + // account (for only marketplace sellers). + EffectiveUriSettings *UriSettings `json:"effectiveUriSettings,omitempty"` + // EligibleDestinations: Optional. The destinations (also known as Marketing + // methods (https://support.google.com/merchants/answer/15130232)) to which the + // checkout program applies, valid destination values are `SHOPPING_ADS`, + // `FREE_LISTINGS` + // + // 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). + // "YOUTUBE_SHOPPING_CHECKOUT" - Youtube shopping checkout. + // "YOUTUBE_AFFILIATE" - [Youtube + // Affiliate](https://support.google.com/youtube/answer/13376398). + // "FREE_VEHICLE_LISTINGS" - [Free vehicle + // listings](https://support.google.com/merchants/answer/11189169). + // "VEHICLE_ADS" - [Vehicle + // ads](https://support.google.com/merchants/answer/11189169). + // "CLOUD_RETAIL" - [Cloud + // retail](https://cloud.google.com/solutions/retail). + // "LOCAL_CLOUD_RETAIL" - [Local cloud + // retail](https://cloud.google.com/solutions/retail). + EligibleDestinations []string `json:"eligibleDestinations,omitempty"` + // EnrollmentState: Output only. Reflects the merchant enrollment state in + // `Checkout` program. + // + // Possible values: + // "CHECKOUT_ENROLLMENT_STATE_UNSPECIFIED" - Default enrollment state when + // enrollment state is not specified. + // "INACTIVE" - Merchant has not enrolled into the program. + // "ENROLLED" - Merchant has enrolled into the program by providing either an + // account level URL or checkout URLs as part of their feed. + // "OPTED_OUT" - Merchant has previously enrolled but opted out of the + // program. + EnrollmentState string `json:"enrollmentState,omitempty"` + // Name: Identifier. The resource name of the program configuration settings. + // Format: `accounts/{account}/programs/{program}/checkoutSettings` + Name string `json:"name,omitempty"` + // ReviewState: Output only. Reflects the merchant review state in `Checkout` + // program. This is set based on the data quality reviews of the URL provided + // by the merchant. A merchant with enrollment state as `ENROLLED` can be in + // the following review states: `IN_REVIEW`, `APPROVED` or `DISAPPROVED`. A + // merchant must be in an `enrollment_state` of `ENROLLED` before a review can + // begin for the merchant.For more details, check the help center doc. + // + // Possible values: + // "CHECKOUT_REVIEW_STATE_UNSPECIFIED" - Default review state when review + // state is not specified. + // "IN_REVIEW" - Merchant provided URLs are being reviewed for data quality + // issues. + // "APPROVED" - Merchant account has been approved. Indicates the data + // quality checks have passed. + // "DISAPPROVED" - Merchant account has been disapproved due to data quality + // issues. + ReviewState string `json:"reviewState,omitempty"` + // UriSettings: URI settings for cart or checkout URL. + UriSettings *UriSettings `json:"uriSettings,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "EffectiveEnrollmentState") + // 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. "EffectiveEnrollmentState") 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 CheckoutSettings) MarshalJSON() ([]byte, error) { + type NoMethod CheckoutSettings + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// ClaimHomepageRequest: Request message for the `ClaimHomepage` method. +type ClaimHomepageRequest struct { + // Overwrite: Optional. When set to `true`, this option removes any existing + // claim on the requested website from any other account to the account making + // the request, effectively replacing the previous claim. + Overwrite bool `json:"overwrite,omitempty"` + // ForceSendFields is a list of field names (e.g. "Overwrite") 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. "Overwrite") 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 ClaimHomepageRequest) MarshalJSON() ([]byte, error) { + type NoMethod ClaimHomepageRequest + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// CreateAndConfigureAccountRequest: Request message for the +// `CreateAndConfigureAccount` method. +type CreateAndConfigureAccountRequest struct { + // Account: Required. The account to be created. + Account *Account `json:"account,omitempty"` + // Service: Required. An account service between the account to be created and + // the provider account is initialized as part of the creation. At least one + // such service needs to be provided. Currently exactly one of these needs to + // be `account_aggregation` and `accounts.createAndConfigure` method can be + // used to create a sub-account under an existing advanced account through this + // method. Additional `account_management` or `product_management` services may + // be provided. + Service []*AddAccountService `json:"service,omitempty"` + // User: Optional. Users to be added to the account. + User []*AddUser `json:"user,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 CreateAndConfigureAccountRequest) MarshalJSON() ([]byte, error) { + type NoMethod CreateAndConfigureAccountRequest + 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: Businesses 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`. 'min_handling_days' and + // 'max_handling_days' should be either set or not set at the same time. + 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. + // 'min_handling_days' and 'max_handling_days' should be either set or not set + // at the same time. + 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) +} + +// DeveloperRegistration: Represents a developer registration owned by a +// Merchant account. +type DeveloperRegistration struct { + // GcpIds: Output only. The GCP ids attached to this developer registration + GcpIds []string `json:"gcpIds,omitempty"` + // Name: Identifier. The `name` (ID) of the developer registration. Generated + // by the Content API upon creation of a new `DeveloperRegistration`. The + // `account` represents the merchant ID of the merchant that owns the + // registration. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "GcpIds") 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. "GcpIds") 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 DeveloperRegistration) MarshalJSON() ([]byte, error) { + type NoMethod DeveloperRegistration + 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 { +} + +// FindLfpProvidersResponse: Response message for the FindLfpProviders method. +type FindLfpProvidersResponse struct { + // LfpProviders: The LFP providers from the specified merchant in the specified + // country. + LfpProviders []*LfpProvider `json:"lfpProviders,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. "LfpProviders") 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. "LfpProviders") 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 FindLfpProvidersResponse) MarshalJSON() ([]byte, error) { + type NoMethod FindLfpProvidersResponse + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// GbpAccount: Collection of information related to a Google Business Profile +// (GBP) account. +type GbpAccount struct { + // GbpAccountId: The id of the GBP account. + GbpAccountId string `json:"gbpAccountId,omitempty"` + // GbpAccountName: The name of the Business Profile. For personal accounts: + // Email id of the owner. For Business accounts: Name of the Business Account. + GbpAccountName string `json:"gbpAccountName,omitempty"` + // ListingCount: Number of listings under this account. + ListingCount int64 `json:"listingCount,omitempty,string"` + // Name: Identifier. The resource name of the GBP account. Format: + // `accounts/{account}/gbpAccount/{gbp_account}` + Name string `json:"name,omitempty"` + // Type: The type of the Business Profile. + // + // Possible values: + // "TYPE_UNSPECIFIED" - Default value. This value is unused. + // "USER" - The GBP account is a user account. + // "BUSINESS_ACCOUNT" - The GBP account is a business account. + Type string `json:"type,omitempty"` + // ForceSendFields is a list of field names (e.g. "GbpAccountId") 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. "GbpAccountId") 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 GbpAccount) MarshalJSON() ([]byte, error) { + type NoMethod GbpAccount + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// 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) +} + +// Handshake: The current status of establishing of the service. (for example, +// pending approval or approved). +type Handshake struct { + // Actor: Output only. The most recent account to modify the account service's + // `approval_status`. + // + // Possible values: + // "ACTOR_UNSPECIFIED" - Unspecified actor. + // "ACCOUNT" - The last change was done by the account who has this service. + // "OTHER_PARTY" - The last change was done by the other party who this + // service points to. + Actor string `json:"actor,omitempty"` + // ApprovalState: Output only. The approval state of this handshake. + // + // Possible values: + // "APPROVAL_STATE_UNSPECIFIED" - Unspecified approval status. + // "PENDING" - The service was proposed and is waiting to be confirmed. + // "ESTABLISHED" - Both parties have confirmed the service. + // "REJECTED" - The service proposal was rejected. + ApprovalState string `json:"approvalState,omitempty"` + // ForceSendFields is a list of field names (e.g. "Actor") 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. "Actor") 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 Handshake) MarshalJSON() ([]byte, error) { + type NoMethod Handshake + 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: The `Homepage` message represents a business's store homepage +// within the system. A business's homepage is the primary domain where +// customers interact with their store. The homepage can be claimed and +// verified as a proof of ownership and allows the business to unlock features +// that require a verified website. For more information, see Understanding +// online store URL verification +// (//support.google.com/merchants/answer/176793). +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) +} + +// ImageImprovementsAccountLevelSettings: Settings for the Automatic Image +// Improvements. +type ImageImprovementsAccountLevelSettings struct { + // AllowAutomaticImageImprovements: Enables automatic image improvements. + AllowAutomaticImageImprovements bool `json:"allowAutomaticImageImprovements,omitempty"` + // ForceSendFields is a list of field names (e.g. + // "AllowAutomaticImageImprovements") 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. "AllowAutomaticImageImprovements") + // 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 ImageImprovementsAccountLevelSettings) MarshalJSON() ([]byte, error) { + type NoMethod ImageImprovementsAccountLevelSettings + 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_AFFILIATE" - [Youtube + // Affiliate](https://support.google.com/youtube/answer/13376398). + // "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). + // "PRODUCT_REVIEWS" - [Product + // Reviews](https://support.google.com/merchants/answer/14620732). + // "MERCHANT_REVIEWS" - [Merchant + // Reviews](https://developers.google.com/merchant-review-feeds). + // "YOUTUBE_CHECKOUT" - YouTube Checkout . + 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) +} + +// InStock: Collection of information related to InStock. +type InStock struct { + // State: Output only. The state of the in-stock serving. + // + // Possible values: + // "STATE_UNSPECIFIED" - Default value. This value is unused. + // "ACTIVE" - The review process has concluded successfully. The reviewed + // item is active. + // "FAILED" - The review process failed. + // "RUNNING" - The review process is running. + // "ACTION_REQUIRED" - The review process is waiting for the merchant to take + // action. + State string `json:"state,omitempty"` + // Uri: Optional. Product landing page URI. It is only used for the review of + // MHLSF in-stock serving. This URI domain should match with the business's + // homepage. Required to be empty if the lsf_type is GHLSF, and required when + // the lsf_type is MHLSF_FULL or MHLSF_BASIC. + Uri string `json:"uri,omitempty"` + // ForceSendFields is a list of field names (e.g. "State") 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. "State") 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 InStock) MarshalJSON() ([]byte, error) { + type NoMethod InStock + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// InventoryVerification: Collection of information related to inventory +// verification +// (https://support.google.com/merchants/answer/14684499?ref_topic=15145634&sjid=6892280366904591178-NC). +type InventoryVerification struct { + // Contact: Required. The name of the contact for the inventory verification + // process. + Contact string `json:"contact,omitempty"` + // ContactEmail: Required. The email address of the contact for the inventory + // verification process. + ContactEmail string `json:"contactEmail,omitempty"` + // ContactState: Output only. The state of the contact verification. + // + // Possible values: + // "STATE_UNSPECIFIED" - Default value. This value is unused. + // "ACTIVE" - The review process has concluded successfully. The reviewed + // item is active. + // "FAILED" - The review process failed. + // "RUNNING" - The review process is running. + // "ACTION_REQUIRED" - The review process is waiting for the merchant to take + // action. + ContactState string `json:"contactState,omitempty"` + // State: Output only. The state of the inventory verification process. + // + // Possible values: + // "STATE_UNSPECIFIED" - Default value. This value is unused. + // "ACTION_REQUIRED" - When the merchant needs to initiate the inventory + // verification process. The next state is INACTIVE. + // "INACTIVE" - When the merchant is ready to request inventory verification. + // "RUNNING" - The inventory verification process is running. If the merchant + // is rejected, the next state is INACTIVE. + // "SUCCEEDED" - The inventory verification process succeeded. + // "SUSPENDED" - When merchant fails the inventory verification process and + // all attempts are exhausted. + State string `json:"state,omitempty"` + // ForceSendFields is a list of field names (e.g. "Contact") 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. "Contact") 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 InventoryVerification) MarshalJSON() ([]byte, error) { + type NoMethod InventoryVerification + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// ItemUpdatesAccountLevelSettings: Settings for the Automatic Item Updates. +type ItemUpdatesAccountLevelSettings struct { + // AllowAvailabilityUpdates: If availability updates are enabled, any previous + // availability values get overwritten if Google finds an out-of-stock + // annotation on the offer's page. If additionally + // `allow_strict_availability_updates` field is set to true, values get + // overwritten if Google finds an in-stock annotation on the offer’s page. + AllowAvailabilityUpdates bool `json:"allowAvailabilityUpdates,omitempty"` + // AllowConditionUpdates: If condition updates are enabled, Google always + // updates item condition with the condition detected from the details of your + // product. + AllowConditionUpdates bool `json:"allowConditionUpdates,omitempty"` + // AllowPriceUpdates: If price updates are enabled, Google always updates the + // active price with the crawled information. + AllowPriceUpdates bool `json:"allowPriceUpdates,omitempty"` + // AllowStrictAvailabilityUpdates: If `allow_availability_updates` is enabled, + // items are automatically updated in all your Shopping target countries. By + // default, availability updates will only be applied to items that are 'out of + // stock' on your website but 'in stock' on Shopping. Set this to true to also + // update items that are 'in stock' on your website, but 'out of stock' on + // Google Shopping. In order for this field to have an effect, you must also + // set `allow_availability_updates`. + AllowStrictAvailabilityUpdates bool `json:"allowStrictAvailabilityUpdates,omitempty"` + // ForceSendFields is a list of field names (e.g. "AllowAvailabilityUpdates") + // 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. "AllowAvailabilityUpdates") 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 ItemUpdatesAccountLevelSettings) MarshalJSON() ([]byte, error) { + type NoMethod ItemUpdatesAccountLevelSettings + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// LfpLink: Collection of information related to the LFP link. +type LfpLink struct { + // ExternalAccountId: Required. The account ID by which this merchant is known + // to the LFP provider. + ExternalAccountId string `json:"externalAccountId,omitempty"` + // LfpProvider: Required. The resource name of the LFP provider. Format: + // `lfpProviders/{lfp_provider}` + LfpProvider string `json:"lfpProvider,omitempty"` + // State: Output only. The state of the LFP link. + // + // Possible values: + // "STATE_UNSPECIFIED" - Default value. This value is unused. + // "ACTIVE" - The review process has concluded successfully. The reviewed + // item is active. + // "FAILED" - The review process failed. + // "RUNNING" - The review process is running. + // "ACTION_REQUIRED" - The review process is waiting for the merchant to take + // action. + State string `json:"state,omitempty"` + // ForceSendFields is a list of field names (e.g. "ExternalAccountId") 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. "ExternalAccountId") 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 LfpLink) MarshalJSON() ([]byte, error) { + type NoMethod LfpLink + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// LfpProvider: Collection of information related to a Local Feed Partnership +// (LFP) provider. +type LfpProvider struct { + // DisplayName: The display name of the LFP provider. + DisplayName string `json:"displayName,omitempty"` + // Name: Identifier. The resource name of the LFP provider. Format: + // `accounts/{account}/omnichannelSettings/{omnichannel_setting}/lfpProviders/{l + // fp_provider}` + Name string `json:"name,omitempty"` + // RegionCode: Output only. Region code defined by CLDR + // (https://cldr.unicode.org/). + RegionCode string `json:"regionCode,omitempty"` + // 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 LfpProvider) MarshalJSON() ([]byte, error) { + type NoMethod LfpProvider + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// LinkGbpAccountRequest: Request message for the LinkGbpAccount method. +type LinkGbpAccountRequest struct { + // GbpEmail: Required. The email address of the Business Profile account. + GbpEmail string `json:"gbpEmail,omitempty"` + // ForceSendFields is a list of field names (e.g. "GbpEmail") 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. "GbpEmail") 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 LinkGbpAccountRequest) MarshalJSON() ([]byte, error) { + type NoMethod LinkGbpAccountRequest + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// LinkGbpAccountResponse: Response message for the LinkGbpAccount method. +type LinkGbpAccountResponse struct { + // Response: Empty response. + Response *Empty `json:"response,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "Response") 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. "Response") 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 LinkGbpAccountResponse) MarshalJSON() ([]byte, error) { + type NoMethod LinkGbpAccountResponse + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// LinkLfpProviderRequest: Request message for the LinkLfpProvider method. +type LinkLfpProviderRequest struct { + // ExternalAccountId: Required. The external account ID by which this merchant + // is known to the LFP provider. + ExternalAccountId string `json:"externalAccountId,omitempty"` + // ForceSendFields is a list of field names (e.g. "ExternalAccountId") 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. "ExternalAccountId") 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 LinkLfpProviderRequest) MarshalJSON() ([]byte, error) { + type NoMethod LinkLfpProviderRequest + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// LinkLfpProviderResponse: Response message for the LinkLfpProvider method. +type LinkLfpProviderResponse struct { + // Response: Empty response. + Response *Empty `json:"response,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "Response") 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. "Response") 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 LinkLfpProviderResponse) MarshalJSON() ([]byte, error) { + type NoMethod LinkLfpProviderResponse + 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) +} + +// ListAccountRelationshipsResponse: Response after trying to list account +// relationships. +type ListAccountRelationshipsResponse struct { + // AccountRelationships: The account relationships that match your filter. + AccountRelationships []*AccountRelationship `json:"accountRelationships,omitempty"` + // NextPageToken: A page token. You can send the `page_token` to get the next + // page. Only included in the `list` response if there are more 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. "AccountRelationships") 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. "AccountRelationships") 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 ListAccountRelationshipsResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListAccountRelationshipsResponse + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// ListAccountServicesResponse: Response after trying to list account services. +type ListAccountServicesResponse struct { + // AccountServices: The account services that match your filter. + AccountServices []*AccountService `json:"accountServices,omitempty"` + // NextPageToken: A page token. You can send the `page_token` to get the next + // page. Only included in the `list` response if there are more 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. "AccountServices") 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. "AccountServices") 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 ListAccountServicesResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListAccountServicesResponse + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// ListAccountsResponse: Response message for the `accounts.list` 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) +} + +// ListGbpAccountsResponse: Response message for the ListGbpAccounts method. +type ListGbpAccountsResponse struct { + // GbpAccounts: The GBP accounts from the specified merchant in the specified + // country. + GbpAccounts []*GbpAccount `json:"gbpAccounts,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. "GbpAccounts") 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. "GbpAccounts") 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 ListGbpAccountsResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListGbpAccountsResponse + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// ListOmnichannelSettingsResponse: Response message for the +// ListOmnichannelSettings method. +type ListOmnichannelSettingsResponse 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"` + // OmnichannelSettings: The omnichannel settings from the specified merchant. + OmnichannelSettings []*OmnichannelSetting `json:"omnichannelSettings,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 ListOmnichannelSettingsResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListOmnichannelSettingsResponse + 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 business. + 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) +} + +// LocalListingManagement: `LocalListingManagement` payload. +type LocalListingManagement struct { +} + +// 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 +// business. +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 business's 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) +} + +// OmnichannelSetting: Collection of information related to the omnichannel +// settings of a merchant. +type OmnichannelSetting struct { + // About: Optional. The about page URI and state for this country. + About *About `json:"about,omitempty"` + // InStock: Optional. The InStock URI and state for this country. + InStock *InStock `json:"inStock,omitempty"` + // InventoryVerification: Optional. The inventory verification contact and + // state for this country. + InventoryVerification *InventoryVerification `json:"inventoryVerification,omitempty"` + // LfpLink: Output only. The established link to a LFP provider. + LfpLink *LfpLink `json:"lfpLink,omitempty"` + // LsfType: Required. The Local Store Front type for this country. + // + // Possible values: + // "LSF_TYPE_UNSPECIFIED" - Default value. This value is unused. + // "GHLSF" - Google-Hosted Local Store Front. Check the [HC + // article](https://support.google.com/merchants/answer/14869424) for more + // details. + // "MHLSF_BASIC" - Merchant-Hosted Local Store Front Basic. Check the [HC + // article](https://support.google.com/merchants/answer/14615867) for more + // details. + // "MHLSF_FULL" - Merchant-Hosted Local Store Front Full. Check the [HC + // article](https://support.google.com/merchants/answer/14617076) for more + // details. + LsfType string `json:"lsfType,omitempty"` + // Name: Identifier. The resource name of the omnichannel setting. Format: + // `accounts/{account}/omnichannelSettings/{omnichannel_setting}` + Name string `json:"name,omitempty"` + // Odo: Optional. The On Display to Order (ODO) policy URI and state for this + // country. + Odo *OnDisplayToOrder `json:"odo,omitempty"` + // Pickup: Optional. The Pickup URI and state for this country. + Pickup *Pickup `json:"pickup,omitempty"` + // RegionCode: Required. Immutable. Region code defined by CLDR + // (https://cldr.unicode.org/). Must be provided in the Create method, and is + // immutable. + 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. "About") 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. "About") 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 OmnichannelSetting) MarshalJSON() ([]byte, error) { + type NoMethod OmnichannelSetting + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// OnDisplayToOrder: Collection of information related to the on display to +// order (ODO +// (https://support.google.com/merchants/answer/14615056?ref_topic=15145747&sjid=6892280366904591178-NC)). +type OnDisplayToOrder struct { + // State: Output only. The state of the URI. + // + // Possible values: + // "STATE_UNSPECIFIED" - Default value. This value is unused. + // "ACTIVE" - The review process has concluded successfully. The reviewed + // item is active. + // "FAILED" - The review process failed. + // "RUNNING" - The review process is running. + // "ACTION_REQUIRED" - The review process is waiting for the merchant to take + // action. + State string `json:"state,omitempty"` + // Uri: Required. The on display to order (ODO) policy URI. + Uri string `json:"uri,omitempty"` + // ForceSendFields is a list of field names (e.g. "State") 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. "State") 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 OnDisplayToOrder) MarshalJSON() ([]byte, error) { + type NoMethod OnDisplayToOrder + 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: Optional. This field specifies if business only accepts + // defective products for returns. + AcceptDefectiveOnly bool `json:"acceptDefectiveOnly,omitempty"` + // AcceptExchange: Optional. This field specifies if business allows customers + // to exchange products. + AcceptExchange bool `json:"acceptExchange,omitempty"` + // Countries: Required. Immutable. 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: Optional. 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: Optional. Immutable. This field represents the unique user-defined + // label of the return policy for the given country. It is important to note + // that the same label cannot be used in different return policies for the same + // country. If not given, policies will be automatically treated as the + // 'default' for the country. When using label, you are creating an exception + // policy in that country 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: Optional. The return policy. + Policy *Policy `json:"policy,omitempty"` + // ProcessRefundDays: Optional. The field specifies the number of days it takes + // for business to process refunds. + ProcessRefundDays int64 `json:"processRefundDays,omitempty"` + // RestockingFee: Optional. 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"` + // ReturnLabelSource: Optional. The field specifies the return label source. + // + // Possible values: + // "RETURN_LABEL_SOURCE_UNSPECIFIED" - Default value. This value is unused. + // "DOWNLOAD_AND_PRINT" - Download and print. + // "IN_THE_PACKAGE" - Label include in the package. + // "CUSTOMER_RESPONSIBILITY" - Customer to provide. + ReturnLabelSource string `json:"returnLabelSource,omitempty"` + // ReturnMethods: Optional. 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: Required. 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: Optional. The return shipping fee. Should be set only + // when customer need to download and print the return label. + ReturnShippingFee *ReturnShippingFee `json:"returnShippingFee,omitempty"` + // SeasonalOverrides: Optional. Overrides to the general policy for orders + // placed during a specific set of time intervals. + SeasonalOverrides []*SeasonalOverride `json:"seasonalOverrides,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. For example: - 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://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) +} + +// Pickup: Collection of information related to Pickup. +type Pickup struct { + // State: Output only. The state of the pickup serving. + // + // Possible values: + // "STATE_UNSPECIFIED" - Default value. This value is unused. + // "ACTIVE" - The review process has concluded successfully. The reviewed + // item is active. + // "FAILED" - The review process failed. + // "RUNNING" - The review process is running. + // "ACTION_REQUIRED" - The review process is waiting for the merchant to take + // action. + State string `json:"state,omitempty"` + // Uri: Required. Pickup product page URI. It is only used for the review of + // pickup serving. This URI domain should match with the business's homepage. + Uri string `json:"uri,omitempty"` + // ForceSendFields is a list of field names (e.g. "State") 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. "State") 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 Pickup) MarshalJSON() ([]byte, error) { + type NoMethod Pickup + 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, such as for postal delivery or +// payments addresses. With a postal address, a postal service can deliver +// items to a premise, P.O. box, or similar. A postal address is not intended +// to model geographical locations like roads, towns, or mountains. In typical +// usage, an address would be created by user input or from importing existing +// data, depending on the type of process. Advice on address input or 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, 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 (for example, + // "Austin, TX"), it is important that the line order is clear. The order of + // address lines should be "envelope order" for the country or region of the + // address. In places where this can vary (for example, Japan), + // `address_language` is used to make it explicit (for example, "ja" for + // large-to-small ordering and "ja-Latn" or "en" for small-to-large). In 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. For Spain, this is the + // province and not the autonomous community (for example, "Barcelona" and not + // "Catalonia"). Many countries don't use an administrative area in postal + // addresses. For example, 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 or 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 (for example, + // state or zip code validation in the United States). + 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 (for example, "CEDEX 7"), or + // just a number alone, representing the "sector code" (Jamaica), "delivery + // area indicator" (Malawi) or "post office indicator" (Côte d'Ivoire). + SortingCode string `json:"sortingCode,omitempty"` + // Sublocality: Optional. Sublocality of the address. For example, this can be + // a neighborhood, borough, or district. + 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. If empty, it + // means that the product was deleted. Will have one of these values : + // (`approved`, `pending`, `disapproved`, ``) + NewValue string `json:"newValue,omitempty"` + // OldValue: The old value of the changed resource or attribute. If empty, it + // means that the product was created. Will have one of these values : + // (`approved`, `pending`, `disapproved`, ``) + OldValue string `json:"oldValue,omitempty"` + // RegionCode: Countries that have the change (if applicable). Represented in + // the ISO 3166 format. + RegionCode string `json:"regionCode,omitempty"` + // ReportingContext: Reporting contexts that have the change (if applicable). + // Currently this field supports only (`SHOPPING_ADS`, `LOCAL_INVENTORY_ADS`, + // `YOUTUBE_SHOPPING`, `YOUTUBE_CHECKOUT`, `YOUTUBE_AFFILIATE`) from the enum + // value ReportingContextEnum + // (/merchant/api/reference/rest/Shared.Types/ReportingContextEnum) + // + // 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_AFFILIATE" - [Youtube + // Affiliate](https://support.google.com/youtube/answer/13376398). + // "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). + // "PRODUCT_REVIEWS" - [Product + // Reviews](https://support.google.com/merchants/answer/14620732). + // "MERCHANT_REVIEWS" - [Merchant + // Reviews](https://developers.google.com/merchant-review-feeds). + // "YOUTUBE_CHECKOUT" - YouTube Checkout . + 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"` + // EventTime: The time at which the event was generated. If you want to order + // the notification messages you receive you should rely on this field not on + // the order of receiving the notifications. + EventTime string `json:"eventTime,omitempty"` + // ExpirationTime: Optional. The product expiration time. This field will not + // be set if the notification is sent for a product deletion event. + ExpirationTime string `json:"expirationTime,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: `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) +} + +// ProductsManagement: `ProductsManagement` payload. +type ProductsManagement struct { +} + +// Program: Defines participation in a given program for the specified account. +// Programs provide a mechanism for adding functionality to a Merchant Center +// accounts. A typical example of this is the Free product listings +// (https://support.google.com/merchants/answer/13889434) program, which +// enables products from a business's store to be shown across Google for free. +// The following list is the available set of program resource IDs accessible +// through the API: * `free-listings` * `shopping-ads` * +// `youtube-shopping-checkout` +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) +} + +// ProposeAccountServiceRequest: Request to propose an account service. +type ProposeAccountServiceRequest struct { + // AccountService: Required. The account service to propose. + AccountService *AccountService `json:"accountService,omitempty"` + // Provider: Required. The provider of the service. Either the reference to an + // account such as `providers/123` or a well-known service provider (one of + // `providers/GOOGLE_ADS` or `providers/GOOGLE_BUSINESS_PROFILE`). + Provider string `json:"provider,omitempty"` + // ForceSendFields is a list of field names (e.g. "AccountService") 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. "AccountService") 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 ProposeAccountServiceRequest) MarshalJSON() ([]byte, error) { + type NoMethod ProposeAccountServiceRequest + 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) +} + +// RegisterGcpRequest: Request message for the RegisterGCP method. +type RegisterGcpRequest struct { + // DeveloperEmail: Immutable. If the developer email provided is associated + // with a user in the merchant account provided, the user will be updated to + // have "API developer" access type and the email preference corresponding to + // that user will be updated to have the new "API notifications" preference. If + // the developer email provided is not associated with any user we will just + // add it as a contact. The email preference corresponding to that contact will + // have the new "API notifications" preference + DeveloperEmail string `json:"developerEmail,omitempty"` + // ForceSendFields is a list of field names (e.g. "DeveloperEmail") 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. "DeveloperEmail") 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 RegisterGcpRequest) MarshalJSON() ([]byte, error) { + type NoMethod RegisterGcpRequest + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// RejectAccountServiceRequest: Request to reject an account service. +type RejectAccountServiceRequest struct { +} + +// RequestInventoryVerificationRequest: Request message for the +// RequestInventoryVerification method. +type RequestInventoryVerificationRequest struct { +} + +// RequestInventoryVerificationResponse: Response message for the +// RequestInventoryVerification method. +type RequestInventoryVerificationResponse struct { + // OmnichannelSetting: The omnichannel setting that was updated. + OmnichannelSetting *OmnichannelSetting `json:"omnichannelSetting,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "OmnichannelSetting") 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. "OmnichannelSetting") 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 RequestInventoryVerificationResponse) MarshalJSON() ([]byte, error) { + type NoMethod RequestInventoryVerificationResponse + 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: Required. The `TermsOfService` that need to be accepted. + TermsOfService string `json:"termsOfService,omitempty"` + // TosFileUri: Required. Full URL to the terms of service file. This field is + // the same as `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: Required. 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) +} + +type SeasonalOverride struct { + // EndDate: Required. seasonal override end date (inclusive). + EndDate *Date `json:"endDate,omitempty"` + // Label: Required. Display name of this seasonal override in Merchant Center. + Label string `json:"label,omitempty"` + // ReturnDays: Number of days (from the delivery date) that the product can be + // returned. + ReturnDays int64 `json:"returnDays,omitempty"` + // ReturnUntilDate: Fixed end date until which the product can be returned. + ReturnUntilDate *Date `json:"returnUntilDate,omitempty"` + // StartDate: Required. Defines the date range when this seasonal override + // applies. Both start_date and end_date are inclusive. The dates of the + // seasonal overrides should not overlap. + StartDate *Date `json:"startDate,omitempty"` + // ForceSendFields is a list of field names (e.g. "EndDate") 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. "EndDate") 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 SeasonalOverride) MarshalJSON() ([]byte, error) { + type NoMethod SeasonalOverride + 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: Required. 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: Optional. 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: Optional. 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: Optional. 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 Center account's shipping settings +// (https://support.google.com/merchants/answer/6069284). The +// `ShippingSettings` resource lets you retrieve and update the shipping +// settings of your advanced account and all its associated sub-accounts. +type ShippingSettings struct { + // Etag: Required. This field helps avoid async issues. It ensures that the + // shipping setting data doesn't change between the `get` call and the `insert` + // call. The user should follow these steps: 1. Set the etag field as an empty + // string for the initial shipping setting creation. 2. After the initial + // creation, call the `get` method to obtain an etag and the current shipping + // setting data before calling `insert`. 3. Modify the shipping setting + // information. 4. Call the `insert` method with the shipping setting + // information and the etag obtained in step 2. 5. If the shipping setting data + // changes between step 2 and step 4, the insert request will fail because the + // etag changes every time the shipping setting data changes. In this case, the + // user should repeat steps 2-4 with the new etag. + Etag string `json:"etag,omitempty"` + // Name: Identifier. The resource name of the shipping settings. Format: + // `accounts/{account}/shippingSettings`. For example, + // `accounts/123456/shippingSettings`. + 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 +// (For example "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 (For example: US and CA). +type ShortCode struct { + // Number: Required. The short code digits, without a leading plus ('+') or + // country calling code. For example "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 business 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 business 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) +} + +// TermsOfService: The `TermsOfService` message represents a specific version +// of the terms of service that merchants must accept to access certain +// features or services. For more information, see Terms of Service +// (https://support.google.com/merchants/answer/160173). This message is +// important for the onboarding process, ensuring that merchants agree to the +// necessary legal agreements for using the service. Merchants can retrieve the +// latest terms of service for a given `kind` and `region` through +// `RetrieveLatestTermsOfService`, and accept them as required through +// `AcceptTermsOfService`. +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 business has accepted a terms of service, `accepted` will be populated, +// otherwise it will be empty * If the business must sign a terms of service, +// `required` will be populated, otherwise it will be empty. Note that both +// `required` and `accepted` can be present. In this case the `accepted` terms +// of services will have an expiration date set in the `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 third-party providers 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`). The actual acceptance of the terms of service is done by +// calling accept on the `TermsOfService` resource. `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 third-party providers 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`. The actual acceptance of the terms of service is done by +// calling accept on the `TermsOfService` resource. +type TermsOfServiceAgreementState struct { + // Accepted: Optional. 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}` The + // identifier format is: `{TermsOfServiceKind}-{country}` For example, an + // identifier could be: `MERCHANT_CENTER-EU` or `MERCHANT_CENTER-US`. + Name string `json:"name,omitempty"` + // RegionCode: Required. Region code as defined by https://cldr.unicode.org/. + // This is the country the current state applies to. + RegionCode string `json:"regionCode,omitempty"` + // Required: Optional. The required terms of service + Required *Required `json:"required,omitempty"` + // TermsOfServiceKind: Required. 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. For example "America/New_York". + Id string `json:"id,omitempty"` + // Version: Optional. IANA Time Zone Database version number. For example + // "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 { +} + +// UnregisterGcpRequest: Request message for the UnregisterGCP method. +type UnregisterGcpRequest struct { +} + +// UriSettings: URL settings for cart or checkout URL. +type UriSettings struct { + // CartUriTemplate: Cart URL template. When the placeholders are expanded will + // redirect the buyer to the cart page on the merchant website with the + // selected item in cart. For more details, check the help center doc + // (https://support.google.com/merchants/answer/13945960#method1&zippy=%2Cproduct-level-url-formatting%2Caccount-level-url-formatting) + CartUriTemplate string `json:"cartUriTemplate,omitempty"` + // CheckoutUriTemplate: Checkout URL template. When the placeholders are + // expanded will redirect the buyer to the merchant checkout page with the item + // in the cart. For more details, check the help center doc + // (https://support.google.com/merchants/answer/13945960#method1&zippy=%2Cproduct-level-url-formatting%2Caccount-level-url-formatting) + CheckoutUriTemplate string `json:"checkoutUriTemplate,omitempty"` + // ForceSendFields is a list of field names (e.g. "CartUriTemplate") 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. "CartUriTemplate") 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 UriSettings) MarshalJSON() ([]byte, error) { + type NoMethod UriSettings + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// User: The `User` message represents a user associated with a Merchant Center +// account. It is used to manage user permissions and access rights within the +// account. For more information, see Frequently asked questions about people +// and access levels (//support.google.com/merchants/answer/12160472). +type User struct { + // AccessRights: Required. 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. + // "READ_ONLY" - Has access to the same read-only methods as STANDARD, but no + // access to any mutating methods. + // "ADMIN" - Admin access rights. + // "PERFORMANCE_REPORTING" - Users with this right have access to performance + // and insights. + // "API_DEVELOPER" - Users with this right have access to Merchant API and + // its notifications. This role is only accessible to accounts that has a + // developer registration. + 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. +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". supported carriers + // (https://support.google.com/merchants/answer/7050921#zippy=%2Ccarrier-rates-au-de-uk-and-us-only) + 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 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_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(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/v1/accounts:createAndConfigure") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.createAndConfigure", "request", internallog.HTTPRequest(req, body.Bytes())) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.createAndConfigure", "response", internallog.HTTPResponse(res, b)) + 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, +// advanced account or sub-account. Deleting an advanced account leads to the +// deletion of all of its sub-accounts. Executing this method requires admin +// access. The deletion succeeds only if the account does not provide services +// to any other account and has no processed offers. You can use the `force` +// parameter to override this. +// +// - 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 +} + +// Force sets the optional parameter "force": If set to `true`, the account is +// deleted even if it provides services to other accounts or has processed +// offers. +func (c *AccountsDeleteCall) Force(force bool) *AccountsDeleteCall { + c.urlParams_.Set("force", fmt.Sprint(force)) + 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_) + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.delete", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.delete", "response", internallog.HTTPResponse(res, b)) + 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_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.get", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.get", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsListCall struct { + s *APIService + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Note: For the `accounts.list` method, quota and limits usage are +// charged for each user, and not for the Merchant Center ID or the advanced +// account ID. To list several sub-accounts, you should use the +// `accounts.listSubaccounts` method, which is more suitable for advanced +// accounts use case. +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 +// (https://developers.google.com/merchant/api/guides/accounts/filter). For +// more details, see the filter syntax reference +// (https://developers.google.com/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 `accounts.list` call. Provide this to retrieve the +// subsequent page. When paginating, all other parameters provided in the +// `accounts.list` request 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_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/accounts") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.list", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.list", "response", internallog.HTTPResponse(res, b)) + 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 advanced account. This is +// a convenience wrapper for the more powerful `accounts.list` 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 aggregation service provider. Format: `accounts/{accountId}`. +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 `accounts.list` call. Provide this to retrieve the +// subsequent page. When paginating, all other parameters provided in the +// `accounts.list` request 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_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+provider}:listSubaccounts") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "provider": c.provider, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.listSubaccounts", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.listSubaccounts", "response", internallog.HTTPResponse(res, b)) + 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, advanced +// account 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": List of fields being +// updated. The following fields are supported (in both `snake_case` and +// `lowerCamelCase`): - `account_name` - `adult_content` - `language_code` - +// `time_zone` +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_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(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/v1/{+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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.patch", "request", internallog.HTTPRequest(req, body.Bytes())) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.patch", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsAutofeedSettingsGetAutofeedSettingsCall struct { + s *APIService + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// GetAutofeedSettings: Retrieves the autofeed settings of an account. +// +// - name: The resource name of the autofeed settings. Format: +// `accounts/{account}/autofeedSettings`. +func (r *AccountsAutofeedSettingsService) GetAutofeedSettings(name string) *AccountsAutofeedSettingsGetAutofeedSettingsCall { + c := &AccountsAutofeedSettingsGetAutofeedSettingsCall{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 *AccountsAutofeedSettingsGetAutofeedSettingsCall) Fields(s ...googleapi.Field) *AccountsAutofeedSettingsGetAutofeedSettingsCall { + 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 *AccountsAutofeedSettingsGetAutofeedSettingsCall) IfNoneMatch(entityTag string) *AccountsAutofeedSettingsGetAutofeedSettingsCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsAutofeedSettingsGetAutofeedSettingsCall) Context(ctx context.Context) *AccountsAutofeedSettingsGetAutofeedSettingsCall { + 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 *AccountsAutofeedSettingsGetAutofeedSettingsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsAutofeedSettingsGetAutofeedSettingsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.autofeedSettings.getAutofeedSettings", "request", internallog.HTTPRequest(req, nil)) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.autofeedSettings.getAutofeedSettings" call. +// Any non-2xx status code is an error. Response headers are in either +// *AutofeedSettings.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 *AccountsAutofeedSettingsGetAutofeedSettingsCall) Do(opts ...googleapi.CallOption) (*AutofeedSettings, 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 := &AutofeedSettings{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.autofeedSettings.getAutofeedSettings", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsAutofeedSettingsUpdateAutofeedSettingsCall struct { + s *APIService + name string + autofeedsettings *AutofeedSettings + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// UpdateAutofeedSettings: Updates the autofeed settings of an account. +// +// - name: Identifier. The resource name of the autofeed settings. Format: +// `accounts/{account}/autofeedSettings`. +func (r *AccountsAutofeedSettingsService) UpdateAutofeedSettings(name string, autofeedsettings *AutofeedSettings) *AccountsAutofeedSettingsUpdateAutofeedSettingsCall { + c := &AccountsAutofeedSettingsUpdateAutofeedSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.autofeedsettings = autofeedsettings + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. List of +// fields being updated. +func (c *AccountsAutofeedSettingsUpdateAutofeedSettingsCall) UpdateMask(updateMask string) *AccountsAutofeedSettingsUpdateAutofeedSettingsCall { + 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 *AccountsAutofeedSettingsUpdateAutofeedSettingsCall) Fields(s ...googleapi.Field) *AccountsAutofeedSettingsUpdateAutofeedSettingsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsAutofeedSettingsUpdateAutofeedSettingsCall) Context(ctx context.Context) *AccountsAutofeedSettingsUpdateAutofeedSettingsCall { + 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 *AccountsAutofeedSettingsUpdateAutofeedSettingsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsAutofeedSettingsUpdateAutofeedSettingsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.autofeedsettings) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.autofeedSettings.updateAutofeedSettings", "request", internallog.HTTPRequest(req, body.Bytes())) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.autofeedSettings.updateAutofeedSettings" call. +// Any non-2xx status code is an error. Response headers are in either +// *AutofeedSettings.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 *AccountsAutofeedSettingsUpdateAutofeedSettingsCall) Do(opts ...googleapi.CallOption) (*AutofeedSettings, 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 := &AutofeedSettings{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.autofeedSettings.updateAutofeedSettings", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsAutomaticImprovementsGetAutomaticImprovementsCall struct { + s *APIService + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// GetAutomaticImprovements: Retrieves the automatic improvements of an +// account. +// +// - name: The resource name of the automatic improvements. Format: +// `accounts/{account}/automaticImprovements`. +func (r *AccountsAutomaticImprovementsService) GetAutomaticImprovements(name string) *AccountsAutomaticImprovementsGetAutomaticImprovementsCall { + c := &AccountsAutomaticImprovementsGetAutomaticImprovementsCall{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 *AccountsAutomaticImprovementsGetAutomaticImprovementsCall) Fields(s ...googleapi.Field) *AccountsAutomaticImprovementsGetAutomaticImprovementsCall { + 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 *AccountsAutomaticImprovementsGetAutomaticImprovementsCall) IfNoneMatch(entityTag string) *AccountsAutomaticImprovementsGetAutomaticImprovementsCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsAutomaticImprovementsGetAutomaticImprovementsCall) Context(ctx context.Context) *AccountsAutomaticImprovementsGetAutomaticImprovementsCall { + 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 *AccountsAutomaticImprovementsGetAutomaticImprovementsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsAutomaticImprovementsGetAutomaticImprovementsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.automaticImprovements.getAutomaticImprovements", "request", internallog.HTTPRequest(req, nil)) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.automaticImprovements.getAutomaticImprovements" call. +// Any non-2xx status code is an error. Response headers are in either +// *AutomaticImprovements.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 *AccountsAutomaticImprovementsGetAutomaticImprovementsCall) Do(opts ...googleapi.CallOption) (*AutomaticImprovements, 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 := &AutomaticImprovements{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.automaticImprovements.getAutomaticImprovements", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsAutomaticImprovementsUpdateAutomaticImprovementsCall struct { + s *APIService + name string + automaticimprovements *AutomaticImprovements + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// UpdateAutomaticImprovements: Updates the automatic improvements of an +// account. +// +// - name: Identifier. The resource name of the automatic improvements. Format: +// `accounts/{account}/automaticImprovements`. +func (r *AccountsAutomaticImprovementsService) UpdateAutomaticImprovements(name string, automaticimprovements *AutomaticImprovements) *AccountsAutomaticImprovementsUpdateAutomaticImprovementsCall { + c := &AccountsAutomaticImprovementsUpdateAutomaticImprovementsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.automaticimprovements = automaticimprovements + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. List of +// fields being updated. The following fields are supported (in both +// `snake_case` and `lowerCamelCase`): - `item_updates` - +// `item_updates.account_level_settings` - `image_improvements` - +// `image_improvements.account_level_settings` - `shipping_improvements` - +// `shipping_improvements.allow_shipping_improvements` +func (c *AccountsAutomaticImprovementsUpdateAutomaticImprovementsCall) UpdateMask(updateMask string) *AccountsAutomaticImprovementsUpdateAutomaticImprovementsCall { + 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 *AccountsAutomaticImprovementsUpdateAutomaticImprovementsCall) Fields(s ...googleapi.Field) *AccountsAutomaticImprovementsUpdateAutomaticImprovementsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsAutomaticImprovementsUpdateAutomaticImprovementsCall) Context(ctx context.Context) *AccountsAutomaticImprovementsUpdateAutomaticImprovementsCall { + 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 *AccountsAutomaticImprovementsUpdateAutomaticImprovementsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsAutomaticImprovementsUpdateAutomaticImprovementsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.automaticimprovements) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.automaticImprovements.updateAutomaticImprovements", "request", internallog.HTTPRequest(req, body.Bytes())) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.automaticImprovements.updateAutomaticImprovements" call. +// Any non-2xx status code is an error. Response headers are in either +// *AutomaticImprovements.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 *AccountsAutomaticImprovementsUpdateAutomaticImprovementsCall) Do(opts ...googleapi.CallOption) (*AutomaticImprovements, 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 := &AutomaticImprovements{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.automaticImprovements.updateAutomaticImprovements", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsBusinessIdentityGetBusinessIdentityCall 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`. For example, +// `accounts/123456/businessIdentity`. +func (r *AccountsBusinessIdentityService) GetBusinessIdentity(name string) *AccountsBusinessIdentityGetBusinessIdentityCall { + c := &AccountsBusinessIdentityGetBusinessIdentityCall{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 *AccountsBusinessIdentityGetBusinessIdentityCall) Fields(s ...googleapi.Field) *AccountsBusinessIdentityGetBusinessIdentityCall { + 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 *AccountsBusinessIdentityGetBusinessIdentityCall) IfNoneMatch(entityTag string) *AccountsBusinessIdentityGetBusinessIdentityCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsBusinessIdentityGetBusinessIdentityCall) Context(ctx context.Context) *AccountsBusinessIdentityGetBusinessIdentityCall { + 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 *AccountsBusinessIdentityGetBusinessIdentityCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsBusinessIdentityGetBusinessIdentityCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.businessIdentity.getBusinessIdentity", "request", internallog.HTTPRequest(req, nil)) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.businessIdentity.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 *AccountsBusinessIdentityGetBusinessIdentityCall) 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.businessIdentity.getBusinessIdentity", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsBusinessIdentityUpdateBusinessIdentityCall 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 *AccountsBusinessIdentityService) UpdateBusinessIdentity(name string, businessidentity *BusinessIdentity) *AccountsBusinessIdentityUpdateBusinessIdentityCall { + c := &AccountsBusinessIdentityUpdateBusinessIdentityCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.businessidentity = businessidentity + return c +} + +// UpdateMask sets the optional parameter "updateMask": List of fields being +// updated. The following fields are supported (in both `snake_case` and +// `lowerCamelCase`): - `black_owned` - `latino_owned` - `promotions_consent` - +// `small_business` - `veteran_owned` - `women_owned` +func (c *AccountsBusinessIdentityUpdateBusinessIdentityCall) UpdateMask(updateMask string) *AccountsBusinessIdentityUpdateBusinessIdentityCall { + 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 *AccountsBusinessIdentityUpdateBusinessIdentityCall) Fields(s ...googleapi.Field) *AccountsBusinessIdentityUpdateBusinessIdentityCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsBusinessIdentityUpdateBusinessIdentityCall) Context(ctx context.Context) *AccountsBusinessIdentityUpdateBusinessIdentityCall { + 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 *AccountsBusinessIdentityUpdateBusinessIdentityCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsBusinessIdentityUpdateBusinessIdentityCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(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/v1/{+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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.businessIdentity.updateBusinessIdentity", "request", internallog.HTTPRequest(req, body.Bytes())) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.businessIdentity.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 *AccountsBusinessIdentityUpdateBusinessIdentityCall) 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.businessIdentity.updateBusinessIdentity", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsBusinessInfoGetBusinessInfoCall 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`. For example, +// `accounts/123456/businessInfo`. +func (r *AccountsBusinessInfoService) GetBusinessInfo(name string) *AccountsBusinessInfoGetBusinessInfoCall { + c := &AccountsBusinessInfoGetBusinessInfoCall{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 *AccountsBusinessInfoGetBusinessInfoCall) Fields(s ...googleapi.Field) *AccountsBusinessInfoGetBusinessInfoCall { + 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 *AccountsBusinessInfoGetBusinessInfoCall) IfNoneMatch(entityTag string) *AccountsBusinessInfoGetBusinessInfoCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsBusinessInfoGetBusinessInfoCall) Context(ctx context.Context) *AccountsBusinessInfoGetBusinessInfoCall { + 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 *AccountsBusinessInfoGetBusinessInfoCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsBusinessInfoGetBusinessInfoCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.businessInfo.getBusinessInfo", "request", internallog.HTTPRequest(req, nil)) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.businessInfo.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 *AccountsBusinessInfoGetBusinessInfoCall) 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.businessInfo.getBusinessInfo", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsBusinessInfoUpdateBusinessInfoCall 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 *AccountsBusinessInfoService) UpdateBusinessInfo(name string, businessinfo *BusinessInfo) *AccountsBusinessInfoUpdateBusinessInfoCall { + c := &AccountsBusinessInfoUpdateBusinessInfoCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.businessinfo = businessinfo + return c +} + +// UpdateMask sets the optional parameter "updateMask": List of fields being +// updated. The following fields are supported (in both `snake_case` and +// `lowerCamelCase`): - `address` - `customer_service` - +// `korean_business_registration_number` +func (c *AccountsBusinessInfoUpdateBusinessInfoCall) UpdateMask(updateMask string) *AccountsBusinessInfoUpdateBusinessInfoCall { + 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 *AccountsBusinessInfoUpdateBusinessInfoCall) Fields(s ...googleapi.Field) *AccountsBusinessInfoUpdateBusinessInfoCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsBusinessInfoUpdateBusinessInfoCall) Context(ctx context.Context) *AccountsBusinessInfoUpdateBusinessInfoCall { + 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 *AccountsBusinessInfoUpdateBusinessInfoCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsBusinessInfoUpdateBusinessInfoCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(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/v1/{+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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.businessInfo.updateBusinessInfo", "request", internallog.HTTPRequest(req, body.Bytes())) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.businessInfo.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 *AccountsBusinessInfoUpdateBusinessInfoCall) 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.businessInfo.updateBusinessInfo", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsDeveloperRegistrationGetDeveloperRegistrationCall struct { + s *APIService + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// GetDeveloperRegistration: Retrieves a developer registration for a merchant. +// +// - name: The `name` (ID) of the developer registration. +func (r *AccountsDeveloperRegistrationService) GetDeveloperRegistration(name string) *AccountsDeveloperRegistrationGetDeveloperRegistrationCall { + c := &AccountsDeveloperRegistrationGetDeveloperRegistrationCall{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 *AccountsDeveloperRegistrationGetDeveloperRegistrationCall) Fields(s ...googleapi.Field) *AccountsDeveloperRegistrationGetDeveloperRegistrationCall { + 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 *AccountsDeveloperRegistrationGetDeveloperRegistrationCall) IfNoneMatch(entityTag string) *AccountsDeveloperRegistrationGetDeveloperRegistrationCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsDeveloperRegistrationGetDeveloperRegistrationCall) Context(ctx context.Context) *AccountsDeveloperRegistrationGetDeveloperRegistrationCall { + 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 *AccountsDeveloperRegistrationGetDeveloperRegistrationCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsDeveloperRegistrationGetDeveloperRegistrationCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.developerRegistration.getDeveloperRegistration", "request", internallog.HTTPRequest(req, nil)) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.developerRegistration.getDeveloperRegistration" call. +// Any non-2xx status code is an error. Response headers are in either +// *DeveloperRegistration.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 *AccountsDeveloperRegistrationGetDeveloperRegistrationCall) Do(opts ...googleapi.CallOption) (*DeveloperRegistration, 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 := &DeveloperRegistration{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.developerRegistration.getDeveloperRegistration", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsDeveloperRegistrationRegisterGcpCall struct { + s *APIService + name string + registergcprequest *RegisterGcpRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// RegisterGcp: Registers the GCP used for the API call to the shopping account +// passed in the request. Will create a user with an "API developer" and add +// the "developer_email" as a contact with "API notifications" email preference +// on. +// +// - name: The name of the developer registration to be created for the +// merchant account that the GCP will be registered with. Format: +// `accounts/{account}/developerRegistration`. +func (r *AccountsDeveloperRegistrationService) RegisterGcp(name string, registergcprequest *RegisterGcpRequest) *AccountsDeveloperRegistrationRegisterGcpCall { + c := &AccountsDeveloperRegistrationRegisterGcpCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.registergcprequest = registergcprequest + 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 *AccountsDeveloperRegistrationRegisterGcpCall) Fields(s ...googleapi.Field) *AccountsDeveloperRegistrationRegisterGcpCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsDeveloperRegistrationRegisterGcpCall) Context(ctx context.Context) *AccountsDeveloperRegistrationRegisterGcpCall { + 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 *AccountsDeveloperRegistrationRegisterGcpCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsDeveloperRegistrationRegisterGcpCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.registergcprequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+name}:registerGcp") + 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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.developerRegistration.registerGcp", "request", internallog.HTTPRequest(req, body.Bytes())) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.developerRegistration.registerGcp" call. +// Any non-2xx status code is an error. Response headers are in either +// *DeveloperRegistration.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 *AccountsDeveloperRegistrationRegisterGcpCall) Do(opts ...googleapi.CallOption) (*DeveloperRegistration, 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 := &DeveloperRegistration{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.developerRegistration.registerGcp", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsDeveloperRegistrationUnregisterGcpCall struct { + s *APIService + name string + unregistergcprequest *UnregisterGcpRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// UnregisterGcp: Unregister the calling GCP from the calling shopping account. +// Note that the GCP will still be able to access the API for at most 1 day +// from the unregister succussful call. +// +// - name: The name of the developer registration to be created for the +// merchant account that the GCP will be registered with. Format: +// `accounts/{account}/developerRegistration`. +func (r *AccountsDeveloperRegistrationService) UnregisterGcp(name string, unregistergcprequest *UnregisterGcpRequest) *AccountsDeveloperRegistrationUnregisterGcpCall { + c := &AccountsDeveloperRegistrationUnregisterGcpCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.unregistergcprequest = unregistergcprequest + 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 *AccountsDeveloperRegistrationUnregisterGcpCall) Fields(s ...googleapi.Field) *AccountsDeveloperRegistrationUnregisterGcpCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsDeveloperRegistrationUnregisterGcpCall) Context(ctx context.Context) *AccountsDeveloperRegistrationUnregisterGcpCall { + 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 *AccountsDeveloperRegistrationUnregisterGcpCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsDeveloperRegistrationUnregisterGcpCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.unregistergcprequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+name}:unregisterGcp") + 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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.developerRegistration.unregisterGcp", "request", internallog.HTTPRequest(req, body.Bytes())) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.developerRegistration.unregisterGcp" 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 *AccountsDeveloperRegistrationUnregisterGcpCall) 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.developerRegistration.unregisterGcp", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsEmailPreferencesGetEmailPreferencesCall 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. This service only permits retrieving and updating email +// preferences for the authenticated 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 *AccountsEmailPreferencesService) GetEmailPreferences(name string) *AccountsEmailPreferencesGetEmailPreferencesCall { + c := &AccountsEmailPreferencesGetEmailPreferencesCall{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 *AccountsEmailPreferencesGetEmailPreferencesCall) Fields(s ...googleapi.Field) *AccountsEmailPreferencesGetEmailPreferencesCall { + 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 *AccountsEmailPreferencesGetEmailPreferencesCall) IfNoneMatch(entityTag string) *AccountsEmailPreferencesGetEmailPreferencesCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsEmailPreferencesGetEmailPreferencesCall) Context(ctx context.Context) *AccountsEmailPreferencesGetEmailPreferencesCall { + 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 *AccountsEmailPreferencesGetEmailPreferencesCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsEmailPreferencesGetEmailPreferencesCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.emailPreferences.getEmailPreferences", "request", internallog.HTTPRequest(req, nil)) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.emailPreferences.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 *AccountsEmailPreferencesGetEmailPreferencesCall) 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.emailPreferences.getEmailPreferences", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsEmailPreferencesUpdateEmailPreferencesCall 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. Advanced account users should specify the advanced account +// rather than a sub-account of the advanced account. 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 *AccountsEmailPreferencesService) UpdateEmailPreferences(name string, emailpreferences *EmailPreferences) *AccountsEmailPreferencesUpdateEmailPreferencesCall { + c := &AccountsEmailPreferencesUpdateEmailPreferencesCall{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. The following fields are supported (in both +// `snake_case` and `lowerCamelCase`): - `news_and_tips` +func (c *AccountsEmailPreferencesUpdateEmailPreferencesCall) UpdateMask(updateMask string) *AccountsEmailPreferencesUpdateEmailPreferencesCall { + 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 *AccountsEmailPreferencesUpdateEmailPreferencesCall) Fields(s ...googleapi.Field) *AccountsEmailPreferencesUpdateEmailPreferencesCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsEmailPreferencesUpdateEmailPreferencesCall) Context(ctx context.Context) *AccountsEmailPreferencesUpdateEmailPreferencesCall { + 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 *AccountsEmailPreferencesUpdateEmailPreferencesCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsEmailPreferencesUpdateEmailPreferencesCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(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/v1/{+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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.emailPreferences.updateEmailPreferences", "request", internallog.HTTPRequest(req, body.Bytes())) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.emailPreferences.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 *AccountsEmailPreferencesUpdateEmailPreferencesCall) 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.emailPreferences.updateEmailPreferences", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsGbpAccountsLinkGbpAccountCall struct { + s *APIService + parent string + linkgbpaccountrequest *LinkGbpAccountRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// LinkGbpAccount: Link the specified merchant to a GBP account for all +// countries. To run this method, you must have admin access to the Merchant +// Center account. If you don't have admin access, the request fails with the +// error message `User is not an administrator of account {ACCOUNT_ID}`. +// +// - parent: The name of the parent resource to which the GBP account is +// linked. Format: `accounts/{account}`. +func (r *AccountsGbpAccountsService) LinkGbpAccount(parent string, linkgbpaccountrequest *LinkGbpAccountRequest) *AccountsGbpAccountsLinkGbpAccountCall { + c := &AccountsGbpAccountsLinkGbpAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.linkgbpaccountrequest = linkgbpaccountrequest + 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 *AccountsGbpAccountsLinkGbpAccountCall) Fields(s ...googleapi.Field) *AccountsGbpAccountsLinkGbpAccountCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsGbpAccountsLinkGbpAccountCall) Context(ctx context.Context) *AccountsGbpAccountsLinkGbpAccountCall { + 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 *AccountsGbpAccountsLinkGbpAccountCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsGbpAccountsLinkGbpAccountCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.linkgbpaccountrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+parent}/gbpAccounts:linkGbpAccount") + 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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.gbpAccounts.linkGbpAccount", "request", internallog.HTTPRequest(req, body.Bytes())) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.gbpAccounts.linkGbpAccount" call. +// Any non-2xx status code is an error. Response headers are in either +// *LinkGbpAccountResponse.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 *AccountsGbpAccountsLinkGbpAccountCall) Do(opts ...googleapi.CallOption) (*LinkGbpAccountResponse, 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 := &LinkGbpAccountResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.gbpAccounts.linkGbpAccount", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsGbpAccountsListCall struct { + s *APIService + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: List the GBP accounts for a given merchant. +// +// - parent: The name of the parent resource under which the GBP accounts are +// listed. Format: `accounts/{account}`. +func (r *AccountsGbpAccountsService) List(parent string) *AccountsGbpAccountsListCall { + c := &AccountsGbpAccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number of +// `GbpAccount` resources to return. The service returns fewer than this value +// if the number of gbp accounts is less that than the `pageSize`. The default +// value is 50. The maximum value is 1000; If a value higher than the maximum +// is specified, then the `pageSize` will default to the maximum. +func (c *AccountsGbpAccountsListCall) PageSize(pageSize int64) *AccountsGbpAccountsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, received +// from a previous `ListGbpAccounts` call. Provide the page token to retrieve +// the subsequent page. When paginating, all other parameters provided to +// `ListGbpAccounts` must match the call that provided the page token. +func (c *AccountsGbpAccountsListCall) PageToken(pageToken string) *AccountsGbpAccountsListCall { + 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 *AccountsGbpAccountsListCall) Fields(s ...googleapi.Field) *AccountsGbpAccountsListCall { + 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 *AccountsGbpAccountsListCall) IfNoneMatch(entityTag string) *AccountsGbpAccountsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsGbpAccountsListCall) Context(ctx context.Context) *AccountsGbpAccountsListCall { + 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 *AccountsGbpAccountsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsGbpAccountsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+parent}/gbpAccounts") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.gbpAccounts.list", "request", internallog.HTTPRequest(req, nil)) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.gbpAccounts.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *ListGbpAccountsResponse.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 *AccountsGbpAccountsListCall) Do(opts ...googleapi.CallOption) (*ListGbpAccountsResponse, 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 := &ListGbpAccountsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.gbpAccounts.list", "response", internallog.HTTPResponse(res, b)) + 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 *AccountsGbpAccountsListCall) Pages(ctx context.Context, f func(*ListGbpAccountsResponse) 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 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 business 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 is returned: * +// PERMISSION_DENIED: User doesn't have the necessary permissions on this +// Merchant Center account. * FAILED_PRECONDITION: - The account is not a +// Merchant Center account. - Merchant Center account doesn't have a homepage. +// - Claiming failed (in this case the error message contains 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_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(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/v1/{+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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.homepage.claim", "request", internallog.HTTPRequest(req, body.Bytes())) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.homepage.claim", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsHomepageGetHomepageCall 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 *AccountsHomepageService) GetHomepage(name string) *AccountsHomepageGetHomepageCall { + c := &AccountsHomepageGetHomepageCall{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 *AccountsHomepageGetHomepageCall) Fields(s ...googleapi.Field) *AccountsHomepageGetHomepageCall { + 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 *AccountsHomepageGetHomepageCall) IfNoneMatch(entityTag string) *AccountsHomepageGetHomepageCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsHomepageGetHomepageCall) Context(ctx context.Context) *AccountsHomepageGetHomepageCall { + 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 *AccountsHomepageGetHomepageCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsHomepageGetHomepageCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.homepage.getHomepage", "request", internallog.HTTPRequest(req, nil)) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.homepage.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 *AccountsHomepageGetHomepageCall) 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.homepage.getHomepage", "response", internallog.HTTPResponse(res, b)) + 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_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(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/v1/{+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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.homepage.unclaim", "request", internallog.HTTPRequest(req, body.Bytes())) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.homepage.unclaim", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsHomepageUpdateHomepageCall 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 *AccountsHomepageService) UpdateHomepage(name string, homepage *Homepage) *AccountsHomepageUpdateHomepageCall { + c := &AccountsHomepageUpdateHomepageCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.homepage = homepage + return c +} + +// UpdateMask sets the optional parameter "updateMask": List of fields being +// updated. The following fields are supported (in both `snake_case` and +// `lowerCamelCase`): - `uri` +func (c *AccountsHomepageUpdateHomepageCall) UpdateMask(updateMask string) *AccountsHomepageUpdateHomepageCall { + 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 *AccountsHomepageUpdateHomepageCall) Fields(s ...googleapi.Field) *AccountsHomepageUpdateHomepageCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsHomepageUpdateHomepageCall) Context(ctx context.Context) *AccountsHomepageUpdateHomepageCall { + 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 *AccountsHomepageUpdateHomepageCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsHomepageUpdateHomepageCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(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/v1/{+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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.homepage.updateHomepage", "request", internallog.HTTPRequest(req, body.Bytes())) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.homepage.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 *AccountsHomepageUpdateHomepageCall) 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.homepage.updateHomepage", "response", internallog.HTTPResponse(res, b)) + 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. When called on +// a multi-client account, this method only returns issues belonging to that +// account, not its sub-accounts. To retrieve issues for sub-accounts, you must +// first call the accounts.listSubaccounts method to obtain a list of +// sub-accounts, and then call `accounts.issues.list` for each sub-account +// individually. +// +// - 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 issues 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 +} + +// TimeZone sets the optional parameter "timeZone": The IANA +// (https://www.iana.org/time-zones) timezone used to localize times in +// human-readable fields. For example 'America/Los_Angeles'. If not set, +// 'America/Los_Angeles' will be used. +func (c *AccountsIssuesListCall) TimeZone(timeZone string) *AccountsIssuesListCall { + c.urlParams_.Set("timeZone", timeZone) + 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_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+parent}/issues") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.issues.list", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.issues.list", "response", internallog.HTTPResponse(res, b)) + 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 AccountsOmnichannelSettingsCreateCall struct { + s *APIService + parent string + omnichannelsetting *OmnichannelSetting + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Create the omnichannel settings for a given merchant. +// +// - parent: The parent resource where this omnichannel setting will be +// created. Format: `accounts/{account}`. +func (r *AccountsOmnichannelSettingsService) Create(parent string, omnichannelsetting *OmnichannelSetting) *AccountsOmnichannelSettingsCreateCall { + c := &AccountsOmnichannelSettingsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.omnichannelsetting = omnichannelsetting + 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 *AccountsOmnichannelSettingsCreateCall) Fields(s ...googleapi.Field) *AccountsOmnichannelSettingsCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsOmnichannelSettingsCreateCall) Context(ctx context.Context) *AccountsOmnichannelSettingsCreateCall { + 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 *AccountsOmnichannelSettingsCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsOmnichannelSettingsCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.omnichannelsetting) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+parent}/omnichannelSettings") + 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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.omnichannelSettings.create", "request", internallog.HTTPRequest(req, body.Bytes())) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.omnichannelSettings.create" call. +// Any non-2xx status code is an error. Response headers are in either +// *OmnichannelSetting.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 *AccountsOmnichannelSettingsCreateCall) Do(opts ...googleapi.CallOption) (*OmnichannelSetting, 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 := &OmnichannelSetting{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.omnichannelSettings.create", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsOmnichannelSettingsGetCall struct { + s *APIService + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Get the omnichannel settings for a given merchant. +// +// - name: The name of the omnichannel setting to retrieve. Format: +// `accounts/{account}/omnichannelSettings/{omnichannel_setting}`. +func (r *AccountsOmnichannelSettingsService) Get(name string) *AccountsOmnichannelSettingsGetCall { + c := &AccountsOmnichannelSettingsGetCall{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 *AccountsOmnichannelSettingsGetCall) Fields(s ...googleapi.Field) *AccountsOmnichannelSettingsGetCall { + 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 *AccountsOmnichannelSettingsGetCall) IfNoneMatch(entityTag string) *AccountsOmnichannelSettingsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsOmnichannelSettingsGetCall) Context(ctx context.Context) *AccountsOmnichannelSettingsGetCall { + 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 *AccountsOmnichannelSettingsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsOmnichannelSettingsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.omnichannelSettings.get", "request", internallog.HTTPRequest(req, nil)) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.omnichannelSettings.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *OmnichannelSetting.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 *AccountsOmnichannelSettingsGetCall) Do(opts ...googleapi.CallOption) (*OmnichannelSetting, 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 := &OmnichannelSetting{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.omnichannelSettings.get", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsOmnichannelSettingsListCall struct { + s *APIService + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: List all the omnichannel settings for a given merchant. +// +// - parent: The parent, which owns this collection of omnichannel settings. +// Format: `accounts/{account}`. +func (r *AccountsOmnichannelSettingsService) List(parent string) *AccountsOmnichannelSettingsListCall { + c := &AccountsOmnichannelSettingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number of +// omnichannel settings to return. The service may return fewer than this +// value. If unspecified, at most 50 omnichannel settings will be returned. The +// maximum value is 1000; values above 1000 will be coerced to 1000. +func (c *AccountsOmnichannelSettingsListCall) PageSize(pageSize int64) *AccountsOmnichannelSettingsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, received +// from a previous `ListOmnichannelSettings` call. Provide this to retrieve the +// subsequent page. When paginating, all other parameters provided to +// `ListOmnichannelSettings` must match the call that provided the page token. +func (c *AccountsOmnichannelSettingsListCall) PageToken(pageToken string) *AccountsOmnichannelSettingsListCall { + 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 *AccountsOmnichannelSettingsListCall) Fields(s ...googleapi.Field) *AccountsOmnichannelSettingsListCall { + 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 *AccountsOmnichannelSettingsListCall) IfNoneMatch(entityTag string) *AccountsOmnichannelSettingsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsOmnichannelSettingsListCall) Context(ctx context.Context) *AccountsOmnichannelSettingsListCall { + 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 *AccountsOmnichannelSettingsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsOmnichannelSettingsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+parent}/omnichannelSettings") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.omnichannelSettings.list", "request", internallog.HTTPRequest(req, nil)) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.omnichannelSettings.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *ListOmnichannelSettingsResponse.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 *AccountsOmnichannelSettingsListCall) Do(opts ...googleapi.CallOption) (*ListOmnichannelSettingsResponse, 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 := &ListOmnichannelSettingsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.omnichannelSettings.list", "response", internallog.HTTPResponse(res, b)) + 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 *AccountsOmnichannelSettingsListCall) Pages(ctx context.Context, f func(*ListOmnichannelSettingsResponse) 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 AccountsOmnichannelSettingsPatchCall struct { + s *APIService + name string + omnichannelsetting *OmnichannelSetting + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Update the omnichannel setting for a given merchant in a given +// country. +// +// - name: Identifier. The resource name of the omnichannel setting. Format: +// `accounts/{account}/omnichannelSettings/{omnichannel_setting}`. +func (r *AccountsOmnichannelSettingsService) Patch(name string, omnichannelsetting *OmnichannelSetting) *AccountsOmnichannelSettingsPatchCall { + c := &AccountsOmnichannelSettingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.omnichannelsetting = omnichannelsetting + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. The list of +// fields to be updated. The following fields are supported in snake_case only: +// - `lsf_type` - `in_stock` - `pickup` - `odo` - `about` - +// `inventory_verification` Full replacement with wildcard `*`is supported, +// while empty/implied update mask is not. +func (c *AccountsOmnichannelSettingsPatchCall) UpdateMask(updateMask string) *AccountsOmnichannelSettingsPatchCall { + 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 *AccountsOmnichannelSettingsPatchCall) Fields(s ...googleapi.Field) *AccountsOmnichannelSettingsPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsOmnichannelSettingsPatchCall) Context(ctx context.Context) *AccountsOmnichannelSettingsPatchCall { + 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 *AccountsOmnichannelSettingsPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsOmnichannelSettingsPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.omnichannelsetting) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.omnichannelSettings.patch", "request", internallog.HTTPRequest(req, body.Bytes())) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.omnichannelSettings.patch" call. +// Any non-2xx status code is an error. Response headers are in either +// *OmnichannelSetting.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 *AccountsOmnichannelSettingsPatchCall) Do(opts ...googleapi.CallOption) (*OmnichannelSetting, 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 := &OmnichannelSetting{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.omnichannelSettings.patch", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsOmnichannelSettingsRequestInventoryVerificationCall struct { + s *APIService + name string + requestinventoryverificationrequest *RequestInventoryVerificationRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// RequestInventoryVerification: Requests inventory verification for a given +// merchant in a given country. +// +// - name: The name of the omnichannel setting to request inventory +// verification. Format: +// `accounts/{account}/omnichannelSettings/{omnichannel_setting}`. +func (r *AccountsOmnichannelSettingsService) RequestInventoryVerification(name string, requestinventoryverificationrequest *RequestInventoryVerificationRequest) *AccountsOmnichannelSettingsRequestInventoryVerificationCall { + c := &AccountsOmnichannelSettingsRequestInventoryVerificationCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.requestinventoryverificationrequest = requestinventoryverificationrequest + 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 *AccountsOmnichannelSettingsRequestInventoryVerificationCall) Fields(s ...googleapi.Field) *AccountsOmnichannelSettingsRequestInventoryVerificationCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsOmnichannelSettingsRequestInventoryVerificationCall) Context(ctx context.Context) *AccountsOmnichannelSettingsRequestInventoryVerificationCall { + 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 *AccountsOmnichannelSettingsRequestInventoryVerificationCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsOmnichannelSettingsRequestInventoryVerificationCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.requestinventoryverificationrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+name}:requestInventoryVerification") + 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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.omnichannelSettings.requestInventoryVerification", "request", internallog.HTTPRequest(req, body.Bytes())) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.omnichannelSettings.requestInventoryVerification" call. +// Any non-2xx status code is an error. Response headers are in either +// *RequestInventoryVerificationResponse.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 *AccountsOmnichannelSettingsRequestInventoryVerificationCall) Do(opts ...googleapi.CallOption) (*RequestInventoryVerificationResponse, 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 := &RequestInventoryVerificationResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.omnichannelSettings.requestInventoryVerification", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsOmnichannelSettingsLfpProvidersFindCall struct { + s *APIService + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Find: Find the LFP provider candidates in a given country. +// +// - parent: The name of the parent resource under which the LFP providers are +// found. Format: +// `accounts/{account}/omnichannelSettings/{omnichannel_setting}`. +func (r *AccountsOmnichannelSettingsLfpProvidersService) Find(parent string) *AccountsOmnichannelSettingsLfpProvidersFindCall { + c := &AccountsOmnichannelSettingsLfpProvidersFindCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number of +// `LfpProvider` resources to return. The service returns fewer than this value +// if the number of lfp providers is less that than the `pageSize`. The default +// value is 50. The maximum value is 1000; If a value higher than the maximum +// is specified, then the `pageSize` will default to the maximum. +func (c *AccountsOmnichannelSettingsLfpProvidersFindCall) PageSize(pageSize int64) *AccountsOmnichannelSettingsLfpProvidersFindCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, received +// from a previous `FindLfpProviders` call. Provide the page token to retrieve +// the subsequent page. When paginating, all other parameters provided to +// `FindLfpProviders` must match the call that provided the page token. +func (c *AccountsOmnichannelSettingsLfpProvidersFindCall) PageToken(pageToken string) *AccountsOmnichannelSettingsLfpProvidersFindCall { + 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 *AccountsOmnichannelSettingsLfpProvidersFindCall) Fields(s ...googleapi.Field) *AccountsOmnichannelSettingsLfpProvidersFindCall { + 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 *AccountsOmnichannelSettingsLfpProvidersFindCall) IfNoneMatch(entityTag string) *AccountsOmnichannelSettingsLfpProvidersFindCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsOmnichannelSettingsLfpProvidersFindCall) Context(ctx context.Context) *AccountsOmnichannelSettingsLfpProvidersFindCall { + 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 *AccountsOmnichannelSettingsLfpProvidersFindCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsOmnichannelSettingsLfpProvidersFindCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+parent}/lfpProviders:find") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.omnichannelSettings.lfpProviders.find", "request", internallog.HTTPRequest(req, nil)) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.omnichannelSettings.lfpProviders.find" call. +// Any non-2xx status code is an error. Response headers are in either +// *FindLfpProvidersResponse.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 *AccountsOmnichannelSettingsLfpProvidersFindCall) Do(opts ...googleapi.CallOption) (*FindLfpProvidersResponse, 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 := &FindLfpProvidersResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.omnichannelSettings.lfpProviders.find", "response", internallog.HTTPResponse(res, b)) + 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 *AccountsOmnichannelSettingsLfpProvidersFindCall) Pages(ctx context.Context, f func(*FindLfpProvidersResponse) 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 AccountsOmnichannelSettingsLfpProvidersLinkLfpProviderCall struct { + s *APIService + name string + linklfpproviderrequest *LinkLfpProviderRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// LinkLfpProvider: Link the specified merchant to a LFP provider for the +// specified country. +// +// - name: The name of the LFP provider resource to link. Format: +// `accounts/{account}/omnichannelSettings/{omnichannel_setting}/lfpProviders/ +// {lfp_provider}`. The `lfp_provider` is the LFP provider ID. +func (r *AccountsOmnichannelSettingsLfpProvidersService) LinkLfpProvider(name string, linklfpproviderrequest *LinkLfpProviderRequest) *AccountsOmnichannelSettingsLfpProvidersLinkLfpProviderCall { + c := &AccountsOmnichannelSettingsLfpProvidersLinkLfpProviderCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.linklfpproviderrequest = linklfpproviderrequest + 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 *AccountsOmnichannelSettingsLfpProvidersLinkLfpProviderCall) Fields(s ...googleapi.Field) *AccountsOmnichannelSettingsLfpProvidersLinkLfpProviderCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsOmnichannelSettingsLfpProvidersLinkLfpProviderCall) Context(ctx context.Context) *AccountsOmnichannelSettingsLfpProvidersLinkLfpProviderCall { + 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 *AccountsOmnichannelSettingsLfpProvidersLinkLfpProviderCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsOmnichannelSettingsLfpProvidersLinkLfpProviderCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.linklfpproviderrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+name}:linkLfpProvider") + 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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.omnichannelSettings.lfpProviders.linkLfpProvider", "request", internallog.HTTPRequest(req, body.Bytes())) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.omnichannelSettings.lfpProviders.linkLfpProvider" call. +// Any non-2xx status code is an error. Response headers are in either +// *LinkLfpProviderResponse.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 *AccountsOmnichannelSettingsLfpProvidersLinkLfpProviderCall) Do(opts ...googleapi.CallOption) (*LinkLfpProviderResponse, 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 := &LinkLfpProviderResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.omnichannelSettings.lfpProviders.linkLfpProvider", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsOnlineReturnPoliciesCreateCall struct { + s *APIService + parent string + onlinereturnpolicy *OnlineReturnPolicy + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a new return policy for a given business. +// +// - parent: The Merchant Center account for which the return policy will be +// created. Format: `accounts/{account}`. +func (r *AccountsOnlineReturnPoliciesService) Create(parent string, onlinereturnpolicy *OnlineReturnPolicy) *AccountsOnlineReturnPoliciesCreateCall { + c := &AccountsOnlineReturnPoliciesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.onlinereturnpolicy = onlinereturnpolicy + 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 *AccountsOnlineReturnPoliciesCreateCall) Fields(s ...googleapi.Field) *AccountsOnlineReturnPoliciesCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsOnlineReturnPoliciesCreateCall) Context(ctx context.Context) *AccountsOnlineReturnPoliciesCreateCall { + 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 *AccountsOnlineReturnPoliciesCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsOnlineReturnPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.onlinereturnpolicy) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+parent}/onlineReturnPolicies") + 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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.onlineReturnPolicies.create", "request", internallog.HTTPRequest(req, body.Bytes())) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.onlineReturnPolicies.create" 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 *AccountsOnlineReturnPoliciesCreateCall) 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.onlineReturnPolicies.create", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsOnlineReturnPoliciesDeleteCall struct { + s *APIService + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes an existing return policy. +// +// - name: The name of the return policy to delete. Format: +// `accounts/{account}/onlineReturnPolicies/{return_policy}`. +func (r *AccountsOnlineReturnPoliciesService) Delete(name string) *AccountsOnlineReturnPoliciesDeleteCall { + c := &AccountsOnlineReturnPoliciesDeleteCall{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 *AccountsOnlineReturnPoliciesDeleteCall) Fields(s ...googleapi.Field) *AccountsOnlineReturnPoliciesDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsOnlineReturnPoliciesDeleteCall) Context(ctx context.Context) *AccountsOnlineReturnPoliciesDeleteCall { + 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 *AccountsOnlineReturnPoliciesDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsOnlineReturnPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.onlineReturnPolicies.delete", "request", internallog.HTTPRequest(req, nil)) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.onlineReturnPolicies.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 *AccountsOnlineReturnPoliciesDeleteCall) 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.onlineReturnPolicies.delete", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsOnlineReturnPoliciesGetCall struct { + s *APIService + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets an existing return policy for a given business. +// +// - 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_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.onlineReturnPolicies.get", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.onlineReturnPolicies.get", "response", internallog.HTTPResponse(res, b)) + 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 for a given business. +// +// - parent: The Merchant Center 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 business 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_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+parent}/onlineReturnPolicies") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.onlineReturnPolicies.list", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.onlineReturnPolicies.list", "response", internallog.HTTPResponse(res, b)) + 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. +// +// - name: The name of the program for which to disable participation for the +// given account. Format: `accounts/{account}/programs/{program}`. For +// example, `accounts/123456/programs/free-listings`. +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_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(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/v1/{+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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.programs.disable", "request", internallog.HTTPRequest(req, body.Bytes())) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.programs.disable", "response", internallog.HTTPResponse(res, b)) + 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. +// +// - name: The name of the program for which to enable participation for the +// given account. Format: `accounts/{account}/programs/{program}`. For +// example, `accounts/123456/programs/free-listings`. +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_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(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/v1/{+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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.programs.enable", "request", internallog.HTTPRequest(req, body.Bytes())) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.programs.enable", "response", internallog.HTTPResponse(res, b)) + 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}`. For example, +// `accounts/123456/programs/free-listings`. +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_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.programs.get", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.programs.get", "response", internallog.HTTPResponse(res, b)) + 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_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+parent}/programs") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.programs.list", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.programs.list", "response", internallog.HTTPResponse(res, b)) + 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 AccountsProgramsCheckoutSettingsCreateCall struct { + s *APIService + parent string + checkoutsettings *CheckoutSettings + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates `CheckoutSettings` for the given merchant. +// +// - parent: The merchant account for which the `CheckoutSettings` will be +// created. +func (r *AccountsProgramsCheckoutSettingsService) Create(parent string, checkoutsettings *CheckoutSettings) *AccountsProgramsCheckoutSettingsCreateCall { + c := &AccountsProgramsCheckoutSettingsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.checkoutsettings = checkoutsettings + 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 *AccountsProgramsCheckoutSettingsCreateCall) Fields(s ...googleapi.Field) *AccountsProgramsCheckoutSettingsCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsProgramsCheckoutSettingsCreateCall) Context(ctx context.Context) *AccountsProgramsCheckoutSettingsCreateCall { + 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 *AccountsProgramsCheckoutSettingsCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsProgramsCheckoutSettingsCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.checkoutsettings) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+parent}/checkoutSettings") + 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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.programs.checkoutSettings.create", "request", internallog.HTTPRequest(req, body.Bytes())) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.programs.checkoutSettings.create" call. +// Any non-2xx status code is an error. Response headers are in either +// *CheckoutSettings.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 *AccountsProgramsCheckoutSettingsCreateCall) Do(opts ...googleapi.CallOption) (*CheckoutSettings, 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 := &CheckoutSettings{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.programs.checkoutSettings.create", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsProgramsCheckoutSettingsDeleteCheckoutSettingsCall struct { + s *APIService + nameid string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// DeleteCheckoutSettings: Deletes `CheckoutSettings` and unenrolls merchant +// from `Checkout` program. +// +// - name: The name/identifier of the merchant account. Format: +// `accounts/{account}/programs/{program}/checkoutSettings`. +func (r *AccountsProgramsCheckoutSettingsService) DeleteCheckoutSettings(nameid string) *AccountsProgramsCheckoutSettingsDeleteCheckoutSettingsCall { + c := &AccountsProgramsCheckoutSettingsDeleteCheckoutSettingsCall{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 *AccountsProgramsCheckoutSettingsDeleteCheckoutSettingsCall) Fields(s ...googleapi.Field) *AccountsProgramsCheckoutSettingsDeleteCheckoutSettingsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsProgramsCheckoutSettingsDeleteCheckoutSettingsCall) Context(ctx context.Context) *AccountsProgramsCheckoutSettingsDeleteCheckoutSettingsCall { + 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 *AccountsProgramsCheckoutSettingsDeleteCheckoutSettingsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsProgramsCheckoutSettingsDeleteCheckoutSettingsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.nameid, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.programs.checkoutSettings.deleteCheckoutSettings", "request", internallog.HTTPRequest(req, nil)) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.programs.checkoutSettings.deleteCheckoutSettings" 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 *AccountsProgramsCheckoutSettingsDeleteCheckoutSettingsCall) 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.programs.checkoutSettings.deleteCheckoutSettings", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsProgramsCheckoutSettingsGetCheckoutSettingsCall struct { + s *APIService + nameid string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// GetCheckoutSettings: Gets `CheckoutSettings` for the given merchant. This +// includes information about review state, enrollment state and URL settings. +// +// - name: The name/identifier of the merchant account. Format: +// `accounts/{account}/programs/{program}/checkoutSettings`. +func (r *AccountsProgramsCheckoutSettingsService) GetCheckoutSettings(nameid string) *AccountsProgramsCheckoutSettingsGetCheckoutSettingsCall { + c := &AccountsProgramsCheckoutSettingsGetCheckoutSettingsCall{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 *AccountsProgramsCheckoutSettingsGetCheckoutSettingsCall) Fields(s ...googleapi.Field) *AccountsProgramsCheckoutSettingsGetCheckoutSettingsCall { + 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 *AccountsProgramsCheckoutSettingsGetCheckoutSettingsCall) IfNoneMatch(entityTag string) *AccountsProgramsCheckoutSettingsGetCheckoutSettingsCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsProgramsCheckoutSettingsGetCheckoutSettingsCall) Context(ctx context.Context) *AccountsProgramsCheckoutSettingsGetCheckoutSettingsCall { + 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 *AccountsProgramsCheckoutSettingsGetCheckoutSettingsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsProgramsCheckoutSettingsGetCheckoutSettingsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.nameid, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.programs.checkoutSettings.getCheckoutSettings", "request", internallog.HTTPRequest(req, nil)) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.programs.checkoutSettings.getCheckoutSettings" call. +// Any non-2xx status code is an error. Response headers are in either +// *CheckoutSettings.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 *AccountsProgramsCheckoutSettingsGetCheckoutSettingsCall) Do(opts ...googleapi.CallOption) (*CheckoutSettings, 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 := &CheckoutSettings{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.programs.checkoutSettings.getCheckoutSettings", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsProgramsCheckoutSettingsUpdateCheckoutSettingsCall struct { + s *APIService + name string + checkoutsettings *CheckoutSettings + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// UpdateCheckoutSettings: Updates `CheckoutSettings` for the given merchant. +// +// - name: Identifier. The resource name of the program configuration settings. +// Format: `accounts/{account}/programs/{program}/checkoutSettings`. +func (r *AccountsProgramsCheckoutSettingsService) UpdateCheckoutSettings(name string, checkoutsettings *CheckoutSettings) *AccountsProgramsCheckoutSettingsUpdateCheckoutSettingsCall { + c := &AccountsProgramsCheckoutSettingsUpdateCheckoutSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.checkoutsettings = checkoutsettings + return c +} + +// UpdateMask sets the optional parameter "updateMask": Required. List of +// fields being updated. The following fields are supported (in both +// `snake_case` and `lowerCamelCase`): - `eligible_destinations` - +// `uri_settings` +func (c *AccountsProgramsCheckoutSettingsUpdateCheckoutSettingsCall) UpdateMask(updateMask string) *AccountsProgramsCheckoutSettingsUpdateCheckoutSettingsCall { + 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 *AccountsProgramsCheckoutSettingsUpdateCheckoutSettingsCall) Fields(s ...googleapi.Field) *AccountsProgramsCheckoutSettingsUpdateCheckoutSettingsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsProgramsCheckoutSettingsUpdateCheckoutSettingsCall) Context(ctx context.Context) *AccountsProgramsCheckoutSettingsUpdateCheckoutSettingsCall { + 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 *AccountsProgramsCheckoutSettingsUpdateCheckoutSettingsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsProgramsCheckoutSettingsUpdateCheckoutSettingsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.checkoutsettings) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.programs.checkoutSettings.updateCheckoutSettings", "request", internallog.HTTPRequest(req, body.Bytes())) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.programs.checkoutSettings.updateCheckoutSettings" call. +// Any non-2xx status code is an error. Response headers are in either +// *CheckoutSettings.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 *AccountsProgramsCheckoutSettingsUpdateCheckoutSettingsCall) Do(opts ...googleapi.CallOption) (*CheckoutSettings, 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 := &CheckoutSettings{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.programs.checkoutSettings.updateCheckoutSettings", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +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_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(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/v1/{+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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.regions.create", "request", internallog.HTTPRequest(req, body.Bytes())) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.regions.create", "response", internallog.HTTPResponse(res, b)) + 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_) + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.regions.delete", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.regions.delete", "response", internallog.HTTPResponse(res, b)) + 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_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.regions.get", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.regions.get", "response", internallog.HTTPResponse(res, b)) + 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_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+parent}/regions") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.regions.list", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.regions.list", "response", internallog.HTTPResponse(res, b)) + 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_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(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/v1/{+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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.regions.patch", "request", internallog.HTTPRequest(req, body.Bytes())) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.regions.patch", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsRelationshipsGetCall struct { + s *APIService + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Retrieve an account relationship. +// +// - name: The resource name of the account relationship to get. Format: +// `accounts/{account}/relationships/{relationship}`. For example, +// `accounts/123456/relationships/567890`. +func (r *AccountsRelationshipsService) Get(name string) *AccountsRelationshipsGetCall { + c := &AccountsRelationshipsGetCall{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 *AccountsRelationshipsGetCall) Fields(s ...googleapi.Field) *AccountsRelationshipsGetCall { + 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 *AccountsRelationshipsGetCall) IfNoneMatch(entityTag string) *AccountsRelationshipsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsRelationshipsGetCall) Context(ctx context.Context) *AccountsRelationshipsGetCall { + 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 *AccountsRelationshipsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsRelationshipsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.relationships.get", "request", internallog.HTTPRequest(req, nil)) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.relationships.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *AccountRelationship.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 *AccountsRelationshipsGetCall) Do(opts ...googleapi.CallOption) (*AccountRelationship, 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 := &AccountRelationship{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.relationships.get", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsRelationshipsListCall struct { + s *APIService + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: List account relationships for the specified account. +// +// - parent: The parent account of the account relationship to filter by. +// Format: `accounts/{account}`. +func (r *AccountsRelationshipsService) List(parent string) *AccountsRelationshipsListCall { + c := &AccountsRelationshipsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number of +// elements to return in the response. Use for paging. If no `page_size` is +// specified, `100` is used as the default value. The maximum allowed value is +// `1000`. +func (c *AccountsRelationshipsListCall) PageSize(pageSize int64) *AccountsRelationshipsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The token returned by the +// previous `list` request. +func (c *AccountsRelationshipsListCall) PageToken(pageToken string) *AccountsRelationshipsListCall { + 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 *AccountsRelationshipsListCall) Fields(s ...googleapi.Field) *AccountsRelationshipsListCall { + 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 *AccountsRelationshipsListCall) IfNoneMatch(entityTag string) *AccountsRelationshipsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsRelationshipsListCall) Context(ctx context.Context) *AccountsRelationshipsListCall { + 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 *AccountsRelationshipsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsRelationshipsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+parent}/relationships") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.relationships.list", "request", internallog.HTTPRequest(req, nil)) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.relationships.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *ListAccountRelationshipsResponse.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 *AccountsRelationshipsListCall) Do(opts ...googleapi.CallOption) (*ListAccountRelationshipsResponse, 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 := &ListAccountRelationshipsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.relationships.list", "response", internallog.HTTPResponse(res, b)) + 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 *AccountsRelationshipsListCall) Pages(ctx context.Context, f func(*ListAccountRelationshipsResponse) 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 AccountsRelationshipsPatchCall struct { + s *APIService + name string + accountrelationship *AccountRelationship + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates the account relationship. Executing this method requires +// admin access. +// +// - name: Identifier. The resource name of the account relationship. Format: +// `accounts/{account}/relationships/{relationship}`. For example, +// `accounts/123456/relationships/567890`. +func (r *AccountsRelationshipsService) Patch(name string, accountrelationship *AccountRelationship) *AccountsRelationshipsPatchCall { + c := &AccountsRelationshipsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.accountrelationship = accountrelationship + return c +} + +// UpdateMask sets the optional parameter "updateMask": List of fields being +// updated. The following fields are supported (in both `snake_case` and +// `lowerCamelCase`): - `account_id_alias` +func (c *AccountsRelationshipsPatchCall) UpdateMask(updateMask string) *AccountsRelationshipsPatchCall { + 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 *AccountsRelationshipsPatchCall) Fields(s ...googleapi.Field) *AccountsRelationshipsPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsRelationshipsPatchCall) Context(ctx context.Context) *AccountsRelationshipsPatchCall { + 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 *AccountsRelationshipsPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsRelationshipsPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.accountrelationship) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.relationships.patch", "request", internallog.HTTPRequest(req, body.Bytes())) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.relationships.patch" call. +// Any non-2xx status code is an error. Response headers are in either +// *AccountRelationship.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 *AccountsRelationshipsPatchCall) Do(opts ...googleapi.CallOption) (*AccountRelationship, 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 := &AccountRelationship{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.relationships.patch", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsServicesApproveCall struct { + s *APIService + name string + approveaccountservicerequest *ApproveAccountServiceRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Approve: Approve an account service proposal. +// +// - name: The resource name of the account service to approve. Format: +// `accounts/{account}/services/{service}`. +func (r *AccountsServicesService) Approve(name string, approveaccountservicerequest *ApproveAccountServiceRequest) *AccountsServicesApproveCall { + c := &AccountsServicesApproveCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.approveaccountservicerequest = approveaccountservicerequest + 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 *AccountsServicesApproveCall) Fields(s ...googleapi.Field) *AccountsServicesApproveCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsServicesApproveCall) Context(ctx context.Context) *AccountsServicesApproveCall { + 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 *AccountsServicesApproveCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsServicesApproveCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.approveaccountservicerequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+name}:approve") + 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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.services.approve", "request", internallog.HTTPRequest(req, body.Bytes())) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.services.approve" call. +// Any non-2xx status code is an error. Response headers are in either +// *AccountService.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 *AccountsServicesApproveCall) Do(opts ...googleapi.CallOption) (*AccountService, 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 := &AccountService{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.services.approve", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsServicesGetCall struct { + s *APIService + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Retrieve an account service. +// +// - name: The resource name of the account service to get. Format: +// `accounts/{account}/services/{service}`. +func (r *AccountsServicesService) Get(name string) *AccountsServicesGetCall { + c := &AccountsServicesGetCall{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 *AccountsServicesGetCall) Fields(s ...googleapi.Field) *AccountsServicesGetCall { + 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 *AccountsServicesGetCall) IfNoneMatch(entityTag string) *AccountsServicesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsServicesGetCall) Context(ctx context.Context) *AccountsServicesGetCall { + 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 *AccountsServicesGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsServicesGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.services.get", "request", internallog.HTTPRequest(req, nil)) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.services.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *AccountService.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 *AccountsServicesGetCall) Do(opts ...googleapi.CallOption) (*AccountService, 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 := &AccountService{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.services.get", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsServicesListCall struct { + s *APIService + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: List account services for the specified accounts. Supports filtering. +// +// - parent: The parent account of the account service to filter by. Format: +// `accounts/{account}`. +func (r *AccountsServicesService) List(parent string) *AccountsServicesListCall { + c := &AccountsServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number of +// elements to return in the response. Use for paging. If no `page_size` is +// specified, `100` is used as the default value. The maximum allowed value is +// `1000`. +func (c *AccountsServicesListCall) PageSize(pageSize int64) *AccountsServicesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The token returned by the +// previous `list` request. +func (c *AccountsServicesListCall) PageToken(pageToken string) *AccountsServicesListCall { + 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 *AccountsServicesListCall) Fields(s ...googleapi.Field) *AccountsServicesListCall { + 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 *AccountsServicesListCall) IfNoneMatch(entityTag string) *AccountsServicesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsServicesListCall) Context(ctx context.Context) *AccountsServicesListCall { + 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 *AccountsServicesListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsServicesListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+parent}/services") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.services.list", "request", internallog.HTTPRequest(req, nil)) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.services.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *ListAccountServicesResponse.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 *AccountsServicesListCall) Do(opts ...googleapi.CallOption) (*ListAccountServicesResponse, 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 := &ListAccountServicesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.services.list", "response", internallog.HTTPResponse(res, b)) + 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 *AccountsServicesListCall) Pages(ctx context.Context, f func(*ListAccountServicesResponse) 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 AccountsServicesProposeCall struct { + s *APIService + parent string + proposeaccountservicerequest *ProposeAccountServiceRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Propose: Propose an account service. +// +// - parent: The resource name of the parent account for the service. Format: +// `accounts/{account}`. +func (r *AccountsServicesService) Propose(parent string, proposeaccountservicerequest *ProposeAccountServiceRequest) *AccountsServicesProposeCall { + c := &AccountsServicesProposeCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.proposeaccountservicerequest = proposeaccountservicerequest + 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 *AccountsServicesProposeCall) Fields(s ...googleapi.Field) *AccountsServicesProposeCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsServicesProposeCall) Context(ctx context.Context) *AccountsServicesProposeCall { + 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 *AccountsServicesProposeCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsServicesProposeCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.proposeaccountservicerequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+parent}/services:propose") + 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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.services.propose", "request", internallog.HTTPRequest(req, body.Bytes())) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.services.propose" call. +// Any non-2xx status code is an error. Response headers are in either +// *AccountService.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 *AccountsServicesProposeCall) Do(opts ...googleapi.CallOption) (*AccountService, 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 := &AccountService{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.services.propose", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsServicesRejectCall struct { + s *APIService + name string + rejectaccountservicerequest *RejectAccountServiceRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Reject: Reject an account service (both proposed and approve services can be +// rejected). +// +// - name: The resource name of the account service to reject. Format: +// `accounts/{account}/services/{service}`. +func (r *AccountsServicesService) Reject(name string, rejectaccountservicerequest *RejectAccountServiceRequest) *AccountsServicesRejectCall { + c := &AccountsServicesRejectCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.rejectaccountservicerequest = rejectaccountservicerequest + 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 *AccountsServicesRejectCall) Fields(s ...googleapi.Field) *AccountsServicesRejectCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsServicesRejectCall) Context(ctx context.Context) *AccountsServicesRejectCall { + 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 *AccountsServicesRejectCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsServicesRejectCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rejectaccountservicerequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+name}:reject") + 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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.services.reject", "request", internallog.HTTPRequest(req, body.Bytes())) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.services.reject" 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 *AccountsServicesRejectCall) 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.services.reject", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsShippingSettingsGetShippingSettingsCall 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}/shippingsettings`. +func (r *AccountsShippingSettingsService) GetShippingSettings(name string) *AccountsShippingSettingsGetShippingSettingsCall { + c := &AccountsShippingSettingsGetShippingSettingsCall{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 *AccountsShippingSettingsGetShippingSettingsCall) Fields(s ...googleapi.Field) *AccountsShippingSettingsGetShippingSettingsCall { + 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 *AccountsShippingSettingsGetShippingSettingsCall) IfNoneMatch(entityTag string) *AccountsShippingSettingsGetShippingSettingsCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsShippingSettingsGetShippingSettingsCall) Context(ctx context.Context) *AccountsShippingSettingsGetShippingSettingsCall { + 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 *AccountsShippingSettingsGetShippingSettingsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsShippingSettingsGetShippingSettingsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.shippingSettings.getShippingSettings", "request", internallog.HTTPRequest(req, nil)) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.shippingSettings.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 *AccountsShippingSettingsGetShippingSettingsCall) 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.shippingSettings.getShippingSettings", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsShippingSettingsInsertCall struct { + s *APIService + parentid string + shippingsettings *ShippingSettings + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Insert: Replace the shipping setting of a business with the request shipping +// setting. Executing this method requires admin access. +// +// - parent: The account for which this shipping setting will be inserted. If +// you are using an advanced account, you must specify the unique identifier +// of the sub-account for which you want to insert the shipping setting. +// Format: `accounts/{ACCOUNT_ID}`. +func (r *AccountsShippingSettingsService) Insert(parentid string, shippingsettings *ShippingSettings) *AccountsShippingSettingsInsertCall { + c := &AccountsShippingSettingsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parentid = parentid + 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_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(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/v1/{+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.parentid, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.shippingSettings.insert", "request", internallog.HTTPRequest(req, body.Bytes())) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.shippingSettings.insert", "response", internallog.HTTPResponse(res, b)) + 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}/termsOfServiceAgreementStates/{identifier}` The +// identifier format is: `{TermsOfServiceKind}-{country}`. +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_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.nameid, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.termsOfServiceAgreementStates.get", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.termsOfServiceAgreementStates.get", "response", internallog.HTTPResponse(res, b)) + 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. Application terms of service covers +// permissions related to the usage of data provided through Merchant Center, +// CSS Center, Manufacturer Center, and more. +// +// - 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_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+parent}/termsOfServiceAgreementStates:retrieveForApplication") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.termsOfServiceAgreementStates.retrieveForApplication", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.termsOfServiceAgreementStates.retrieveForApplication", "response", internallog.HTTPResponse(res, b)) + 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_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(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/v1/{+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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.users.create", "request", internallog.HTTPRequest(req, body.Bytes())) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.users.create", "response", internallog.HTTPResponse(res, b)) + 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. The user to be deleted can't be the last admin user +// of that account. Also a user is protected from deletion if it is managed by +// Business Manager" +// +// - 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_) + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.users.delete", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.users.delete", "response", internallog.HTTPResponse(res, b)) + 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_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.users.get", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.users.get", "response", internallog.HTTPResponse(res, b)) + 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_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+parent}/users") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.users.list", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.users.list", "response", internallog.HTTPResponse(res, b)) + 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": List of fields being +// updated. The following fields are supported (in both `snake_case` and +// `lowerCamelCase`): - `access_rights` +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_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(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/v1/{+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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.users.patch", "request", internallog.HTTPRequest(req, body.Bytes())) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.users.patch", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type TermsOfServiceAcceptCall struct { + s *APIService + name string + urlParams_ gensupport.URLParams + 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. Format: `accounts/{account}` +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 +} + +// 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_) + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+name}:accept") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.termsOfService.accept", "request", internallog.HTTPRequest(req, nil)) + 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 +// *AcceptTermsOfServiceResponse.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) (*AcceptTermsOfServiceResponse, 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 := &AcceptTermsOfServiceResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.termsOfService.accept", "response", internallog.HTTPResponse(res, b)) + 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_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.termsOfService.get", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.termsOfService.get", "response", internallog.HTTPResponse(res, b)) + 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": Required. 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": 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 *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_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/v1/termsOfService:retrieveLatest") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.termsOfService.retrieveLatest", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.termsOfService.retrieveLatest", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} diff --git a/merchantapi/conversions/v1/merchantapi-api.json b/merchantapi/conversions/v1/merchantapi-api.json new file mode 100644 index 00000000000..ef9d22270a2 --- /dev/null +++ b/merchantapi/conversions/v1/merchantapi-api.json @@ -0,0 +1,650 @@ +{ + "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.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_v1", + "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/v1/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/v1/{+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/v1/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/v1/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "get": { + "description": "Fetches a conversion source.", + "flatPath": "conversions/v1/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/v1/{+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/v1/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) conversion sources. By default, deleted conversion sources are not returned.", + "location": "query", + "type": "boolean" + } + }, + "path": "conversions/v1/{+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/v1/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 conversion 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": "Optional. List of fields being updated.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "conversions/v1/{+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/v1/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/v1/{+name}:undelete", + "request": { + "$ref": "UndeleteConversionSourceRequest" + }, + "response": { + "$ref": "ConversionSource" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + } + } + } + }, + "revision": "20250804", + "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 window (in days) used for attribution in this source. Supported values are `7`, `30` \u0026 `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 Youtube 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 conversion 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 is currently not 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 the type of a conversion event.", + "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 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. The maximum length is 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. If empty, it means that the product was deleted. Will have one of these values : (`approved`, `pending`, `disapproved`, ``)", + "type": "string" + }, + "oldValue": { + "description": "The old value of the changed resource or attribute. If empty, it means that the product was created. Will have one of these values : (`approved`, `pending`, `disapproved`, ``)", + "type": "string" + }, + "regionCode": { + "description": "Countries that have the change (if applicable). Represented in the ISO 3166 format.", + "type": "string" + }, + "reportingContext": { + "description": "Reporting contexts that have the change (if applicable). Currently this field supports only (`SHOPPING_ADS`, `LOCAL_INVENTORY_ADS`, `YOUTUBE_SHOPPING`, `YOUTUBE_CHECKOUT`, `YOUTUBE_AFFILIATE`) from the enum value [ReportingContextEnum](/merchant/api/reference/rest/Shared.Types/ReportingContextEnum)", + "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_AFFILIATE", + "YOUTUBE_SHOPPING", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL", + "PRODUCT_REVIEWS", + "MERCHANT_REVIEWS", + "YOUTUBE_CHECKOUT" + ], + "enumDeprecated": [ + false, + false, + true, + false, + false, + false, + false, + 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 Affiliate](https://support.google.com/youtube/answer/13376398).", + "[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).", + "[Product Reviews](https://support.google.com/merchants/answer/14620732).", + "[Merchant Reviews](https://developers.google.com/merchant-review-feeds).", + "YouTube Checkout ." + ], + "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" + }, + "eventTime": { + "description": "The time at which the event was generated. If you want to order the notification messages you receive you should rely on this field not on the order of receiving the notifications.", + "format": "google-datetime", + "type": "string" + }, + "expirationTime": { + "description": "Optional. The product expiration time. This field will not be set if the notification is sent for a product deletion event.", + "format": "google-datetime", + "type": "string" + }, + "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: `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_v1", + "version_module": true +} \ No newline at end of file diff --git a/merchantapi/conversions/v1/merchantapi-gen.go b/merchantapi/conversions/v1/merchantapi-gen.go new file mode 100644 index 00000000000..63c4b3b4c11 --- /dev/null +++ b/merchantapi/conversions/v1/merchantapi-gen.go @@ -0,0 +1,1237 @@ +// Copyright 2025 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.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/v1" +// ... +// 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/v1" + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "log/slog" + "net/http" + "net/url" + "strconv" + "strings" + + "github.com/googleapis/gax-go/v2/internallog" + 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 +var _ = internallog.New + +const apiId = "merchantapi:conversions_v1" +const apiName = "merchantapi" +const apiVersion = "conversions_v1" +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 := &Service{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)} + s.Accounts = NewAccountsService(s) + 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") + } + return NewService(context.TODO(), option.WithHTTPClient(client)) +} + +type Service struct { + client *http.Client + logger *slog.Logger + 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 window (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 Youtube 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 conversion 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 + // is currently not 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 the type of a conversion event. +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 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. The maximum length is 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. If empty, it + // means that the product was deleted. Will have one of these values : + // (`approved`, `pending`, `disapproved`, ``) + NewValue string `json:"newValue,omitempty"` + // OldValue: The old value of the changed resource or attribute. If empty, it + // means that the product was created. Will have one of these values : + // (`approved`, `pending`, `disapproved`, ``) + OldValue string `json:"oldValue,omitempty"` + // RegionCode: Countries that have the change (if applicable). Represented in + // the ISO 3166 format. + RegionCode string `json:"regionCode,omitempty"` + // ReportingContext: Reporting contexts that have the change (if applicable). + // Currently this field supports only (`SHOPPING_ADS`, `LOCAL_INVENTORY_ADS`, + // `YOUTUBE_SHOPPING`, `YOUTUBE_CHECKOUT`, `YOUTUBE_AFFILIATE`) from the enum + // value ReportingContextEnum + // (/merchant/api/reference/rest/Shared.Types/ReportingContextEnum) + // + // 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_AFFILIATE" - [Youtube + // Affiliate](https://support.google.com/youtube/answer/13376398). + // "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). + // "PRODUCT_REVIEWS" - [Product + // Reviews](https://support.google.com/merchants/answer/14620732). + // "MERCHANT_REVIEWS" - [Merchant + // Reviews](https://developers.google.com/merchant-review-feeds). + // "YOUTUBE_CHECKOUT" - YouTube Checkout . + 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"` + // EventTime: The time at which the event was generated. If you want to order + // the notification messages you receive you should rely on this field not on + // the order of receiving the notifications. + EventTime string `json:"eventTime,omitempty"` + // ExpirationTime: Optional. The product expiration time. This field will not + // be set if the notification is sent for a product deletion event. + ExpirationTime string `json:"expirationTime,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: `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_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(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/v1/{+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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.conversionSources.create", "request", internallog.HTTPRequest(req, body.Bytes())) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.conversionSources.create", "response", internallog.HTTPResponse(res, b)) + 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_) + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "conversions/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.conversionSources.delete", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.conversionSources.delete", "response", internallog.HTTPResponse(res, b)) + 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_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "conversions/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.conversionSources.get", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.conversionSources.get", "response", internallog.HTTPResponse(res, b)) + 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) conversion sources. By default, deleted conversion sources are +// not returned. +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_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "conversions/v1/{+parent}/conversionSources") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.conversionSources.list", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.conversionSources.list", "response", internallog.HTTPResponse(res, b)) + 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 conversion 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": 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_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(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/v1/{+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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.conversionSources.patch", "request", internallog.HTTPRequest(req, body.Bytes())) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.conversionSources.patch", "response", internallog.HTTPResponse(res, b)) + 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_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(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/v1/{+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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.conversionSources.undelete", "request", internallog.HTTPRequest(req, body.Bytes())) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.conversionSources.undelete", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} diff --git a/merchantapi/datasources/v1/merchantapi-api.json b/merchantapi/datasources/v1/merchantapi-api.json new file mode 100644 index 00000000000..de665d563d1 --- /dev/null +++ b/merchantapi/datasources/v1/merchantapi-api.json @@ -0,0 +1,1037 @@ +{ + "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.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_v1", + "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. This method always creates a new data source.", + "flatPath": "datasources/v1/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/v1/{+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/v1/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/v1/{+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/v1/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/v1/{+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/v1/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/v1/{+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/v1/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/v1/{+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/v1/accounts/{accountsId}/dataSources/{dataSourcesId}", + "httpMethod": "PATCH", + "id": "merchantapi.accounts.dataSources.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. Identifier. The name of the data source. Format: `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. For example, If you insert `updateMask=displayName` in the request, it will only update the `displayName` leaving all other fields untouched.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "datasources/v1/{+name}", + "request": { + "$ref": "DataSource" + }, + "response": { + "$ref": "DataSource" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + }, + "resources": { + "fileUploads": { + "methods": { + "get": { + "description": "Gets the latest data source file upload. Only the `latest` alias is accepted for a file upload.", + "flatPath": "datasources/v1/accounts/{accountsId}/dataSources/{dataSourcesId}/fileUploads/{fileUploadsId}", + "httpMethod": "GET", + "id": "merchantapi.accounts.dataSources.fileUploads.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the data source file upload to retrieve. Format: `accounts/{account}/dataSources/{datasource}/fileUploads/latest`", + "location": "path", + "pattern": "^accounts/[^/]+/dataSources/[^/]+/fileUploads/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "datasources/v1/{+name}", + "response": { + "$ref": "FileUpload" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + } + } + } + } + } + }, + "revision": "20250804", + "rootUrl": "https://merchantapi.googleapis.com/", + "schemas": { + "DataSource": { + "description": "The [data source](/merchant/api/guides/data-sources/overview) 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 sub-API." + ], + "readOnly": true, + "type": "string" + }, + "localInventoryDataSource": { + "$ref": "LocalInventoryDataSource", + "description": "The [local inventory](https://support.google.com/merchants/answer/7023001) data source." + }, + "merchantReviewDataSource": { + "$ref": "MerchantReviewDataSource", + "description": "The [merchant review](https://support.google.com/merchants/answer/7045996) data source." + }, + "name": { + "description": "Required. Identifier. The name of the data source. Format: `accounts/{account}/dataSources/{datasource}`", + "type": "string" + }, + "primaryProductDataSource": { + "$ref": "PrimaryProductDataSource", + "description": "The [primary data source](https://support.google.com/merchants/answer/7439058) for local and online products." + }, + "productReviewDataSource": { + "$ref": "ProductReviewDataSource", + "description": "The [product review](https://support.google.com/merchants/answer/7045996) data source." + }, + "promotionDataSource": { + "$ref": "PromotionDataSource", + "description": "The [promotion](https://support.google.com/merchants/answer/2906014) data source." + }, + "regionalInventoryDataSource": { + "$ref": "RegionalInventoryDataSource", + "description": "The [regional inventory](https://support.google.com/merchants/answer/7439058) data source." + }, + "supplementalProductDataSource": { + "$ref": "SupplementalProductDataSource", + "description": "The [supplemental data source](https://support.google.com/merchants/answer/7439058) for local and online products." + } + }, + "type": "object" + }, + "DataSourceReference": { + "description": "Data source reference can be used to manage related data sources within the data source service.", + "id": "DataSourceReference", + "properties": { + "primaryDataSourceName": { + "description": "Optional. The name of the primary data source. Format: `accounts/{account}/dataSources/{datasource}`", + "type": "string" + }, + "self": { + "description": "Self should be used to reference the primary data source itself.", + "type": "boolean" + }, + "supplementalDataSourceName": { + "description": "Optional. The name of the supplemental data source. Format: `accounts/{account}/dataSources/{datasource}`", + "type": "string" + } + }, + "type": "object" + }, + "DefaultRule": { + "description": "Default rule management of the data source.", + "id": "DefaultRule", + "properties": { + "takeFromDataSources": { + "description": "Required. The list of data sources linked in the [default rule](https://support.google.com/merchants/answer/7450276). This list is ordered by the default rule priority of joining the data. It might include none or multiple references to `self` and supplemental data sources. The list must not be empty. To link the data source to the default rule, you need to add a new reference to this list (in sequential order). To unlink the data source from the default rule, you need to remove the given reference from this list. Changing the order of this list will result in changing the priority of data sources in the default rule. For example, providing the following list: [`1001`, `self`] will take attribute values from supplemental data source `1001`, and fallback to `self` if the attribute is not set in `1001`.", + "items": { + "$ref": "DataSourceReference" + }, + "type": "array" + } + }, + "type": "object" + }, + "Destination": { + "description": "Destinations also known as [Marketing methods](https://support.google.com/merchants/answer/15130232) selections.", + "id": "Destination", + "properties": { + "destination": { + "description": "[Marketing methods](https://support.google.com/merchants/answer/15130232) (also known as destination) selections.", + "enum": [ + "DESTINATION_ENUM_UNSPECIFIED", + "SHOPPING_ADS", + "DISPLAY_ADS", + "LOCAL_INVENTORY_ADS", + "FREE_LISTINGS", + "FREE_LOCAL_LISTINGS", + "YOUTUBE_SHOPPING", + "YOUTUBE_SHOPPING_CHECKOUT", + "YOUTUBE_AFFILIATE", + "FREE_VEHICLE_LISTINGS", + "VEHICLE_ADS", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL" + ], + "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).", + "Youtube shopping checkout.", + "[Youtube Affiliate](https://support.google.com/youtube/answer/13376398).", + "[Free vehicle listings](https://support.google.com/merchants/answer/11189169).", + "[Vehicle ads](https://support.google.com/merchants/answer/11189169).", + "[Cloud retail](https://cloud.google.com/solutions/retail).", + "[Local cloud retail](https://cloud.google.com/solutions/retail)." + ], + "type": "string" + }, + "state": { + "description": "The state of the destination.", + "enum": [ + "STATE_UNSPECIFIED", + "ENABLED", + "DISABLED" + ], + "enumDescriptions": [ + "Not specified.", + "Indicates that the destination is enabled.", + "Indicates that the destination is disabled." + ], + "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" + }, + "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_uri. 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_uri. 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. However, you can't set up `GOOGLE_SHEETS` as a data source through the API. To add `GOOGLE_SHEETS` as a data source through the Merchant Center, see [Add products to Merchant Center](https://support.google.com/merchants/answer/12158053)." + ], + "readOnly": true, + "type": "string" + }, + "fileName": { + "description": "Optional. The file name of the data source. Required for `UPLOAD` file input type.", + "type": "string" + } + }, + "type": "object" + }, + "FileUpload": { + "description": "The file upload of a specific data source, that is, the result of the retrieval of the data source at a certain timestamp computed asynchronously when the data source processing is finished. Only applicable to file data sources.", + "id": "FileUpload", + "properties": { + "dataSourceId": { + "description": "Output only. The data source id.", + "format": "int64", + "readOnly": true, + "type": "string" + }, + "issues": { + "description": "Output only. The list of issues occurring in the data source.", + "items": { + "$ref": "Issue" + }, + "readOnly": true, + "type": "array" + }, + "itemsCreated": { + "description": "Output only. The number of items in the data source that were created.", + "format": "int64", + "readOnly": true, + "type": "string" + }, + "itemsTotal": { + "description": "Output only. The number of items in the data source that were processed.", + "format": "int64", + "readOnly": true, + "type": "string" + }, + "itemsUpdated": { + "description": "Output only. The number of items in the data source that were updated.", + "format": "int64", + "readOnly": true, + "type": "string" + }, + "name": { + "description": "Identifier. The name of the data source file upload. Format: `{datasource.name=accounts/{account}/dataSources/{datasource}/fileUploads/{fileupload}}`", + "type": "string" + }, + "processingState": { + "description": "Output only. The processing state of the data source.", + "enum": [ + "PROCESSING_STATE_UNSPECIFIED", + "FAILED", + "IN_PROGRESS", + "SUCCEEDED" + ], + "enumDescriptions": [ + "Processing state unspecified.", + "The data source could not be processed or all the items had errors.", + "The data source is being processed.", + "The data source was processed successfully, though some items might have had errors." + ], + "readOnly": true, + "type": "string" + }, + "uploadTime": { + "description": "Output only. The date at which the file of the data source was uploaded.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "Issue": { + "description": "An error occurring in the data source, like \"invalid price\".", + "id": "Issue", + "properties": { + "code": { + "description": "Output only. The code of the error, for example, \"validation/invalid_value\". Returns \"?\" if the code is unknown.", + "readOnly": true, + "type": "string" + }, + "count": { + "description": "Output only. The number of occurrences of the error in the file upload.", + "format": "int64", + "readOnly": true, + "type": "string" + }, + "description": { + "description": "Output only. The error description, for example, \"Your data source contains items which have too many attributes, or are too big. These items will be dropped\".", + "readOnly": true, + "type": "string" + }, + "documentationUri": { + "description": "Output only. Link to the documentation explaining the issue in more details, if available.", + "readOnly": true, + "type": "string" + }, + "severity": { + "description": "Output only. The severity of the issue.", + "enum": [ + "SEVERITY_UNSPECIFIED", + "WARNING", + "ERROR" + ], + "enumDescriptions": [ + "Severity unspecified.", + "The issue is the warning.", + "The issue is an error." + ], + "readOnly": true, + "type": "string" + }, + "title": { + "description": "Output only. The title of the issue, for example, \"Item too big\".", + "readOnly": true, + "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 type is only available for file inputs and can't be used to create API local inventory data sources.", + "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" + }, + "MerchantReviewDataSource": { + "description": "The merchant review data source.", + "id": "MerchantReviewDataSource", + "properties": {}, + "type": "object" + }, + "PrimaryProductDataSource": { + "description": "The primary data source for local and online products.", + "id": "PrimaryProductDataSource", + "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 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" + }, + "defaultRule": { + "$ref": "DefaultRule", + "description": "Optional. Default rule management of the data source. If set, the linked data sources will be replaced." + }, + "destinations": { + "description": "Optional. A list of destinations describing where products of the data source can be shown. When retrieving the data source, the list contains all the destinations that can be used for the data source, including the ones that are disabled for the data source but enabled for the account. Only destinations that are enabled on the account, for example through program participation, can be enabled on the data source. If unset, during creation, the destinations will be inherited based on the account level program participation. If set, during creation or update, the data source will be set only for the specified destinations. Updating this field requires at least one destination.", + "items": { + "$ref": "Destination" + }, + "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" + }, + "legacyLocal": { + "description": "Optional. Immutable. Determines whether the products of this data source are **only** targeting local destinations. Legacy local products are prefixed with `local~` in the product resource ID. For example, `accounts/123/products/local~en~US~sku123`.", + "type": "boolean" + } + }, + "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. If empty, it means that the product was deleted. Will have one of these values : (`approved`, `pending`, `disapproved`, ``)", + "type": "string" + }, + "oldValue": { + "description": "The old value of the changed resource or attribute. If empty, it means that the product was created. Will have one of these values : (`approved`, `pending`, `disapproved`, ``)", + "type": "string" + }, + "regionCode": { + "description": "Countries that have the change (if applicable). Represented in the ISO 3166 format.", + "type": "string" + }, + "reportingContext": { + "description": "Reporting contexts that have the change (if applicable). Currently this field supports only (`SHOPPING_ADS`, `LOCAL_INVENTORY_ADS`, `YOUTUBE_SHOPPING`, `YOUTUBE_CHECKOUT`, `YOUTUBE_AFFILIATE`) from the enum value [ReportingContextEnum](/merchant/api/reference/rest/Shared.Types/ReportingContextEnum)", + "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_AFFILIATE", + "YOUTUBE_SHOPPING", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL", + "PRODUCT_REVIEWS", + "MERCHANT_REVIEWS", + "YOUTUBE_CHECKOUT" + ], + "enumDeprecated": [ + false, + false, + true, + false, + false, + false, + false, + 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 Affiliate](https://support.google.com/youtube/answer/13376398).", + "[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).", + "[Product Reviews](https://support.google.com/merchants/answer/14620732).", + "[Merchant Reviews](https://developers.google.com/merchant-review-feeds).", + "YouTube Checkout ." + ], + "type": "string" + } + }, + "type": "object" + }, + "ProductReviewDataSource": { + "description": "The product review data source.", + "id": "ProductReviewDataSource", + "properties": {}, + "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" + }, + "eventTime": { + "description": "The time at which the event was generated. If you want to order the notification messages you receive you should rely on this field not on the order of receiving the notifications.", + "format": "google-datetime", + "type": "string" + }, + "expirationTime": { + "description": "Optional. The product expiration time. This field will not be set if the notification is sent for a product deletion event.", + "format": "google-datetime", + "type": "string" + }, + "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: `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": { + "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. After creation, you should make sure to link the supplemental product data source into one or more primary product data sources.", + "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. The fields must 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" + }, + "referencingPrimaryDataSources": { + "description": "Output only. The (unordered and deduplicated) list of all primary data sources linked to this data source in either default or custom rules. Supplemental data source cannot be deleted before all links are removed.", + "items": { + "$ref": "DataSourceReference" + }, + "readOnly": true, + "type": "array" + } + }, + "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 a day in 24 hour format. Must be greater than or equal to 0 and typically must be less than or equal 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 an hour. Must be greater than or equal to 0 and less than or equal to 59.", + "format": "int32", + "type": "integer" + }, + "nanos": { + "description": "Fractions of seconds, in nanoseconds. Must be greater than or equal to 0 and less than or equal to 999,999,999.", + "format": "int32", + "type": "integer" + }, + "seconds": { + "description": "Seconds of a minute. Must be greater than or equal to 0 and typically must be less than or equal 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_v1", + "version_module": true +} \ No newline at end of file diff --git a/merchantapi/datasources/v1/merchantapi-gen.go b/merchantapi/datasources/v1/merchantapi-gen.go new file mode 100644 index 00000000000..7a9b5c5da6f --- /dev/null +++ b/merchantapi/datasources/v1/merchantapi-gen.go @@ -0,0 +1,1795 @@ +// Copyright 2025 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.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/v1" +// ... +// 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/v1" + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "log/slog" + "net/http" + "net/url" + "strconv" + "strings" + + "github.com/googleapis/gax-go/v2/internallog" + 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 +var _ = internallog.New + +const apiId = "merchantapi:datasources_v1" +const apiName = "merchantapi" +const apiVersion = "datasources_v1" +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 := &Service{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)} + s.Accounts = NewAccountsService(s) + 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") + } + return NewService(context.TODO(), option.WithHTTPClient(client)) +} + +type Service struct { + client *http.Client + logger *slog.Logger + 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} + rs.FileUploads = NewAccountsDataSourcesFileUploadsService(s) + return rs +} + +type AccountsDataSourcesService struct { + s *Service + + FileUploads *AccountsDataSourcesFileUploadsService +} + +func NewAccountsDataSourcesFileUploadsService(s *Service) *AccountsDataSourcesFileUploadsService { + rs := &AccountsDataSourcesFileUploadsService{s: s} + return rs +} + +type AccountsDataSourcesFileUploadsService struct { + s *Service +} + +// DataSource: The data source (/merchant/api/guides/data-sources/overview) 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 sub-API. + Input string `json:"input,omitempty"` + // LocalInventoryDataSource: The local inventory + // (https://support.google.com/merchants/answer/7023001) data source. + LocalInventoryDataSource *LocalInventoryDataSource `json:"localInventoryDataSource,omitempty"` + // MerchantReviewDataSource: The merchant review + // (https://support.google.com/merchants/answer/7045996) data source. + MerchantReviewDataSource *MerchantReviewDataSource `json:"merchantReviewDataSource,omitempty"` + // Name: Required. Identifier. The name of the data source. Format: + // `accounts/{account}/dataSources/{datasource}` + Name string `json:"name,omitempty"` + // PrimaryProductDataSource: The primary data source + // (https://support.google.com/merchants/answer/7439058) for local and online + // products. + PrimaryProductDataSource *PrimaryProductDataSource `json:"primaryProductDataSource,omitempty"` + // ProductReviewDataSource: The product review + // (https://support.google.com/merchants/answer/7045996) data source. + ProductReviewDataSource *ProductReviewDataSource `json:"productReviewDataSource,omitempty"` + // PromotionDataSource: The promotion + // (https://support.google.com/merchants/answer/2906014) data source. + PromotionDataSource *PromotionDataSource `json:"promotionDataSource,omitempty"` + // RegionalInventoryDataSource: The regional inventory + // (https://support.google.com/merchants/answer/7439058) data source. + RegionalInventoryDataSource *RegionalInventoryDataSource `json:"regionalInventoryDataSource,omitempty"` + // SupplementalProductDataSource: 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) +} + +// DataSourceReference: Data source reference can be used to manage related +// data sources within the data source service. +type DataSourceReference struct { + // PrimaryDataSourceName: Optional. The name of the primary data source. + // Format: `accounts/{account}/dataSources/{datasource}` + PrimaryDataSourceName string `json:"primaryDataSourceName,omitempty"` + // Self: Self should be used to reference the primary data source itself. + Self bool `json:"self,omitempty"` + // SupplementalDataSourceName: Optional. The name of the supplemental data + // source. Format: `accounts/{account}/dataSources/{datasource}` + SupplementalDataSourceName string `json:"supplementalDataSourceName,omitempty"` + // ForceSendFields is a list of field names (e.g. "PrimaryDataSourceName") 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. "PrimaryDataSourceName") 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 DataSourceReference) MarshalJSON() ([]byte, error) { + type NoMethod DataSourceReference + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// DefaultRule: Default rule management of the data source. +type DefaultRule struct { + // TakeFromDataSources: Required. The list of data sources linked in the + // default rule (https://support.google.com/merchants/answer/7450276). This + // list is ordered by the default rule priority of joining the data. It might + // include none or multiple references to `self` and supplemental data sources. + // The list must not be empty. To link the data source to the default rule, you + // need to add a new reference to this list (in sequential order). To unlink + // the data source from the default rule, you need to remove the given + // reference from this list. Changing the order of this list will result in + // changing the priority of data sources in the default rule. For example, + // providing the following list: [`1001`, `self`] will take attribute values + // from supplemental data source `1001`, and fallback to `self` if the + // attribute is not set in `1001`. + TakeFromDataSources []*DataSourceReference `json:"takeFromDataSources,omitempty"` + // ForceSendFields is a list of field names (e.g. "TakeFromDataSources") 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. "TakeFromDataSources") 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 DefaultRule) MarshalJSON() ([]byte, error) { + type NoMethod DefaultRule + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// Destination: Destinations also known as Marketing methods +// (https://support.google.com/merchants/answer/15130232) selections. +type Destination struct { + // Destination: Marketing methods + // (https://support.google.com/merchants/answer/15130232) (also known as + // destination) selections. + // + // 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). + // "YOUTUBE_SHOPPING_CHECKOUT" - Youtube shopping checkout. + // "YOUTUBE_AFFILIATE" - [Youtube + // Affiliate](https://support.google.com/youtube/answer/13376398). + // "FREE_VEHICLE_LISTINGS" - [Free vehicle + // listings](https://support.google.com/merchants/answer/11189169). + // "VEHICLE_ADS" - [Vehicle + // ads](https://support.google.com/merchants/answer/11189169). + // "CLOUD_RETAIL" - [Cloud + // retail](https://cloud.google.com/solutions/retail). + // "LOCAL_CLOUD_RETAIL" - [Local cloud + // retail](https://cloud.google.com/solutions/retail). + Destination string `json:"destination,omitempty"` + // State: The state of the destination. + // + // Possible values: + // "STATE_UNSPECIFIED" - Not specified. + // "ENABLED" - Indicates that the destination is enabled. + // "DISABLED" - Indicates that the destination is disabled. + State string `json:"state,omitempty"` + // ForceSendFields is a list of field names (e.g. "Destination") 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. "Destination") 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 Destination) MarshalJSON() ([]byte, error) { + type NoMethod Destination + 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_uri. 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_uri. 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. However, you can't set up `GOOGLE_SHEETS` as a data source + // through the API. To add `GOOGLE_SHEETS` as a data source through the + // Merchant Center, see [Add products to Merchant + // Center](https://support.google.com/merchants/answer/12158053). + 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) +} + +// FileUpload: The file upload of a specific data source, that is, the result +// of the retrieval of the data source at a certain timestamp computed +// asynchronously when the data source processing is finished. Only applicable +// to file data sources. +type FileUpload struct { + // DataSourceId: Output only. The data source id. + DataSourceId int64 `json:"dataSourceId,omitempty,string"` + // Issues: Output only. The list of issues occurring in the data source. + Issues []*Issue `json:"issues,omitempty"` + // ItemsCreated: Output only. The number of items in the data source that were + // created. + ItemsCreated int64 `json:"itemsCreated,omitempty,string"` + // ItemsTotal: Output only. The number of items in the data source that were + // processed. + ItemsTotal int64 `json:"itemsTotal,omitempty,string"` + // ItemsUpdated: Output only. The number of items in the data source that were + // updated. + ItemsUpdated int64 `json:"itemsUpdated,omitempty,string"` + // Name: Identifier. The name of the data source file upload. Format: + // `{datasource.name=accounts/{account}/dataSources/{datasource}/fileUploads/{fi + // leupload}}` + Name string `json:"name,omitempty"` + // ProcessingState: Output only. The processing state of the data source. + // + // Possible values: + // "PROCESSING_STATE_UNSPECIFIED" - Processing state unspecified. + // "FAILED" - The data source could not be processed or all the items had + // errors. + // "IN_PROGRESS" - The data source is being processed. + // "SUCCEEDED" - The data source was processed successfully, though some + // items might have had errors. + ProcessingState string `json:"processingState,omitempty"` + // UploadTime: Output only. The date at which the file of the data source was + // uploaded. + UploadTime string `json:"uploadTime,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 FileUpload) MarshalJSON() ([]byte, error) { + type NoMethod FileUpload + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// Issue: An error occurring in the data source, like "invalid price". +type Issue struct { + // Code: Output only. The code of the error, for example, + // "validation/invalid_value". Returns "?" if the code is unknown. + Code string `json:"code,omitempty"` + // Count: Output only. The number of occurrences of the error in the file + // upload. + Count int64 `json:"count,omitempty,string"` + // Description: Output only. The error description, for example, "Your data + // source contains items which have too many attributes, or are too big. These + // items will be dropped". + Description string `json:"description,omitempty"` + // DocumentationUri: Output only. Link to the documentation explaining the + // issue in more details, if available. + DocumentationUri string `json:"documentationUri,omitempty"` + // Severity: Output only. The severity of the issue. + // + // Possible values: + // "SEVERITY_UNSPECIFIED" - Severity unspecified. + // "WARNING" - The issue is the warning. + // "ERROR" - The issue is an error. + Severity string `json:"severity,omitempty"` + // Title: Output only. The title of the issue, for example, "Item too big". + Title string `json:"title,omitempty"` + // ForceSendFields is a list of field names (e.g. "Code") 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. "Code") 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 Issue) MarshalJSON() ([]byte, error) { + type NoMethod Issue + 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 is only +// available for file inputs and can't be used to create API local inventory +// data sources. +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) +} + +// MerchantReviewDataSource: The merchant review data source. +type MerchantReviewDataSource struct { +} + +// PrimaryProductDataSource: The primary data source for local and online +// products. +type PrimaryProductDataSource 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 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"` + // DefaultRule: Optional. Default rule management of the data source. If set, + // the linked data sources will be replaced. + DefaultRule *DefaultRule `json:"defaultRule,omitempty"` + // Destinations: Optional. A list of destinations describing where products of + // the data source can be shown. When retrieving the data source, the list + // contains all the destinations that can be used for the data source, + // including the ones that are disabled for the data source but enabled for the + // account. Only destinations that are enabled on the account, for example + // through program participation, can be enabled on the data source. If unset, + // during creation, the destinations will be inherited based on the account + // level program participation. If set, during creation or update, the data + // source will be set only for the specified destinations. Updating this field + // requires at least one destination. + Destinations []*Destination `json:"destinations,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"` + // LegacyLocal: Optional. Immutable. Determines whether the products of this + // data source are **only** targeting local destinations. Legacy local products + // are prefixed with `local~` in the product resource ID. For example, + // `accounts/123/products/local~en~US~sku123`. + LegacyLocal bool `json:"legacyLocal,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 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. If empty, it + // means that the product was deleted. Will have one of these values : + // (`approved`, `pending`, `disapproved`, ``) + NewValue string `json:"newValue,omitempty"` + // OldValue: The old value of the changed resource or attribute. If empty, it + // means that the product was created. Will have one of these values : + // (`approved`, `pending`, `disapproved`, ``) + OldValue string `json:"oldValue,omitempty"` + // RegionCode: Countries that have the change (if applicable). Represented in + // the ISO 3166 format. + RegionCode string `json:"regionCode,omitempty"` + // ReportingContext: Reporting contexts that have the change (if applicable). + // Currently this field supports only (`SHOPPING_ADS`, `LOCAL_INVENTORY_ADS`, + // `YOUTUBE_SHOPPING`, `YOUTUBE_CHECKOUT`, `YOUTUBE_AFFILIATE`) from the enum + // value ReportingContextEnum + // (/merchant/api/reference/rest/Shared.Types/ReportingContextEnum) + // + // 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_AFFILIATE" - [Youtube + // Affiliate](https://support.google.com/youtube/answer/13376398). + // "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). + // "PRODUCT_REVIEWS" - [Product + // Reviews](https://support.google.com/merchants/answer/14620732). + // "MERCHANT_REVIEWS" - [Merchant + // Reviews](https://developers.google.com/merchant-review-feeds). + // "YOUTUBE_CHECKOUT" - YouTube Checkout . + 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) +} + +// ProductReviewDataSource: The product review data source. +type ProductReviewDataSource struct { +} + +// 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"` + // EventTime: The time at which the event was generated. If you want to order + // the notification messages you receive you should rely on this field not on + // the order of receiving the notifications. + EventTime string `json:"eventTime,omitempty"` + // ExpirationTime: Optional. The product expiration time. This field will not + // be set if the notification is sent for a product deletion event. + ExpirationTime string `json:"expirationTime,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: `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) +} + +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. After creation, you should make sure to link the +// supplemental product data source into one or more primary product data +// sources. +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. The fields must 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. + FeedLabel string `json:"feedLabel,omitempty"` + // ReferencingPrimaryDataSources: Output only. The (unordered and deduplicated) + // list of all primary data sources linked to this data source in either + // default or custom rules. Supplemental data source cannot be deleted before + // all links are removed. + ReferencingPrimaryDataSources []*DataSourceReference `json:"referencingPrimaryDataSources,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 a day in 24 hour format. Must be greater than or equal to 0 + // and typically must be less than or equal 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 an hour. Must be greater than or equal to 0 and less + // than or equal to 59. + Minutes int64 `json:"minutes,omitempty"` + // Nanos: Fractions of seconds, in nanoseconds. Must be greater than or equal + // to 0 and less than or equal to 999,999,999. + Nanos int64 `json:"nanos,omitempty"` + // Seconds: Seconds of a minute. Must be greater than or equal to 0 and + // typically must be less than or equal 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. +// This method always creates a new data source. +// +// - 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_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(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/v1/{+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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.dataSources.create", "request", internallog.HTTPRequest(req, body.Bytes())) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.dataSources.create", "response", internallog.HTTPResponse(res, b)) + 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_) + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "datasources/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.dataSources.delete", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.dataSources.delete", "response", internallog.HTTPResponse(res, b)) + 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_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(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/v1/{+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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.dataSources.fetch", "request", internallog.HTTPRequest(req, body.Bytes())) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.dataSources.fetch", "response", internallog.HTTPResponse(res, b)) + 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_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "datasources/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.dataSources.get", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.dataSources.get", "response", internallog.HTTPResponse(res, b)) + 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_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "datasources/v1/{+parent}/dataSources") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.dataSources.list", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.dataSources.list", "response", internallog.HTTPResponse(res, b)) + 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: +// `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. For example, If you insert `updateMask=displayName` in the +// request, it will only update the `displayName` leaving all other fields +// untouched. +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_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(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/v1/{+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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.dataSources.patch", "request", internallog.HTTPRequest(req, body.Bytes())) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.dataSources.patch", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsDataSourcesFileUploadsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets the latest data source file upload. Only the `latest` alias is +// accepted for a file upload. +// +// - name: The name of the data source file upload to retrieve. Format: +// `accounts/{account}/dataSources/{datasource}/fileUploads/latest`. +func (r *AccountsDataSourcesFileUploadsService) Get(name string) *AccountsDataSourcesFileUploadsGetCall { + c := &AccountsDataSourcesFileUploadsGetCall{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 *AccountsDataSourcesFileUploadsGetCall) Fields(s ...googleapi.Field) *AccountsDataSourcesFileUploadsGetCall { + 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 *AccountsDataSourcesFileUploadsGetCall) IfNoneMatch(entityTag string) *AccountsDataSourcesFileUploadsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsDataSourcesFileUploadsGetCall) Context(ctx context.Context) *AccountsDataSourcesFileUploadsGetCall { + 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 *AccountsDataSourcesFileUploadsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsDataSourcesFileUploadsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "datasources/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.dataSources.fileUploads.get", "request", internallog.HTTPRequest(req, nil)) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.dataSources.fileUploads.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *FileUpload.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 *AccountsDataSourcesFileUploadsGetCall) Do(opts ...googleapi.CallOption) (*FileUpload, 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 := &FileUpload{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.dataSources.fileUploads.get", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} diff --git a/merchantapi/inventories/v1/merchantapi-api.json b/merchantapi/inventories/v1/merchantapi-api.json new file mode 100644 index 00000000000..7287cd72b53 --- /dev/null +++ b/merchantapi/inventories/v1/merchantapi-api.json @@ -0,0 +1,713 @@ +{ + "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.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_v1", + "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/v1/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/v1/{+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/v1/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/v1/{+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/v1/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/v1/{+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/v1/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/v1/{+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/v1/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/v1/{+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/v1/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/v1/{+parent}/regionalInventories", + "response": { + "$ref": "ListRegionalInventoriesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + } + } + } + } + } + }, + "revision": "20250804", + "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" + }, + "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" + }, + "localInventoryAttributes": { + "$ref": "LocalInventoryAttributes", + "description": "Optional. A list of local inventory attributes." + }, + "name": { + "description": "Output only. The name of the `LocalInventory` resource. Format: `accounts/{account}/products/{product}/localInventories/{store_code}`", + "readOnly": true, + "type": "string" + }, + "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" + }, + "LocalInventoryAttributes": { + "description": "Local inventory attributes.", + "id": "LocalInventoryAttributes", + "properties": { + "availability": { + "description": "[Availability](https://support.google.com/merchants/answer/3061342) of the product at this store.", + "enum": [ + "LOCAL_INVENTORY_AVAILABILITY_UNSPECIFIED", + "IN_STOCK", + "LIMITED_AVAILABILITY", + "ON_DISPLAY_TO_ORDER", + "OUT_OF_STOCK" + ], + "enumDescriptions": [ + "Indicates that the availability is unspecified.", + "Indicates that the product is in stock.", + "Indicates that the product is out of stock.", + "Indicates that the product is on display to order.", + "Indicates that the product is out of stock." + ], + "type": "string" + }, + "instoreProductLocation": { + "description": "Optional. Location of the product inside the store. Maximum length is 20 bytes.", + "type": "string" + }, + "pickupMethod": { + "description": "Optional. Supported [pickup method](https://support.google.com/merchants/answer/3061342) for this product. Unless the value is `\"not supported\"`, this field must be submitted together with `pickupSla`.", + "enum": [ + "PICKUP_METHOD_UNSPECIFIED", + "BUY", + "RESERVE", + "SHIP_TO_STORE", + "NOT_SUPPORTED" + ], + "enumDescriptions": [ + "Indicates that the pickup method is unspecified.", + "Indicates that the pickup method is Buy.", + "Indicates that the pickup method is Reserve.", + "Indicates that the pickup method is Ship to store.", + "Indicates that the pickup method is not supported." + ], + "type": "string" + }, + "pickupSla": { + "description": "Optional. 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`. See more details [here](https://support.google.com/merchants/answer/3061342).", + "enum": [ + "PICKUP_SLA_UNSPECIFIED", + "SAME_DAY", + "NEXT_DAY", + "TWO_DAY", + "THREE_DAY", + "FOUR_DAY", + "FIVE_DAY", + "SIX_DAY", + "SEVEN_DAY", + "MULTI_WEEK" + ], + "enumDescriptions": [ + "Indicates that the pickup SLA is unspecified.", + "Indicates that the pickup SLA is same day.", + "Indicates that the pickup SLA is next day.", + "Indicates that the pickup SLA is two days.", + "Indicates that the pickup SLA is three days.", + "Indicates that the pickup SLA is four days.", + "Indicates that the pickup SLA is five days.", + "Indicates that the pickup SLA is six days.", + "Indicates that the pickup SLA is seven days.", + "Indicates that the pickup SLA is multi-week." + ], + "type": "string" + }, + "price": { + "$ref": "Price", + "description": "Optional. Price of the product at this store." + }, + "quantity": { + "description": "Optional. Quantity of the product available at this store. Must be greater than or equal to zero.", + "format": "int64", + "type": "string" + }, + "salePrice": { + "$ref": "Price", + "description": "Optional. Sale price of the product at this store. Mandatory if `salePriceEffectiveDate` is defined." + }, + "salePriceEffectiveDate": { + "$ref": "Interval", + "description": "Optional. The `TimePeriod` of the sale at this store." + } + }, + "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. If empty, it means that the product was deleted. Will have one of these values : (`approved`, `pending`, `disapproved`, ``)", + "type": "string" + }, + "oldValue": { + "description": "The old value of the changed resource or attribute. If empty, it means that the product was created. Will have one of these values : (`approved`, `pending`, `disapproved`, ``)", + "type": "string" + }, + "regionCode": { + "description": "Countries that have the change (if applicable). Represented in the ISO 3166 format.", + "type": "string" + }, + "reportingContext": { + "description": "Reporting contexts that have the change (if applicable). Currently this field supports only (`SHOPPING_ADS`, `LOCAL_INVENTORY_ADS`, `YOUTUBE_SHOPPING`, `YOUTUBE_CHECKOUT`, `YOUTUBE_AFFILIATE`) from the enum value [ReportingContextEnum](/merchant/api/reference/rest/Shared.Types/ReportingContextEnum)", + "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_AFFILIATE", + "YOUTUBE_SHOPPING", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL", + "PRODUCT_REVIEWS", + "MERCHANT_REVIEWS", + "YOUTUBE_CHECKOUT" + ], + "enumDeprecated": [ + false, + false, + true, + false, + false, + false, + false, + 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 Affiliate](https://support.google.com/youtube/answer/13376398).", + "[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).", + "[Product Reviews](https://support.google.com/merchants/answer/14620732).", + "[Merchant Reviews](https://developers.google.com/merchant-review-feeds).", + "YouTube Checkout ." + ], + "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" + }, + "eventTime": { + "description": "The time at which the event was generated. If you want to order the notification messages you receive you should rely on this field not on the order of receiving the notifications.", + "format": "google-datetime", + "type": "string" + }, + "expirationTime": { + "description": "Optional. The product expiration time. This field will not be set if the notification is sent for a product deletion event.", + "format": "google-datetime", + "type": "string" + }, + "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: `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" + }, + "name": { + "description": "Output only. The name of the `RegionalInventory` resource. Format: `{regional_inventory.name=accounts/{account}/products/{product}/regionalInventories/{region}`", + "readOnly": true, + "type": "string" + }, + "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" + }, + "regionalInventoryAttributes": { + "$ref": "RegionalInventoryAttributes", + "description": "Optional. A list of regional inventory attributes." + } + }, + "type": "object" + }, + "RegionalInventoryAttributes": { + "description": "Regional inventory attributes.", + "id": "RegionalInventoryAttributes", + "properties": { + "availability": { + "description": "Optional. [Availability](https://support.google.com/merchants/answer/14644124) of the product in this region.", + "enum": [ + "REGIONAL_INVENTORY_AVAILABILITY_UNSPECIFIED", + "IN_STOCK", + "OUT_OF_STOCK" + ], + "enumDescriptions": [ + "Indicates that the availability is unspecified.", + "Indicates that the product is in stock.", + "Indicates that the product is out of stock." + ], + "type": "string" + }, + "price": { + "$ref": "Price", + "description": "Optional. Price of the product in this region." + }, + "salePrice": { + "$ref": "Price", + "description": "Optional. Sale price of the product in this region. Mandatory if `salePriceEffectiveDate` is defined." + }, + "salePriceEffectiveDate": { + "$ref": "Interval", + "description": "Optional. The `TimePeriod` of the sale price in this region." + } + }, + "type": "object" + } + }, + "servicePath": "", + "title": "Merchant API", + "version": "inventories_v1", + "version_module": true +} \ No newline at end of file diff --git a/merchantapi/inventories/v1/merchantapi-gen.go b/merchantapi/inventories/v1/merchantapi-gen.go new file mode 100644 index 00000000000..86ad9ab1d66 --- /dev/null +++ b/merchantapi/inventories/v1/merchantapi-gen.go @@ -0,0 +1,1388 @@ +// Copyright 2025 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.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/v1" +// ... +// 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/v1" + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "log/slog" + "net/http" + "net/url" + "strconv" + "strings" + + "github.com/googleapis/gax-go/v2/internallog" + 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 +var _ = internallog.New + +const apiId = "merchantapi:inventories_v1" +const apiName = "merchantapi" +const apiVersion = "inventories_v1" +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 := &Service{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)} + s.Accounts = NewAccountsService(s) + 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") + } + return NewService(context.TODO(), option.WithHTTPClient(client)) +} + +type Service struct { + client *http.Client + logger *slog.Logger + 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 +} + +// 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"` + // LocalInventoryAttributes: Optional. A list of local inventory attributes. + LocalInventoryAttributes *LocalInventoryAttributes `json:"localInventoryAttributes,omitempty"` + // Name: Output only. The name of the `LocalInventory` resource. Format: + // `accounts/{account}/products/{product}/localInventories/{store_code}` + Name string `json:"name,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) +} + +// LocalInventoryAttributes: Local inventory attributes. +type LocalInventoryAttributes struct { + // Availability: Availability + // (https://support.google.com/merchants/answer/3061342) of the product at this + // store. + // + // Possible values: + // "LOCAL_INVENTORY_AVAILABILITY_UNSPECIFIED" - Indicates that the + // availability is unspecified. + // "IN_STOCK" - Indicates that the product is in stock. + // "LIMITED_AVAILABILITY" - Indicates that the product is out of stock. + // "ON_DISPLAY_TO_ORDER" - Indicates that the product is on display to order. + // "OUT_OF_STOCK" - Indicates that the product is out of stock. + Availability string `json:"availability,omitempty"` + // InstoreProductLocation: Optional. Location of the product inside the store. + // Maximum length is 20 bytes. + InstoreProductLocation string `json:"instoreProductLocation,omitempty"` + // PickupMethod: Optional. Supported pickup method + // (https://support.google.com/merchants/answer/3061342) for this product. + // Unless the value is "not supported", this field must be submitted together + // with `pickupSla`. + // + // Possible values: + // "PICKUP_METHOD_UNSPECIFIED" - Indicates that the pickup method is + // unspecified. + // "BUY" - Indicates that the pickup method is Buy. + // "RESERVE" - Indicates that the pickup method is Reserve. + // "SHIP_TO_STORE" - Indicates that the pickup method is Ship to store. + // "NOT_SUPPORTED" - Indicates that the pickup method is not supported. + PickupMethod string `json:"pickupMethod,omitempty"` + // PickupSla: Optional. 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`. See more details here + // (https://support.google.com/merchants/answer/3061342). + // + // Possible values: + // "PICKUP_SLA_UNSPECIFIED" - Indicates that the pickup SLA is unspecified. + // "SAME_DAY" - Indicates that the pickup SLA is same day. + // "NEXT_DAY" - Indicates that the pickup SLA is next day. + // "TWO_DAY" - Indicates that the pickup SLA is two days. + // "THREE_DAY" - Indicates that the pickup SLA is three days. + // "FOUR_DAY" - Indicates that the pickup SLA is four days. + // "FIVE_DAY" - Indicates that the pickup SLA is five days. + // "SIX_DAY" - Indicates that the pickup SLA is six days. + // "SEVEN_DAY" - Indicates that the pickup SLA is seven days. + // "MULTI_WEEK" - Indicates that the pickup SLA is multi-week. + PickupSla string `json:"pickupSla,omitempty"` + // Price: Optional. Price of the product at this store. + 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"` + // SalePrice: Optional. Sale price of the product at this store. Mandatory if + // `salePriceEffectiveDate` is defined. + SalePrice *Price `json:"salePrice,omitempty"` + // SalePriceEffectiveDate: Optional. The `TimePeriod` of the sale at this + // store. + SalePriceEffectiveDate *Interval `json:"salePriceEffectiveDate,omitempty"` + // 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 LocalInventoryAttributes) MarshalJSON() ([]byte, error) { + type NoMethod LocalInventoryAttributes + 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. If empty, it + // means that the product was deleted. Will have one of these values : + // (`approved`, `pending`, `disapproved`, ``) + NewValue string `json:"newValue,omitempty"` + // OldValue: The old value of the changed resource or attribute. If empty, it + // means that the product was created. Will have one of these values : + // (`approved`, `pending`, `disapproved`, ``) + OldValue string `json:"oldValue,omitempty"` + // RegionCode: Countries that have the change (if applicable). Represented in + // the ISO 3166 format. + RegionCode string `json:"regionCode,omitempty"` + // ReportingContext: Reporting contexts that have the change (if applicable). + // Currently this field supports only (`SHOPPING_ADS`, `LOCAL_INVENTORY_ADS`, + // `YOUTUBE_SHOPPING`, `YOUTUBE_CHECKOUT`, `YOUTUBE_AFFILIATE`) from the enum + // value ReportingContextEnum + // (/merchant/api/reference/rest/Shared.Types/ReportingContextEnum) + // + // 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_AFFILIATE" - [Youtube + // Affiliate](https://support.google.com/youtube/answer/13376398). + // "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). + // "PRODUCT_REVIEWS" - [Product + // Reviews](https://support.google.com/merchants/answer/14620732). + // "MERCHANT_REVIEWS" - [Merchant + // Reviews](https://developers.google.com/merchant-review-feeds). + // "YOUTUBE_CHECKOUT" - YouTube Checkout . + 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"` + // EventTime: The time at which the event was generated. If you want to order + // the notification messages you receive you should rely on this field not on + // the order of receiving the notifications. + EventTime string `json:"eventTime,omitempty"` + // ExpirationTime: Optional. The product expiration time. This field will not + // be set if the notification is sent for a product deletion event. + ExpirationTime string `json:"expirationTime,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: `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"` + // 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"` + // 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"` + // RegionalInventoryAttributes: Optional. A list of regional inventory + // attributes. + RegionalInventoryAttributes *RegionalInventoryAttributes `json:"regionalInventoryAttributes,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) +} + +// RegionalInventoryAttributes: Regional inventory attributes. +type RegionalInventoryAttributes struct { + // Availability: Optional. Availability + // (https://support.google.com/merchants/answer/14644124) of the product in + // this region. + // + // Possible values: + // "REGIONAL_INVENTORY_AVAILABILITY_UNSPECIFIED" - Indicates that the + // availability is unspecified. + // "IN_STOCK" - Indicates that the product is in stock. + // "OUT_OF_STOCK" - Indicates that the product is out of stock. + Availability string `json:"availability,omitempty"` + // Price: Optional. Price of the product in this region. + Price *Price `json:"price,omitempty"` + // SalePrice: Optional. Sale price of the product in this region. Mandatory if + // `salePriceEffectiveDate` is defined. + SalePrice *Price `json:"salePrice,omitempty"` + // SalePriceEffectiveDate: Optional. The `TimePeriod` of the sale price in this + // region. + SalePriceEffectiveDate *Interval `json:"salePriceEffectiveDate,omitempty"` + // 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 RegionalInventoryAttributes) MarshalJSON() ([]byte, error) { + type NoMethod RegionalInventoryAttributes + 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_) + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "inventories/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.products.localInventories.delete", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.products.localInventories.delete", "response", internallog.HTTPResponse(res, b)) + 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_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(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/v1/{+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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.products.localInventories.insert", "request", internallog.HTTPRequest(req, body.Bytes())) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.products.localInventories.insert", "response", internallog.HTTPResponse(res, b)) + 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_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "inventories/v1/{+parent}/localInventories") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.products.localInventories.list", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.products.localInventories.list", "response", internallog.HTTPResponse(res, b)) + 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_) + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "inventories/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.products.regionalInventories.delete", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.products.regionalInventories.delete", "response", internallog.HTTPResponse(res, b)) + 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_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(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/v1/{+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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.products.regionalInventories.insert", "request", internallog.HTTPRequest(req, body.Bytes())) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.products.regionalInventories.insert", "response", internallog.HTTPResponse(res, b)) + 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_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "inventories/v1/{+parent}/regionalInventories") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.products.regionalInventories.list", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.products.regionalInventories.list", "response", internallog.HTTPResponse(res, b)) + 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/issueresolution/v1/merchantapi-api.json b/merchantapi/issueresolution/v1/merchantapi-api.json new file mode 100644 index 00000000000..94c44bb0c6c --- /dev/null +++ b/merchantapi/issueresolution/v1/merchantapi-api.json @@ -0,0 +1,1248 @@ +{ + "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.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:issueresolution_v1", + "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": { + "aggregateProductStatuses": { + "methods": { + "list": { + "description": "Lists the `AggregateProductStatuses` resources for 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.", + "flatPath": "issueresolution/v1/accounts/{accountsId}/aggregateProductStatuses", + "httpMethod": "GET", + "id": "merchantapi.accounts.aggregateProductStatuses.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "filter": { + "description": "Optional. A filter expression that filters the aggregate product statuses. Filtering is only supported by the `reporting_context` and `country` field. For example: `reporting_context = \"SHOPPING_ADS\" AND country = \"US\"`.", + "location": "query", + "type": "string" + }, + "pageSize": { + "description": "Optional. The maximum number of aggregate product statuses to return. The service may return fewer than this value. If unspecified, at most 25 aggregate product statuses are returned. The maximum value is 250; values above 250 are coerced to 250.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. A page token, received from a previous `ListAggregateProductStatuses` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListAggregateProductStatuses` must match the call that provided the page token.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The account to list aggregate product statuses for. Format: `accounts/{account}`", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "issueresolution/v1/{+parent}/aggregateProductStatuses", + "response": { + "$ref": "ListAggregateProductStatusesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + } + } + }, + "issueresolution": { + "methods": { + "renderaccountissues": { + "description": "Provide a list of business's account issues with an issue resolution content and available actions. This content and actions are meant to be rendered and shown in third-party applications.", + "flatPath": "issueresolution/v1/accounts/{accountsId}:renderaccountissues", + "httpMethod": "POST", + "id": "merchantapi.issueresolution.renderaccountissues", + "parameterOrder": [ + "name" + ], + "parameters": { + "languageCode": { + "description": "Optional. The [IETF BCP-47](https://tools.ietf.org/html/bcp47) language code used to localize issue resolution content. If not set, the result will be in default language `en-US`.", + "location": "query", + "type": "string" + }, + "name": { + "description": "Required. The account to fetch issues for. Format: `accounts/{account}`", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + }, + "timeZone": { + "description": "Optional. The [IANA](https://www.iana.org/time-zones) timezone used to localize times in an issue resolution content. For example 'America/Los_Angeles'. If not set, results will use as a default UTC.", + "location": "query", + "type": "string" + } + }, + "path": "issueresolution/v1/{+name}:renderaccountissues", + "request": { + "$ref": "RenderIssuesRequestPayload" + }, + "response": { + "$ref": "RenderAccountIssuesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "renderproductissues": { + "description": "Provide a list of issues for business's product with an issue resolution content and available actions. This content and actions are meant to be rendered and shown in third-party applications.", + "flatPath": "issueresolution/v1/accounts/{accountsId}/products/{productsId}:renderproductissues", + "httpMethod": "POST", + "id": "merchantapi.issueresolution.renderproductissues", + "parameterOrder": [ + "name" + ], + "parameters": { + "languageCode": { + "description": "Optional. The [IETF BCP-47](https://tools.ietf.org/html/bcp47) language code used to localize an issue resolution content. If not set, the result will be in default language `en-US`.", + "location": "query", + "type": "string" + }, + "name": { + "description": "Required. The name of the product to fetch issues for. Format: `accounts/{account}/products/{product}`", + "location": "path", + "pattern": "^accounts/[^/]+/products/[^/]+$", + "required": true, + "type": "string" + }, + "timeZone": { + "description": "Optional. The [IANA](https://www.iana.org/time-zones) timezone used to localize times in an issue resolution content. For example 'America/Los_Angeles'. If not set, results will use as a default UTC.", + "location": "query", + "type": "string" + } + }, + "path": "issueresolution/v1/{+name}:renderproductissues", + "request": { + "$ref": "RenderIssuesRequestPayload" + }, + "response": { + "$ref": "RenderProductIssuesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "triggeraction": { + "description": "Start an action. The action can be requested by a business in third-party application. Before the business can request the action, the third-party application needs to show them action specific content and display a user input form. The action can be successfully started only once all `required` inputs are provided. If any `required` input is missing, or invalid value was provided, the service will return 400 error. Validation errors will contain Ids for all problematic field together with translated, human readable error messages that can be shown to the user.", + "flatPath": "issueresolution/v1/accounts/{accountsId}:triggeraction", + "httpMethod": "POST", + "id": "merchantapi.issueresolution.triggeraction", + "parameterOrder": [ + "name" + ], + "parameters": { + "languageCode": { + "description": "Optional. Language code [IETF BCP 47 syntax](https://tools.ietf.org/html/bcp47) used to localize the response. If not set, the result will be in default language `en-US`.", + "location": "query", + "type": "string" + }, + "name": { + "description": "Required. The business's account that is triggering the action. Format: `accounts/{account}`", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "issueresolution/v1/{+name}:triggeraction", + "request": { + "$ref": "TriggerActionPayload" + }, + "response": { + "$ref": "TriggerActionResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + } + }, + "revision": "20250804", + "rootUrl": "https://merchantapi.googleapis.com/", + "schemas": { + "Action": { + "description": "An actionable step that can be executed to solve the issue.", + "id": "Action", + "properties": { + "builtinSimpleAction": { + "$ref": "BuiltInSimpleAction", + "description": "Action implemented and performed in (your) third-party application. The application should point the business to the place, where they can access the corresponding functionality or provide instructions, if the specific functionality is not available." + }, + "builtinUserInputAction": { + "$ref": "BuiltInUserInputAction", + "description": "Action implemented and performed in (your) third-party application. The application needs to show an additional content and input form to the business as specified for given action. They can trigger the action only when they provided all required inputs." + }, + "buttonLabel": { + "description": "Label of the action button.", + "type": "string" + }, + "externalAction": { + "$ref": "ExternalAction", + "description": "Action that is implemented and performed outside of (your) third-party application. The application needs to redirect the business to the external location where they can perform the action." + }, + "isAvailable": { + "description": "Controlling whether the button is active or disabled. The value is 'false' when the action was already requested or is not available. If the action is not available then a reason will be present. If (your) third-party application shows a disabled button for action that is not available, then it should also show reasons.", + "type": "boolean" + }, + "reasons": { + "description": "List of reasons why the action is not available. The list of reasons is empty if the action is available. If there is only one reason, it can be displayed next to the disabled button. If there are more reasons, all of them should be displayed, for example in a pop-up dialog.", + "items": { + "$ref": "Reason" + }, + "type": "array" + } + }, + "type": "object" + }, + "ActionFlow": { + "description": "Flow that can be selected for an action. When a business selects a flow, application should open a dialog with more information and input form.", + "id": "ActionFlow", + "properties": { + "dialogButtonLabel": { + "description": "Label for the button to trigger the action from the action dialog. For example: \"Request review\"", + "type": "string" + }, + "dialogCallout": { + "$ref": "Callout", + "description": "Important message to be highlighted in the request dialog. For example: \"You can only request a review for disagreeing with this issue once. If it's not approved, you'll need to fix the issue and wait a few days before you can request another review.\"" + }, + "dialogMessage": { + "$ref": "TextWithTooltip", + "description": "Message displayed in the request dialog. For example: \"Make sure you've fixed all your country-specific issues. If not, you may have to wait 7 days to request another review\". There may be an more information to be shown in a tooltip." + }, + "dialogTitle": { + "description": "Title of the request dialog. For example: \"Before you request a review\"", + "type": "string" + }, + "id": { + "description": "Not for display but need to be sent back for the selected action flow.", + "type": "string" + }, + "inputs": { + "description": "A list of input fields.", + "items": { + "$ref": "InputField" + }, + "type": "array" + }, + "label": { + "description": "Text value describing the intent for the action flow. It can be used as an input label if business needs to pick one of multiple flows. For example: \"I disagree with the issue\"", + "type": "string" + } + }, + "type": "object" + }, + "ActionInput": { + "description": "Input provided by the business.", + "id": "ActionInput", + "properties": { + "actionFlowId": { + "description": "Required. Id of the selected action flow.", + "type": "string" + }, + "inputValues": { + "description": "Required. Values for input fields.", + "items": { + "$ref": "InputValue" + }, + "type": "array" + } + }, + "type": "object" + }, + "AdditionalContent": { + "description": "Long text from external source.", + "id": "AdditionalContent", + "properties": { + "paragraphs": { + "description": "Long text organized into paragraphs.", + "items": { + "type": "string" + }, + "type": "array" + }, + "title": { + "description": "Title of the additional content;", + "type": "string" + } + }, + "type": "object" + }, + "AggregateProductStatus": { + "description": "Aggregate product statuses for a given reporting context and country.", + "id": "AggregateProductStatus", + "properties": { + "country": { + "description": "The country of the aggregate product statuses. Represented as a [CLDR territory code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).", + "type": "string" + }, + "itemLevelIssues": { + "description": "The product issues that affect the given reporting context and country.", + "items": { + "$ref": "ItemLevelIssue" + }, + "type": "array" + }, + "name": { + "description": "Identifier. The name of the `AggregateProductStatuses` resource. Format: `accounts/{account}/aggregateProductStatuses/{aggregateProductStatuses}`", + "type": "string" + }, + "reportingContext": { + "description": "The reporting context of the aggregate product statuses.", + "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_AFFILIATE", + "YOUTUBE_SHOPPING", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL", + "PRODUCT_REVIEWS", + "MERCHANT_REVIEWS", + "YOUTUBE_CHECKOUT" + ], + "enumDeprecated": [ + false, + false, + true, + false, + false, + false, + false, + 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 Affiliate](https://support.google.com/youtube/answer/13376398).", + "[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).", + "[Product Reviews](https://support.google.com/merchants/answer/14620732).", + "[Merchant Reviews](https://developers.google.com/merchant-review-feeds).", + "YouTube Checkout ." + ], + "type": "string" + }, + "stats": { + "$ref": "Stats", + "description": "Products statistics for the given reporting context and country." + } + }, + "type": "object" + }, + "Breakdown": { + "description": "A detailed impact breakdown for a group of regions where the impact of the issue on different shopping destinations is the same.", + "id": "Breakdown", + "properties": { + "details": { + "description": "Human readable, localized description of issue's effect on different targets. Should be rendered as a list. For example: * \"Products not showing in ads\" * \"Products not showing organically\"", + "items": { + "type": "string" + }, + "type": "array" + }, + "regions": { + "description": "Lists of regions. Should be rendered as a title for this group of details. The full list should be shown to the business. If the list is too long, it is recommended to make it expandable.", + "items": { + "$ref": "Region" + }, + "type": "array" + } + }, + "type": "object" + }, + "BuiltInSimpleAction": { + "description": "Action that is implemented and performed in (your) third-party application. Represents various functionality that is expected to be available to business and will help them with resolving the issue. The application should point the business to the place, where they can access the corresponding functionality. If the functionality is not supported, it is recommended to explain the situation to the business and provide them with instructions how to solve the issue.", + "id": "BuiltInSimpleAction", + "properties": { + "additionalContent": { + "$ref": "AdditionalContent", + "description": "Long text from an external source that should be available to the business. Present when the type is `SHOW_ADDITIONAL_CONTENT`." + }, + "attributeCode": { + "description": "The attribute that needs to be updated. Present when the type is `EDIT_ITEM_ATTRIBUTE`. This field contains a code for attribute, represented in snake_case. You can find a list of product's attributes, with their codes [here](https://support.google.com/merchants/answer/7052112).", + "type": "string" + }, + "type": { + "description": "The type of action that represents a functionality that is expected to be available in third-party application.", + "enum": [ + "BUILT_IN_SIMPLE_ACTION_TYPE_UNSPECIFIED", + "VERIFY_PHONE", + "CLAIM_WEBSITE", + "ADD_PRODUCTS", + "ADD_CONTACT_INFO", + "LINK_ADS_ACCOUNT", + "ADD_BUSINESS_REGISTRATION_NUMBER", + "EDIT_ITEM_ATTRIBUTE", + "FIX_ACCOUNT_ISSUE", + "SHOW_ADDITIONAL_CONTENT" + ], + "enumDescriptions": [ + "Default value. Will never be provided by the API.", + "Redirect the business to the part of your application where they can verify their phone.", + "Redirect the business to the part of your application where they can claim their website.", + "Redirect the business to the part of your application where they can add products.", + "Open a form where the business can edit their contact information.", + "Redirect the business to the part of your application where they can link ads account.", + "Open a form where the business can add their business registration number.", + "Open a form where the business can edit an attribute. The attribute that needs to be updated is specified in attribute_code field of the action.", + "Redirect the business from the product issues to the diagnostic page with their account issues in your application. This action will be returned only for product issues that are caused by an account issue and thus the business should resolve the problem on the account level.", + "Show additional content to the business. This action will be used for example to deliver a justification from national authority." + ], + "type": "string" + } + }, + "type": "object" + }, + "BuiltInUserInputAction": { + "description": "Action that is implemented and performed in (your) third-party application. The application needs to show an additional content and input form to the business. They can start the action only when they provided all required inputs. The application will request processing of the action by calling the [triggeraction method](https://developers.google.com/merchant/api/reference/rest/issueresolution_v1beta/issueresolution/triggeraction).", + "id": "BuiltInUserInputAction", + "properties": { + "actionContext": { + "description": "Contains the action's context that must be included as part of the TriggerActionPayload.action_context in TriggerActionRequest.payload to call the `triggeraction` method. The content should be treated as opaque and must not be modified.", + "type": "string" + }, + "flows": { + "description": "Actions may provide multiple different flows. Business selects one that fits best to their intent. Selecting the flow is the first step in user's interaction with the action. It affects what input fields will be available and required and also how the request will be processed.", + "items": { + "$ref": "ActionFlow" + }, + "type": "array" + } + }, + "type": "object" + }, + "Callout": { + "description": "An important message that should be highlighted. Usually displayed as a banner.", + "id": "Callout", + "properties": { + "fullMessage": { + "$ref": "TextWithTooltip", + "description": "A full message that needs to be shown to the business." + }, + "styleHint": { + "description": "Can be used to render messages with different severity in different styles. Snippets off all types contain important information that should be displayed to the business.", + "enum": [ + "CALLOUT_STYLE_HINT_UNSPECIFIED", + "ERROR", + "WARNING", + "INFO" + ], + "enumDescriptions": [ + "Default value. Will never be provided by the API.", + "The most important type of information highlighting problems, like an unsuccessful outcome of previously requested actions.", + "Information warning about pending problems, risks or deadlines.", + "Default severity for important information like pending status of previously requested action or cooldown for re-review." + ], + "type": "string" + } + }, + "type": "object" + }, + "CheckboxInput": { + "description": "Checkbox input allows the business to provide a boolean value. Corresponds to the [html input type=checkbox](https://www.w3.org/TR/2012/WD-html-markup-20121025/input.checkbox.html#input.checkbox). If the business checks the box, the input value for the field is `true`, otherwise it is `false`. This type of input is often used as a confirmation that the business completed required steps before they are allowed to start the action. In such a case, the input field is marked as required and the button to trigger the action should stay disabled until the business checks the box.", + "id": "CheckboxInput", + "properties": {}, + "type": "object" + }, + "CheckboxInputValue": { + "description": "Value for checkbox input field.", + "id": "CheckboxInputValue", + "properties": { + "value": { + "description": "Required. True if the business checked the box field. False otherwise.", + "type": "boolean" + } + }, + "type": "object" + }, + "ChoiceInput": { + "description": "Choice input allows the business to select one of the offered choices. Some choices may be linked to additional input fields that should be displayed under or next to the choice option. The value for the additional input field needs to be provided only when the specific choice is selected by the the business. For example, additional input field can be hidden or disabled until the business selects the specific choice.", + "id": "ChoiceInput", + "properties": { + "options": { + "description": "A list of choices. Only one option can be selected.", + "items": { + "$ref": "ChoiceInputOption" + }, + "type": "array" + } + }, + "type": "object" + }, + "ChoiceInputOption": { + "description": "A choice that the business can select.", + "id": "ChoiceInputOption", + "properties": { + "additionalInput": { + "$ref": "InputField", + "description": "Input that should be displayed when this option is selected. The additional input will not contain a `ChoiceInput`." + }, + "id": { + "description": "Not for display but need to be sent back for the selected choice option.", + "type": "string" + }, + "label": { + "$ref": "TextWithTooltip", + "description": "Short description of the choice option. There may be more information to be shown as a tooltip." + } + }, + "type": "object" + }, + "ChoiceInputValue": { + "description": "Value for choice input field.", + "id": "ChoiceInputValue", + "properties": { + "choiceInputOptionId": { + "description": "Required. Id of the option that was selected by the business.", + "type": "string" + } + }, + "type": "object" + }, + "ExternalAction": { + "description": "Action that is implemented and performed outside of the third-party application. It should redirect the business to the provided URL of an external system where they can perform the action. For example to request a review in the Merchant Center.", + "id": "ExternalAction", + "properties": { + "type": { + "description": "The type of external action.", + "enum": [ + "EXTERNAL_ACTION_TYPE_UNSPECIFIED", + "REVIEW_PRODUCT_ISSUE_IN_MERCHANT_CENTER", + "REVIEW_ACCOUNT_ISSUE_IN_MERCHANT_CENTER", + "LEGAL_APPEAL_IN_HELP_CENTER", + "VERIFY_IDENTITY_IN_MERCHANT_CENTER" + ], + "enumDescriptions": [ + "Default value. Will never be provided by the API.", + "Redirect to Merchant Center where the business can request a review for issue related to their product.", + "Redirect to Merchant Center where the business can request a review for issue related to their account.", + "Redirect to the form in Help Center where the business can request a legal appeal for the issue.", + "Redirect to Merchant Center where the business can perform identity verification." + ], + "type": "string" + }, + "uri": { + "description": "URL to external system, for example Merchant Center, where the business can perform the action.", + "type": "string" + } + }, + "type": "object" + }, + "Impact": { + "description": "Overall impact of the issue.", + "id": "Impact", + "properties": { + "breakdowns": { + "description": "Detailed impact breakdown. Explains the types of restriction the issue has in different shopping destinations and territory. If present, it should be rendered to the business. Can be shown as a mouse over dropdown or a dialog. Each breakdown item represents a group of regions with the same impact details.", + "items": { + "$ref": "Breakdown" + }, + "type": "array" + }, + "message": { + "description": "Optional. Message summarizing the overall impact of the issue. If present, it should be rendered to the business. For example: \"Disapproves 90k offers in 25 countries\"", + "type": "string" + }, + "severity": { + "description": "The severity of the issue.", + "enum": [ + "SEVERITY_UNSPECIFIED", + "ERROR", + "WARNING", + "INFO" + ], + "enumDescriptions": [ + "Default value. Will never be provided by the API.", + "Causes either an account suspension or an item disapproval. Errors should be resolved as soon as possible to ensure items are eligible to appear in results again.", + "Warnings can negatively impact the performance of ads and can lead to item or account suspensions in the future unless the issue is resolved.", + "Infos are suggested optimizations to increase data quality. Resolving these issues is recommended, but not required." + ], + "type": "string" + } + }, + "type": "object" + }, + "InputField": { + "description": "Input field that needs to be available to the business. If the field is marked as required, then a value needs to be provided for a successful processing of the request.", + "id": "InputField", + "properties": { + "checkboxInput": { + "$ref": "CheckboxInput", + "description": "Input field to provide a boolean value. Corresponds to the [html input type=checkbox](https://www.w3.org/TR/2012/WD-html-markup-20121025/input.checkbox.html#input.checkbox)." + }, + "choiceInput": { + "$ref": "ChoiceInput", + "description": "Input field to select one of the offered choices. Corresponds to the [html input type=radio](https://www.w3.org/TR/2012/WD-html-markup-20121025/input.radio.html#input.radio)." + }, + "id": { + "description": "Not for display but need to be sent back for the given input field.", + "type": "string" + }, + "label": { + "$ref": "TextWithTooltip", + "description": "Input field label. There may be more information to be shown in a tooltip." + }, + "required": { + "description": "Whether the field is required. The action button needs to stay disabled till values for all required fields are provided.", + "type": "boolean" + }, + "textInput": { + "$ref": "TextInput", + "description": "Input field to provide text information. Corresponds to the [html input type=text](https://www.w3.org/TR/2012/WD-html-markup-20121025/input.text.html#input.text) or [html textarea](https://www.w3.org/TR/2012/WD-html-markup-20121025/textarea.html#textarea)." + } + }, + "type": "object" + }, + "InputValue": { + "description": "Input provided by the business for input field.", + "id": "InputValue", + "properties": { + "checkboxInputValue": { + "$ref": "CheckboxInputValue", + "description": "Value for checkbox input field." + }, + "choiceInputValue": { + "$ref": "ChoiceInputValue", + "description": "Value for choice input field." + }, + "inputFieldId": { + "description": "Required. Id of the corresponding input field.", + "type": "string" + }, + "textInputValue": { + "$ref": "TextInputValue", + "description": "Value for text input field." + } + }, + "type": "object" + }, + "ItemLevelIssue": { + "description": "The ItemLevelIssue of the product status.", + "id": "ItemLevelIssue", + "properties": { + "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" + }, + "documentationUri": { + "description": "The URL of a web page to help with resolving this issue.", + "type": "string" + }, + "productCount": { + "description": "The number of products affected by this issue.", + "format": "int64", + "type": "string" + }, + "resolution": { + "description": "Whether the issue can be resolved by the merchant.", + "enum": [ + "RESOLUTION_UNSPECIFIED", + "MERCHANT_ACTION", + "PENDING_PROCESSING" + ], + "enumDescriptions": [ + "Not specified.", + "The issue can be resolved by the merchant.", + "The issue will be resolved auomatically." + ], + "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" + }, + "ListAggregateProductStatusesResponse": { + "description": "Response message for the `ListAggregateProductStatuses` method.", + "id": "ListAggregateProductStatusesResponse", + "properties": { + "aggregateProductStatuses": { + "description": "The `AggregateProductStatuses` resources for the given account.", + "items": { + "$ref": "AggregateProductStatus" + }, + "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" + }, + "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. If empty, it means that the product was deleted. Will have one of these values : (`approved`, `pending`, `disapproved`, ``)", + "type": "string" + }, + "oldValue": { + "description": "The old value of the changed resource or attribute. If empty, it means that the product was created. Will have one of these values : (`approved`, `pending`, `disapproved`, ``)", + "type": "string" + }, + "regionCode": { + "description": "Countries that have the change (if applicable). Represented in the ISO 3166 format.", + "type": "string" + }, + "reportingContext": { + "description": "Reporting contexts that have the change (if applicable). Currently this field supports only (`SHOPPING_ADS`, `LOCAL_INVENTORY_ADS`, `YOUTUBE_SHOPPING`, `YOUTUBE_CHECKOUT`, `YOUTUBE_AFFILIATE`) from the enum value [ReportingContextEnum](/merchant/api/reference/rest/Shared.Types/ReportingContextEnum)", + "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_AFFILIATE", + "YOUTUBE_SHOPPING", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL", + "PRODUCT_REVIEWS", + "MERCHANT_REVIEWS", + "YOUTUBE_CHECKOUT" + ], + "enumDeprecated": [ + false, + false, + true, + false, + false, + false, + false, + 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 Affiliate](https://support.google.com/youtube/answer/13376398).", + "[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).", + "[Product Reviews](https://support.google.com/merchants/answer/14620732).", + "[Merchant Reviews](https://developers.google.com/merchant-review-feeds).", + "YouTube Checkout ." + ], + "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" + }, + "eventTime": { + "description": "The time at which the event was generated. If you want to order the notification messages you receive you should rely on this field not on the order of receiving the notifications.", + "format": "google-datetime", + "type": "string" + }, + "expirationTime": { + "description": "Optional. The product expiration time. This field will not be set if the notification is sent for a product deletion event.", + "format": "google-datetime", + "type": "string" + }, + "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: `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" + }, + "Reason": { + "description": "A single reason why the action is not available.", + "id": "Reason", + "properties": { + "action": { + "$ref": "Action", + "description": "Optional. An action that needs to be performed to solve the problem represented by this reason. This action will always be available. Should be rendered as a link or button next to the summarizing message. For example, the review may be available only once the business configure all required attributes. In such a situation this action can be a link to the form, where they can fill the missing attribute to unblock the main action." + }, + "detail": { + "description": "Detailed explanation of the reason. Should be displayed as a hint if present.", + "type": "string" + }, + "message": { + "description": "Messages summarizing the reason, why the action is not available. For example: \"Review requested on Jan 03. Review requests can take a few days to complete.\"", + "type": "string" + } + }, + "type": "object" + }, + "Region": { + "description": "Region with code and localized name.", + "id": "Region", + "properties": { + "code": { + "description": "The [CLDR territory code] (http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml)", + "type": "string" + }, + "name": { + "description": "The localized name of the region. For region with code='001' the value is 'All countries' or the equivalent in other languages.", + "type": "string" + } + }, + "type": "object" + }, + "RenderAccountIssuesResponse": { + "description": "Response containing an issue resolution content and actions for listed account issues.", + "id": "RenderAccountIssuesResponse", + "properties": { + "renderedIssues": { + "description": "List of account issues for a given account. This list can be shown with compressed, expandable items. In the compressed form, the title and impact should be shown for each issue. Once the issue is expanded, the detailed content and available actions should be rendered.", + "items": { + "$ref": "RenderedIssue" + }, + "type": "array" + } + }, + "type": "object" + }, + "RenderIssuesRequestPayload": { + "description": "The payload for configuring how the content should be rendered.", + "id": "RenderIssuesRequestPayload", + "properties": { + "contentOption": { + "description": "Optional. How the detailed content should be returned. Default option is to return the content as a pre-rendered HTML text.", + "enum": [ + "CONTENT_OPTION_UNSPECIFIED", + "PRE_RENDERED_HTML" + ], + "enumDescriptions": [ + "Default value. Will never be provided by the API.", + "Returns the detail of the issue as a pre-rendered HTML text." + ], + "type": "string" + }, + "userInputActionOption": { + "description": "Optional. How actions with user input form should be handled. If not provided, actions will be returned as links that points the business to Merchant Center where they can request the action.", + "enum": [ + "USER_INPUT_ACTION_RENDERING_OPTION_UNSPECIFIED", + "REDIRECT_TO_MERCHANT_CENTER", + "BUILT_IN_USER_INPUT_ACTIONS" + ], + "enumDescriptions": [ + "Default value. Will never be provided by the API.", + "Actions that require user input are represented only as links that points the business to Merchant Center where they can request the action. Provides easier to implement alternative to `BUILT_IN_USER_INPUT_ACTIONS`.", + "Returns content and input form definition for each complex action. Your application needs to display this content and input form to the business before they can request processing of the action. To start the action, your application needs to call the `triggeraction` method." + ], + "type": "string" + } + }, + "type": "object" + }, + "RenderProductIssuesResponse": { + "description": "Response containing an issue resolution content and actions for listed product issues.", + "id": "RenderProductIssuesResponse", + "properties": { + "renderedIssues": { + "description": "List of issues for a given product. This list can be shown with compressed, expandable items. In the compressed form, the title and impact should be shown for each issue. Once the issue is expanded, the detailed content and available actions should be rendered.", + "items": { + "$ref": "RenderedIssue" + }, + "type": "array" + } + }, + "type": "object" + }, + "RenderedIssue": { + "description": "An issue affecting specific business or their product.", + "id": "RenderedIssue", + "properties": { + "actions": { + "description": "A list of actionable steps that can be executed to solve the issue. An example is requesting a re-review or providing arguments when business disagrees with the issue. Actions that are supported in (your) third-party application can be rendered as buttons and should be available to the business when they expand the issue.", + "items": { + "$ref": "Action" + }, + "type": "array" + }, + "impact": { + "$ref": "Impact", + "description": "Clarifies the severity of the issue. The summarizing message, if present, should be shown right under the title for each issue. It helps business to quickly understand the impact of the issue. The detailed breakdown helps the business to fully understand the impact of the issue. It can be rendered as dialog that opens when the business mouse over the summarized impact statement. Issues with different severity can be styled differently. They may use a different color or icon to signal the difference between `ERROR`, `WARNING` and `INFO`." + }, + "prerenderedContent": { + "description": "Details of the issue as a pre-rendered HTML. HTML elements contain CSS classes that can be used to customize the style of the content. Always sanitize the HTML before embedding it directly to your application. The sanitizer needs to allow basic HTML tags, such as: `div`, `span`, `p`, `a`, `ul`, `li`, `table`, `tr`, `td`. For example, you can use [DOMPurify](https://www.npmjs.com/package/dompurify). CSS classes: * `issue-detail` - top level container for the detail of the issue * `callout-banners` - section of the `issue-detail` with callout banners * `callout-banner` - single callout banner, inside `callout-banners` * `callout-banner-info` - callout with important information (default) * `callout-banner-warning` - callout with a warning * `callout-banner-error` - callout informing about an error (most severe) * `issue-content` - section of the `issue-detail`, contains multiple `content-element` * `content-element` - content element such as a list, link or paragraph, inside `issue-content` * `root-causes` - unordered list with items describing root causes of the issue, inside `issue-content` * `root-causes-intro` - intro text before the `root-causes` list, inside `issue-content` * `segment` - section of the text, `span` inside paragraph * `segment-attribute` - section of the text that represents a product attribute, for example 'image\\_link' * `segment-literal` - section of the text that contains a special value, for example '0-1000 kg' * `segment-bold` - section of the text that should be rendered as bold * `segment-italic` - section of the text that should be rendered as italic * `tooltip` - used on paragraphs that should be rendered with a tooltip. A section of the text in such a paragraph will have a class `tooltip-text` and is intended to be shown in a mouse over dialog. If the style is not used, the `tooltip-text` section would be shown on a new line, after the main part of the text. * `tooltip-text` - marks a section of the text within a `tooltip`, that is intended to be shown in a mouse over dialog. * `tooltip-icon` - marks a section of the text within a `tooltip`, that can be replaced with a tooltip icon, for example '?' or 'i'. By default, this section contains a `br` tag, that is separating the main text and the tooltip text when the style is not used. * `tooltip-style-question` - the tooltip shows helpful information, can use the '?' as an icon. * `tooltip-style-info` - the tooltip adds additional information fitting to the context, can use the 'i' as an icon. * `content-moderation` - marks the paragraph that explains how the issue was identified. * `new-element` - Present for new elements added to the pre-rendered content in the future. To make sure that a new content element does not break your style, you can hide everything with this class.", + "type": "string" + }, + "prerenderedOutOfCourtDisputeSettlement": { + "description": "Pre-rendered HTML that contains a link to the external location where the ODS can be requested and instructions for how to request it. HTML elements contain CSS classes that can be used to customize the style of this snippet. Always sanitize the HTML before embedding it directly to your application. The sanitizer needs to allow basic HTML tags, such as: `div`, `span`, `p`, `a`, `ul`, `li`, `table`, `tr`, `td`. For example, you can use [DOMPurify](https://www.npmjs.com/package/dompurify). CSS classes: * `ods-section`* - wrapper around the out-of-court dispute resolution section * `ods-description`* - intro text for the out-of-court dispute resolution. It may contain multiple segments and a link. * `ods-param`* - wrapper around the header-value pair for parameters that the business may need to provide during the ODS process. * `ods-routing-id`* - ods param for the Routing ID. * `ods-reference-id`* - ods param for the Routing ID. * `ods-param-header`* - header for the ODS parameter * `ods-param-value`* - value of the ODS parameter. This value should be rendered in a way that it is easy for the user to identify and copy. * `segment` - section of the text, `span` inside paragraph * `segment-attribute` - section of the text that represents a product attribute, for example 'image\\_link' * `segment-literal` - section of the text that contains a special value, for example '0-1000 kg' * `segment-bold` - section of the text that should be rendered as bold * `segment-italic` - section of the text that should be rendered as italic * `tooltip` - used on paragraphs that should be rendered with a tooltip. A section of the text in such a paragraph will have a class `tooltip-text` and is intended to be shown in a mouse over dialog. If the style is not used, the `tooltip-text` section would be shown on a new line, after the main part of the text. * `tooltip-text` - marks a section of the text within a `tooltip`, that is intended to be shown in a mouse over dialog. * `tooltip-icon` - marks a section of the text within a `tooltip`, that can be replaced with a tooltip icon, for example '?' or 'i'. By default, this section contains a `br` tag, that is separating the main text and the tooltip text when the style is not used. * `tooltip-style-question` - the tooltip shows helpful information, can use the '?' as an icon. * `tooltip-style-info` - the tooltip adds additional information fitting to the context, can use the 'i' as an icon.", + "type": "string" + }, + "title": { + "description": "Title of the issue.", + "type": "string" + } + }, + "type": "object" + }, + "Stats": { + "description": "Products statistics.", + "id": "Stats", + "properties": { + "activeCount": { + "description": "The number of products that are active.", + "format": "int64", + "type": "string" + }, + "disapprovedCount": { + "description": "The number of products that are disapproved.", + "format": "int64", + "type": "string" + }, + "expiringCount": { + "description": "The number of products that are expiring.", + "format": "int64", + "type": "string" + }, + "pendingCount": { + "description": "The number of products that are pending.", + "format": "int64", + "type": "string" + } + }, + "type": "object" + }, + "TextInput": { + "description": "Text input allows the business to provide a text value.", + "id": "TextInput", + "properties": { + "additionalInfo": { + "$ref": "TextWithTooltip", + "description": "Additional info regarding the field to be displayed to the business. For example, warning to not include personal identifiable information. There may be more information to be shown in a tooltip." + }, + "ariaLabel": { + "description": "Text to be used as the [aria-label](https://www.w3.org/TR/WCAG20-TECHS/ARIA14.html) for the input.", + "type": "string" + }, + "formatInfo": { + "description": "Information about the required format. If present, it should be shown close to the input field to help the business to provide a correct value. For example: \"VAT numbers should be in a format similar to SK9999999999\"", + "type": "string" + }, + "type": { + "description": "Type of the text input", + "enum": [ + "TEXT_INPUT_TYPE_UNSPECIFIED", + "GENERIC_SHORT_TEXT", + "GENERIC_LONG_TEXT" + ], + "enumDescriptions": [ + "Default value. Will never be provided by the API.", + "Used when a short text is expected. The field can be rendered as a [text field](https://www.w3.org/TR/2012/WD-html-markup-20121025/input.text.html#input.text).", + "Used when a longer text is expected. The field should be rendered as a [textarea](https://www.w3.org/TR/2012/WD-html-markup-20121025/textarea.html#textarea)." + ], + "type": "string" + } + }, + "type": "object" + }, + "TextInputValue": { + "description": "Value for text input field.", + "id": "TextInputValue", + "properties": { + "value": { + "description": "Required. Text provided by the business.", + "type": "string" + } + }, + "type": "object" + }, + "TextWithTooltip": { + "description": "Block of text that may contain a tooltip with more information.", + "id": "TextWithTooltip", + "properties": { + "simpleTooltipValue": { + "description": "Value of the tooltip as a simple text.", + "type": "string" + }, + "simpleValue": { + "description": "Value of the message as a simple text.", + "type": "string" + }, + "tooltipIconStyle": { + "description": "The suggested type of an icon for tooltip, if a tooltip is present.", + "enum": [ + "TOOLTIP_ICON_STYLE_UNSPECIFIED", + "INFO", + "QUESTION" + ], + "enumDescriptions": [ + "Default value. Will never be provided by the API.", + "Used when the tooltip adds additional information to the context, the 'i' can be used as an icon.", + "Used when the tooltip shows helpful information, the '?' can be used as an icon." + ], + "type": "string" + } + }, + "type": "object" + }, + "TriggerActionPayload": { + "description": "The payload for the triggered action.", + "id": "TriggerActionPayload", + "properties": { + "actionContext": { + "description": "Required. The context from the selected action. The value is obtained from rendered issues and needs to be sent back to identify the action that is being triggered.", + "type": "string" + }, + "actionInput": { + "$ref": "ActionInput", + "description": "Required. Input provided by the business." + } + }, + "type": "object" + }, + "TriggerActionResponse": { + "description": "Response informing about the started action.", + "id": "TriggerActionResponse", + "properties": { + "message": { + "description": "The message for the business.", + "type": "string" + } + }, + "type": "object" + } + }, + "servicePath": "", + "title": "Merchant API", + "version": "issueresolution_v1", + "version_module": true +} \ No newline at end of file diff --git a/merchantapi/issueresolution/v1/merchantapi-gen.go b/merchantapi/issueresolution/v1/merchantapi-gen.go new file mode 100644 index 00000000000..09d08dbfe3e --- /dev/null +++ b/merchantapi/issueresolution/v1/merchantapi-gen.go @@ -0,0 +1,2039 @@ +// Copyright 2025 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.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/issueresolution/v1" +// ... +// 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/issueresolution/v1" + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "log/slog" + "net/http" + "net/url" + "strconv" + "strings" + + "github.com/googleapis/gax-go/v2/internallog" + 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 +var _ = internallog.New + +const apiId = "merchantapi:issueresolution_v1" +const apiName = "merchantapi" +const apiVersion = "issueresolution_v1" +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 := &Service{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)} + s.Accounts = NewAccountsService(s) + s.Issueresolution = NewIssueresolutionService(s) + 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") + } + return NewService(context.TODO(), option.WithHTTPClient(client)) +} + +type Service struct { + client *http.Client + logger *slog.Logger + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Accounts *AccountsService + + Issueresolution *IssueresolutionService +} + +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.AggregateProductStatuses = NewAccountsAggregateProductStatusesService(s) + return rs +} + +type AccountsService struct { + s *Service + + AggregateProductStatuses *AccountsAggregateProductStatusesService +} + +func NewAccountsAggregateProductStatusesService(s *Service) *AccountsAggregateProductStatusesService { + rs := &AccountsAggregateProductStatusesService{s: s} + return rs +} + +type AccountsAggregateProductStatusesService struct { + s *Service +} + +func NewIssueresolutionService(s *Service) *IssueresolutionService { + rs := &IssueresolutionService{s: s} + return rs +} + +type IssueresolutionService struct { + s *Service +} + +// Action: An actionable step that can be executed to solve the issue. +type Action struct { + // BuiltinSimpleAction: Action implemented and performed in (your) third-party + // application. The application should point the business to the place, where + // they can access the corresponding functionality or provide instructions, if + // the specific functionality is not available. + BuiltinSimpleAction *BuiltInSimpleAction `json:"builtinSimpleAction,omitempty"` + // BuiltinUserInputAction: Action implemented and performed in (your) + // third-party application. The application needs to show an additional content + // and input form to the business as specified for given action. They can + // trigger the action only when they provided all required inputs. + BuiltinUserInputAction *BuiltInUserInputAction `json:"builtinUserInputAction,omitempty"` + // ButtonLabel: Label of the action button. + ButtonLabel string `json:"buttonLabel,omitempty"` + // ExternalAction: Action that is implemented and performed outside of (your) + // third-party application. The application needs to redirect the business to + // the external location where they can perform the action. + ExternalAction *ExternalAction `json:"externalAction,omitempty"` + // IsAvailable: Controlling whether the button is active or disabled. The value + // is 'false' when the action was already requested or is not available. If the + // action is not available then a reason will be present. If (your) third-party + // application shows a disabled button for action that is not available, then + // it should also show reasons. + IsAvailable bool `json:"isAvailable,omitempty"` + // Reasons: List of reasons why the action is not available. The list of + // reasons is empty if the action is available. If there is only one reason, it + // can be displayed next to the disabled button. If there are more reasons, all + // of them should be displayed, for example in a pop-up dialog. + Reasons []*Reason `json:"reasons,omitempty"` + // ForceSendFields is a list of field names (e.g. "BuiltinSimpleAction") 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. "BuiltinSimpleAction") 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 Action) MarshalJSON() ([]byte, error) { + type NoMethod Action + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// ActionFlow: Flow that can be selected for an action. When a business selects +// a flow, application should open a dialog with more information and input +// form. +type ActionFlow struct { + // DialogButtonLabel: Label for the button to trigger the action from the + // action dialog. For example: "Request review" + DialogButtonLabel string `json:"dialogButtonLabel,omitempty"` + // DialogCallout: Important message to be highlighted in the request dialog. + // For example: "You can only request a review for disagreeing with this issue + // once. If it's not approved, you'll need to fix the issue and wait a few days + // before you can request another review." + DialogCallout *Callout `json:"dialogCallout,omitempty"` + // DialogMessage: Message displayed in the request dialog. For example: "Make + // sure you've fixed all your country-specific issues. If not, you may have to + // wait 7 days to request another review". There may be an more information to + // be shown in a tooltip. + DialogMessage *TextWithTooltip `json:"dialogMessage,omitempty"` + // DialogTitle: Title of the request dialog. For example: "Before you request a + // review" + DialogTitle string `json:"dialogTitle,omitempty"` + // Id: Not for display but need to be sent back for the selected action flow. + Id string `json:"id,omitempty"` + // Inputs: A list of input fields. + Inputs []*InputField `json:"inputs,omitempty"` + // Label: Text value describing the intent for the action flow. It can be used + // as an input label if business needs to pick one of multiple flows. For + // example: "I disagree with the issue" + Label string `json:"label,omitempty"` + // ForceSendFields is a list of field names (e.g. "DialogButtonLabel") 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. "DialogButtonLabel") 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 ActionFlow) MarshalJSON() ([]byte, error) { + type NoMethod ActionFlow + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// ActionInput: Input provided by the business. +type ActionInput struct { + // ActionFlowId: Required. Id of the selected action flow. + ActionFlowId string `json:"actionFlowId,omitempty"` + // InputValues: Required. Values for input fields. + InputValues []*InputValue `json:"inputValues,omitempty"` + // ForceSendFields is a list of field names (e.g. "ActionFlowId") 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. "ActionFlowId") 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 ActionInput) MarshalJSON() ([]byte, error) { + type NoMethod ActionInput + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// AdditionalContent: Long text from external source. +type AdditionalContent struct { + // Paragraphs: Long text organized into paragraphs. + Paragraphs []string `json:"paragraphs,omitempty"` + // Title: Title of the additional content; + Title string `json:"title,omitempty"` + // ForceSendFields is a list of field names (e.g. "Paragraphs") 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. "Paragraphs") 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 AdditionalContent) MarshalJSON() ([]byte, error) { + type NoMethod AdditionalContent + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// AggregateProductStatus: Aggregate product statuses for a given reporting +// context and country. +type AggregateProductStatus struct { + // Country: The country of the aggregate product statuses. Represented as a + // CLDR territory code + // (https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml). + Country string `json:"country,omitempty"` + // ItemLevelIssues: The product issues that affect the given reporting context + // and country. + ItemLevelIssues []*ItemLevelIssue `json:"itemLevelIssues,omitempty"` + // Name: Identifier. The name of the `AggregateProductStatuses` resource. + // Format: + // `accounts/{account}/aggregateProductStatuses/{aggregateProductStatuses}` + Name string `json:"name,omitempty"` + // ReportingContext: The reporting context of the aggregate product statuses. + // + // 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_AFFILIATE" - [Youtube + // Affiliate](https://support.google.com/youtube/answer/13376398). + // "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). + // "PRODUCT_REVIEWS" - [Product + // Reviews](https://support.google.com/merchants/answer/14620732). + // "MERCHANT_REVIEWS" - [Merchant + // Reviews](https://developers.google.com/merchant-review-feeds). + // "YOUTUBE_CHECKOUT" - YouTube Checkout . + ReportingContext string `json:"reportingContext,omitempty"` + // Stats: Products statistics for the given reporting context and country. + Stats *Stats `json:"stats,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 AggregateProductStatus) MarshalJSON() ([]byte, error) { + type NoMethod AggregateProductStatus + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// Breakdown: A detailed impact breakdown for a group of regions where the +// impact of the issue on different shopping destinations is the same. +type Breakdown struct { + // Details: Human readable, localized description of issue's effect on + // different targets. Should be rendered as a list. For example: * "Products + // not showing in ads" * "Products not showing organically" + Details []string `json:"details,omitempty"` + // Regions: Lists of regions. Should be rendered as a title for this group of + // details. The full list should be shown to the business. If the list is too + // long, it is recommended to make it expandable. + Regions []*Region `json:"regions,omitempty"` + // ForceSendFields is a list of field names (e.g. "Details") 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. "Details") 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 Breakdown) MarshalJSON() ([]byte, error) { + type NoMethod Breakdown + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// BuiltInSimpleAction: Action that is implemented and performed in (your) +// third-party application. Represents various functionality that is expected +// to be available to business and will help them with resolving the issue. The +// application should point the business to the place, where they can access +// the corresponding functionality. If the functionality is not supported, it +// is recommended to explain the situation to the business and provide them +// with instructions how to solve the issue. +type BuiltInSimpleAction struct { + // AdditionalContent: Long text from an external source that should be + // available to the business. Present when the type is + // `SHOW_ADDITIONAL_CONTENT`. + AdditionalContent *AdditionalContent `json:"additionalContent,omitempty"` + // AttributeCode: The attribute that needs to be updated. Present when the type + // is `EDIT_ITEM_ATTRIBUTE`. This field contains a code for attribute, + // represented in snake_case. You can find a list of product's attributes, with + // their codes here (https://support.google.com/merchants/answer/7052112). + AttributeCode string `json:"attributeCode,omitempty"` + // Type: The type of action that represents a functionality that is expected to + // be available in third-party application. + // + // Possible values: + // "BUILT_IN_SIMPLE_ACTION_TYPE_UNSPECIFIED" - Default value. Will never be + // provided by the API. + // "VERIFY_PHONE" - Redirect the business to the part of your application + // where they can verify their phone. + // "CLAIM_WEBSITE" - Redirect the business to the part of your application + // where they can claim their website. + // "ADD_PRODUCTS" - Redirect the business to the part of your application + // where they can add products. + // "ADD_CONTACT_INFO" - Open a form where the business can edit their contact + // information. + // "LINK_ADS_ACCOUNT" - Redirect the business to the part of your application + // where they can link ads account. + // "ADD_BUSINESS_REGISTRATION_NUMBER" - Open a form where the business can + // add their business registration number. + // "EDIT_ITEM_ATTRIBUTE" - Open a form where the business can edit an + // attribute. The attribute that needs to be updated is specified in + // attribute_code field of the action. + // "FIX_ACCOUNT_ISSUE" - Redirect the business from the product issues to the + // diagnostic page with their account issues in your application. This action + // will be returned only for product issues that are caused by an account issue + // and thus the business should resolve the problem on the account level. + // "SHOW_ADDITIONAL_CONTENT" - Show additional content to the business. This + // action will be used for example to deliver a justification from national + // authority. + Type string `json:"type,omitempty"` + // ForceSendFields is a list of field names (e.g. "AdditionalContent") 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. "AdditionalContent") 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 BuiltInSimpleAction) MarshalJSON() ([]byte, error) { + type NoMethod BuiltInSimpleAction + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// BuiltInUserInputAction: Action that is implemented and performed in (your) +// third-party application. The application needs to show an additional content +// and input form to the business. They can start the action only when they +// provided all required inputs. The application will request processing of the +// action by calling the triggeraction method +// (https://developers.google.com/merchant/api/reference/rest/issueresolution_v1beta/issueresolution/triggeraction). +type BuiltInUserInputAction struct { + // ActionContext: Contains the action's context that must be included as part + // of the TriggerActionPayload.action_context in TriggerActionRequest.payload + // to call the `triggeraction` method. The content should be treated as opaque + // and must not be modified. + ActionContext string `json:"actionContext,omitempty"` + // Flows: Actions may provide multiple different flows. Business selects one + // that fits best to their intent. Selecting the flow is the first step in + // user's interaction with the action. It affects what input fields will be + // available and required and also how the request will be processed. + Flows []*ActionFlow `json:"flows,omitempty"` + // ForceSendFields is a list of field names (e.g. "ActionContext") 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. "ActionContext") 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 BuiltInUserInputAction) MarshalJSON() ([]byte, error) { + type NoMethod BuiltInUserInputAction + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// Callout: An important message that should be highlighted. Usually displayed +// as a banner. +type Callout struct { + // FullMessage: A full message that needs to be shown to the business. + FullMessage *TextWithTooltip `json:"fullMessage,omitempty"` + // StyleHint: Can be used to render messages with different severity in + // different styles. Snippets off all types contain important information that + // should be displayed to the business. + // + // Possible values: + // "CALLOUT_STYLE_HINT_UNSPECIFIED" - Default value. Will never be provided + // by the API. + // "ERROR" - The most important type of information highlighting problems, + // like an unsuccessful outcome of previously requested actions. + // "WARNING" - Information warning about pending problems, risks or + // deadlines. + // "INFO" - Default severity for important information like pending status of + // previously requested action or cooldown for re-review. + StyleHint string `json:"styleHint,omitempty"` + // ForceSendFields is a list of field names (e.g. "FullMessage") 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. "FullMessage") 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 Callout) MarshalJSON() ([]byte, error) { + type NoMethod Callout + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// CheckboxInput: Checkbox input allows the business to provide a boolean +// value. Corresponds to the html input type=checkbox +// (https://www.w3.org/TR/2012/WD-html-markup-20121025/input.checkbox.html#input.checkbox). +// If the business checks the box, the input value for the field is `true`, +// otherwise it is `false`. This type of input is often used as a confirmation +// that the business completed required steps before they are allowed to start +// the action. In such a case, the input field is marked as required and the +// button to trigger the action should stay disabled until the business checks +// the box. +type CheckboxInput struct { +} + +// CheckboxInputValue: Value for checkbox input field. +type CheckboxInputValue struct { + // Value: Required. True if the business checked the box field. False + // otherwise. + Value bool `json:"value,omitempty"` + // ForceSendFields is a list of field names (e.g. "Value") 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. "Value") 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 CheckboxInputValue) MarshalJSON() ([]byte, error) { + type NoMethod CheckboxInputValue + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// ChoiceInput: Choice input allows the business to select one of the offered +// choices. Some choices may be linked to additional input fields that should +// be displayed under or next to the choice option. The value for the +// additional input field needs to be provided only when the specific choice is +// selected by the the business. For example, additional input field can be +// hidden or disabled until the business selects the specific choice. +type ChoiceInput struct { + // Options: A list of choices. Only one option can be selected. + Options []*ChoiceInputOption `json:"options,omitempty"` + // ForceSendFields is a list of field names (e.g. "Options") 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. "Options") 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 ChoiceInput) MarshalJSON() ([]byte, error) { + type NoMethod ChoiceInput + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// ChoiceInputOption: A choice that the business can select. +type ChoiceInputOption struct { + // AdditionalInput: Input that should be displayed when this option is + // selected. The additional input will not contain a `ChoiceInput`. + AdditionalInput *InputField `json:"additionalInput,omitempty"` + // Id: Not for display but need to be sent back for the selected choice option. + Id string `json:"id,omitempty"` + // Label: Short description of the choice option. There may be more information + // to be shown as a tooltip. + Label *TextWithTooltip `json:"label,omitempty"` + // ForceSendFields is a list of field names (e.g. "AdditionalInput") 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. "AdditionalInput") 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 ChoiceInputOption) MarshalJSON() ([]byte, error) { + type NoMethod ChoiceInputOption + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// ChoiceInputValue: Value for choice input field. +type ChoiceInputValue struct { + // ChoiceInputOptionId: Required. Id of the option that was selected by the + // business. + ChoiceInputOptionId string `json:"choiceInputOptionId,omitempty"` + // ForceSendFields is a list of field names (e.g. "ChoiceInputOptionId") 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. "ChoiceInputOptionId") 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 ChoiceInputValue) MarshalJSON() ([]byte, error) { + type NoMethod ChoiceInputValue + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// ExternalAction: Action that is implemented and performed outside of the +// third-party application. It should redirect the business to the provided URL +// of an external system where they can perform the action. For example to +// request a review in the Merchant Center. +type ExternalAction struct { + // Type: The type of external action. + // + // Possible values: + // "EXTERNAL_ACTION_TYPE_UNSPECIFIED" - Default value. Will never be provided + // by the API. + // "REVIEW_PRODUCT_ISSUE_IN_MERCHANT_CENTER" - Redirect to Merchant Center + // where the business can request a review for issue related to their product. + // "REVIEW_ACCOUNT_ISSUE_IN_MERCHANT_CENTER" - Redirect to Merchant Center + // where the business can request a review for issue related to their account. + // "LEGAL_APPEAL_IN_HELP_CENTER" - Redirect to the form in Help Center where + // the business can request a legal appeal for the issue. + // "VERIFY_IDENTITY_IN_MERCHANT_CENTER" - Redirect to Merchant Center where + // the business can perform identity verification. + Type string `json:"type,omitempty"` + // Uri: URL to external system, for example Merchant Center, where the business + // can perform the action. + Uri string `json:"uri,omitempty"` + // ForceSendFields is a list of field names (e.g. "Type") 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. "Type") 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 ExternalAction) MarshalJSON() ([]byte, error) { + type NoMethod ExternalAction + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// Impact: Overall impact of the issue. +type Impact struct { + // Breakdowns: Detailed impact breakdown. Explains the types of restriction the + // issue has in different shopping destinations and territory. If present, it + // should be rendered to the business. Can be shown as a mouse over dropdown or + // a dialog. Each breakdown item represents a group of regions with the same + // impact details. + Breakdowns []*Breakdown `json:"breakdowns,omitempty"` + // Message: Optional. Message summarizing the overall impact of the issue. If + // present, it should be rendered to the business. For example: "Disapproves + // 90k offers in 25 countries" + Message string `json:"message,omitempty"` + // Severity: The severity of the issue. + // + // Possible values: + // "SEVERITY_UNSPECIFIED" - Default value. Will never be provided by the API. + // "ERROR" - Causes either an account suspension or an item disapproval. + // Errors should be resolved as soon as possible to ensure items are eligible + // to appear in results again. + // "WARNING" - Warnings can negatively impact the performance of ads and can + // lead to item or account suspensions in the future unless the issue is + // resolved. + // "INFO" - Infos are suggested optimizations to increase data quality. + // Resolving these issues is recommended, but not required. + Severity string `json:"severity,omitempty"` + // ForceSendFields is a list of field names (e.g. "Breakdowns") 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. "Breakdowns") 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) +} + +// InputField: Input field that needs to be available to the business. If the +// field is marked as required, then a value needs to be provided for a +// successful processing of the request. +type InputField struct { + // CheckboxInput: Input field to provide a boolean value. Corresponds to the + // html input type=checkbox + // (https://www.w3.org/TR/2012/WD-html-markup-20121025/input.checkbox.html#input.checkbox). + CheckboxInput *CheckboxInput `json:"checkboxInput,omitempty"` + // ChoiceInput: Input field to select one of the offered choices. Corresponds + // to the html input type=radio + // (https://www.w3.org/TR/2012/WD-html-markup-20121025/input.radio.html#input.radio). + ChoiceInput *ChoiceInput `json:"choiceInput,omitempty"` + // Id: Not for display but need to be sent back for the given input field. + Id string `json:"id,omitempty"` + // Label: Input field label. There may be more information to be shown in a + // tooltip. + Label *TextWithTooltip `json:"label,omitempty"` + // Required: Whether the field is required. The action button needs to stay + // disabled till values for all required fields are provided. + Required bool `json:"required,omitempty"` + // TextInput: Input field to provide text information. Corresponds to the html + // input type=text + // (https://www.w3.org/TR/2012/WD-html-markup-20121025/input.text.html#input.text) + // or html textarea + // (https://www.w3.org/TR/2012/WD-html-markup-20121025/textarea.html#textarea). + TextInput *TextInput `json:"textInput,omitempty"` + // ForceSendFields is a list of field names (e.g. "CheckboxInput") 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. "CheckboxInput") 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 InputField) MarshalJSON() ([]byte, error) { + type NoMethod InputField + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// InputValue: Input provided by the business for input field. +type InputValue struct { + // CheckboxInputValue: Value for checkbox input field. + CheckboxInputValue *CheckboxInputValue `json:"checkboxInputValue,omitempty"` + // ChoiceInputValue: Value for choice input field. + ChoiceInputValue *ChoiceInputValue `json:"choiceInputValue,omitempty"` + // InputFieldId: Required. Id of the corresponding input field. + InputFieldId string `json:"inputFieldId,omitempty"` + // TextInputValue: Value for text input field. + TextInputValue *TextInputValue `json:"textInputValue,omitempty"` + // ForceSendFields is a list of field names (e.g. "CheckboxInputValue") 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. "CheckboxInputValue") 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 InputValue) MarshalJSON() ([]byte, error) { + type NoMethod InputValue + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// ItemLevelIssue: The ItemLevelIssue of the product status. +type ItemLevelIssue struct { + // 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"` + // DocumentationUri: The URL of a web page to help with resolving this issue. + DocumentationUri string `json:"documentationUri,omitempty"` + // ProductCount: The number of products affected by this issue. + ProductCount int64 `json:"productCount,omitempty,string"` + // Resolution: Whether the issue can be resolved by the merchant. + // + // Possible values: + // "RESOLUTION_UNSPECIFIED" - Not specified. + // "MERCHANT_ACTION" - The issue can be resolved by the merchant. + // "PENDING_PROCESSING" - The issue will be resolved auomatically. + 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. "Attribute") 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. "Attribute") 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) +} + +// ListAggregateProductStatusesResponse: Response message for the +// `ListAggregateProductStatuses` method. +type ListAggregateProductStatusesResponse struct { + // AggregateProductStatuses: The `AggregateProductStatuses` resources for the + // given account. + AggregateProductStatuses []*AggregateProductStatus `json:"aggregateProductStatuses,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. "AggregateProductStatuses") + // 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. "AggregateProductStatuses") 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 ListAggregateProductStatusesResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListAggregateProductStatusesResponse + 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. If empty, it + // means that the product was deleted. Will have one of these values : + // (`approved`, `pending`, `disapproved`, ``) + NewValue string `json:"newValue,omitempty"` + // OldValue: The old value of the changed resource or attribute. If empty, it + // means that the product was created. Will have one of these values : + // (`approved`, `pending`, `disapproved`, ``) + OldValue string `json:"oldValue,omitempty"` + // RegionCode: Countries that have the change (if applicable). Represented in + // the ISO 3166 format. + RegionCode string `json:"regionCode,omitempty"` + // ReportingContext: Reporting contexts that have the change (if applicable). + // Currently this field supports only (`SHOPPING_ADS`, `LOCAL_INVENTORY_ADS`, + // `YOUTUBE_SHOPPING`, `YOUTUBE_CHECKOUT`, `YOUTUBE_AFFILIATE`) from the enum + // value ReportingContextEnum + // (/merchant/api/reference/rest/Shared.Types/ReportingContextEnum) + // + // 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_AFFILIATE" - [Youtube + // Affiliate](https://support.google.com/youtube/answer/13376398). + // "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). + // "PRODUCT_REVIEWS" - [Product + // Reviews](https://support.google.com/merchants/answer/14620732). + // "MERCHANT_REVIEWS" - [Merchant + // Reviews](https://developers.google.com/merchant-review-feeds). + // "YOUTUBE_CHECKOUT" - YouTube Checkout . + 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"` + // EventTime: The time at which the event was generated. If you want to order + // the notification messages you receive you should rely on this field not on + // the order of receiving the notifications. + EventTime string `json:"eventTime,omitempty"` + // ExpirationTime: Optional. The product expiration time. This field will not + // be set if the notification is sent for a product deletion event. + ExpirationTime string `json:"expirationTime,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: `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) +} + +// Reason: A single reason why the action is not available. +type Reason struct { + // Action: Optional. An action that needs to be performed to solve the problem + // represented by this reason. This action will always be available. Should be + // rendered as a link or button next to the summarizing message. For example, + // the review may be available only once the business configure all required + // attributes. In such a situation this action can be a link to the form, where + // they can fill the missing attribute to unblock the main action. + Action *Action `json:"action,omitempty"` + // Detail: Detailed explanation of the reason. Should be displayed as a hint if + // present. + Detail string `json:"detail,omitempty"` + // Message: Messages summarizing the reason, why the action is not available. + // For example: "Review requested on Jan 03. Review requests can take a few + // days to complete." + Message string `json:"message,omitempty"` + // ForceSendFields is a list of field names (e.g. "Action") 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. "Action") 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 Reason) MarshalJSON() ([]byte, error) { + type NoMethod Reason + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// Region: Region with code and localized name. +type Region struct { + // Code: The [CLDR territory code] + // (http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) + Code string `json:"code,omitempty"` + // Name: The localized name of the region. For region with code='001' the value + // is 'All countries' or the equivalent in other languages. + Name string `json:"name,omitempty"` + // ForceSendFields is a list of field names (e.g. "Code") 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. "Code") 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) +} + +// RenderAccountIssuesResponse: Response containing an issue resolution content +// and actions for listed account issues. +type RenderAccountIssuesResponse struct { + // RenderedIssues: List of account issues for a given account. This list can be + // shown with compressed, expandable items. In the compressed form, the title + // and impact should be shown for each issue. Once the issue is expanded, the + // detailed content and available actions should be rendered. + RenderedIssues []*RenderedIssue `json:"renderedIssues,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "RenderedIssues") 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. "RenderedIssues") 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 RenderAccountIssuesResponse) MarshalJSON() ([]byte, error) { + type NoMethod RenderAccountIssuesResponse + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// RenderIssuesRequestPayload: The payload for configuring how the content +// should be rendered. +type RenderIssuesRequestPayload struct { + // ContentOption: Optional. How the detailed content should be returned. + // Default option is to return the content as a pre-rendered HTML text. + // + // Possible values: + // "CONTENT_OPTION_UNSPECIFIED" - Default value. Will never be provided by + // the API. + // "PRE_RENDERED_HTML" - Returns the detail of the issue as a pre-rendered + // HTML text. + ContentOption string `json:"contentOption,omitempty"` + // UserInputActionOption: Optional. How actions with user input form should be + // handled. If not provided, actions will be returned as links that points the + // business to Merchant Center where they can request the action. + // + // Possible values: + // "USER_INPUT_ACTION_RENDERING_OPTION_UNSPECIFIED" - Default value. Will + // never be provided by the API. + // "REDIRECT_TO_MERCHANT_CENTER" - Actions that require user input are + // represented only as links that points the business to Merchant Center where + // they can request the action. Provides easier to implement alternative to + // `BUILT_IN_USER_INPUT_ACTIONS`. + // "BUILT_IN_USER_INPUT_ACTIONS" - Returns content and input form definition + // for each complex action. Your application needs to display this content and + // input form to the business before they can request processing of the action. + // To start the action, your application needs to call the `triggeraction` + // method. + UserInputActionOption string `json:"userInputActionOption,omitempty"` + // ForceSendFields is a list of field names (e.g. "ContentOption") 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. "ContentOption") 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 RenderIssuesRequestPayload) MarshalJSON() ([]byte, error) { + type NoMethod RenderIssuesRequestPayload + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// RenderProductIssuesResponse: Response containing an issue resolution content +// and actions for listed product issues. +type RenderProductIssuesResponse struct { + // RenderedIssues: List of issues for a given product. This list can be shown + // with compressed, expandable items. In the compressed form, the title and + // impact should be shown for each issue. Once the issue is expanded, the + // detailed content and available actions should be rendered. + RenderedIssues []*RenderedIssue `json:"renderedIssues,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "RenderedIssues") 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. "RenderedIssues") 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 RenderProductIssuesResponse) MarshalJSON() ([]byte, error) { + type NoMethod RenderProductIssuesResponse + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// RenderedIssue: An issue affecting specific business or their product. +type RenderedIssue struct { + // Actions: A list of actionable steps that can be executed to solve the issue. + // An example is requesting a re-review or providing arguments when business + // disagrees with the issue. Actions that are supported in (your) third-party + // application can be rendered as buttons and should be available to the + // business when they expand the issue. + Actions []*Action `json:"actions,omitempty"` + // Impact: Clarifies the severity of the issue. The summarizing message, if + // present, should be shown right under the title for each issue. It helps + // business to quickly understand the impact of the issue. The detailed + // breakdown helps the business to fully understand the impact of the issue. It + // can be rendered as dialog that opens when the business mouse over the + // summarized impact statement. Issues with different severity can be styled + // differently. They may use a different color or icon to signal the difference + // between `ERROR`, `WARNING` and `INFO`. + Impact *Impact `json:"impact,omitempty"` + // PrerenderedContent: Details of the issue as a pre-rendered HTML. HTML + // elements contain CSS classes that can be used to customize the style of the + // content. Always sanitize the HTML before embedding it directly to your + // application. The sanitizer needs to allow basic HTML tags, such as: `div`, + // `span`, `p`, `a`, `ul`, `li`, `table`, `tr`, `td`. For example, you can use + // DOMPurify (https://www.npmjs.com/package/dompurify). CSS classes: * + // `issue-detail` - top level container for the detail of the issue * + // `callout-banners` - section of the `issue-detail` with callout banners * + // `callout-banner` - single callout banner, inside `callout-banners` * + // `callout-banner-info` - callout with important information (default) * + // `callout-banner-warning` - callout with a warning * `callout-banner-error` - + // callout informing about an error (most severe) * `issue-content` - section + // of the `issue-detail`, contains multiple `content-element` * + // `content-element` - content element such as a list, link or paragraph, + // inside `issue-content` * `root-causes` - unordered list with items + // describing root causes of the issue, inside `issue-content` * + // `root-causes-intro` - intro text before the `root-causes` list, inside + // `issue-content` * `segment` - section of the text, `span` inside paragraph * + // `segment-attribute` - section of the text that represents a product + // attribute, for example 'image\_link' * `segment-literal` - section of the + // text that contains a special value, for example '0-1000 kg' * `segment-bold` + // - section of the text that should be rendered as bold * `segment-italic` - + // section of the text that should be rendered as italic * `tooltip` - used on + // paragraphs that should be rendered with a tooltip. A section of the text in + // such a paragraph will have a class `tooltip-text` and is intended to be + // shown in a mouse over dialog. If the style is not used, the `tooltip-text` + // section would be shown on a new line, after the main part of the text. * + // `tooltip-text` - marks a section of the text within a `tooltip`, that is + // intended to be shown in a mouse over dialog. * `tooltip-icon` - marks a + // section of the text within a `tooltip`, that can be replaced with a tooltip + // icon, for example '?' or 'i'. By default, this section contains a `br` tag, + // that is separating the main text and the tooltip text when the style is not + // used. * `tooltip-style-question` - the tooltip shows helpful information, + // can use the '?' as an icon. * `tooltip-style-info` - the tooltip adds + // additional information fitting to the context, can use the 'i' as an icon. * + // `content-moderation` - marks the paragraph that explains how the issue was + // identified. * `new-element` - Present for new elements added to the + // pre-rendered content in the future. To make sure that a new content element + // does not break your style, you can hide everything with this class. + PrerenderedContent string `json:"prerenderedContent,omitempty"` + // PrerenderedOutOfCourtDisputeSettlement: Pre-rendered HTML that contains a + // link to the external location where the ODS can be requested and + // instructions for how to request it. HTML elements contain CSS classes that + // can be used to customize the style of this snippet. Always sanitize the HTML + // before embedding it directly to your application. The sanitizer needs to + // allow basic HTML tags, such as: `div`, `span`, `p`, `a`, `ul`, `li`, + // `table`, `tr`, `td`. For example, you can use DOMPurify + // (https://www.npmjs.com/package/dompurify). CSS classes: * `ods-section`* - + // wrapper around the out-of-court dispute resolution section * + // `ods-description`* - intro text for the out-of-court dispute resolution. It + // may contain multiple segments and a link. * `ods-param`* - wrapper around + // the header-value pair for parameters that the business may need to provide + // during the ODS process. * `ods-routing-id`* - ods param for the Routing ID. + // * `ods-reference-id`* - ods param for the Routing ID. * `ods-param-header`* + // - header for the ODS parameter * `ods-param-value`* - value of the ODS + // parameter. This value should be rendered in a way that it is easy for the + // user to identify and copy. * `segment` - section of the text, `span` inside + // paragraph * `segment-attribute` - section of the text that represents a + // product attribute, for example 'image\_link' * `segment-literal` - section + // of the text that contains a special value, for example '0-1000 kg' * + // `segment-bold` - section of the text that should be rendered as bold * + // `segment-italic` - section of the text that should be rendered as italic * + // `tooltip` - used on paragraphs that should be rendered with a tooltip. A + // section of the text in such a paragraph will have a class `tooltip-text` and + // is intended to be shown in a mouse over dialog. If the style is not used, + // the `tooltip-text` section would be shown on a new line, after the main part + // of the text. * `tooltip-text` - marks a section of the text within a + // `tooltip`, that is intended to be shown in a mouse over dialog. * + // `tooltip-icon` - marks a section of the text within a `tooltip`, that can be + // replaced with a tooltip icon, for example '?' or 'i'. By default, this + // section contains a `br` tag, that is separating the main text and the + // tooltip text when the style is not used. * `tooltip-style-question` - the + // tooltip shows helpful information, can use the '?' as an icon. * + // `tooltip-style-info` - the tooltip adds additional information fitting to + // the context, can use the 'i' as an icon. + PrerenderedOutOfCourtDisputeSettlement string `json:"prerenderedOutOfCourtDisputeSettlement,omitempty"` + // Title: Title of the issue. + Title string `json:"title,omitempty"` + // ForceSendFields is a list of field names (e.g. "Actions") 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. "Actions") 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 RenderedIssue) MarshalJSON() ([]byte, error) { + type NoMethod RenderedIssue + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// Stats: Products statistics. +type Stats struct { + // ActiveCount: The number of products that are active. + ActiveCount int64 `json:"activeCount,omitempty,string"` + // DisapprovedCount: The number of products that are disapproved. + DisapprovedCount int64 `json:"disapprovedCount,omitempty,string"` + // ExpiringCount: The number of products that are expiring. + ExpiringCount int64 `json:"expiringCount,omitempty,string"` + // PendingCount: The number of products that are pending. + PendingCount int64 `json:"pendingCount,omitempty,string"` + // ForceSendFields is a list of field names (e.g. "ActiveCount") 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. "ActiveCount") 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 Stats) MarshalJSON() ([]byte, error) { + type NoMethod Stats + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// TextInput: Text input allows the business to provide a text value. +type TextInput struct { + // AdditionalInfo: Additional info regarding the field to be displayed to the + // business. For example, warning to not include personal identifiable + // information. There may be more information to be shown in a tooltip. + AdditionalInfo *TextWithTooltip `json:"additionalInfo,omitempty"` + // AriaLabel: Text to be used as the aria-label + // (https://www.w3.org/TR/WCAG20-TECHS/ARIA14.html) for the input. + AriaLabel string `json:"ariaLabel,omitempty"` + // FormatInfo: Information about the required format. If present, it should be + // shown close to the input field to help the business to provide a correct + // value. For example: "VAT numbers should be in a format similar to + // SK9999999999" + FormatInfo string `json:"formatInfo,omitempty"` + // Type: Type of the text input + // + // Possible values: + // "TEXT_INPUT_TYPE_UNSPECIFIED" - Default value. Will never be provided by + // the API. + // "GENERIC_SHORT_TEXT" - Used when a short text is expected. The field can + // be rendered as a [text + // field](https://www.w3.org/TR/2012/WD-html-markup-20121025/input.text.html#inp + // ut.text). + // "GENERIC_LONG_TEXT" - Used when a longer text is expected. The field + // should be rendered as a + // [textarea](https://www.w3.org/TR/2012/WD-html-markup-20121025/textarea.html#t + // extarea). + Type string `json:"type,omitempty"` + // ForceSendFields is a list of field names (e.g. "AdditionalInfo") 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. "AdditionalInfo") 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 TextInput) MarshalJSON() ([]byte, error) { + type NoMethod TextInput + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// TextInputValue: Value for text input field. +type TextInputValue struct { + // Value: Required. Text provided by the business. + Value string `json:"value,omitempty"` + // ForceSendFields is a list of field names (e.g. "Value") 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. "Value") 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 TextInputValue) MarshalJSON() ([]byte, error) { + type NoMethod TextInputValue + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// TextWithTooltip: Block of text that may contain a tooltip with more +// information. +type TextWithTooltip struct { + // SimpleTooltipValue: Value of the tooltip as a simple text. + SimpleTooltipValue string `json:"simpleTooltipValue,omitempty"` + // SimpleValue: Value of the message as a simple text. + SimpleValue string `json:"simpleValue,omitempty"` + // TooltipIconStyle: The suggested type of an icon for tooltip, if a tooltip is + // present. + // + // Possible values: + // "TOOLTIP_ICON_STYLE_UNSPECIFIED" - Default value. Will never be provided + // by the API. + // "INFO" - Used when the tooltip adds additional information to the context, + // the 'i' can be used as an icon. + // "QUESTION" - Used when the tooltip shows helpful information, the '?' can + // be used as an icon. + TooltipIconStyle string `json:"tooltipIconStyle,omitempty"` + // ForceSendFields is a list of field names (e.g. "SimpleTooltipValue") 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. "SimpleTooltipValue") 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 TextWithTooltip) MarshalJSON() ([]byte, error) { + type NoMethod TextWithTooltip + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// TriggerActionPayload: The payload for the triggered action. +type TriggerActionPayload struct { + // ActionContext: Required. The context from the selected action. The value is + // obtained from rendered issues and needs to be sent back to identify the + // action that is being triggered. + ActionContext string `json:"actionContext,omitempty"` + // ActionInput: Required. Input provided by the business. + ActionInput *ActionInput `json:"actionInput,omitempty"` + // ForceSendFields is a list of field names (e.g. "ActionContext") 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. "ActionContext") 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 TriggerActionPayload) MarshalJSON() ([]byte, error) { + type NoMethod TriggerActionPayload + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// TriggerActionResponse: Response informing about the started action. +type TriggerActionResponse struct { + // Message: The message for the business. + Message string `json:"message,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "Message") 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. "Message") 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 TriggerActionResponse) MarshalJSON() ([]byte, error) { + type NoMethod TriggerActionResponse + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +type AccountsAggregateProductStatusesListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists the `AggregateProductStatuses` resources for 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. +// +// - parent: The account to list aggregate product statuses for. Format: +// `accounts/{account}`. +func (r *AccountsAggregateProductStatusesService) List(parent string) *AccountsAggregateProductStatusesListCall { + c := &AccountsAggregateProductStatusesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Filter sets the optional parameter "filter": A filter expression that +// filters the aggregate product statuses. Filtering is only supported by the +// `reporting_context` and `country` field. For example: `reporting_context = +// "SHOPPING_ADS" AND country = "US". +func (c *AccountsAggregateProductStatusesListCall) Filter(filter string) *AccountsAggregateProductStatusesListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number of +// aggregate product statuses to return. The service may return fewer than this +// value. If unspecified, at most 25 aggregate product statuses are returned. +// The maximum value is 250; values above 250 are coerced to 250. +func (c *AccountsAggregateProductStatusesListCall) PageSize(pageSize int64) *AccountsAggregateProductStatusesListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": A page token, received +// from a previous `ListAggregateProductStatuses` call. Provide this to +// retrieve the subsequent page. When paginating, all other parameters provided +// to `ListAggregateProductStatuses` must match the call that provided the page +// token. +func (c *AccountsAggregateProductStatusesListCall) PageToken(pageToken string) *AccountsAggregateProductStatusesListCall { + 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 *AccountsAggregateProductStatusesListCall) Fields(s ...googleapi.Field) *AccountsAggregateProductStatusesListCall { + 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 *AccountsAggregateProductStatusesListCall) IfNoneMatch(entityTag string) *AccountsAggregateProductStatusesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsAggregateProductStatusesListCall) Context(ctx context.Context) *AccountsAggregateProductStatusesListCall { + 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 *AccountsAggregateProductStatusesListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsAggregateProductStatusesListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "issueresolution/v1/{+parent}/aggregateProductStatuses") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.aggregateProductStatuses.list", "request", internallog.HTTPRequest(req, nil)) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.aggregateProductStatuses.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *ListAggregateProductStatusesResponse.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 *AccountsAggregateProductStatusesListCall) Do(opts ...googleapi.CallOption) (*ListAggregateProductStatusesResponse, 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 := &ListAggregateProductStatusesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.aggregateProductStatuses.list", "response", internallog.HTTPResponse(res, b)) + 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 *AccountsAggregateProductStatusesListCall) Pages(ctx context.Context, f func(*ListAggregateProductStatusesResponse) 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 IssueresolutionRenderaccountissuesCall struct { + s *Service + name string + renderissuesrequestpayload *RenderIssuesRequestPayload + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Renderaccountissues: Provide a list of business's account issues with an +// issue resolution content and available actions. This content and actions are +// meant to be rendered and shown in third-party applications. +// +// - name: The account to fetch issues for. Format: `accounts/{account}`. +func (r *IssueresolutionService) Renderaccountissues(name string, renderissuesrequestpayload *RenderIssuesRequestPayload) *IssueresolutionRenderaccountissuesCall { + c := &IssueresolutionRenderaccountissuesCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.renderissuesrequestpayload = renderissuesrequestpayload + return c +} + +// LanguageCode sets the optional parameter "languageCode": The IETF BCP-47 +// (https://tools.ietf.org/html/bcp47) language code used to localize issue +// resolution content. If not set, the result will be in default language +// `en-US`. +func (c *IssueresolutionRenderaccountissuesCall) LanguageCode(languageCode string) *IssueresolutionRenderaccountissuesCall { + c.urlParams_.Set("languageCode", languageCode) + return c +} + +// TimeZone sets the optional parameter "timeZone": The IANA +// (https://www.iana.org/time-zones) timezone used to localize times in an +// issue resolution content. For example 'America/Los_Angeles'. If not set, +// results will use as a default UTC. +func (c *IssueresolutionRenderaccountissuesCall) TimeZone(timeZone string) *IssueresolutionRenderaccountissuesCall { + c.urlParams_.Set("timeZone", timeZone) + 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 *IssueresolutionRenderaccountissuesCall) Fields(s ...googleapi.Field) *IssueresolutionRenderaccountissuesCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *IssueresolutionRenderaccountissuesCall) Context(ctx context.Context) *IssueresolutionRenderaccountissuesCall { + 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 *IssueresolutionRenderaccountissuesCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *IssueresolutionRenderaccountissuesCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.renderissuesrequestpayload) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "issueresolution/v1/{+name}:renderaccountissues") + 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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.issueresolution.renderaccountissues", "request", internallog.HTTPRequest(req, body.Bytes())) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.issueresolution.renderaccountissues" call. +// Any non-2xx status code is an error. Response headers are in either +// *RenderAccountIssuesResponse.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 *IssueresolutionRenderaccountissuesCall) Do(opts ...googleapi.CallOption) (*RenderAccountIssuesResponse, 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 := &RenderAccountIssuesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.issueresolution.renderaccountissues", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type IssueresolutionRenderproductissuesCall struct { + s *Service + name string + renderissuesrequestpayload *RenderIssuesRequestPayload + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Renderproductissues: Provide a list of issues for business's product with an +// issue resolution content and available actions. This content and actions are +// meant to be rendered and shown in third-party applications. +// +// - name: The name of the product to fetch issues for. Format: +// `accounts/{account}/products/{product}`. +func (r *IssueresolutionService) Renderproductissues(name string, renderissuesrequestpayload *RenderIssuesRequestPayload) *IssueresolutionRenderproductissuesCall { + c := &IssueresolutionRenderproductissuesCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.renderissuesrequestpayload = renderissuesrequestpayload + return c +} + +// LanguageCode sets the optional parameter "languageCode": The IETF BCP-47 +// (https://tools.ietf.org/html/bcp47) language code used to localize an issue +// resolution content. If not set, the result will be in default language +// `en-US`. +func (c *IssueresolutionRenderproductissuesCall) LanguageCode(languageCode string) *IssueresolutionRenderproductissuesCall { + c.urlParams_.Set("languageCode", languageCode) + return c +} + +// TimeZone sets the optional parameter "timeZone": The IANA +// (https://www.iana.org/time-zones) timezone used to localize times in an +// issue resolution content. For example 'America/Los_Angeles'. If not set, +// results will use as a default UTC. +func (c *IssueresolutionRenderproductissuesCall) TimeZone(timeZone string) *IssueresolutionRenderproductissuesCall { + c.urlParams_.Set("timeZone", timeZone) + 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 *IssueresolutionRenderproductissuesCall) Fields(s ...googleapi.Field) *IssueresolutionRenderproductissuesCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *IssueresolutionRenderproductissuesCall) Context(ctx context.Context) *IssueresolutionRenderproductissuesCall { + 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 *IssueresolutionRenderproductissuesCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *IssueresolutionRenderproductissuesCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.renderissuesrequestpayload) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "issueresolution/v1/{+name}:renderproductissues") + 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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.issueresolution.renderproductissues", "request", internallog.HTTPRequest(req, body.Bytes())) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.issueresolution.renderproductissues" call. +// Any non-2xx status code is an error. Response headers are in either +// *RenderProductIssuesResponse.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 *IssueresolutionRenderproductissuesCall) Do(opts ...googleapi.CallOption) (*RenderProductIssuesResponse, 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 := &RenderProductIssuesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.issueresolution.renderproductissues", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type IssueresolutionTriggeractionCall struct { + s *Service + name string + triggeractionpayload *TriggerActionPayload + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Triggeraction: Start an action. The action can be requested by a business in +// third-party application. Before the business can request the action, the +// third-party application needs to show them action specific content and +// display a user input form. The action can be successfully started only once +// all `required` inputs are provided. If any `required` input is missing, or +// invalid value was provided, the service will return 400 error. Validation +// errors will contain Ids for all problematic field together with translated, +// human readable error messages that can be shown to the user. +// +// - name: The business's account that is triggering the action. Format: +// `accounts/{account}`. +func (r *IssueresolutionService) Triggeraction(name string, triggeractionpayload *TriggerActionPayload) *IssueresolutionTriggeractionCall { + c := &IssueresolutionTriggeractionCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.triggeractionpayload = triggeractionpayload + return c +} + +// LanguageCode sets the optional parameter "languageCode": Language code IETF +// BCP 47 syntax (https://tools.ietf.org/html/bcp47) used to localize the +// response. If not set, the result will be in default language `en-US`. +func (c *IssueresolutionTriggeractionCall) LanguageCode(languageCode string) *IssueresolutionTriggeractionCall { + c.urlParams_.Set("languageCode", languageCode) + 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 *IssueresolutionTriggeractionCall) Fields(s ...googleapi.Field) *IssueresolutionTriggeractionCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *IssueresolutionTriggeractionCall) Context(ctx context.Context) *IssueresolutionTriggeractionCall { + 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 *IssueresolutionTriggeractionCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *IssueresolutionTriggeractionCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.triggeractionpayload) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "issueresolution/v1/{+name}:triggeraction") + 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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.issueresolution.triggeraction", "request", internallog.HTTPRequest(req, body.Bytes())) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.issueresolution.triggeraction" call. +// Any non-2xx status code is an error. Response headers are in either +// *TriggerActionResponse.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 *IssueresolutionTriggeractionCall) Do(opts ...googleapi.CallOption) (*TriggerActionResponse, 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 := &TriggerActionResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.issueresolution.triggeraction", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} diff --git a/merchantapi/notifications/v1/merchantapi-api.json b/merchantapi/notifications/v1/merchantapi-api.json new file mode 100644 index 00000000000..c24b06d3c21 --- /dev/null +++ b/merchantapi/notifications/v1/merchantapi-api.json @@ -0,0 +1,483 @@ +{ + "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.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_v1", + "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 business. For standalone or subaccounts accounts, the business can create a subscription for self. For MCAs, the business can create a subscription for all managed accounts or for a specific subaccount. We will allow the following types of notification subscriptions to exist together (per business 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 business as a subscriber per event type): 1. Multiple self subscriptions. 2. Multiple \"all managed accounts\" subscriptions. 3. \"All managed accounts\" subscription and partial subscriptions at the same time. 4. Multiple partial subscriptions for the same target account.", + "flatPath": "notifications/v1/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/v1/{+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/v1/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/v1/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "get": { + "description": "Gets notification subscriptions for an account.", + "flatPath": "notifications/v1/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/v1/{+name}", + "response": { + "$ref": "NotificationSubscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "description": "Gets all the notification subscriptions for a merchant.", + "flatPath": "notifications/v1/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/v1/{+parent}/notificationsubscriptions", + "response": { + "$ref": "ListNotificationSubscriptionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "patch": { + "description": "Updates an existing notification subscription for a merchant.", + "flatPath": "notifications/v1/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/v1/{+name}", + "request": { + "$ref": "NotificationSubscription" + }, + "response": { + "$ref": "NotificationSubscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + } + } + } + }, + "revision": "20250804", + "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. If empty, it means that the product was deleted. Will have one of these values : (`approved`, `pending`, `disapproved`, ``)", + "type": "string" + }, + "oldValue": { + "description": "The old value of the changed resource or attribute. If empty, it means that the product was created. Will have one of these values : (`approved`, `pending`, `disapproved`, ``)", + "type": "string" + }, + "regionCode": { + "description": "Countries that have the change (if applicable). Represented in the ISO 3166 format.", + "type": "string" + }, + "reportingContext": { + "description": "Reporting contexts that have the change (if applicable). Currently this field supports only (`SHOPPING_ADS`, `LOCAL_INVENTORY_ADS`, `YOUTUBE_SHOPPING`, `YOUTUBE_CHECKOUT`, `YOUTUBE_AFFILIATE`) from the enum value [ReportingContextEnum](/merchant/api/reference/rest/Shared.Types/ReportingContextEnum)", + "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_AFFILIATE", + "YOUTUBE_SHOPPING", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL", + "PRODUCT_REVIEWS", + "MERCHANT_REVIEWS", + "YOUTUBE_CHECKOUT" + ], + "enumDeprecated": [ + false, + false, + true, + false, + false, + false, + false, + 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 Affiliate](https://support.google.com/youtube/answer/13376398).", + "[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).", + "[Product Reviews](https://support.google.com/merchants/answer/14620732).", + "[Merchant Reviews](https://developers.google.com/merchant-review-feeds).", + "YouTube Checkout ." + ], + "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" + }, + "eventTime": { + "description": "The time at which the event was generated. If you want to order the notification messages you receive you should rely on this field not on the order of receiving the notifications.", + "format": "google-datetime", + "type": "string" + }, + "expirationTime": { + "description": "Optional. The product expiration time. This field will not be set if the notification is sent for a product deletion event.", + "format": "google-datetime", + "type": "string" + }, + "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: `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_v1", + "version_module": true +} \ No newline at end of file diff --git a/merchantapi/notifications/v1/merchantapi-gen.go b/merchantapi/notifications/v1/merchantapi-gen.go new file mode 100644 index 00000000000..f79d990eaf6 --- /dev/null +++ b/merchantapi/notifications/v1/merchantapi-gen.go @@ -0,0 +1,979 @@ +// Copyright 2025 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.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/v1" +// ... +// 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/v1" + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "log/slog" + "net/http" + "net/url" + "strconv" + "strings" + + "github.com/googleapis/gax-go/v2/internallog" + 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 +var _ = internallog.New + +const apiId = "merchantapi:notifications_v1" +const apiName = "merchantapi" +const apiVersion = "notifications_v1" +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 := &Service{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)} + s.Accounts = NewAccountsService(s) + 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") + } + return NewService(context.TODO(), option.WithHTTPClient(client)) +} + +type Service struct { + client *http.Client + logger *slog.Logger + 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. If empty, it + // means that the product was deleted. Will have one of these values : + // (`approved`, `pending`, `disapproved`, ``) + NewValue string `json:"newValue,omitempty"` + // OldValue: The old value of the changed resource or attribute. If empty, it + // means that the product was created. Will have one of these values : + // (`approved`, `pending`, `disapproved`, ``) + OldValue string `json:"oldValue,omitempty"` + // RegionCode: Countries that have the change (if applicable). Represented in + // the ISO 3166 format. + RegionCode string `json:"regionCode,omitempty"` + // ReportingContext: Reporting contexts that have the change (if applicable). + // Currently this field supports only (`SHOPPING_ADS`, `LOCAL_INVENTORY_ADS`, + // `YOUTUBE_SHOPPING`, `YOUTUBE_CHECKOUT`, `YOUTUBE_AFFILIATE`) from the enum + // value ReportingContextEnum + // (/merchant/api/reference/rest/Shared.Types/ReportingContextEnum) + // + // 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_AFFILIATE" - [Youtube + // Affiliate](https://support.google.com/youtube/answer/13376398). + // "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). + // "PRODUCT_REVIEWS" - [Product + // Reviews](https://support.google.com/merchants/answer/14620732). + // "MERCHANT_REVIEWS" - [Merchant + // Reviews](https://developers.google.com/merchant-review-feeds). + // "YOUTUBE_CHECKOUT" - YouTube Checkout . + 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"` + // EventTime: The time at which the event was generated. If you want to order + // the notification messages you receive you should rely on this field not on + // the order of receiving the notifications. + EventTime string `json:"eventTime,omitempty"` + // ExpirationTime: Optional. The product expiration time. This field will not + // be set if the notification is sent for a product deletion event. + ExpirationTime string `json:"expirationTime,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: `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 business. For standalone +// or subaccounts accounts, the business can create a subscription for self. +// For MCAs, the business can create a subscription for all managed accounts or +// for a specific subaccount. We will allow the following types of notification +// subscriptions to exist together (per business 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 business as a subscriber per event type): 1. +// Multiple self subscriptions. 2. Multiple "all managed accounts" +// subscriptions. 3. "All managed accounts" subscription 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_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(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/v1/{+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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.notificationsubscriptions.create", "request", internallog.HTTPRequest(req, body.Bytes())) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.notificationsubscriptions.create", "response", internallog.HTTPResponse(res, b)) + 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_) + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "notifications/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.notificationsubscriptions.delete", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.notificationsubscriptions.delete", "response", internallog.HTTPResponse(res, b)) + 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_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "notifications/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.notificationsubscriptions.get", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.notificationsubscriptions.get", "response", internallog.HTTPResponse(res, b)) + 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_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "notifications/v1/{+parent}/notificationsubscriptions") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.notificationsubscriptions.list", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.notificationsubscriptions.list", "response", internallog.HTTPResponse(res, b)) + 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_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(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/v1/{+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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.notificationsubscriptions.patch", "request", internallog.HTTPRequest(req, body.Bytes())) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.notificationsubscriptions.patch", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} diff --git a/merchantapi/ordertracking/v1/merchantapi-api.json b/merchantapi/ordertracking/v1/merchantapi-api.json new file mode 100644 index 00000000000..8d3096c8e53 --- /dev/null +++ b/merchantapi/ordertracking/v1/merchantapi-api.json @@ -0,0 +1,566 @@ +{ + "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.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:ordertracking_v1", + "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": { + "orderTrackingSignals": { + "methods": { + "create": { + "description": "Creates new order tracking signal.", + "flatPath": "ordertracking/v1/accounts/{accountsId}/orderTrackingSignals", + "httpMethod": "POST", + "id": "merchantapi.accounts.orderTrackingSignals.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "orderTrackingSignalId": { + "description": "Output only. The ID that uniquely identifies this order tracking signal.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The account of the business for which the order signal is created. Format: accounts/{account}", + "location": "path", + "pattern": "^accounts/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "ordertracking/v1/{+parent}/orderTrackingSignals", + "request": { + "$ref": "OrderTrackingSignal" + }, + "response": { + "$ref": "OrderTrackingSignal" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + } + } + } + }, + "revision": "20250804", + "rootUrl": "https://merchantapi.googleapis.com/", + "schemas": { + "DateTime": { + "description": "Represents civil time (or occasionally physical time). This type can represent a civil time in one of a few possible ways: * When utc_offset is set and time_zone is unset: a civil time on a calendar day with a particular offset from UTC. * When time_zone is set and utc_offset is unset: a civil time on a calendar day in a particular time zone. * When neither time_zone nor utc_offset is set: a civil time on a calendar day in local time. The date is relative to the Proleptic Gregorian Calendar. If year, month, or day are 0, the DateTime is considered not to have a specific year, month, or day respectively. This type may also be used to represent a physical time if all the date and time fields are set and either case of the `time_offset` oneof is set. Consider using `Timestamp` message for physical time instead. If your use case also would like to store the user's timezone, that can be done in another field. This type is more flexible than some applications may want. Make sure to document and validate your application's limitations.", + "id": "DateTime", + "properties": { + "day": { + "description": "Optional. Day of month. Must be from 1 to 31 and valid for the year and month, or 0 if specifying a datetime without a day.", + "format": "int32", + "type": "integer" + }, + "hours": { + "description": "Optional. Hours of day in 24 hour format. Should be from 0 to 23, defaults to 0 (midnight). An API may choose to allow the value \"24:00:00\" for scenarios like business closing time.", + "format": "int32", + "type": "integer" + }, + "minutes": { + "description": "Optional. Minutes of hour of day. Must be from 0 to 59, defaults to 0.", + "format": "int32", + "type": "integer" + }, + "month": { + "description": "Optional. Month of year. Must be from 1 to 12, or 0 if specifying a datetime without a month.", + "format": "int32", + "type": "integer" + }, + "nanos": { + "description": "Optional. Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999, defaults to 0.", + "format": "int32", + "type": "integer" + }, + "seconds": { + "description": "Optional. Seconds of minutes of the time. Must normally be from 0 to 59, defaults to 0. An API may allow the value 60 if it allows leap-seconds.", + "format": "int32", + "type": "integer" + }, + "timeZone": { + "$ref": "TimeZone", + "description": "Time zone." + }, + "utcOffset": { + "description": "UTC offset. Must be whole seconds, between -18 hours and +18 hours. For example, a UTC offset of -4:00 would be represented as { seconds: -14400 }.", + "format": "google-duration", + "type": "string" + }, + "year": { + "description": "Optional. Year of date. Must be from 1 to 9999, or 0 if specifying a datetime without a year.", + "format": "int32", + "type": "integer" + } + }, + "type": "object" + }, + "LineItemDetails": { + "description": "The line items of the order.", + "id": "LineItemDetails", + "properties": { + "brand": { + "description": "Optional. Brand of the product.", + "type": "string" + }, + "gtin": { + "description": "Optional. The Global Trade Item Number.", + "type": "string" + }, + "lineItemId": { + "description": "Required. The ID for this line item.", + "type": "string" + }, + "mpn": { + "description": "Optional. The manufacturer part number.", + "type": "string" + }, + "productId": { + "description": "Required. The Content API REST ID of the product, in the form channel:contentLanguage:targetCountry:offerId.", + "type": "string" + }, + "productTitle": { + "description": "Optional. Plain text title of this product.", + "type": "string" + }, + "quantity": { + "description": "Required. The quantity of the line item in the order.", + "format": "int64", + "type": "string" + } + }, + "type": "object" + }, + "OrderTrackingSignal": { + "description": "Represents a business trade from which signals are extracted, such as shipping.", + "id": "OrderTrackingSignal", + "properties": { + "customerShippingFee": { + "$ref": "Price", + "description": "Optional. The shipping fee of the order; this value should be set to zero in the case of free shipping." + }, + "deliveryPostalCode": { + "description": "Optional. The delivery postal code, as a continuous string without spaces or dashes, for example \"95016\". This field will be anonymized in returned OrderTrackingSignal creation response.", + "type": "string" + }, + "deliveryRegionCode": { + "description": "Optional. The [CLDR territory code] (http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) for the shipping destination.", + "type": "string" + }, + "lineItems": { + "description": "Required. Information about line items in the order.", + "items": { + "$ref": "LineItemDetails" + }, + "type": "array" + }, + "merchantId": { + "description": "Optional. The Google Merchant Center ID of this order tracking signal. This value is optional. If left unset, the caller's Merchant Center ID is used. You must request access in order to provide data on behalf of another business. For more information, see [Submitting Order Tracking Signals](/shopping-content/guides/order-tracking-signals).", + "format": "int64", + "type": "string" + }, + "orderCreatedTime": { + "$ref": "DateTime", + "description": "Required. The time when the order was created on the businesses side. Include the year and timezone string, if available." + }, + "orderId": { + "description": "Required. The ID of the order on the businesses side. This field will be hashed in returned OrderTrackingSignal creation response.", + "type": "string" + }, + "orderTrackingSignalId": { + "description": "Output only. The ID that uniquely identifies this order tracking signal.", + "format": "int64", + "readOnly": true, + "type": "string" + }, + "shipmentLineItemMapping": { + "description": "Optional. The mapping of the line items to the shipment information.", + "items": { + "$ref": "ShipmentLineItemMapping" + }, + "type": "array" + }, + "shippingInfo": { + "description": "Required. The shipping information for the order.", + "items": { + "$ref": "ShippingInfo" + }, + "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. If empty, it means that the product was deleted. Will have one of these values : (`approved`, `pending`, `disapproved`, ``)", + "type": "string" + }, + "oldValue": { + "description": "The old value of the changed resource or attribute. If empty, it means that the product was created. Will have one of these values : (`approved`, `pending`, `disapproved`, ``)", + "type": "string" + }, + "regionCode": { + "description": "Countries that have the change (if applicable). Represented in the ISO 3166 format.", + "type": "string" + }, + "reportingContext": { + "description": "Reporting contexts that have the change (if applicable). Currently this field supports only (`SHOPPING_ADS`, `LOCAL_INVENTORY_ADS`, `YOUTUBE_SHOPPING`, `YOUTUBE_CHECKOUT`, `YOUTUBE_AFFILIATE`) from the enum value [ReportingContextEnum](/merchant/api/reference/rest/Shared.Types/ReportingContextEnum)", + "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_AFFILIATE", + "YOUTUBE_SHOPPING", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL", + "PRODUCT_REVIEWS", + "MERCHANT_REVIEWS", + "YOUTUBE_CHECKOUT" + ], + "enumDeprecated": [ + false, + false, + true, + false, + false, + false, + false, + 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 Affiliate](https://support.google.com/youtube/answer/13376398).", + "[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).", + "[Product Reviews](https://support.google.com/merchants/answer/14620732).", + "[Merchant Reviews](https://developers.google.com/merchant-review-feeds).", + "YouTube Checkout ." + ], + "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" + }, + "eventTime": { + "description": "The time at which the event was generated. If you want to order the notification messages you receive you should rely on this field not on the order of receiving the notifications.", + "format": "google-datetime", + "type": "string" + }, + "expirationTime": { + "description": "Optional. The product expiration time. This field will not be set if the notification is sent for a product deletion event.", + "format": "google-datetime", + "type": "string" + }, + "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: `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" + }, + "ShipmentLineItemMapping": { + "description": "Represents how many items are in the shipment for the given shipment_id and line_item_id.", + "id": "ShipmentLineItemMapping", + "properties": { + "lineItemId": { + "description": "Required. The line item ID.", + "type": "string" + }, + "quantity": { + "description": "Required. The line item quantity in the shipment.", + "format": "int64", + "type": "string" + }, + "shipmentId": { + "description": "Required. The shipment ID. This field will be hashed in returned OrderTrackingSignal creation response.", + "type": "string" + } + }, + "type": "object" + }, + "ShippingInfo": { + "description": "The shipping information for the order.", + "id": "ShippingInfo", + "properties": { + "actualDeliveryTime": { + "$ref": "DateTime", + "description": "Optional. The time when the shipment was actually delivered. Include the year and timezone string, if available. This field is required, if one of the following fields is absent: tracking_id or carrier_name." + }, + "carrier": { + "description": "Optional. The name of the shipping carrier for the delivery. This field is required if one of the following fields is absent: earliest_delivery_promise_time, latest_delivery_promise_time, and actual_delivery_time.", + "type": "string" + }, + "carrierService": { + "description": "Optional. The service type for fulfillment, such as GROUND, FIRST_CLASS, etc.", + "type": "string" + }, + "earliestDeliveryPromiseTime": { + "$ref": "DateTime", + "description": "Optional. The earliest delivery promised time. Include the year and timezone string, if available. This field is required, if one of the following fields is absent: tracking_id or carrier_name." + }, + "latestDeliveryPromiseTime": { + "$ref": "DateTime", + "description": "Optional. The latest delivery promised time. Include the year and timezone string, if available. This field is required, if one of the following fields is absent: tracking_id or carrier_name." + }, + "originPostalCode": { + "description": "Required. The origin postal code, as a continuous string without spaces or dashes, for example \"95016\". This field will be anonymized in returned OrderTrackingSignal creation response.", + "type": "string" + }, + "originRegionCode": { + "description": "Required. The [CLDR territory code] (http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) for the shipping origin.", + "type": "string" + }, + "shipmentId": { + "description": "Required. The shipment ID. This field will be hashed in returned OrderTrackingSignal creation response.", + "type": "string" + }, + "shippedTime": { + "$ref": "DateTime", + "description": "Optional. The time when the shipment was shipped. Include the year and timezone string, if available." + }, + "shippingStatus": { + "description": "Required. The status of the shipment.", + "enum": [ + "SHIPPING_STATE_UNSPECIFIED", + "SHIPPED", + "DELIVERED" + ], + "enumDescriptions": [ + "The shipping status is not known to business.", + "All items are shipped.", + "The shipment is already delivered." + ], + "type": "string" + }, + "trackingId": { + "description": "Optional. The tracking ID of the shipment. This field is required if one of the following fields is absent: earliest_delivery_promise_time, latest_delivery_promise_time, and actual_delivery_time.", + "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. For example \"America/New_York\".", + "type": "string" + }, + "version": { + "description": "Optional. IANA Time Zone Database version number. For example \"2019a\".", + "type": "string" + } + }, + "type": "object" + } + }, + "servicePath": "", + "title": "Merchant API", + "version": "ordertracking_v1", + "version_module": true +} \ No newline at end of file diff --git a/merchantapi/ordertracking/v1/merchantapi-gen.go b/merchantapi/ordertracking/v1/merchantapi-gen.go new file mode 100644 index 00000000000..de5d44f91bc --- /dev/null +++ b/merchantapi/ordertracking/v1/merchantapi-gen.go @@ -0,0 +1,722 @@ +// Copyright 2025 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.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/ordertracking/v1" +// ... +// 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/ordertracking/v1" + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "log/slog" + "net/http" + "net/url" + "strconv" + "strings" + + "github.com/googleapis/gax-go/v2/internallog" + 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 +var _ = internallog.New + +const apiId = "merchantapi:ordertracking_v1" +const apiName = "merchantapi" +const apiVersion = "ordertracking_v1" +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 := &Service{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)} + s.Accounts = NewAccountsService(s) + 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") + } + return NewService(context.TODO(), option.WithHTTPClient(client)) +} + +type Service struct { + client *http.Client + logger *slog.Logger + 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.OrderTrackingSignals = NewAccountsOrderTrackingSignalsService(s) + return rs +} + +type AccountsService struct { + s *Service + + OrderTrackingSignals *AccountsOrderTrackingSignalsService +} + +func NewAccountsOrderTrackingSignalsService(s *Service) *AccountsOrderTrackingSignalsService { + rs := &AccountsOrderTrackingSignalsService{s: s} + return rs +} + +type AccountsOrderTrackingSignalsService struct { + s *Service +} + +// DateTime: Represents civil time (or occasionally physical time). This type +// can represent a civil time in one of a few possible ways: * When utc_offset +// is set and time_zone is unset: a civil time on a calendar day with a +// particular offset from UTC. * When time_zone is set and utc_offset is unset: +// a civil time on a calendar day in a particular time zone. * When neither +// time_zone nor utc_offset is set: a civil time on a calendar day in local +// time. The date is relative to the Proleptic Gregorian Calendar. If year, +// month, or day are 0, the DateTime is considered not to have a specific year, +// month, or day respectively. This type may also be used to represent a +// physical time if all the date and time fields are set and either case of the +// `time_offset` oneof is set. Consider using `Timestamp` message for physical +// time instead. If your use case also would like to store the user's timezone, +// that can be done in another field. This type is more flexible than some +// applications may want. Make sure to document and validate your application's +// limitations. +type DateTime struct { + // Day: Optional. Day of month. Must be from 1 to 31 and valid for the year and + // month, or 0 if specifying a datetime without a day. + Day int64 `json:"day,omitempty"` + // Hours: Optional. Hours of day in 24 hour format. Should be from 0 to 23, + // defaults to 0 (midnight). An API may choose to allow the value "24:00:00" + // for scenarios like business closing time. + Hours int64 `json:"hours,omitempty"` + // Minutes: Optional. Minutes of hour of day. Must be from 0 to 59, defaults to + // 0. + Minutes int64 `json:"minutes,omitempty"` + // Month: Optional. Month of year. Must be from 1 to 12, or 0 if specifying a + // datetime without a month. + Month int64 `json:"month,omitempty"` + // Nanos: Optional. Fractions of seconds in nanoseconds. Must be from 0 to + // 999,999,999, defaults to 0. + Nanos int64 `json:"nanos,omitempty"` + // Seconds: Optional. Seconds of minutes of the time. Must normally be from 0 + // to 59, defaults to 0. An API may allow the value 60 if it allows + // leap-seconds. + Seconds int64 `json:"seconds,omitempty"` + // TimeZone: Time zone. + TimeZone *TimeZone `json:"timeZone,omitempty"` + // UtcOffset: UTC offset. Must be whole seconds, between -18 hours and +18 + // hours. For example, a UTC offset of -4:00 would be represented as { seconds: + // -14400 }. + UtcOffset string `json:"utcOffset,omitempty"` + // Year: Optional. Year of date. Must be from 1 to 9999, or 0 if specifying a + // datetime 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 DateTime) MarshalJSON() ([]byte, error) { + type NoMethod DateTime + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// LineItemDetails: The line items of the order. +type LineItemDetails struct { + // Brand: Optional. Brand of the product. + Brand string `json:"brand,omitempty"` + // Gtin: Optional. The Global Trade Item Number. + Gtin string `json:"gtin,omitempty"` + // LineItemId: Required. The ID for this line item. + LineItemId string `json:"lineItemId,omitempty"` + // Mpn: Optional. The manufacturer part number. + Mpn string `json:"mpn,omitempty"` + // ProductId: Required. The Content API REST ID of the product, in the form + // channel:contentLanguage:targetCountry:offerId. + ProductId string `json:"productId,omitempty"` + // ProductTitle: Optional. Plain text title of this product. + ProductTitle string `json:"productTitle,omitempty"` + // Quantity: Required. The quantity of the line item in the order. + Quantity int64 `json:"quantity,omitempty,string"` + // 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 LineItemDetails) MarshalJSON() ([]byte, error) { + type NoMethod LineItemDetails + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// OrderTrackingSignal: Represents a business trade from which signals are +// extracted, such as shipping. +type OrderTrackingSignal struct { + // CustomerShippingFee: Optional. The shipping fee of the order; this value + // should be set to zero in the case of free shipping. + CustomerShippingFee *Price `json:"customerShippingFee,omitempty"` + // DeliveryPostalCode: Optional. The delivery postal code, as a continuous + // string without spaces or dashes, for example "95016". This field will be + // anonymized in returned OrderTrackingSignal creation response. + DeliveryPostalCode string `json:"deliveryPostalCode,omitempty"` + // DeliveryRegionCode: Optional. The [CLDR territory code] + // (http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) for the + // shipping destination. + DeliveryRegionCode string `json:"deliveryRegionCode,omitempty"` + // LineItems: Required. Information about line items in the order. + LineItems []*LineItemDetails `json:"lineItems,omitempty"` + // MerchantId: Optional. The Google Merchant Center ID of this order tracking + // signal. This value is optional. If left unset, the caller's Merchant Center + // ID is used. You must request access in order to provide data on behalf of + // another business. For more information, see Submitting Order Tracking + // Signals (/shopping-content/guides/order-tracking-signals). + MerchantId int64 `json:"merchantId,omitempty,string"` + // OrderCreatedTime: Required. The time when the order was created on the + // businesses side. Include the year and timezone string, if available. + OrderCreatedTime *DateTime `json:"orderCreatedTime,omitempty"` + // OrderId: Required. The ID of the order on the businesses side. This field + // will be hashed in returned OrderTrackingSignal creation response. + OrderId string `json:"orderId,omitempty"` + // OrderTrackingSignalId: Output only. The ID that uniquely identifies this + // order tracking signal. + OrderTrackingSignalId int64 `json:"orderTrackingSignalId,omitempty,string"` + // ShipmentLineItemMapping: Optional. The mapping of the line items to the + // shipment information. + ShipmentLineItemMapping []*ShipmentLineItemMapping `json:"shipmentLineItemMapping,omitempty"` + // ShippingInfo: Required. The shipping information for the order. + ShippingInfo []*ShippingInfo `json:"shippingInfo,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "CustomerShippingFee") 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. "CustomerShippingFee") 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 OrderTrackingSignal) MarshalJSON() ([]byte, error) { + type NoMethod OrderTrackingSignal + 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. If empty, it + // means that the product was deleted. Will have one of these values : + // (`approved`, `pending`, `disapproved`, ``) + NewValue string `json:"newValue,omitempty"` + // OldValue: The old value of the changed resource or attribute. If empty, it + // means that the product was created. Will have one of these values : + // (`approved`, `pending`, `disapproved`, ``) + OldValue string `json:"oldValue,omitempty"` + // RegionCode: Countries that have the change (if applicable). Represented in + // the ISO 3166 format. + RegionCode string `json:"regionCode,omitempty"` + // ReportingContext: Reporting contexts that have the change (if applicable). + // Currently this field supports only (`SHOPPING_ADS`, `LOCAL_INVENTORY_ADS`, + // `YOUTUBE_SHOPPING`, `YOUTUBE_CHECKOUT`, `YOUTUBE_AFFILIATE`) from the enum + // value ReportingContextEnum + // (/merchant/api/reference/rest/Shared.Types/ReportingContextEnum) + // + // 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_AFFILIATE" - [Youtube + // Affiliate](https://support.google.com/youtube/answer/13376398). + // "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). + // "PRODUCT_REVIEWS" - [Product + // Reviews](https://support.google.com/merchants/answer/14620732). + // "MERCHANT_REVIEWS" - [Merchant + // Reviews](https://developers.google.com/merchant-review-feeds). + // "YOUTUBE_CHECKOUT" - YouTube Checkout . + 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"` + // EventTime: The time at which the event was generated. If you want to order + // the notification messages you receive you should rely on this field not on + // the order of receiving the notifications. + EventTime string `json:"eventTime,omitempty"` + // ExpirationTime: Optional. The product expiration time. This field will not + // be set if the notification is sent for a product deletion event. + ExpirationTime string `json:"expirationTime,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: `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) +} + +// ShipmentLineItemMapping: Represents how many items are in the shipment for +// the given shipment_id and line_item_id. +type ShipmentLineItemMapping struct { + // LineItemId: Required. The line item ID. + LineItemId string `json:"lineItemId,omitempty"` + // Quantity: Required. The line item quantity in the shipment. + Quantity int64 `json:"quantity,omitempty,string"` + // ShipmentId: Required. The shipment ID. This field will be hashed in returned + // OrderTrackingSignal creation response. + ShipmentId string `json:"shipmentId,omitempty"` + // ForceSendFields is a list of field names (e.g. "LineItemId") 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. "LineItemId") 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 ShipmentLineItemMapping) MarshalJSON() ([]byte, error) { + type NoMethod ShipmentLineItemMapping + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// ShippingInfo: The shipping information for the order. +type ShippingInfo struct { + // ActualDeliveryTime: Optional. The time when the shipment was actually + // delivered. Include the year and timezone string, if available. This field is + // required, if one of the following fields is absent: tracking_id or + // carrier_name. + ActualDeliveryTime *DateTime `json:"actualDeliveryTime,omitempty"` + // Carrier: Optional. The name of the shipping carrier for the delivery. This + // field is required if one of the following fields is absent: + // earliest_delivery_promise_time, latest_delivery_promise_time, and + // actual_delivery_time. + Carrier string `json:"carrier,omitempty"` + // CarrierService: Optional. The service type for fulfillment, such as GROUND, + // FIRST_CLASS, etc. + CarrierService string `json:"carrierService,omitempty"` + // EarliestDeliveryPromiseTime: Optional. The earliest delivery promised time. + // Include the year and timezone string, if available. This field is required, + // if one of the following fields is absent: tracking_id or carrier_name. + EarliestDeliveryPromiseTime *DateTime `json:"earliestDeliveryPromiseTime,omitempty"` + // LatestDeliveryPromiseTime: Optional. The latest delivery promised time. + // Include the year and timezone string, if available. This field is required, + // if one of the following fields is absent: tracking_id or carrier_name. + LatestDeliveryPromiseTime *DateTime `json:"latestDeliveryPromiseTime,omitempty"` + // OriginPostalCode: Required. The origin postal code, as a continuous string + // without spaces or dashes, for example "95016". This field will be anonymized + // in returned OrderTrackingSignal creation response. + OriginPostalCode string `json:"originPostalCode,omitempty"` + // OriginRegionCode: Required. The [CLDR territory code] + // (http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) for the + // shipping origin. + OriginRegionCode string `json:"originRegionCode,omitempty"` + // ShipmentId: Required. The shipment ID. This field will be hashed in returned + // OrderTrackingSignal creation response. + ShipmentId string `json:"shipmentId,omitempty"` + // ShippedTime: Optional. The time when the shipment was shipped. Include the + // year and timezone string, if available. + ShippedTime *DateTime `json:"shippedTime,omitempty"` + // ShippingStatus: Required. The status of the shipment. + // + // Possible values: + // "SHIPPING_STATE_UNSPECIFIED" - The shipping status is not known to + // business. + // "SHIPPED" - All items are shipped. + // "DELIVERED" - The shipment is already delivered. + ShippingStatus string `json:"shippingStatus,omitempty"` + // TrackingId: Optional. The tracking ID of the shipment. This field is + // required if one of the following fields is absent: + // earliest_delivery_promise_time, latest_delivery_promise_time, and + // actual_delivery_time. + TrackingId string `json:"trackingId,omitempty"` + // ForceSendFields is a list of field names (e.g. "ActualDeliveryTime") 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. "ActualDeliveryTime") 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 ShippingInfo) MarshalJSON() ([]byte, error) { + type NoMethod ShippingInfo + 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. For example "America/New_York". + Id string `json:"id,omitempty"` + // Version: Optional. IANA Time Zone Database version number. For example + // "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) +} + +type AccountsOrderTrackingSignalsCreateCall struct { + s *Service + parent string + ordertrackingsignal *OrderTrackingSignal + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates new order tracking signal. +// +// - parent: The account of the business for which the order signal is created. +// Format: accounts/{account}. +func (r *AccountsOrderTrackingSignalsService) Create(parent string, ordertrackingsignal *OrderTrackingSignal) *AccountsOrderTrackingSignalsCreateCall { + c := &AccountsOrderTrackingSignalsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.ordertrackingsignal = ordertrackingsignal + return c +} + +// OrderTrackingSignalId sets the optional parameter "orderTrackingSignalId": +// Output only. The ID that uniquely identifies this order tracking signal. +func (c *AccountsOrderTrackingSignalsCreateCall) OrderTrackingSignalId(orderTrackingSignalId string) *AccountsOrderTrackingSignalsCreateCall { + c.urlParams_.Set("orderTrackingSignalId", orderTrackingSignalId) + 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 *AccountsOrderTrackingSignalsCreateCall) Fields(s ...googleapi.Field) *AccountsOrderTrackingSignalsCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsOrderTrackingSignalsCreateCall) Context(ctx context.Context) *AccountsOrderTrackingSignalsCreateCall { + 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 *AccountsOrderTrackingSignalsCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsOrderTrackingSignalsCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.ordertrackingsignal) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "ordertracking/v1/{+parent}/orderTrackingSignals") + 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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.orderTrackingSignals.create", "request", internallog.HTTPRequest(req, body.Bytes())) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.orderTrackingSignals.create" call. +// Any non-2xx status code is an error. Response headers are in either +// *OrderTrackingSignal.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 *AccountsOrderTrackingSignalsCreateCall) Do(opts ...googleapi.CallOption) (*OrderTrackingSignal, 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 := &OrderTrackingSignal{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.orderTrackingSignals.create", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} diff --git a/merchantapi/products/v1/merchantapi-api.json b/merchantapi/products/v1/merchantapi-api.json new file mode 100644 index 00000000000..829aa3da925 --- /dev/null +++ b/merchantapi/products/v1/merchantapi-api.json @@ -0,0 +1,2125 @@ +{ + "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.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_v1", + "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/v1/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}`. For example, `accounts/123456/dataSources/104628`.", + "location": "query", + "type": "string" + }, + "name": { + "description": "Required. The name of the product input resource to delete. Format: `accounts/{account}/productInputs/{product}` where the last section `product` consists of: `content_language~feed_label~offer_id` example for product name is `accounts/123/productInputs/en~US~sku123`.", + "location": "path", + "pattern": "^accounts/[^/]+/productInputs/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "products/v1/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "insert": { + "description": "[Uploads a product input to your Merchant Center account](/merchant/api/guides/products/overview#upload-product-input). You must have a products [data source](/merchant/api/guides/data-sources/overview) to be able to insert a product. The unique identifier of the data source is passed as a query parameter in the request URL. If a product input with the same contentLanguage, offerId, and dataSource already exists, then the product input inserted by 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/v1/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. For more information, see [Overview of Data sources sub-API](/merchant/api/guides/data-sources/overview). Only API data sources are supported. Format: `accounts/{account}/dataSources/{datasource}`. For example, `accounts/123456/dataSources/104628`.", + "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/v1/{+parent}/productInputs:insert", + "request": { + "$ref": "ProductInput" + }, + "response": { + "$ref": "ProductInput" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "patch": { + "description": "Updates the existing product input in 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/v1/accounts/{accountsId}/productInputs/{productInputsId}", + "httpMethod": "PATCH", + "id": "merchantapi.accounts.productInputs.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "dataSource": { + "description": "Required. The primary or supplemental product data source where `data_source` name identifies the product input to be updated. Only API data sources are supported. Format: `accounts/{account}/dataSources/{datasource}`. For example, `accounts/123456/dataSources/104628`.", + "location": "query", + "type": "string" + }, + "name": { + "description": "Identifier. The name of the product input. Format: `accounts/{account}/productInputs/{productinput}` where the last section `productinput` consists of: `content_language~feed_label~offer_id` example for product input name is `accounts/123/productInputs/en~US~sku123`. A legacy local product input name would be `accounts/123/productInputs/local~en~US~sku123`. Note: For calls to the v1beta version, the `productInput` section consists of: `channel~content_language~feed_label~offer_id`, for example: `accounts/123/productInputs/online~en~US~sku123`.", + "location": "path", + "pattern": "^accounts/[^/]+/productInputs/[^/]+$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Optional. The list of product attributes to be updated. If the update mask is omitted, then it is treated as implied field mask equivalent to all fields that are populated (have a non-empty value). Attributes specified in the update mask without a value specified in the body will be deleted from the product. Update mask can only be specified for top level fields in attributes and custom attributes. To specify the update mask for custom attributes you need to add the `custom_attribute.` prefix. Providing special \"*\" value for full product replacement is not supported.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "products/v1/{+name}", + "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/v1/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}` where the last section `product` consists of: `content_language~feed_label~offer_id` example for product name is `accounts/123/products/en~US~sku123`. A legacy local product name would be `accounts/123/products/local~en~US~sku123`. Note: For calls to the v1beta version, the `product` section consists of: `channel~content_language~feed_label~offer_id`, for example: `accounts/123/products/online~en~US~sku123`.", + "location": "path", + "pattern": "^accounts/[^/]+/products/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "products/v1/{+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/v1/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 default page size of 25 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/v1/{+parent}/products", + "response": { + "$ref": "ListProductsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + } + } + } + }, + "revision": "20250804", + "rootUrl": "https://merchantapi.googleapis.com/", + "schemas": { + "AutomatedDiscounts": { + "description": "Information regarding Automated Discounts.", + "id": "AutomatedDiscounts", + "properties": { + "gadPrice": { + "$ref": "Price", + "description": "The current sale price for products with a price optimized using Google Automated Discounts (GAD). Absent if the information about the GAD_price of the product is not available." + }, + "priorPrice": { + "$ref": "Price", + "description": "The price prior to the application of the first price reduction. Absent if the information about the prior price of the product is not available." + }, + "priorPriceProgressive": { + "$ref": "Price", + "description": "The price prior to the application of consecutive price reductions. Absent if the information about the prior price of the product is not available." + } + }, + "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_AFFILIATE", + "YOUTUBE_SHOPPING", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL", + "PRODUCT_REVIEWS", + "MERCHANT_REVIEWS", + "YOUTUBE_CHECKOUT" + ], + "enumDeprecated": [ + false, + false, + true, + false, + false, + false, + false, + 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 Affiliate](https://support.google.com/youtube/answer/13376398).", + "[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).", + "[Product Reviews](https://support.google.com/merchants/answer/14620732).", + "[Merchant Reviews](https://developers.google.com/merchant-review-feeds).", + "YouTube Checkout ." + ], + "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" + }, + "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_AFFILIATE", + "YOUTUBE_SHOPPING", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL", + "PRODUCT_REVIEWS", + "MERCHANT_REVIEWS", + "YOUTUBE_CHECKOUT" + ], + "enumDeprecated": [ + false, + false, + true, + false, + false, + false, + false, + 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 Affiliate](https://support.google.com/youtube/answer/13376398).", + "[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).", + "[Product Reviews](https://support.google.com/merchants/answer/14620732).", + "[Merchant Reviews](https://developers.google.com/merchant-review-feeds).", + "YouTube Checkout ." + ], + "type": "string" + }, + "resolution": { + "description": "Whether the issue can be resolved by the business.", + "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" + }, + "memberPriceEffectiveDate": { + "$ref": "Interval", + "description": "A date range during which the item is eligible for member price. If not specified, the member price is always applicable. The date range is represented by a pair of ISO 8601 dates separated by a space, comma, or slash." + }, + "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 business 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 business. The corresponding program must be linked to the Merchant Center account.", + "type": "string" + }, + "shippingLabel": { + "description": "The label of the shipping benefit. If the field has value, this offer has loyalty shipping benefit. If the field value isn't provided, the item is not eligible for loyalty shipping for the given loyalty tier.", + "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. 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": { + "automatedDiscounts": { + "$ref": "AutomatedDiscounts", + "description": "Output only. The automated discounts information for the product.", + "readOnly": true + }, + "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 lets you categorize and identify your products. The maximum allowed characters is 20 and the supported characters are`A-Z`, `0-9`, hyphen and underscore. The feed label must not include any spaces. For more information, see [Using feed labels](//support.google.com/merchants/answer/14994087)", + "readOnly": true, + "type": "string" + }, + "legacyLocal": { + "description": "Output only. Determines whether the product is **only** targeting local destinations and whether the product name should be distinguished with a `local~` prefix. For example, `accounts/123/products/local~en~US~sku123`.", + "readOnly": true, + "type": "boolean" + }, + "name": { + "description": "The name of the product. Format: `accounts/{account}/products/{product}` where the last section `product` consists of: `content_language~feed_label~offer_id` example for product name is `accounts/123/products/en~US~sku123`. A legacy local product name would be `accounts/123/products/local~en~US~sku123`. Note: For calls to the v1beta version, the `product` section consists of: `channel~content_language~feed_label~offer_id`, for example: `accounts/123/products/online~en~US~sku123`.", + "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" + }, + "productAttributes": { + "$ref": "ProductAttributes", + "description": "Output only. A list of strongly-typed product attributes.", + "readOnly": true + }, + "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" + }, + "ProductAttributes": { + "description": "Product attributes.", + "id": "ProductAttributes", + "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. For more information, see [Display ads attribute](https://support.google.com/merchants/answer/6069387).", + "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.", + "enum": [ + "AGE_GROUP_UNSPECIFIED", + "ADULT", + "KIDS", + "TODDLER", + "INFANT", + "NEWBORN" + ], + "enumDescriptions": [ + "Age group is not specified.", + "Teens or older.", + "5-13 years old.", + "1-5 years old.", + "3-12 months old.", + "0-3 months old." + ], + "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 business offers do not fall below this value, thereby preserving the offer's value and profitability." + }, + "availability": { + "description": "[Availability](https://support.google.com/merchants/answer/6324448) status of the item.", + "enum": [ + "AVAILABILITY_UNSPECIFIED", + "IN_STOCK", + "OUT_OF_STOCK", + "PREORDER", + "LIMITED_AVAILABILITY", + "BACKORDER" + ], + "enumDescriptions": [ + "Availability is not specified.", + "In stock.", + "Out of stock.", + "Pre-order.", + "Limited availability.", + "Backorder." + ], + "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](https://support.google.com/merchants/answer/6324351) of the item. For example, \"Google\".", + "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": "ProductCertification" + }, + "type": "array" + }, + "cloudExportAdditionalProperties": { + "description": "Extra fields to export to the Cloud Retail program.", + "items": { + "$ref": "CloudExportAdditionalProperties" + }, + "type": "array" + }, + "color": { + "description": "[Color](https://support.google.com/merchants/answer/6324487) of the item. For example, \"red\".", + "type": "string" + }, + "condition": { + "description": "[Condition](https://support.google.com/merchants/answer/6324469) or state of the item.", + "enum": [ + "CONDITION_UNSPECIFIED", + "NEW", + "USED", + "REFURBISHED" + ], + "enumDescriptions": [ + "Default value. This value is unused.", + "Brand new, original, unopened packaging.", + "Previously used, original packaging opened or missing.", + "Professionally restored to working order, comes with a warranty, may or may not have the original packaging." + ], + "type": "string" + }, + "costOfGoodsSold": { + "$ref": "Price", + "description": "Cost of goods sold. Used for gross profit reporting." + }, + "customLabel0": { + "description": "[Custom label 0](https://support.google.com/merchants/answer/6324473) for custom grouping of items in a Shopping campaign.", + "type": "string" + }, + "customLabel1": { + "description": "[Custom label 1](https://support.google.com/merchants/answer/6324473) for custom grouping of items in a Shopping campaign.", + "type": "string" + }, + "customLabel2": { + "description": "[Custom label 2](https://support.google.com/merchants/answer/6324473) for custom grouping of items in a Shopping campaign.", + "type": "string" + }, + "customLabel3": { + "description": "[Custom label 3](https://support.google.com/merchants/answer/6324473) for custom grouping of items in a Shopping campaign.", + "type": "string" + }, + "customLabel4": { + "description": "[Custom label 4](https://support.google.com/merchants/answer/6324473) 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. For more information, see [Display ads attribute specification](https://support.google.com/merchants/answer/6069387).", + "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. For more information, see [Display ads attribute](https://support.google.com/merchants/answer/6069387).", + "format": "double", + "type": "number" + }, + "energyEfficiencyClass": { + "description": "The [energy efficiency class](https://support.google.com/merchants/answer/7562785) as defined in EU directive 2010/30/EU.", + "enum": [ + "ENERGY_EFFICIENCY_CLASS_UNSPECIFIED", + "APPP", + "APP", + "AP", + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ], + "enumDescriptions": [ + "The energy efficiency class is unspecified.", + "A+++.", + "A++.", + "A+.", + "A.", + "B.", + "C.", + "D.", + "E.", + "F.", + "G." + ], + "type": "string" + }, + "excludedDestinations": { + "description": "The list of destinations to exclude for this target (corresponds to unchecked check boxes in Merchant Center). For more information, see [Excluded destination](https://support.google.com/merchants/answer/6324486). Note: We recommend setting destinations on datasources level for most use cases. Use this field within products to only setup exceptions.", + "items": { + "enum": [ + "DESTINATION_ENUM_UNSPECIFIED", + "SHOPPING_ADS", + "DISPLAY_ADS", + "LOCAL_INVENTORY_ADS", + "FREE_LISTINGS", + "FREE_LOCAL_LISTINGS", + "YOUTUBE_SHOPPING", + "YOUTUBE_SHOPPING_CHECKOUT", + "YOUTUBE_AFFILIATE", + "FREE_VEHICLE_LISTINGS", + "VEHICLE_ADS", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL" + ], + "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).", + "Youtube shopping checkout.", + "[Youtube Affiliate](https://support.google.com/youtube/answer/13376398).", + "[Free vehicle listings](https://support.google.com/merchants/answer/11189169).", + "[Vehicle ads](https://support.google.com/merchants/answer/11189169).", + "[Cloud retail](https://cloud.google.com/solutions/retail).", + "[Local cloud retail](https://cloud.google.com/solutions/retail)." + ], + "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](https://support.google.com/merchants/answer/6324479) of the item.", + "enum": [ + "GENDER_UNSPECIFIED", + "MALE", + "FEMALE", + "UNISEX" + ], + "enumDescriptions": [ + "Gender is not specified.", + "Male.", + "Female.", + "Unisex." + ], + "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" + }, + "gtins": { + "description": "Global Trade Item Numbers ([GTIN](https://support.google.com/merchants/answer/188494#gtin)) of the item. You can provide up to 10 GTINs.", + "items": { + "type": "string" + }, + "type": "array" + }, + "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`. For more information, see [Included destination](https://support.google.com/merchants/answer/7501026). Note: We recommend setting destinations on datasources level for most use cases. Use this field within products to only setup exceptions.", + "items": { + "enum": [ + "DESTINATION_ENUM_UNSPECIFIED", + "SHOPPING_ADS", + "DISPLAY_ADS", + "LOCAL_INVENTORY_ADS", + "FREE_LISTINGS", + "FREE_LOCAL_LISTINGS", + "YOUTUBE_SHOPPING", + "YOUTUBE_SHOPPING_CHECKOUT", + "YOUTUBE_AFFILIATE", + "FREE_VEHICLE_LISTINGS", + "VEHICLE_ADS", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL" + ], + "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).", + "Youtube shopping checkout.", + "[Youtube Affiliate](https://support.google.com/youtube/answer/13376398).", + "[Free vehicle listings](https://support.google.com/merchants/answer/11189169).", + "[Vehicle ads](https://support.google.com/merchants/answer/11189169).", + "[Cloud retail](https://cloud.google.com/solutions/retail).", + "[Local cloud retail](https://cloud.google.com/solutions/retail)." + ], + "type": "string" + }, + "type": "array" + }, + "installment": { + "$ref": "ProductInstallment", + "description": "Number and amount of installments to pay for an item." + }, + "isBundle": { + "description": "Whether the item is a business-defined sub-API. A [sub-API] (https://support.google.com/merchants/answer/6324449) is a custom grouping of different products sold by a business 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](https://support.google.com/merchants/answer/13871172) for business 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](https://support.google.com/merchants/answer/6324410) of which the item is made. For example, \"Leather\" or \"Cotton\".", + "type": "string" + }, + "maxEnergyEfficiencyClass": { + "description": "The [energy efficiency class](https://support.google.com/merchants/answer/7562785) as defined in EU directive 2010/30/EU.", + "enum": [ + "ENERGY_EFFICIENCY_CLASS_UNSPECIFIED", + "APPP", + "APP", + "AP", + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ], + "enumDescriptions": [ + "The energy efficiency class is unspecified.", + "A+++.", + "A++.", + "A+.", + "A.", + "B.", + "C.", + "D.", + "E.", + "F.", + "G." + ], + "type": "string" + }, + "maxHandlingTime": { + "description": "Maximal product handling time (in business days).", + "format": "int64", + "type": "string" + }, + "maximumRetailPrice": { + "$ref": "Price", + "description": "Maximum retail price (MRP) of the item. Applicable to India only." + }, + "minEnergyEfficiencyClass": { + "description": "The [energy efficiency class](https://support.google.com/merchants/answer/7562785) as defined in EU directive 2010/30/EU.", + "enum": [ + "ENERGY_EFFICIENCY_CLASS_UNSPECIFIED", + "APPP", + "APP", + "AP", + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ], + "enumDescriptions": [ + "The energy efficiency class is unspecified.", + "A+++.", + "A++.", + "A+.", + "A.", + "B.", + "C.", + "D.", + "E.", + "F.", + "G." + ], + "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](https://support.google.com/merchants/answer/13870216) for business 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 business-defined multipack.", + "format": "int64", + "type": "string" + }, + "pattern": { + "description": "The item's [pattern](https://support.google.com/merchants/answer/6324483). For example, polka dots.", + "type": "string" + }, + "pause": { + "description": "Publication of this item will be temporarily [paused](https://support.google.com/merchants/answer/11909930).", + "enum": [ + "PAUSE_UNSPECIFIED", + "ADS", + "ALL" + ], + "enumDescriptions": [ + "The pause is unspecified.", + "You’re currently pausing your product for all ads locations (including Shopping Ads, Display Ads, and local inventory ads).", + "You’re currently pausing your product for all Shopping locations (including Shopping Ads, Display Ads, local inventory ads, Buy on Google, and free listings)." + ], + "type": "string" + }, + "pickupMethod": { + "description": "The [pickup](https://support.google.com/merchants/answer/14634021) option for the item.", + "enum": [ + "PICKUP_METHOD_UNSPECIFIED", + "NOT_SUPPORTED", + "BUY", + "RESERVE", + "SHIP_TO_STORE" + ], + "enumDescriptions": [ + "Pickup method is not specified.", + "The item is not available for store pickup.", + "The entire transaction occurs online.", + "The item is reserved online and the transaction occurs in-store.", + "The item is purchased online and shipped to a local store for the customer to pick up." + ], + "type": "string" + }, + "pickupSla": { + "description": "Item store pickup timeline. For more information, see [Pickup SLA](https://support.google.com/merchants/answer/14635400).", + "enum": [ + "PICKUP_SLA_UNSPECIFIED", + "SAME_DAY", + "NEXT_DAY", + "TWO_DAY", + "THREE_DAY", + "FOUR_DAY", + "FIVE_DAY", + "SIX_DAY", + "MULTI_WEEK" + ], + "enumDescriptions": [ + "Pickup SLA is not specified.", + "Indicates that the product is available for pickup the same day that the order is placed, subject to cut off times.", + "Indicates that the product is available for pickup the following day that the order is placed.", + "Indicates that the product will be shipped to a store for a customer to pick up in 2 days.", + "Indicates that the product will be shipped to a store for a customer to pick up in 3 days.", + "Indicates that the product will be shipped to a store for a customer to pick up in 4 days", + "Indicates that the product will be shipped to a store for a customer to pick up in 5 days.", + "Indicates that the product will be shipped to a store for a customer to pick up in 6 days.", + "Indicates that the product will be shipped to a store for a customer to pick up in one week or more." + ], + "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 [product highlights](https://support.google.com/merchants/answer/9216100).", + "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/7052112#product_category)).", + "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/7052112#price_and_availability)." + }, + "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)](https://en.wikipedia.org/wiki/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 [Size](https://support.google.com/merchants/answer/6324492).", + "type": "string" + }, + "sizeSystem": { + "description": "System in which the size is specified. Recommended for apparel items. For more information, see [Size system](https://support.google.com/merchants/answer/6324502).", + "enum": [ + "SIZE_SYSTEM_UNSPECIFIED", + "AU", + "BR", + "CN", + "DE", + "EU", + "FR", + "IT", + "JP", + "MEX", + "UK", + "US" + ], + "enumDescriptions": [ + "Unspecified size system.", + "AU.", + "BR.", + "CN.", + "DE.", + "EU.", + "FR.", + "IT.", + "JP.", + "MEX.", + "UK.", + "US." + ], + "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 [Size type](https://support.google.com/merchants/answer/6324497).", + "items": { + "enum": [ + "SIZE_TYPE_UNSPECIFIED", + "REGULAR", + "PETITE", + "MATERNITY", + "BIG", + "TALL", + "PLUS" + ], + "enumDescriptions": [ + "The size type is not specified.", + "Regular size.", + "Petite size.", + "Maternity size.", + "Big size.", + "Tall size.", + "Plus size." + ], + "type": "string" + }, + "type": "array" + }, + "structuredDescription": { + "$ref": "StructuredDescription", + "description": "Structured description, for algorithmically (AI)-generated descriptions." + }, + "structuredTitle": { + "$ref": "StructuredTitle", + "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." + }, + "sustainabilityIncentives": { + "description": "The list of sustainability incentive programs.", + "items": { + "$ref": "ProductSustainabilityIncentive" + }, + "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" + }, + "ProductCertification": { + "description": "Product [certification](https://support.google.com/merchants/answer/13528839), initially introduced for EU energy efficiency labeling compliance using the EU EPREL database.", + "id": "ProductCertification", + "properties": { + "certificationAuthority": { + "description": "The certification authority.", + "enum": [ + "CERTIFICATION_AUTHORITY_UNSPECIFIED", + "ADEME", + "BMWK", + "EPA", + "EC" + ], + "enumDescriptions": [ + "Certification authority is not specified.", + "For the French CO2 emissions class for vehicles.", + "For the German CO2 emissions classes for vehicles.", + "Environment Protection Agency.", + "European Commission for energy labels in the EU." + ], + "type": "string" + }, + "certificationCode": { + "description": "The certification code. Maximum length is 2000 characters.", + "type": "string" + }, + "certificationName": { + "description": "The name of the certification.", + "enum": [ + "CERTIFICATION_NAME_UNSPECIFIED", + "ENERGY_STAR", + "ENERGY_STAR_MOST_EFFICIENT", + "EPREL", + "EU_ECOLABEL", + "VEHICLE_ENERGY_EFFICIENCY", + "VEHICLE_ENERGY_EFFICIENCY_DISCHARGED_BATTERY" + ], + "enumDescriptions": [ + "Certification name is not specified.", + "Energy Star.", + "Energy Star Most Efficient.", + "Represents energy efficiency certifications in the EU European Registry for Energy Labeling (EPREL) database.", + "EU Ecolabel.", + "The overall CO2 class of a vehicle", + "For the CO2 class of a vehicle with a discharged battery." + ], + "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" + }, + "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. If empty, it means that the product was deleted. Will have one of these values : (`approved`, `pending`, `disapproved`, ``)", + "type": "string" + }, + "oldValue": { + "description": "The old value of the changed resource or attribute. If empty, it means that the product was created. Will have one of these values : (`approved`, `pending`, `disapproved`, ``)", + "type": "string" + }, + "regionCode": { + "description": "Countries that have the change (if applicable). Represented in the ISO 3166 format.", + "type": "string" + }, + "reportingContext": { + "description": "Reporting contexts that have the change (if applicable). Currently this field supports only (`SHOPPING_ADS`, `LOCAL_INVENTORY_ADS`, `YOUTUBE_SHOPPING`, `YOUTUBE_CHECKOUT`, `YOUTUBE_AFFILIATE`) from the enum value [ReportingContextEnum](/merchant/api/reference/rest/Shared.Types/ReportingContextEnum)", + "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_AFFILIATE", + "YOUTUBE_SHOPPING", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL", + "PRODUCT_REVIEWS", + "MERCHANT_REVIEWS", + "YOUTUBE_CHECKOUT" + ], + "enumDeprecated": [ + false, + false, + true, + false, + false, + false, + false, + 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 Affiliate](https://support.google.com/youtube/answer/13376398).", + "[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).", + "[Product Reviews](https://support.google.com/merchants/answer/14620732).", + "[Merchant Reviews](https://developers.google.com/merchant-review-feeds).", + "YouTube Checkout ." + ], + "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. For more information, see [Manage products](/merchant/api/guides/products/overview). 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 [Products Data Specification](https://support.google.com/merchants/answer/188494) with [some exceptions](https://support.google.com/merchants/answer/7052112). The following reference documentation lists the field names in the **camelCase** casing style while the Products Data Specification lists the names in the **snake_case** casing style.", + "id": "ProductInput", + "properties": { + "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. 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 that lets you categorize and identify your products. The maximum allowed characters are 20, and the supported characters are `A-Z`, `0-9`, hyphen, and underscore. The feed label must not include any spaces. For more information, see [Using feed labels](//support.google.com/merchants/answer/14994087).", + "type": "string" + }, + "legacyLocal": { + "description": "Immutable. Determines whether the product is **only** targeting local destinations and whether the product name should be distinguished with a `local~` prefix. For example, `accounts/123/productInputs/local~en~US~sku123`. If a product that is not `legacy_local` is already targeting local destinations, creating a `legacy_local` product with an otherwise matching name will fail.", + "type": "boolean" + }, + "name": { + "description": "Identifier. The name of the product input. Format: `accounts/{account}/productInputs/{productinput}` where the last section `productinput` consists of: `content_language~feed_label~offer_id` example for product input name is `accounts/123/productInputs/en~US~sku123`. A legacy local product input name would be `accounts/123/productInputs/local~en~US~sku123`. Note: For calls to the v1beta version, the `productInput` section consists of: `channel~content_language~feed_label~offer_id`, for example: `accounts/123/productInputs/online~en~US~sku123`.", + "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: `accounts/{account}/products/{product}`", + "readOnly": true, + "type": "string" + }, + "productAttributes": { + "$ref": "ProductAttributes", + "description": "Optional. A list of strongly-typed product attributes." + }, + "versionNumber": { + "description": "Optional. Immutable. 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. Do not set this field for updates. Do not set this field for insertions into supplemental data sources. If the operation is prevented, the aborted exception will be thrown.", + "format": "int64", + "type": "string" + } + }, + "type": "object" + }, + "ProductInstallment": { + "description": "A message that represents installment.", + "id": "ProductInstallment", + "properties": { + "amount": { + "$ref": "Price", + "description": "The amount the buyer has to pay per month." + }, + "creditType": { + "description": "Type of installment payments.", + "enum": [ + "CREDIT_TYPE_UNSPECIFIED", + "FINANCE", + "LEASE" + ], + "enumDescriptions": [ + "Default value. This value is unused.", + "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" + }, + "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" + }, + "eventTime": { + "description": "The time at which the event was generated. If you want to order the notification messages you receive you should rely on this field not on the order of receiving the notifications.", + "format": "google-datetime", + "type": "string" + }, + "expirationTime": { + "description": "Optional. The product expiration time. This field will not be set if the notification is sent for a product deletion event.", + "format": "google-datetime", + "type": "string" + }, + "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: `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" + }, + "ProductSustainabilityIncentive": { + "description": "Information regarding sustainability-related incentive programs such as rebates or tax relief.", + "id": "ProductSustainabilityIncentive", + "properties": { + "amount": { + "$ref": "Price", + "description": "The fixed amount of the incentive." + }, + "percentage": { + "description": "The percentage of the sale price that the incentive is applied to.", + "format": "double", + "type": "number" + }, + "type": { + "description": "Sustainability incentive program.", + "enum": [ + "TYPE_UNSPECIFIED", + "EV_TAX_CREDIT", + "EV_PRICE_DISCOUNT" + ], + "enumDescriptions": [ + "Unspecified or unknown sustainability incentive type.", + "Program offering tax liability reductions for electric vehicles and, in some countries, plug-in hybrids. These reductions can be based on a specific amount or a percentage of the sale price.", + "A subsidy program, often called an environmental bonus, provides a purchase grant for electric vehicles and, in some countries, plug-in hybrids. The grant amount may be a fixed sum or a percentage of the sale price." + ], + "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" + }, + "StructuredDescription": { + "description": "Structured description, for algorithmically (AI)-generated descriptions.", + "id": "StructuredDescription", + "properties": { + "content": { + "description": "The description text Maximum length is 5000 characters", + "type": "string" + }, + "digitalSourceType": { + "description": "The digital source type. Following [IPTC](https://cv.iptc.org/newscodes/digitalsourcetype).", + "enum": [ + "DIGITAL_SOURCE_TYPE_UNSPECIFIED", + "TRAINED_ALGORITHMIC_MEDIA", + "DEFAULT" + ], + "enumDescriptions": [ + "Digital source type is unspecified.", + "Text created algorithmically using a model derived from sampled content.", + "Text NOT created algorithmically using a model derived from sampled content (the default)" + ], + "type": "string" + } + }, + "type": "object" + }, + "StructuredTitle": { + "description": "Structured title, for algorithmically (AI)-generated titles.", + "id": "StructuredTitle", + "properties": { + "content": { + "description": "The title text Maximum length is 150 characters", + "type": "string" + }, + "digitalSourceType": { + "description": "The digital source type. Following [IPTC](https://cv.iptc.org/newscodes/digitalsourcetype).", + "enum": [ + "DIGITAL_SOURCE_TYPE_UNSPECIFIED", + "TRAINED_ALGORITHMIC_MEDIA", + "DEFAULT" + ], + "enumDescriptions": [ + "Digital source type is unspecified.", + "Text created algorithmically using a model derived from sampled content.", + "Text NOT created algorithmically using a model derived from sampled content (the default)" + ], + "type": "string" + } + }, + "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" + }, + "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_v1", + "version_module": true +} \ No newline at end of file diff --git a/merchantapi/products/v1/merchantapi-gen.go b/merchantapi/products/v1/merchantapi-gen.go new file mode 100644 index 00000000000..8c5ba44d233 --- /dev/null +++ b/merchantapi/products/v1/merchantapi-gen.go @@ -0,0 +1,2742 @@ +// Copyright 2025 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.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/v1" +// ... +// 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/v1" + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "log/slog" + "net/http" + "net/url" + "strconv" + "strings" + + "github.com/googleapis/gax-go/v2/internallog" + 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 +var _ = internallog.New + +const apiId = "merchantapi:products_v1" +const apiName = "merchantapi" +const apiVersion = "products_v1" +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 := &Service{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)} + s.Accounts = NewAccountsService(s) + 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") + } + return NewService(context.TODO(), option.WithHTTPClient(client)) +} + +type Service struct { + client *http.Client + logger *slog.Logger + 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 +} + +// AutomatedDiscounts: Information regarding Automated Discounts. +type AutomatedDiscounts struct { + // GadPrice: The current sale price for products with a price optimized using + // Google Automated Discounts (GAD). Absent if the information about the + // GAD_price of the product is not available. + GadPrice *Price `json:"gadPrice,omitempty"` + // PriorPrice: The price prior to the application of the first price reduction. + // Absent if the information about the prior price of the product is not + // available. + PriorPrice *Price `json:"priorPrice,omitempty"` + // PriorPriceProgressive: The price prior to the application of consecutive + // price reductions. Absent if the information about the prior price of the + // product is not available. + PriorPriceProgressive *Price `json:"priorPriceProgressive,omitempty"` + // ForceSendFields is a list of field names (e.g. "GadPrice") 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. "GadPrice") 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 AutomatedDiscounts) MarshalJSON() ([]byte, error) { + type NoMethod AutomatedDiscounts + 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_AFFILIATE" - [Youtube + // Affiliate](https://support.google.com/youtube/answer/13376398). + // "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). + // "PRODUCT_REVIEWS" - [Product + // Reviews](https://support.google.com/merchants/answer/14620732). + // "MERCHANT_REVIEWS" - [Merchant + // Reviews](https://developers.google.com/merchant-review-feeds). + // "YOUTUBE_CHECKOUT" - YouTube Checkout . + 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) +} + +// 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_AFFILIATE" - [Youtube + // Affiliate](https://support.google.com/youtube/answer/13376398). + // "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). + // "PRODUCT_REVIEWS" - [Product + // Reviews](https://support.google.com/merchants/answer/14620732). + // "MERCHANT_REVIEWS" - [Merchant + // Reviews](https://developers.google.com/merchant-review-feeds). + // "YOUTUBE_CHECKOUT" - YouTube Checkout . + ReportingContext string `json:"reportingContext,omitempty"` + // Resolution: Whether the issue can be resolved by the business. + 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"` + // MemberPriceEffectiveDate: A date range during which the item is eligible for + // member price. If not specified, the member price is always applicable. The + // date range is represented by a pair of ISO 8601 dates separated by a space, + // comma, or slash. + MemberPriceEffectiveDate *Interval `json:"memberPriceEffectiveDate,omitempty"` + // 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 business 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 business. + // The corresponding program must be linked to the Merchant Center account. + ProgramLabel string `json:"programLabel,omitempty"` + // ShippingLabel: The label of the shipping benefit. If the field has value, + // this offer has loyalty shipping benefit. If the field value isn't provided, + // the item is not eligible for loyalty shipping for the given loyalty tier. + ShippingLabel string `json:"shippingLabel,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. 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 { + // AutomatedDiscounts: Output only. The automated discounts information for the + // product. + AutomatedDiscounts *AutomatedDiscounts `json:"automatedDiscounts,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 lets you categorize and identify your + // products. The maximum allowed characters is 20 and the supported characters + // are`A-Z`, `0-9`, hyphen and underscore. The feed label must not include any + // spaces. For more information, see Using feed labels + // (//support.google.com/merchants/answer/14994087) + FeedLabel string `json:"feedLabel,omitempty"` + // LegacyLocal: Output only. Determines whether the product is **only** + // targeting local destinations and whether the product name should be + // distinguished with a `local~` prefix. For example, + // `accounts/123/products/local~en~US~sku123`. + LegacyLocal bool `json:"legacyLocal,omitempty"` + // Name: The name of the product. Format: + // `accounts/{account}/products/{product}` where the last section `product` + // consists of: `content_language~feed_label~offer_id` example for product name + // is `accounts/123/products/en~US~sku123`. A legacy local product name would + // be `accounts/123/products/local~en~US~sku123`. Note: For calls to the v1beta + // version, the `product` section consists of: + // `channel~content_language~feed_label~offer_id`, for example: + // `accounts/123/products/online~en~US~sku123`. + 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"` + // ProductAttributes: Output only. A list of strongly-typed product attributes. + ProductAttributes *ProductAttributes `json:"productAttributes,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. "AutomatedDiscounts") 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. "AutomatedDiscounts") 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) +} + +// ProductAttributes: Product attributes. +type ProductAttributes 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. For more information, see Display ads attribute + // (https://support.google.com/merchants/answer/6069387). + 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. + // + // Possible values: + // "AGE_GROUP_UNSPECIFIED" - Age group is not specified. + // "ADULT" - Teens or older. + // "KIDS" - 5-13 years old. + // "TODDLER" - 1-5 years old. + // "INFANT" - 3-12 months old. + // "NEWBORN" - 0-3 months old. + 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 business offers do not fall below this value, + // thereby preserving the offer's value and profitability. + AutoPricingMinPrice *Price `json:"autoPricingMinPrice,omitempty"` + // Availability: Availability + // (https://support.google.com/merchants/answer/6324448) status of the item. + // + // Possible values: + // "AVAILABILITY_UNSPECIFIED" - Availability is not specified. + // "IN_STOCK" - In stock. + // "OUT_OF_STOCK" - Out of stock. + // "PREORDER" - Pre-order. + // "LIMITED_AVAILABILITY" - Limited availability. + // "BACKORDER" - Backorder. + 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 (https://support.google.com/merchants/answer/6324351) of the + // item. For example, "Google". + 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 []*ProductCertification `json:"certifications,omitempty"` + // CloudExportAdditionalProperties: Extra fields to export to the Cloud Retail + // program. + CloudExportAdditionalProperties []*CloudExportAdditionalProperties `json:"cloudExportAdditionalProperties,omitempty"` + // Color: Color (https://support.google.com/merchants/answer/6324487) of the + // item. For example, "red". + Color string `json:"color,omitempty"` + // Condition: Condition (https://support.google.com/merchants/answer/6324469) + // or state of the item. + // + // Possible values: + // "CONDITION_UNSPECIFIED" - Default value. This value is unused. + // "NEW" - Brand new, original, unopened packaging. + // "USED" - Previously used, original packaging opened or missing. + // "REFURBISHED" - Professionally restored to working order, comes with a + // warranty, may or may not have the original packaging. + Condition string `json:"condition,omitempty"` + // CostOfGoodsSold: Cost of goods sold. Used for gross profit reporting. + CostOfGoodsSold *Price `json:"costOfGoodsSold,omitempty"` + // CustomLabel0: Custom label 0 + // (https://support.google.com/merchants/answer/6324473) for custom grouping of + // items in a Shopping campaign. + CustomLabel0 string `json:"customLabel0,omitempty"` + // CustomLabel1: Custom label 1 + // (https://support.google.com/merchants/answer/6324473) for custom grouping of + // items in a Shopping campaign. + CustomLabel1 string `json:"customLabel1,omitempty"` + // CustomLabel2: Custom label 2 + // (https://support.google.com/merchants/answer/6324473) for custom grouping of + // items in a Shopping campaign. + CustomLabel2 string `json:"customLabel2,omitempty"` + // CustomLabel3: Custom label 3 + // (https://support.google.com/merchants/answer/6324473) for custom grouping of + // items in a Shopping campaign. + CustomLabel3 string `json:"customLabel3,omitempty"` + // CustomLabel4: Custom label 4 + // (https://support.google.com/merchants/answer/6324473) 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. For more + // information, see Display ads attribute specification + // (https://support.google.com/merchants/answer/6069387). + 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. For more + // information, see Display ads attribute + // (https://support.google.com/merchants/answer/6069387). + DisplayAdsValue float64 `json:"displayAdsValue,omitempty"` + // EnergyEfficiencyClass: The energy efficiency class + // (https://support.google.com/merchants/answer/7562785) as defined in EU + // directive 2010/30/EU. + // + // Possible values: + // "ENERGY_EFFICIENCY_CLASS_UNSPECIFIED" - The energy efficiency class is + // unspecified. + // "APPP" - A+++. + // "APP" - A++. + // "AP" - A+. + // "A" - A. + // "B" - B. + // "C" - C. + // "D" - D. + // "E" - E. + // "F" - F. + // "G" - G. + EnergyEfficiencyClass string `json:"energyEfficiencyClass,omitempty"` + // ExcludedDestinations: The list of destinations to exclude for this target + // (corresponds to unchecked check boxes in Merchant Center). For more + // information, see Excluded destination + // (https://support.google.com/merchants/answer/6324486). Note: We recommend + // setting destinations on datasources level for most use cases. Use this field + // within products to only setup exceptions. + // + // 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). + // "YOUTUBE_SHOPPING_CHECKOUT" - Youtube shopping checkout. + // "YOUTUBE_AFFILIATE" - [Youtube + // Affiliate](https://support.google.com/youtube/answer/13376398). + // "FREE_VEHICLE_LISTINGS" - [Free vehicle + // listings](https://support.google.com/merchants/answer/11189169). + // "VEHICLE_ADS" - [Vehicle + // ads](https://support.google.com/merchants/answer/11189169). + // "CLOUD_RETAIL" - [Cloud + // retail](https://cloud.google.com/solutions/retail). + // "LOCAL_CLOUD_RETAIL" - [Local cloud + // retail](https://cloud.google.com/solutions/retail). + 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 (https://support.google.com/merchants/answer/6324479) + // of the item. + // + // Possible values: + // "GENDER_UNSPECIFIED" - Gender is not specified. + // "MALE" - Male. + // "FEMALE" - Female. + // "UNISEX" - Unisex. + 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"` + // Gtins: Global Trade Item Numbers (GTIN + // (https://support.google.com/merchants/answer/188494#gtin)) of the item. You + // can provide up to 10 GTINs. + Gtins []string `json:"gtins,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`. + // For more information, see Included destination + // (https://support.google.com/merchants/answer/7501026). Note: We recommend + // setting destinations on datasources level for most use cases. Use this field + // within products to only setup exceptions. + // + // 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). + // "YOUTUBE_SHOPPING_CHECKOUT" - Youtube shopping checkout. + // "YOUTUBE_AFFILIATE" - [Youtube + // Affiliate](https://support.google.com/youtube/answer/13376398). + // "FREE_VEHICLE_LISTINGS" - [Free vehicle + // listings](https://support.google.com/merchants/answer/11189169). + // "VEHICLE_ADS" - [Vehicle + // ads](https://support.google.com/merchants/answer/11189169). + // "CLOUD_RETAIL" - [Cloud + // retail](https://cloud.google.com/solutions/retail). + // "LOCAL_CLOUD_RETAIL" - [Local cloud + // retail](https://cloud.google.com/solutions/retail). + IncludedDestinations []string `json:"includedDestinations,omitempty"` + // Installment: Number and amount of installments to pay for an item. + Installment *ProductInstallment `json:"installment,omitempty"` + // IsBundle: Whether the item is a business-defined sub-API. A [sub-API] + // (https://support.google.com/merchants/answer/6324449) is a custom grouping + // of different products sold by a business 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 + // (https://support.google.com/merchants/answer/13871172) for business 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 (https://support.google.com/merchants/answer/6324410) + // of which the item is made. For example, "Leather" or "Cotton". + Material string `json:"material,omitempty"` + // MaxEnergyEfficiencyClass: The energy efficiency class + // (https://support.google.com/merchants/answer/7562785) as defined in EU + // directive 2010/30/EU. + // + // Possible values: + // "ENERGY_EFFICIENCY_CLASS_UNSPECIFIED" - The energy efficiency class is + // unspecified. + // "APPP" - A+++. + // "APP" - A++. + // "AP" - A+. + // "A" - A. + // "B" - B. + // "C" - C. + // "D" - D. + // "E" - E. + // "F" - F. + // "G" - G. + MaxEnergyEfficiencyClass string `json:"maxEnergyEfficiencyClass,omitempty"` + // MaxHandlingTime: Maximal product handling time (in business days). + MaxHandlingTime int64 `json:"maxHandlingTime,omitempty,string"` + // MaximumRetailPrice: Maximum retail price (MRP) of the item. Applicable to + // India only. + MaximumRetailPrice *Price `json:"maximumRetailPrice,omitempty"` + // MinEnergyEfficiencyClass: The energy efficiency class + // (https://support.google.com/merchants/answer/7562785) as defined in EU + // directive 2010/30/EU. + // + // Possible values: + // "ENERGY_EFFICIENCY_CLASS_UNSPECIFIED" - The energy efficiency class is + // unspecified. + // "APPP" - A+++. + // "APP" - A++. + // "AP" - A+. + // "A" - A. + // "B" - B. + // "C" - C. + // "D" - D. + // "E" - E. + // "F" - F. + // "G" - G. + 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 + // (https://support.google.com/merchants/answer/13870216) for business 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 business-defined multipack. + Multipack int64 `json:"multipack,omitempty,string"` + // Pattern: The item's pattern + // (https://support.google.com/merchants/answer/6324483). 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). + // + // Possible values: + // "PAUSE_UNSPECIFIED" - The pause is unspecified. + // "ADS" - You’re currently pausing your product for all ads locations + // (including Shopping Ads, Display Ads, and local inventory ads). + // "ALL" - You’re currently pausing your product for all Shopping locations + // (including Shopping Ads, Display Ads, local inventory ads, Buy on Google, + // and free listings). + Pause string `json:"pause,omitempty"` + // PickupMethod: The pickup + // (https://support.google.com/merchants/answer/14634021) option for the item. + // + // Possible values: + // "PICKUP_METHOD_UNSPECIFIED" - Pickup method is not specified. + // "NOT_SUPPORTED" - The item is not available for store pickup. + // "BUY" - The entire transaction occurs online. + // "RESERVE" - The item is reserved online and the transaction occurs + // in-store. + // "SHIP_TO_STORE" - The item is purchased online and shipped to a local + // store for the customer to pick up. + PickupMethod string `json:"pickupMethod,omitempty"` + // PickupSla: Item store pickup timeline. For more information, see Pickup SLA + // (https://support.google.com/merchants/answer/14635400). + // + // Possible values: + // "PICKUP_SLA_UNSPECIFIED" - Pickup SLA is not specified. + // "SAME_DAY" - Indicates that the product is available for pickup the same + // day that the order is placed, subject to cut off times. + // "NEXT_DAY" - Indicates that the product is available for pickup the + // following day that the order is placed. + // "TWO_DAY" - Indicates that the product will be shipped to a store for a + // customer to pick up in 2 days. + // "THREE_DAY" - Indicates that the product will be shipped to a store for a + // customer to pick up in 3 days. + // "FOUR_DAY" - Indicates that the product will be shipped to a store for a + // customer to pick up in 4 days + // "FIVE_DAY" - Indicates that the product will be shipped to a store for a + // customer to pick up in 5 days. + // "SIX_DAY" - Indicates that the product will be shipped to a store for a + // customer to pick up in 6 days. + // "MULTI_WEEK" - Indicates that the product will be shipped to a store for a + // customer to pick up in one week or more. + 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 product + // highlights (https://support.google.com/merchants/answer/9216100). + 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/7052112#product_category)). + 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/7052112#price_and_availability). + 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) + // (https://en.wikipedia.org/wiki/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 Size + // (https://support.google.com/merchants/answer/6324492). + Size string `json:"size,omitempty"` + // SizeSystem: System in which the size is specified. Recommended for apparel + // items. For more information, see Size system + // (https://support.google.com/merchants/answer/6324502). + // + // Possible values: + // "SIZE_SYSTEM_UNSPECIFIED" - Unspecified size system. + // "AU" - AU. + // "BR" - BR. + // "CN" - CN. + // "DE" - DE. + // "EU" - EU. + // "FR" - FR. + // "IT" - IT. + // "JP" - JP. + // "MEX" - MEX. + // "UK" - UK. + // "US" - US. + 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 Size + // type (https://support.google.com/merchants/answer/6324497). + // + // Possible values: + // "SIZE_TYPE_UNSPECIFIED" - The size type is not specified. + // "REGULAR" - Regular size. + // "PETITE" - Petite size. + // "MATERNITY" - Maternity size. + // "BIG" - Big size. + // "TALL" - Tall size. + // "PLUS" - Plus size. + SizeTypes []string `json:"sizeTypes,omitempty"` + // StructuredDescription: Structured description, for algorithmically + // (AI)-generated descriptions. + StructuredDescription *StructuredDescription `json:"structuredDescription,omitempty"` + // StructuredTitle: Structured title, for algorithmically (AI)-generated + // titles. + StructuredTitle *StructuredTitle `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"` + // SustainabilityIncentives: The list of sustainability incentive programs. + SustainabilityIncentives []*ProductSustainabilityIncentive `json:"sustainabilityIncentives,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 ProductAttributes) MarshalJSON() ([]byte, error) { + type NoMethod ProductAttributes + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +func (s *ProductAttributes) UnmarshalJSON(data []byte) error { + type NoMethod ProductAttributes + 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 +} + +// ProductCertification: Product certification +// (https://support.google.com/merchants/answer/13528839), initially introduced +// for EU energy efficiency labeling compliance using the EU EPREL database. +type ProductCertification struct { + // CertificationAuthority: The certification authority. + // + // Possible values: + // "CERTIFICATION_AUTHORITY_UNSPECIFIED" - Certification authority is not + // specified. + // "ADEME" - For the French CO2 emissions class for vehicles. + // "BMWK" - For the German CO2 emissions classes for vehicles. + // "EPA" - Environment Protection Agency. + // "EC" - European Commission for energy labels in the EU. + 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. + // + // Possible values: + // "CERTIFICATION_NAME_UNSPECIFIED" - Certification name is not specified. + // "ENERGY_STAR" - Energy Star. + // "ENERGY_STAR_MOST_EFFICIENT" - Energy Star Most Efficient. + // "EPREL" - Represents energy efficiency certifications in the EU European + // Registry for Energy Labeling (EPREL) database. + // "EU_ECOLABEL" - EU Ecolabel. + // "VEHICLE_ENERGY_EFFICIENCY" - The overall CO2 class of a vehicle + // "VEHICLE_ENERGY_EFFICIENCY_DISCHARGED_BATTERY" - For the CO2 class of a + // vehicle with a discharged battery. + 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 ProductCertification) MarshalJSON() ([]byte, error) { + type NoMethod ProductCertification + 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. If empty, it + // means that the product was deleted. Will have one of these values : + // (`approved`, `pending`, `disapproved`, ``) + NewValue string `json:"newValue,omitempty"` + // OldValue: The old value of the changed resource or attribute. If empty, it + // means that the product was created. Will have one of these values : + // (`approved`, `pending`, `disapproved`, ``) + OldValue string `json:"oldValue,omitempty"` + // RegionCode: Countries that have the change (if applicable). Represented in + // the ISO 3166 format. + RegionCode string `json:"regionCode,omitempty"` + // ReportingContext: Reporting contexts that have the change (if applicable). + // Currently this field supports only (`SHOPPING_ADS`, `LOCAL_INVENTORY_ADS`, + // `YOUTUBE_SHOPPING`, `YOUTUBE_CHECKOUT`, `YOUTUBE_AFFILIATE`) from the enum + // value ReportingContextEnum + // (/merchant/api/reference/rest/Shared.Types/ReportingContextEnum) + // + // 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_AFFILIATE" - [Youtube + // Affiliate](https://support.google.com/youtube/answer/13376398). + // "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). + // "PRODUCT_REVIEWS" - [Product + // Reviews](https://support.google.com/merchants/answer/14620732). + // "MERCHANT_REVIEWS" - [Merchant + // Reviews](https://developers.google.com/merchant-review-feeds). + // "YOUTUBE_CHECKOUT" - YouTube Checkout . + 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. For more +// information, see Manage products (/merchant/api/guides/products/overview). +// 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 Products Data Specification +// (https://support.google.com/merchants/answer/188494) with some exceptions +// (https://support.google.com/merchants/answer/7052112). The following +// reference documentation lists the field names in the **camelCase** casing +// style while the Products Data Specification lists the names in the +// **snake_case** casing style. +type ProductInput struct { + // 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. 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 that lets you categorize and + // identify your products. The maximum allowed characters are 20, and the + // supported characters are `A-Z`, `0-9`, hyphen, and underscore. The feed + // label must not include any spaces. For more information, see Using feed + // labels (//support.google.com/merchants/answer/14994087). + FeedLabel string `json:"feedLabel,omitempty"` + // LegacyLocal: Immutable. Determines whether the product is **only** targeting + // local destinations and whether the product name should be distinguished with + // a `local~` prefix. For example, + // `accounts/123/productInputs/local~en~US~sku123`. If a product that is not + // `legacy_local` is already targeting local destinations, creating a + // `legacy_local` product with an otherwise matching name will fail. + LegacyLocal bool `json:"legacyLocal,omitempty"` + // Name: Identifier. The name of the product input. Format: + // `accounts/{account}/productInputs/{productinput}` where the last section + // `productinput` consists of: `content_language~feed_label~offer_id` example + // for product input name is `accounts/123/productInputs/en~US~sku123`. A + // legacy local product input name would be + // `accounts/123/productInputs/local~en~US~sku123`. Note: For calls to the + // v1beta version, the `productInput` section consists of: + // `channel~content_language~feed_label~offer_id`, for example: + // `accounts/123/productInputs/online~en~US~sku123`. + 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: + // `accounts/{account}/products/{product}` + Product string `json:"product,omitempty"` + // ProductAttributes: Optional. A list of strongly-typed product attributes. + ProductAttributes *ProductAttributes `json:"productAttributes,omitempty"` + // VersionNumber: Optional. Immutable. 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. Do not set this field for updates. Do + // not set this field for insertions into supplemental 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. "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 ProductInput) MarshalJSON() ([]byte, error) { + type NoMethod ProductInput + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// ProductInstallment: A message that represents installment. +type ProductInstallment struct { + // Amount: The amount the buyer has to pay per month. + Amount *Price `json:"amount,omitempty"` + // CreditType: Type of installment payments. + // + // Possible values: + // "CREDIT_TYPE_UNSPECIFIED" - Default value. This value is unused. + // "FINANCE" - Finance. + // "LEASE" - 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 ProductInstallment) MarshalJSON() ([]byte, error) { + type NoMethod ProductInstallment + 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"` + // EventTime: The time at which the event was generated. If you want to order + // the notification messages you receive you should rely on this field not on + // the order of receiving the notifications. + EventTime string `json:"eventTime,omitempty"` + // ExpirationTime: Optional. The product expiration time. This field will not + // be set if the notification is sent for a product deletion event. + ExpirationTime string `json:"expirationTime,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: `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) +} + +// ProductSustainabilityIncentive: Information regarding sustainability-related +// incentive programs such as rebates or tax relief. +type ProductSustainabilityIncentive struct { + // Amount: The fixed amount of the incentive. + Amount *Price `json:"amount,omitempty"` + // Percentage: The percentage of the sale price that the incentive is applied + // to. + Percentage float64 `json:"percentage,omitempty"` + // Type: Sustainability incentive program. + // + // Possible values: + // "TYPE_UNSPECIFIED" - Unspecified or unknown sustainability incentive type. + // "EV_TAX_CREDIT" - Program offering tax liability reductions for electric + // vehicles and, in some countries, plug-in hybrids. These reductions can be + // based on a specific amount or a percentage of the sale price. + // "EV_PRICE_DISCOUNT" - A subsidy program, often called an environmental + // bonus, provides a purchase grant for electric vehicles and, in some + // countries, plug-in hybrids. The grant amount may be a fixed sum or a + // percentage of the sale price. + Type string `json:"type,omitempty"` + // 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 ProductSustainabilityIncentive) MarshalJSON() ([]byte, error) { + type NoMethod ProductSustainabilityIncentive + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +func (s *ProductSustainabilityIncentive) UnmarshalJSON(data []byte) error { + type NoMethod ProductSustainabilityIncentive + var s1 struct { + Percentage gensupport.JSONFloat64 `json:"percentage"` + *NoMethod + } + s1.NoMethod = (*NoMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Percentage = float64(s1.Percentage) + return nil +} + +// 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 +} + +// StructuredDescription: Structured description, for algorithmically +// (AI)-generated descriptions. +type StructuredDescription struct { + // Content: The description text Maximum length is 5000 characters + Content string `json:"content,omitempty"` + // DigitalSourceType: The digital source type. Following IPTC + // (https://cv.iptc.org/newscodes/digitalsourcetype). + // + // Possible values: + // "DIGITAL_SOURCE_TYPE_UNSPECIFIED" - Digital source type is unspecified. + // "TRAINED_ALGORITHMIC_MEDIA" - Text created algorithmically using a model + // derived from sampled content. + // "DEFAULT" - Text NOT created algorithmically using a model derived from + // sampled content (the default) + 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 StructuredDescription) MarshalJSON() ([]byte, error) { + type NoMethod StructuredDescription + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// StructuredTitle: Structured title, for algorithmically (AI)-generated +// titles. +type StructuredTitle struct { + // Content: The title text Maximum length is 150 characters + Content string `json:"content,omitempty"` + // DigitalSourceType: The digital source type. Following IPTC + // (https://cv.iptc.org/newscodes/digitalsourcetype). + // + // Possible values: + // "DIGITAL_SOURCE_TYPE_UNSPECIFIED" - Digital source type is unspecified. + // "TRAINED_ALGORITHMIC_MEDIA" - Text created algorithmically using a model + // derived from sampled content. + // "DEFAULT" - Text NOT created algorithmically using a model derived from + // sampled content (the default) + 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 StructuredTitle) MarshalJSON() ([]byte, error) { + type NoMethod StructuredTitle + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// 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) +} + +// 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}` where the last section +// `product` consists of: `content_language~feed_label~offer_id` example for +// product name is `accounts/123/productInputs/en~US~sku123`. +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}`. For example, +// `accounts/123456/dataSources/104628`. +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_) + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "products/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.productInputs.delete", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.productInputs.delete", "response", internallog.HTTPResponse(res, b)) + 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 +// (/merchant/api/guides/products/overview#upload-product-input). You must have +// a products data source (/merchant/api/guides/data-sources/overview) to be +// able to insert a product. The unique identifier of the data source is passed +// as a query parameter in the request URL. If a product input with the same +// contentLanguage, offerId, and dataSource already exists, then the product +// input inserted by 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. For more information, see Overview of Data sources sub-API +// (/merchant/api/guides/data-sources/overview). Only API data sources are +// supported. Format: `accounts/{account}/dataSources/{datasource}`. For +// example, `accounts/123456/dataSources/104628`. +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_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(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/v1/{+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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.productInputs.insert", "request", internallog.HTTPRequest(req, body.Bytes())) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.productInputs.insert", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + +type AccountsProductInputsPatchCall struct { + s *Service + name string + productinput *ProductInput + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates the existing product input in 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: Identifier. The name of the product input. Format: +// `accounts/{account}/productInputs/{productinput}` where the last section +// `productinput` consists of: `content_language~feed_label~offer_id` example +// for product input name is `accounts/123/productInputs/en~US~sku123`. A +// legacy local product input name would be +// `accounts/123/productInputs/local~en~US~sku123`. Note: For calls to the +// v1beta version, the `productInput` section consists of: +// `channel~content_language~feed_label~offer_id`, for example: +// `accounts/123/productInputs/online~en~US~sku123`. +func (r *AccountsProductInputsService) Patch(name string, productinput *ProductInput) *AccountsProductInputsPatchCall { + c := &AccountsProductInputsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.productinput = productinput + return c +} + +// DataSource sets the optional parameter "dataSource": Required. The primary +// or supplemental product data source where `data_source` name identifies the +// product input to be updated. Only API data sources are supported. Format: +// `accounts/{account}/dataSources/{datasource}`. For example, +// `accounts/123456/dataSources/104628`. +func (c *AccountsProductInputsPatchCall) DataSource(dataSource string) *AccountsProductInputsPatchCall { + c.urlParams_.Set("dataSource", dataSource) + return c +} + +// UpdateMask sets the optional parameter "updateMask": The list of product +// attributes to be updated. If the update mask is omitted, then it is treated +// as implied field mask equivalent to all fields that are populated (have a +// non-empty value). Attributes specified in the update mask without a value +// specified in the body will be deleted from the product. Update mask can only +// be specified for top level fields in attributes and custom attributes. To +// specify the update mask for custom attributes you need to add the +// `custom_attribute.` prefix. Providing special "*" value for full product +// replacement is not supported. +func (c *AccountsProductInputsPatchCall) UpdateMask(updateMask string) *AccountsProductInputsPatchCall { + 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 *AccountsProductInputsPatchCall) Fields(s ...googleapi.Field) *AccountsProductInputsPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *AccountsProductInputsPatchCall) Context(ctx context.Context) *AccountsProductInputsPatchCall { + 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 *AccountsProductInputsPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *AccountsProductInputsPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(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/v1/{+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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.productInputs.patch", "request", internallog.HTTPRequest(req, body.Bytes())) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "merchantapi.accounts.productInputs.patch" 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 *AccountsProductInputsPatchCall) 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.productInputs.patch", "response", internallog.HTTPResponse(res, b)) + 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}` where the last section `product` +// consists of: `content_language~feed_label~offer_id` example for product +// name is `accounts/123/products/en~US~sku123`. A legacy local product name +// would be `accounts/123/products/local~en~US~sku123`. Note: For calls to +// the v1beta version, the `product` section consists of: +// `channel~content_language~feed_label~offer_id`, for example: +// `accounts/123/products/online~en~US~sku123`. +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_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "products/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.products.get", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.products.get", "response", internallog.HTTPResponse(res, b)) + 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 default page size of 25 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_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "products/v1/{+parent}/products") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.products.list", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.products.list", "response", internallog.HTTPResponse(res, b)) + 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/v1/merchantapi-api.json b/merchantapi/promotions/v1/merchantapi-api.json new file mode 100644 index 00000000000..66d1c55fd1c --- /dev/null +++ b/merchantapi/promotions/v1/merchantapi-api.json @@ -0,0 +1,1034 @@ +{ + "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.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_v1", + "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/v1/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/v1/{+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/v1/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/v1/{+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/v1/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 250; values above 250 will be coerced to 250. 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/v1/{+parent}/promotions", + "response": { + "$ref": "ListPromotionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + } + } + } + }, + "revision": "20250804", + "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. Only available for online promotions.", + "Overnight free shipping coupon value type. Only available for online promotions.", + "Two day free shipping coupon value type. Only available for online promotions." + ], + "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": { + "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 (also known as [Marketing methods](https://support.google.com/merchants/answer/15130232)) 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", + "YOUTUBE_SHOPPING_CHECKOUT", + "YOUTUBE_AFFILIATE", + "FREE_VEHICLE_LISTINGS", + "VEHICLE_ADS", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL" + ], + "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).", + "Youtube shopping checkout.", + "[Youtube Affiliate](https://support.google.com/youtube/answer/13376398).", + "[Free vehicle listings](https://support.google.com/merchants/answer/11189169).", + "[Vehicle ads](https://support.google.com/merchants/answer/11189169).", + "[Cloud retail](https://cloud.google.com/solutions/retail).", + "[Local cloud retail](https://cloud.google.com/solutions/retail)." + ], + "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_AFFILIATE", + "YOUTUBE_SHOPPING", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL", + "PRODUCT_REVIEWS", + "MERCHANT_REVIEWS", + "YOUTUBE_CHECKOUT" + ], + "enumDeprecated": [ + false, + false, + true, + false, + false, + false, + false, + 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 Affiliate](https://support.google.com/youtube/answer/13376398).", + "[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).", + "[Product Reviews](https://support.google.com/merchants/answer/14620732).", + "[Merchant Reviews](https://developers.google.com/merchant-review-feeds).", + "YouTube Checkout ." + ], + "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_AFFILIATE", + "YOUTUBE_SHOPPING", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL", + "PRODUCT_REVIEWS", + "MERCHANT_REVIEWS", + "YOUTUBE_CHECKOUT" + ], + "enumDeprecated": [ + false, + false, + true, + false, + false, + false, + false, + 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 Affiliate](https://support.google.com/youtube/answer/13376398).", + "[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).", + "[Product Reviews](https://support.google.com/merchants/answer/14620732).", + "[Merchant Reviews](https://developers.google.com/merchant-review-feeds).", + "YouTube Checkout ." + ], + "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. If empty, it means that the product was deleted. Will have one of these values : (`approved`, `pending`, `disapproved`, ``)", + "type": "string" + }, + "oldValue": { + "description": "The old value of the changed resource or attribute. If empty, it means that the product was created. Will have one of these values : (`approved`, `pending`, `disapproved`, ``)", + "type": "string" + }, + "regionCode": { + "description": "Countries that have the change (if applicable). Represented in the ISO 3166 format.", + "type": "string" + }, + "reportingContext": { + "description": "Reporting contexts that have the change (if applicable). Currently this field supports only (`SHOPPING_ADS`, `LOCAL_INVENTORY_ADS`, `YOUTUBE_SHOPPING`, `YOUTUBE_CHECKOUT`, `YOUTUBE_AFFILIATE`) from the enum value [ReportingContextEnum](/merchant/api/reference/rest/Shared.Types/ReportingContextEnum)", + "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_AFFILIATE", + "YOUTUBE_SHOPPING", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL", + "PRODUCT_REVIEWS", + "MERCHANT_REVIEWS", + "YOUTUBE_CHECKOUT" + ], + "enumDeprecated": [ + false, + false, + true, + false, + false, + false, + false, + 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 Affiliate](https://support.google.com/youtube/answer/13376398).", + "[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).", + "[Product Reviews](https://support.google.com/merchants/answer/14620732).", + "[Merchant Reviews](https://developers.google.com/merchant-review-feeds).", + "YouTube Checkout ." + ], + "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" + }, + "eventTime": { + "description": "The time at which the event was generated. If you want to order the notification messages you receive you should rely on this field not on the order of receiving the notifications.", + "format": "google-datetime", + "type": "string" + }, + "expirationTime": { + "description": "Optional. The product expiration time. This field will not be set if the notification is sent for a product deletion event.", + "format": "google-datetime", + "type": "string" + }, + "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: `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_v1", + "version_module": true +} \ No newline at end of file diff --git a/merchantapi/promotions/v1/merchantapi-gen.go b/merchantapi/promotions/v1/merchantapi-gen.go new file mode 100644 index 00000000000..cc190ec34d1 --- /dev/null +++ b/merchantapi/promotions/v1/merchantapi-gen.go @@ -0,0 +1,1349 @@ +// Copyright 2025 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.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/v1" +// ... +// 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/v1" + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "log/slog" + "net/http" + "net/url" + "strconv" + "strings" + + "github.com/googleapis/gax-go/v2/internallog" + 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 +var _ = internallog.New + +const apiId = "merchantapi:promotions_v1" +const apiName = "merchantapi" +const apiVersion = "promotions_v1" +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 := &Service{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)} + s.Accounts = NewAccountsService(s) + 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") + } + return NewService(context.TODO(), option.WithHTTPClient(client)) +} + +type Service struct { + client *http.Client + logger *slog.Logger + 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. Only + // available for online promotions. + // "FREE_SHIPPING_OVERNIGHT" - Overnight free shipping coupon value type. + // Only available for online promotions. + // "FREE_SHIPPING_TWO_DAY" - Two day free shipping coupon value type. Only + // available for online promotions. + 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 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 (also known as + // Marketing methods (https://support.google.com/merchants/answer/15130232)) + // 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). + // "YOUTUBE_SHOPPING_CHECKOUT" - Youtube shopping checkout. + // "YOUTUBE_AFFILIATE" - [Youtube + // Affiliate](https://support.google.com/youtube/answer/13376398). + // "FREE_VEHICLE_LISTINGS" - [Free vehicle + // listings](https://support.google.com/merchants/answer/11189169). + // "VEHICLE_ADS" - [Vehicle + // ads](https://support.google.com/merchants/answer/11189169). + // "CLOUD_RETAIL" - [Cloud + // retail](https://cloud.google.com/solutions/retail). + // "LOCAL_CLOUD_RETAIL" - [Local cloud + // retail](https://cloud.google.com/solutions/retail). + 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_AFFILIATE" - [Youtube + // Affiliate](https://support.google.com/youtube/answer/13376398). + // "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). + // "PRODUCT_REVIEWS" - [Product + // Reviews](https://support.google.com/merchants/answer/14620732). + // "MERCHANT_REVIEWS" - [Merchant + // Reviews](https://developers.google.com/merchant-review-feeds). + // "YOUTUBE_CHECKOUT" - YouTube Checkout . + 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_AFFILIATE" - [Youtube + // Affiliate](https://support.google.com/youtube/answer/13376398). + // "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). + // "PRODUCT_REVIEWS" - [Product + // Reviews](https://support.google.com/merchants/answer/14620732). + // "MERCHANT_REVIEWS" - [Merchant + // Reviews](https://developers.google.com/merchant-review-feeds). + // "YOUTUBE_CHECKOUT" - YouTube Checkout . + 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. If empty, it + // means that the product was deleted. Will have one of these values : + // (`approved`, `pending`, `disapproved`, ``) + NewValue string `json:"newValue,omitempty"` + // OldValue: The old value of the changed resource or attribute. If empty, it + // means that the product was created. Will have one of these values : + // (`approved`, `pending`, `disapproved`, ``) + OldValue string `json:"oldValue,omitempty"` + // RegionCode: Countries that have the change (if applicable). Represented in + // the ISO 3166 format. + RegionCode string `json:"regionCode,omitempty"` + // ReportingContext: Reporting contexts that have the change (if applicable). + // Currently this field supports only (`SHOPPING_ADS`, `LOCAL_INVENTORY_ADS`, + // `YOUTUBE_SHOPPING`, `YOUTUBE_CHECKOUT`, `YOUTUBE_AFFILIATE`) from the enum + // value ReportingContextEnum + // (/merchant/api/reference/rest/Shared.Types/ReportingContextEnum) + // + // 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_AFFILIATE" - [Youtube + // Affiliate](https://support.google.com/youtube/answer/13376398). + // "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). + // "PRODUCT_REVIEWS" - [Product + // Reviews](https://support.google.com/merchants/answer/14620732). + // "MERCHANT_REVIEWS" - [Merchant + // Reviews](https://developers.google.com/merchant-review-feeds). + // "YOUTUBE_CHECKOUT" - YouTube Checkout . + 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"` + // EventTime: The time at which the event was generated. If you want to order + // the notification messages you receive you should rely on this field not on + // the order of receiving the notifications. + EventTime string `json:"eventTime,omitempty"` + // ExpirationTime: Optional. The product expiration time. This field will not + // be set if the notification is sent for a product deletion event. + ExpirationTime string `json:"expirationTime,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: `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_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "promotions/v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.promotions.get", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.promotions.get", "response", internallog.HTTPResponse(res, b)) + 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_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(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/v1/{+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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.promotions.insert", "request", internallog.HTTPRequest(req, body.Bytes())) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.promotions.insert", "response", internallog.HTTPResponse(res, b)) + 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 250; values above 250 will be coerced to 250. 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_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "promotions/v1/{+parent}/promotions") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.promotions.list", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.promotions.list", "response", internallog.HTTPResponse(res, b)) + 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/v1/merchantapi-api.json b/merchantapi/quota/v1/merchantapi-api.json new file mode 100644 index 00000000000..65cbd102fc9 --- /dev/null +++ b/merchantapi/quota/v1/merchantapi-api.json @@ -0,0 +1,393 @@ +{ + "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.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_v1", + "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/v1/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/v1/{+parent}/quotas", + "response": { + "$ref": "ListQuotaGroupsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + } + } + } + }, + "revision": "20250804", + "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 quota_usage.", + "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. If empty, it means that the product was deleted. Will have one of these values : (`approved`, `pending`, `disapproved`, ``)", + "type": "string" + }, + "oldValue": { + "description": "The old value of the changed resource or attribute. If empty, it means that the product was created. Will have one of these values : (`approved`, `pending`, `disapproved`, ``)", + "type": "string" + }, + "regionCode": { + "description": "Countries that have the change (if applicable). Represented in the ISO 3166 format.", + "type": "string" + }, + "reportingContext": { + "description": "Reporting contexts that have the change (if applicable). Currently this field supports only (`SHOPPING_ADS`, `LOCAL_INVENTORY_ADS`, `YOUTUBE_SHOPPING`, `YOUTUBE_CHECKOUT`, `YOUTUBE_AFFILIATE`) from the enum value [ReportingContextEnum](/merchant/api/reference/rest/Shared.Types/ReportingContextEnum)", + "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_AFFILIATE", + "YOUTUBE_SHOPPING", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL", + "PRODUCT_REVIEWS", + "MERCHANT_REVIEWS", + "YOUTUBE_CHECKOUT" + ], + "enumDeprecated": [ + false, + false, + true, + false, + false, + false, + false, + 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 Affiliate](https://support.google.com/youtube/answer/13376398).", + "[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).", + "[Product Reviews](https://support.google.com/merchants/answer/14620732).", + "[Merchant Reviews](https://developers.google.com/merchant-review-feeds).", + "YouTube Checkout ." + ], + "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" + }, + "eventTime": { + "description": "The time at which the event was generated. If you want to order the notification messages you receive you should rely on this field not on the order of receiving the notifications.", + "format": "google-datetime", + "type": "string" + }, + "expirationTime": { + "description": "Optional. The product expiration time. This field will not be set if the notification is sent for a product deletion event.", + "format": "google-datetime", + "type": "string" + }, + "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: `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_v1", + "version_module": true +} \ No newline at end of file diff --git a/merchantapi/quota/v1/merchantapi-gen.go b/merchantapi/quota/v1/merchantapi-gen.go new file mode 100644 index 00000000000..b6d0be0b915 --- /dev/null +++ b/merchantapi/quota/v1/merchantapi-gen.go @@ -0,0 +1,552 @@ +// Copyright 2025 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.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/v1" +// ... +// 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/v1" + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "log/slog" + "net/http" + "net/url" + "strconv" + "strings" + + "github.com/googleapis/gax-go/v2/internallog" + 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 +var _ = internallog.New + +const apiId = "merchantapi:quota_v1" +const apiName = "merchantapi" +const apiVersion = "quota_v1" +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 := &Service{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)} + s.Accounts = NewAccountsService(s) + 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") + } + return NewService(context.TODO(), option.WithHTTPClient(client)) +} + +type Service struct { + client *http.Client + logger *slog.Logger + 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 quota_usage. + 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. If empty, it + // means that the product was deleted. Will have one of these values : + // (`approved`, `pending`, `disapproved`, ``) + NewValue string `json:"newValue,omitempty"` + // OldValue: The old value of the changed resource or attribute. If empty, it + // means that the product was created. Will have one of these values : + // (`approved`, `pending`, `disapproved`, ``) + OldValue string `json:"oldValue,omitempty"` + // RegionCode: Countries that have the change (if applicable). Represented in + // the ISO 3166 format. + RegionCode string `json:"regionCode,omitempty"` + // ReportingContext: Reporting contexts that have the change (if applicable). + // Currently this field supports only (`SHOPPING_ADS`, `LOCAL_INVENTORY_ADS`, + // `YOUTUBE_SHOPPING`, `YOUTUBE_CHECKOUT`, `YOUTUBE_AFFILIATE`) from the enum + // value ReportingContextEnum + // (/merchant/api/reference/rest/Shared.Types/ReportingContextEnum) + // + // 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_AFFILIATE" - [Youtube + // Affiliate](https://support.google.com/youtube/answer/13376398). + // "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). + // "PRODUCT_REVIEWS" - [Product + // Reviews](https://support.google.com/merchants/answer/14620732). + // "MERCHANT_REVIEWS" - [Merchant + // Reviews](https://developers.google.com/merchant-review-feeds). + // "YOUTUBE_CHECKOUT" - YouTube Checkout . + 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"` + // EventTime: The time at which the event was generated. If you want to order + // the notification messages you receive you should rely on this field not on + // the order of receiving the notifications. + EventTime string `json:"eventTime,omitempty"` + // ExpirationTime: Optional. The product expiration time. This field will not + // be set if the notification is sent for a product deletion event. + ExpirationTime string `json:"expirationTime,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: `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_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "quota/v1/{+parent}/quotas") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.quotas.list", "request", internallog.HTTPRequest(req, nil)) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.quotas.list", "response", internallog.HTTPResponse(res, b)) + 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/v1/merchantapi-api.json b/merchantapi/reports/v1/merchantapi-api.json new file mode 100644 index 00000000000..977b56cb89d --- /dev/null +++ b/merchantapi/reports/v1/merchantapi-api.json @@ -0,0 +1,1550 @@ +{ + "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.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_v1", + "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/v1/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/v1/{+parent}/reports:search", + "request": { + "$ref": "SearchRequest" + }, + "response": { + "$ref": "SearchResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + } + } + } + }, + "revision": "20250804", + "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_AFFILIATE", + "YOUTUBE_SHOPPING", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL", + "PRODUCT_REVIEWS", + "MERCHANT_REVIEWS", + "YOUTUBE_CHECKOUT" + ], + "enumDeprecated": [ + false, + false, + true, + false, + false, + false, + false, + 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 Affiliate](https://support.google.com/youtube/answer/13376398).", + "[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).", + "[Product Reviews](https://support.google.com/merchants/answer/14620732).", + "[Merchant Reviews](https://developers.google.com/merchant-review-feeds).", + "YouTube Checkout ." + ], + "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. If empty, it means that the product was deleted. Will have one of these values : (`approved`, `pending`, `disapproved`, ``)", + "type": "string" + }, + "oldValue": { + "description": "The old value of the changed resource or attribute. If empty, it means that the product was created. Will have one of these values : (`approved`, `pending`, `disapproved`, ``)", + "type": "string" + }, + "regionCode": { + "description": "Countries that have the change (if applicable). Represented in the ISO 3166 format.", + "type": "string" + }, + "reportingContext": { + "description": "Reporting contexts that have the change (if applicable). Currently this field supports only (`SHOPPING_ADS`, `LOCAL_INVENTORY_ADS`, `YOUTUBE_SHOPPING`, `YOUTUBE_CHECKOUT`, `YOUTUBE_AFFILIATE`) from the enum value [ReportingContextEnum](/merchant/api/reference/rest/Shared.Types/ReportingContextEnum)", + "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_AFFILIATE", + "YOUTUBE_SHOPPING", + "CLOUD_RETAIL", + "LOCAL_CLOUD_RETAIL", + "PRODUCT_REVIEWS", + "MERCHANT_REVIEWS", + "YOUTUBE_CHECKOUT" + ], + "enumDeprecated": [ + false, + false, + true, + false, + false, + false, + false, + 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 Affiliate](https://support.google.com/youtube/answer/13376398).", + "[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).", + "[Product Reviews](https://support.google.com/merchants/answer/14620732).", + "[Merchant Reviews](https://developers.google.com/merchant-review-feeds).", + "YouTube Checkout ." + ], + "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" + }, + "eventTime": { + "description": "The time at which the event was generated. If you want to order the notification messages you receive you should rely on this field not on the order of receiving the notifications.", + "format": "google-datetime", + "type": "string" + }, + "expirationTime": { + "description": "Optional. The product expiration time. This field will not be set if the notification is sent for a product deletion event.", + "format": "google-datetime", + "type": "string" + }, + "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: `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](/merchant/api/guides/reports/query-language). For the full list of available tables and fields, see the [Available fields](/merchant/api/reference/rest/reports_v1beta/accounts.reports).", + "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_v1", + "version_module": true +} \ No newline at end of file diff --git a/merchantapi/reports/v1/merchantapi-gen.go b/merchantapi/reports/v1/merchantapi-gen.go new file mode 100644 index 00000000000..955fa43e044 --- /dev/null +++ b/merchantapi/reports/v1/merchantapi-gen.go @@ -0,0 +1,1801 @@ +// Copyright 2025 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.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/v1" +// ... +// 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/v1" + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "log/slog" + "net/http" + "net/url" + "strconv" + "strings" + + "github.com/googleapis/gax-go/v2/internallog" + 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 +var _ = internallog.New + +const apiId = "merchantapi:reports_v1" +const apiName = "merchantapi" +const apiVersion = "reports_v1" +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 := &Service{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)} + s.Accounts = NewAccountsService(s) + 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") + } + return NewService(context.TODO(), option.WithHTTPClient(client)) +} + +type Service struct { + client *http.Client + logger *slog.Logger + 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_AFFILIATE" - [Youtube + // Affiliate](https://support.google.com/youtube/answer/13376398). + // "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). + // "PRODUCT_REVIEWS" - [Product + // Reviews](https://support.google.com/merchants/answer/14620732). + // "MERCHANT_REVIEWS" - [Merchant + // Reviews](https://developers.google.com/merchant-review-feeds). + // "YOUTUBE_CHECKOUT" - YouTube Checkout . + 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. If empty, it + // means that the product was deleted. Will have one of these values : + // (`approved`, `pending`, `disapproved`, ``) + NewValue string `json:"newValue,omitempty"` + // OldValue: The old value of the changed resource or attribute. If empty, it + // means that the product was created. Will have one of these values : + // (`approved`, `pending`, `disapproved`, ``) + OldValue string `json:"oldValue,omitempty"` + // RegionCode: Countries that have the change (if applicable). Represented in + // the ISO 3166 format. + RegionCode string `json:"regionCode,omitempty"` + // ReportingContext: Reporting contexts that have the change (if applicable). + // Currently this field supports only (`SHOPPING_ADS`, `LOCAL_INVENTORY_ADS`, + // `YOUTUBE_SHOPPING`, `YOUTUBE_CHECKOUT`, `YOUTUBE_AFFILIATE`) from the enum + // value ReportingContextEnum + // (/merchant/api/reference/rest/Shared.Types/ReportingContextEnum) + // + // 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_AFFILIATE" - [Youtube + // Affiliate](https://support.google.com/youtube/answer/13376398). + // "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). + // "PRODUCT_REVIEWS" - [Product + // Reviews](https://support.google.com/merchants/answer/14620732). + // "MERCHANT_REVIEWS" - [Merchant + // Reviews](https://developers.google.com/merchant-review-feeds). + // "YOUTUBE_CHECKOUT" - YouTube Checkout . + 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"` + // EventTime: The time at which the event was generated. If you want to order + // the notification messages you receive you should rely on this field not on + // the order of receiving the notifications. + EventTime string `json:"eventTime,omitempty"` + // ExpirationTime: Optional. The product expiration time. This field will not + // be set if the notification is sent for a product deletion event. + ExpirationTime string `json:"expirationTime,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: `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 + // (/merchant/api/guides/reports/query-language). For the full list of + // available tables and fields, see the Available fields + // (/merchant/api/reference/rest/reports_v1beta/accounts.reports). + 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_) + body, err := googleapi.WithoutDataWrapper.JSONBuffer(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/v1/{+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, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "merchantapi.accounts.reports.search", "request", internallog.HTTPRequest(req, body.Bytes())) + 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 + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "merchantapi.accounts.reports.search", "response", internallog.HTTPResponse(res, b)) + 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/solar/v1/solar-api.json b/solar/v1/solar-api.json index 32a01bc8145..47375fa093e 100644 --- a/solar/v1/solar-api.json +++ b/solar/v1/solar-api.json @@ -154,7 +154,7 @@ "Solar data is derived from aerial imagery captured at low-altitude and processed at 0.1 m/pixel.", "Solar data is derived from enhanced aerial imagery captured at high-altitude and processed at 0.25 m/pixel.", "Solar data is derived from enhanced satellite imagery processed at 0.25 m/pixel.", - "Solar data is derived from enhanced satellite imagery processed at 0.25 m/pixel. **Note:** This enum is only available if `experiments=EXPANDED_COVERAGE` is set in the request. For more information, see [Expanded Coverage](https://developers.google.com/maps/documentation/solar/expanded-coverage)." + "Solar data is derived from enhanced satellite imagery processed at 0.25 m/pixel." ], "location": "query", "type": "string" @@ -236,7 +236,7 @@ "Solar data is derived from aerial imagery captured at low-altitude and processed at 0.1 m/pixel.", "Solar data is derived from enhanced aerial imagery captured at high-altitude and processed at 0.25 m/pixel.", "Solar data is derived from enhanced satellite imagery processed at 0.25 m/pixel.", - "Solar data is derived from enhanced satellite imagery processed at 0.25 m/pixel. **Note:** This enum is only available if `experiments=EXPANDED_COVERAGE` is set in the request. For more information, see [Expanded Coverage](https://developers.google.com/maps/documentation/solar/expanded-coverage)." + "Solar data is derived from enhanced satellite imagery processed at 0.25 m/pixel." ], "location": "query", "type": "string" @@ -299,7 +299,7 @@ } } }, - "revision": "20250427", + "revision": "20250804", "rootUrl": "https://solar.googleapis.com/", "schemas": { "BuildingInsights": { @@ -340,7 +340,7 @@ "Solar data is derived from aerial imagery captured at low-altitude and processed at 0.1 m/pixel.", "Solar data is derived from enhanced aerial imagery captured at high-altitude and processed at 0.25 m/pixel.", "Solar data is derived from enhanced satellite imagery processed at 0.25 m/pixel.", - "Solar data is derived from enhanced satellite imagery processed at 0.25 m/pixel. **Note:** This enum is only available if `experiments=EXPANDED_COVERAGE` is set in the request. For more information, see [Expanded Coverage](https://developers.google.com/maps/documentation/solar/expanded-coverage)." + "Solar data is derived from enhanced satellite imagery processed at 0.25 m/pixel." ], "type": "string" }, @@ -436,7 +436,7 @@ "Solar data is derived from aerial imagery captured at low-altitude and processed at 0.1 m/pixel.", "Solar data is derived from enhanced aerial imagery captured at high-altitude and processed at 0.25 m/pixel.", "Solar data is derived from enhanced satellite imagery processed at 0.25 m/pixel.", - "Solar data is derived from enhanced satellite imagery processed at 0.25 m/pixel. **Note:** This enum is only available if `experiments=EXPANDED_COVERAGE` is set in the request. For more information, see [Expanded Coverage](https://developers.google.com/maps/documentation/solar/expanded-coverage)." + "Solar data is derived from enhanced satellite imagery processed at 0.25 m/pixel." ], "type": "string" }, diff --git a/solar/v1/solar-gen.go b/solar/v1/solar-gen.go index e0d2190799e..e8d3c10b718 100644 --- a/solar/v1/solar-gen.go +++ b/solar/v1/solar-gen.go @@ -216,11 +216,7 @@ type BuildingInsights struct { // "LOW" - Solar data is derived from enhanced satellite imagery processed at // 0.25 m/pixel. // "BASE" - Solar data is derived from enhanced satellite imagery processed - // at 0.25 m/pixel. **Note:** This enum is only available if - // `experiments=EXPANDED_COVERAGE` is set in the request. For more information, - // see [Expanded - // Coverage](https://developers.google.com/maps/documentation/solar/expanded-cov - // erage). + // at 0.25 m/pixel. ImageryQuality string `json:"imageryQuality,omitempty"` // Name: The resource name for the building, of the format // `buildings/{place_id}`. @@ -367,11 +363,7 @@ type DataLayers struct { // "LOW" - Solar data is derived from enhanced satellite imagery processed at // 0.25 m/pixel. // "BASE" - Solar data is derived from enhanced satellite imagery processed - // at 0.25 m/pixel. **Note:** This enum is only available if - // `experiments=EXPANDED_COVERAGE` is set in the request. For more information, - // see [Expanded - // Coverage](https://developers.google.com/maps/documentation/solar/expanded-cov - // erage). + // at 0.25 m/pixel. ImageryQuality string `json:"imageryQuality,omitempty"` // MaskUrl: The URL for the building mask image: one bit per pixel saying // whether that pixel is considered to be part of a rooftop or not. @@ -1275,11 +1267,7 @@ func (c *BuildingInsightsFindClosestCall) LocationLongitude(locationLongitude fl // // "BASE" - Solar data is derived from enhanced satellite imagery processed // -// at 0.25 m/pixel. **Note:** This enum is only available if -// `experiments=EXPANDED_COVERAGE` is set in the request. For more information, -// see [Expanded -// Coverage](https://developers.google.com/maps/documentation/solar/expanded-cov -// erage). +// at 0.25 m/pixel. func (c *BuildingInsightsFindClosestCall) RequiredQuality(requiredQuality string) *BuildingInsightsFindClosestCall { c.urlParams_.Set("requiredQuality", requiredQuality) return c @@ -1478,11 +1466,7 @@ func (c *DataLayersGetCall) RadiusMeters(radiusMeters float64) *DataLayersGetCal // // "BASE" - Solar data is derived from enhanced satellite imagery processed // -// at 0.25 m/pixel. **Note:** This enum is only available if -// `experiments=EXPANDED_COVERAGE` is set in the request. For more information, -// see [Expanded -// Coverage](https://developers.google.com/maps/documentation/solar/expanded-cov -// erage). +// at 0.25 m/pixel. func (c *DataLayersGetCall) RequiredQuality(requiredQuality string) *DataLayersGetCall { c.urlParams_.Set("requiredQuality", requiredQuality) return c diff --git a/texttospeech/v1/texttospeech-api.json b/texttospeech/v1/texttospeech-api.json index 4106c09c5c3..60b36f39a53 100644 --- a/texttospeech/v1/texttospeech-api.json +++ b/texttospeech/v1/texttospeech-api.json @@ -318,7 +318,7 @@ } } }, - "revision": "20250716", + "revision": "20250805", "rootUrl": "https://texttospeech.googleapis.com/", "schemas": { "AdvancedVoiceOptions": { @@ -791,6 +791,10 @@ "description": "Required. The language (and potentially also the region) of the voice expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag, e.g. \"en-US\". This should not include a script tag (e.g. use \"cmn-cn\" rather than \"cmn-Hant-cn\"), because the script will be inferred from the input provided in the SynthesisInput. The TTS service will use this parameter to help choose an appropriate voice. Note that the TTS service may choose a voice with a slightly different language code than the one selected; it may substitute a different region (e.g. using en-US rather than en-CA if there isn't a Canadian voice available), or even a different language, e.g. using \"nb\" (Norwegian Bokmal) instead of \"no\" (Norwegian)\".", "type": "string" }, + "modelName": { + "description": "Optional. The name of the model. If set, the service will choose the model matching the specified configuration.", + "type": "string" + }, "name": { "description": "The name of the voice. If both the name and the gender are not set, the service will choose a voice based on the other parameters such as language_code.", "type": "string" diff --git a/texttospeech/v1/texttospeech-gen.go b/texttospeech/v1/texttospeech-gen.go index 1832dcdf760..e11871d488a 100644 --- a/texttospeech/v1/texttospeech-gen.go +++ b/texttospeech/v1/texttospeech-gen.go @@ -941,6 +941,9 @@ type VoiceSelectionParams struct { // isn't a Canadian voice available), or even a different language, e.g. using // "nb" (Norwegian Bokmal) instead of "no" (Norwegian)". LanguageCode string `json:"languageCode,omitempty"` + // ModelName: Optional. The name of the model. If set, the service will choose + // the model matching the specified configuration. + ModelName string `json:"modelName,omitempty"` // Name: The name of the voice. If both the name and the gender are not set, // the service will choose a voice based on the other parameters such as // language_code. diff --git a/texttospeech/v1beta1/texttospeech-api.json b/texttospeech/v1beta1/texttospeech-api.json index e75c93dd9c3..5d734f772fb 100644 --- a/texttospeech/v1beta1/texttospeech-api.json +++ b/texttospeech/v1beta1/texttospeech-api.json @@ -261,7 +261,7 @@ } } }, - "revision": "20250716", + "revision": "20250805", "rootUrl": "https://texttospeech.googleapis.com/", "schemas": { "AdvancedVoiceOptions": { @@ -766,6 +766,10 @@ "description": "Required. The language (and potentially also the region) of the voice expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag, e.g. \"en-US\". This should not include a script tag (e.g. use \"cmn-cn\" rather than \"cmn-Hant-cn\"), because the script will be inferred from the input provided in the SynthesisInput. The TTS service will use this parameter to help choose an appropriate voice. Note that the TTS service may choose a voice with a slightly different language code than the one selected; it may substitute a different region (e.g. using en-US rather than en-CA if there isn't a Canadian voice available), or even a different language, e.g. using \"nb\" (Norwegian Bokmal) instead of \"no\" (Norwegian)\".", "type": "string" }, + "modelName": { + "description": "Optional. The name of the model. If set, the service will choose the model matching the specified configuration.", + "type": "string" + }, "name": { "description": "The name of the voice. If both the name and the gender are not set, the service will choose a voice based on the other parameters such as language_code.", "type": "string" diff --git a/texttospeech/v1beta1/texttospeech-gen.go b/texttospeech/v1beta1/texttospeech-gen.go index 9092486e6d0..8d2e9e257f5 100644 --- a/texttospeech/v1beta1/texttospeech-gen.go +++ b/texttospeech/v1beta1/texttospeech-gen.go @@ -971,6 +971,9 @@ type VoiceSelectionParams struct { // isn't a Canadian voice available), or even a different language, e.g. using // "nb" (Norwegian Bokmal) instead of "no" (Norwegian)". LanguageCode string `json:"languageCode,omitempty"` + // ModelName: Optional. The name of the model. If set, the service will choose + // the model matching the specified configuration. + ModelName string `json:"modelName,omitempty"` // Name: The name of the voice. If both the name and the gender are not set, // the service will choose a voice based on the other parameters such as // language_code.