REST Resource: projects.locations.catalogs.branches

Resource: Branch

A data branch that stores all instances of Products.

JSON representation
{
  "name": string,
  "displayName": string,
  "isDefault": boolean,
  "lastProductImportTime": string,
  "productCountStats": [
    {
      object (ProductCountStatistic)
    }
  ],
  "qualityMetrics": [
    {
      object (QualityMetric)
    }
  ]
}
Fields
name

string

Immutable. Full resource name of the branch, such as projects/*/locations/global/catalogs/default_catalog/branches/branchId.

displayName

string

Output only. Human readable name of the branch to display in the UI.

isDefault

boolean

Output only. Indicates whether this branch is set as the default branch of its parent catalog.

lastProductImportTime

string (Timestamp format)

Output only. Timestamp of last import through ProductService.ImportProducts. Empty value means no import has been made to this branch.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

productCountStats[]

object (ProductCountStatistic)

Output only. Statistics for number of products in the branch, provided for different scopes.

This field is not populated in [BranchView.BASIC][] view.

qualityMetrics[]

object (QualityMetric)

Output only. The quality metrics measured among products of this branch.

See QualityMetric.requirement_key for supported metrics. Metrics could be missing if failed to retrieve.

This field is not populated in [BranchView.BASIC][] view.

ProductCountStatistic

A statistic about the number of products in a branch.

JSON representation
{
  "scope": enum (ProductCountScope),
  "counts": {
    string: string,
    ...
  }
}
Fields
scope

enum (ProductCountScope)

[ProductCountScope] of the [counts].

counts

map (key: string, value: string (int64 format))

The number of products in scope broken down into different groups.

The key is a group representing a set of products, and the value is the number of products in that group. Note: keys in this map may change over time.

Possible keys: * "primary-in-stock", products have Product.Type.PRIMARY type and Product.Availability.IN_STOCK availability.

ProductCountScope

Scope of what products are included for this count.

Enums
PRODUCT_COUNT_SCOPE_UNSPECIFIED Default value for enum. This value is not used in the API response.
ALL_PRODUCTS Scope for all existing products in the branch. Useful for understanding how many products there are in a branch.
LAST_24_HOUR_UPDATE Scope for products created or updated in the last 24 hours.

QualityMetric

Metric measured on a group of Products against a certain quality requirement. Contains the number of products that pass the check and the number of products that don't.

JSON representation
{
  "requirementKey": string,
  "qualifiedProductCount": integer,
  "unqualifiedProductCount": integer,
  "suggestedQualityPercentThreshold": number,
  "unqualifiedSampleProducts": [
    {
      object (Product)
    }
  ]
}
Fields
requirementKey

string

The key that represents a quality requirement rule.

Supported keys: * "has-valid-uri": product has a valid and accessible uri.

  • "available-expire-time-conformance": Product.available_time is early than "now", and Product.expire_time is greater than "now".

  • "has-searchable-attributes": product has at least one attribute set to searchable.

  • "has-description": product has non-empty description.

  • "has-at-least-bigram-title": Product title has at least two words. A comprehensive title helps to improve search quality.

  • "variant-has-image": the variant products has at least one image. You may ignore this metric if all your products are at primary level.

  • "variant-has-price-info": the variant products has priceInfo set. You may ignore this metric if all your products are at primary level.

  • "has-publish-time": product has non-empty publishTime.

qualifiedProductCount

integer

Number of products passing the quality requirement check. We only check searchable products.

unqualifiedProductCount

integer

Number of products failing the quality requirement check. We only check searchable products.

suggestedQualityPercentThreshold

number

Value from 0 to 100 representing the suggested percentage of products that meet the quality requirements to get good search and recommendation performance. 100 * (qualifiedProductCount) / (qualifiedProductCount + unqualifiedProductCount) should be greater or equal to this suggestion.

unqualifiedSampleProducts[]

object (Product)

A list of a maximum of 100 sample products that do not qualify for this requirement.

This field is only populated in the response to BranchService.GetBranch API, and is always empty for BranchService.ListBranches.

Only the following fields are set in the Product.

Methods

get

Retrieves a Branch.

list

Lists all instances of Branch under the specified parent Catalog.