- [Resource: Branch](https://docs.cloud.google.com/gemini-enterprise-cx/ai-commerce-search/reference/rest/v2alpha/projects.locations.catalogs.branches.md.txt#Branch)
  - [JSON representation](https://docs.cloud.google.com/gemini-enterprise-cx/ai-commerce-search/reference/rest/v2alpha/projects.locations.catalogs.branches.md.txt#Branch.SCHEMA_REPRESENTATION)
- [ProductCountStatistic](https://docs.cloud.google.com/gemini-enterprise-cx/ai-commerce-search/reference/rest/v2alpha/projects.locations.catalogs.branches.md.txt#ProductCountStatistic)
  - [JSON representation](https://docs.cloud.google.com/gemini-enterprise-cx/ai-commerce-search/reference/rest/v2alpha/projects.locations.catalogs.branches.md.txt#ProductCountStatistic.SCHEMA_REPRESENTATION)
- [ProductCountScope](https://docs.cloud.google.com/gemini-enterprise-cx/ai-commerce-search/reference/rest/v2alpha/projects.locations.catalogs.branches.md.txt#ProductCountScope)
- [QualityMetric](https://docs.cloud.google.com/gemini-enterprise-cx/ai-commerce-search/reference/rest/v2alpha/projects.locations.catalogs.branches.md.txt#QualityMetric)
  - [JSON representation](https://docs.cloud.google.com/gemini-enterprise-cx/ai-commerce-search/reference/rest/v2alpha/projects.locations.catalogs.branches.md.txt#QualityMetric.SCHEMA_REPRESENTATION)
- [Methods](https://docs.cloud.google.com/gemini-enterprise-cx/ai-commerce-search/reference/rest/v2alpha/projects.locations.catalogs.branches.md.txt#METHODS_SUMMARY)

## Resource: Branch

A data branch that stores all instances of `Product`s.

| 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. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `productCountStats[]` | ``object (`ProductCountStatistic`)`` Output only. Statistics for number of products in the branch, provided for different `scopes`. This field is not populated in `BranchView.BRANCH_VIEW_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.BRANCH_VIEW_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. - "primary-out-of-stock", products have `Product.Type.PRIMARY` type and `Product.Availability.OUT_OF_STOCK` availability. - "primary-preorder", products have `Product.Type.PRIMARY` type and `Product.Availability.PREORDER` availability. - "primary-backorder", products have `Product.Type.PRIMARY` type and `Product.Availability.BACKORDER` availability. - "variant-in-stock", products have `Product.Type.VARIANT` type and `Product.Availability.IN_STOCK` availability. - "variant-out-of-stock", products have `Product.Type.VARIANT` type and `Product.Availability.OUT_OF_STOCK` availability. - "variant-preorder", products have `Product.Type.VARIANT` type and `Product.Availability.PREORDER` availability. - "variant-backorder", products have `Product.Type.VARIANT` type and `Product.Availability.BACKORDER` availability. - "price-discounted", products have \[Product.price_info.price\] \< \[Product.price_info.original_price\]. |

## 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 `Product`s 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`. - `Product.name` - `Product.id` - `Product.title` |

| ## Methods ||
|---|---|
| ### `get` | Retrieves a `Branch`. |
| ### `list` | Lists all instances of `Branch` under the specified parent `Catalog`. |