[[["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,["# Retail V2 API - Class Google::Cloud::Retail::V2::CreateProductRequest (v2.3.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.3.0 (latest)](/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CreateProductRequest)\n- [2.2.0](/ruby/docs/reference/google-cloud-retail-v2/2.2.0/Google-Cloud-Retail-V2-CreateProductRequest)\n- [2.1.0](/ruby/docs/reference/google-cloud-retail-v2/2.1.0/Google-Cloud-Retail-V2-CreateProductRequest)\n- [2.0.0](/ruby/docs/reference/google-cloud-retail-v2/2.0.0/Google-Cloud-Retail-V2-CreateProductRequest)\n- [1.3.0](/ruby/docs/reference/google-cloud-retail-v2/1.3.0/Google-Cloud-Retail-V2-CreateProductRequest)\n- [1.2.0](/ruby/docs/reference/google-cloud-retail-v2/1.2.0/Google-Cloud-Retail-V2-CreateProductRequest)\n- [1.1.0](/ruby/docs/reference/google-cloud-retail-v2/1.1.0/Google-Cloud-Retail-V2-CreateProductRequest)\n- [1.0.1](/ruby/docs/reference/google-cloud-retail-v2/1.0.1/Google-Cloud-Retail-V2-CreateProductRequest)\n- [0.21.0](/ruby/docs/reference/google-cloud-retail-v2/0.21.0/Google-Cloud-Retail-V2-CreateProductRequest)\n- [0.20.0](/ruby/docs/reference/google-cloud-retail-v2/0.20.0/Google-Cloud-Retail-V2-CreateProductRequest)\n- [0.19.0](/ruby/docs/reference/google-cloud-retail-v2/0.19.0/Google-Cloud-Retail-V2-CreateProductRequest)\n- [0.18.2](/ruby/docs/reference/google-cloud-retail-v2/0.18.2/Google-Cloud-Retail-V2-CreateProductRequest)\n- [0.17.0](/ruby/docs/reference/google-cloud-retail-v2/0.17.0/Google-Cloud-Retail-V2-CreateProductRequest)\n- [0.16.1](/ruby/docs/reference/google-cloud-retail-v2/0.16.1/Google-Cloud-Retail-V2-CreateProductRequest)\n- [0.15.0](/ruby/docs/reference/google-cloud-retail-v2/0.15.0/Google-Cloud-Retail-V2-CreateProductRequest)\n- [0.14.0](/ruby/docs/reference/google-cloud-retail-v2/0.14.0/Google-Cloud-Retail-V2-CreateProductRequest)\n- [0.13.0](/ruby/docs/reference/google-cloud-retail-v2/0.13.0/Google-Cloud-Retail-V2-CreateProductRequest)\n- [0.12.0](/ruby/docs/reference/google-cloud-retail-v2/0.12.0/Google-Cloud-Retail-V2-CreateProductRequest)\n- [0.11.0](/ruby/docs/reference/google-cloud-retail-v2/0.11.0/Google-Cloud-Retail-V2-CreateProductRequest)\n- [0.10.0](/ruby/docs/reference/google-cloud-retail-v2/0.10.0/Google-Cloud-Retail-V2-CreateProductRequest)\n- [0.9.0](/ruby/docs/reference/google-cloud-retail-v2/0.9.0/Google-Cloud-Retail-V2-CreateProductRequest)\n- [0.8.0](/ruby/docs/reference/google-cloud-retail-v2/0.8.0/Google-Cloud-Retail-V2-CreateProductRequest)\n- [0.7.0](/ruby/docs/reference/google-cloud-retail-v2/0.7.0/Google-Cloud-Retail-V2-CreateProductRequest)\n- [0.6.4](/ruby/docs/reference/google-cloud-retail-v2/0.6.4/Google-Cloud-Retail-V2-CreateProductRequest) \nReference documentation and code samples for the Retail V2 API class Google::Cloud::Retail::V2::CreateProductRequest.\n\nRequest message for\n[ProductService.CreateProduct](/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-ProductService-Client#Google__Cloud__Retail__V2__ProductService__Client_create_product_instance_ \"Google::Cloud::Retail::V2::ProductService::Client#create_product (method)\")\nmethod. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #parent\n\n def parent() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Required. The parent catalog resource name, such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`.\n\n### #parent=\n\n def parent=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Required. The parent catalog resource name, such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`. \n**Returns**\n\n- (::String) --- Required. The parent catalog resource name, such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`.\n\n### #product\n\n def product() -\u003e ::Google::Cloud::Retail::V2::Product\n\n**Returns**\n\n- ([::Google::Cloud::Retail::V2::Product](./Google-Cloud-Retail-V2-Product)) --- Required. The [Product](/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product \"Google::Cloud::Retail::V2::Product (class)\") to create.\n\n### #product=\n\n def product=(value) -\u003e ::Google::Cloud::Retail::V2::Product\n\n**Parameter**\n\n- **value** ([::Google::Cloud::Retail::V2::Product](./Google-Cloud-Retail-V2-Product)) --- Required. The [Product](/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product \"Google::Cloud::Retail::V2::Product (class)\") to create. \n**Returns**\n\n- ([::Google::Cloud::Retail::V2::Product](./Google-Cloud-Retail-V2-Product)) --- Required. The [Product](/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product \"Google::Cloud::Retail::V2::Product (class)\") to create.\n\n### #product_id\n\n def product_id() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Required. The ID to use for the [Product](/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product \"Google::Cloud::Retail::V2::Product (class)\"), which will become the final component of the [Product.name](/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product#Google__Cloud__Retail__V2__Product_name_instance_ \"Google::Cloud::Retail::V2::Product#name (method)\").\n\n\n If the caller does not have permission to create the\n [Product](/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product \"Google::Cloud::Retail::V2::Product (class)\"), regardless of whether or not it\n exists, a PERMISSION_DENIED error is returned.\n\n This field must be unique among all\n [Product](/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product \"Google::Cloud::Retail::V2::Product (class)\")s with the same\n [parent](/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CreateProductRequest#Google__Cloud__Retail__V2__CreateProductRequest_parent_instance_ \"Google::Cloud::Retail::V2::CreateProductRequest#parent (method)\"). Otherwise, an\n ALREADY_EXISTS error is returned.\n\n This field must be a UTF-8 encoded string with a length limit of 128\n characters. Otherwise, an INVALID_ARGUMENT error is returned.\n\n### #product_id=\n\n def product_id=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Required. The ID to use for the [Product](/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product \"Google::Cloud::Retail::V2::Product (class)\"), which will become the final component of the [Product.name](/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product#Google__Cloud__Retail__V2__Product_name_instance_ \"Google::Cloud::Retail::V2::Product#name (method)\").\n\n\n If the caller does not have permission to create the\n [Product](/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product \"Google::Cloud::Retail::V2::Product (class)\"), regardless of whether or not it\n exists, a PERMISSION_DENIED error is returned.\n\n This field must be unique among all\n [Product](/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product \"Google::Cloud::Retail::V2::Product (class)\")s with the same\n [parent](/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CreateProductRequest#Google__Cloud__Retail__V2__CreateProductRequest_parent_instance_ \"Google::Cloud::Retail::V2::CreateProductRequest#parent (method)\"). Otherwise, an\n ALREADY_EXISTS error is returned.\n\n This field must be a UTF-8 encoded string with a length limit of 128\ncharacters. Otherwise, an INVALID_ARGUMENT error is returned. \n**Returns**\n\n- (::String) --- Required. The ID to use for the [Product](/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product \"Google::Cloud::Retail::V2::Product (class)\"), which will become the final component of the [Product.name](/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product#Google__Cloud__Retail__V2__Product_name_instance_ \"Google::Cloud::Retail::V2::Product#name (method)\").\n\n\n If the caller does not have permission to create the\n [Product](/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product \"Google::Cloud::Retail::V2::Product (class)\"), regardless of whether or not it\n exists, a PERMISSION_DENIED error is returned.\n\n This field must be unique among all\n [Product](/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-Product \"Google::Cloud::Retail::V2::Product (class)\")s with the same\n [parent](/ruby/docs/reference/google-cloud-retail-v2/latest/Google-Cloud-Retail-V2-CreateProductRequest#Google__Cloud__Retail__V2__CreateProductRequest_parent_instance_ \"Google::Cloud::Retail::V2::CreateProductRequest#parent (method)\"). Otherwise, an\n ALREADY_EXISTS error is returned.\n\n This field must be a UTF-8 encoded string with a length limit of 128\n characters. Otherwise, an INVALID_ARGUMENT error is returned."]]