Reference documentation and code samples for the Google Cloud Retail V2 Client class SetDefaultBranchRequest.
Request message to set a specified branch as new default_branch.
Generated from protobuf messagegoogle.cloud.retail.v2.SetDefaultBranchRequest
Namespace
Google \ Cloud \ Retail \ V2
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ catalog
string
Full resource name of the catalog, such asprojects/*/locations/global/catalogs/default_catalog.
↳ branch_id
string
The final component of the resource name of a branch. This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT error is returned. If there are no sufficient active products in the targeted branch andforceis not set, a FAILED_PRECONDITION error is returned.
↳ note
string
Some note on this request, this can be retrieved byCatalogService.GetDefaultBranchbefore next valid default branch set occurs. This field must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
↳ force
bool
If set to true, it permits switching to a branch withbranch_ideven if it has no sufficient active products.
getCatalog
Full resource name of the catalog, such asprojects/*/locations/global/catalogs/default_catalog.
Returns
Type
Description
string
setCatalog
Full resource name of the catalog, such asprojects/*/locations/global/catalogs/default_catalog.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getBranchId
The final component of the resource name of a branch.
This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT
error is returned.
If there are no sufficient active products in the targeted branch andforceis not set, a
FAILED_PRECONDITION error is returned.
Returns
Type
Description
string
setBranchId
The final component of the resource name of a branch.
This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT
error is returned.
If there are no sufficient active products in the targeted branch andforceis not set, a
FAILED_PRECONDITION error is returned.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getNote
Some note on this request, this can be retrieved byCatalogService.GetDefaultBranchbefore next valid default branch set occurs.
This field must be a UTF-8 encoded string with a length limit of 1,000
characters. Otherwise, an INVALID_ARGUMENT error is returned.
Returns
Type
Description
string
setNote
Some note on this request, this can be retrieved byCatalogService.GetDefaultBranchbefore next valid default branch set occurs.
This field must be a UTF-8 encoded string with a length limit of 1,000
characters. Otherwise, an INVALID_ARGUMENT error is returned.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getForce
If set to true, it permits switching to a branch withbranch_ideven
if it has no sufficient active products.
Returns
Type
Description
bool
setForce
If set to true, it permits switching to a branch withbranch_ideven
if it has no sufficient active products.
Parameter
Name
Description
var
bool
Returns
Type
Description
$this
static::build
Parameter
Name
Description
catalog
string
Full resource name of the catalog, such asprojects/*/locations/global/catalogs/default_catalog.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Retail V2 Client - Class SetDefaultBranchRequest (2.3.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.3.1 (latest)](/php/docs/reference/cloud-retail/latest/V2.SetDefaultBranchRequest)\n- [2.3.0](/php/docs/reference/cloud-retail/2.3.0/V2.SetDefaultBranchRequest)\n- [2.2.1](/php/docs/reference/cloud-retail/2.2.1/V2.SetDefaultBranchRequest)\n- [2.1.3](/php/docs/reference/cloud-retail/2.1.3/V2.SetDefaultBranchRequest)\n- [2.0.0](/php/docs/reference/cloud-retail/2.0.0/V2.SetDefaultBranchRequest)\n- [1.7.0](/php/docs/reference/cloud-retail/1.7.0/V2.SetDefaultBranchRequest)\n- [1.6.4](/php/docs/reference/cloud-retail/1.6.4/V2.SetDefaultBranchRequest)\n- [1.5.0](/php/docs/reference/cloud-retail/1.5.0/V2.SetDefaultBranchRequest)\n- [1.4.2](/php/docs/reference/cloud-retail/1.4.2/V2.SetDefaultBranchRequest)\n- [1.3.1](/php/docs/reference/cloud-retail/1.3.1/V2.SetDefaultBranchRequest)\n- [1.2.1](/php/docs/reference/cloud-retail/1.2.1/V2.SetDefaultBranchRequest)\n- [1.1.1](/php/docs/reference/cloud-retail/1.1.1/V2.SetDefaultBranchRequest)\n- [1.0.1](/php/docs/reference/cloud-retail/1.0.1/V2.SetDefaultBranchRequest) \nReference documentation and code samples for the Google Cloud Retail V2 Client class SetDefaultBranchRequest.\n\nRequest message to set a specified branch as new default_branch.\n\nGenerated from protobuf message `google.cloud.retail.v2.SetDefaultBranchRequest`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Retail \\\\ V2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getCatalog\n\nFull resource name of the catalog, such as\n`projects/*/locations/global/catalogs/default_catalog`.\n\n### setCatalog\n\nFull resource name of the catalog, such as\n`projects/*/locations/global/catalogs/default_catalog`.\n\n### getBranchId\n\nThe final component of the resource name of a branch.\n\nThis field must be one of \"0\", \"1\" or \"2\". Otherwise, an INVALID_ARGUMENT\nerror is returned.\nIf there are no sufficient active products in the targeted branch and\n[force](/php/docs/reference/cloud-retail/latest/V2.SetDefaultBranchRequest#_Google_Cloud_Retail_V2_SetDefaultBranchRequest__getForce__) is not set, a\nFAILED_PRECONDITION error is returned.\n\n### setBranchId\n\nThe final component of the resource name of a branch.\n\nThis field must be one of \"0\", \"1\" or \"2\". Otherwise, an INVALID_ARGUMENT\nerror is returned.\nIf there are no sufficient active products in the targeted branch and\n[force](/php/docs/reference/cloud-retail/latest/V2.SetDefaultBranchRequest#_Google_Cloud_Retail_V2_SetDefaultBranchRequest__getForce__) is not set, a\nFAILED_PRECONDITION error is returned.\n\n### getNote\n\nSome note on this request, this can be retrieved by\n[CatalogService.GetDefaultBranch](/php/docs/reference/cloud-retail/latest/V2.Client.CatalogServiceClient#_Google_Cloud_Retail_V2_Client_CatalogServiceClient__getDefaultBranch__)\nbefore next valid default branch set occurs.\n\nThis field must be a UTF-8 encoded string with a length limit of 1,000\ncharacters. Otherwise, an INVALID_ARGUMENT error is returned.\n\n### setNote\n\nSome note on this request, this can be retrieved by\n[CatalogService.GetDefaultBranch](/php/docs/reference/cloud-retail/latest/V2.Client.CatalogServiceClient#_Google_Cloud_Retail_V2_Client_CatalogServiceClient__getDefaultBranch__)\nbefore next valid default branch set occurs.\n\nThis field must be a UTF-8 encoded string with a length limit of 1,000\ncharacters. Otherwise, an INVALID_ARGUMENT error is returned.\n\n### getForce\n\nIf set to true, it permits switching to a branch with\n[branch_id](/php/docs/reference/cloud-retail/latest/V2.SetDefaultBranchRequest#_Google_Cloud_Retail_V2_SetDefaultBranchRequest__getBranchId__) even\nif it has no sufficient active products.\n\n### setForce\n\nIf set to true, it permits switching to a branch with\n[branch_id](/php/docs/reference/cloud-retail/latest/V2.SetDefaultBranchRequest#_Google_Cloud_Retail_V2_SetDefaultBranchRequest__getBranchId__) even\nif it has no sufficient active products.\n\n### static::build"]]