public sealed class CustomAttribute : IMessage<CustomAttribute>, IEquatable<CustomAttribute>, IDeepCloneable<CustomAttribute>, IBufferMessage, IMessage
Reference documentation and code samples for the Discovery Engine v1 API class CustomAttribute.
A custom attribute that is not explicitly modeled in a resource, e.g.
[UserEvent][google.cloud.discoveryengine.v1.UserEvent].
The numerical values of this custom attribute. For example, [2.3, 15.4]
when the key is "lengths_cm".
Exactly one of
[CustomAttribute.text][google.cloud.discoveryengine.v1.CustomAttribute.text]
or
[CustomAttribute.numbers][google.cloud.discoveryengine.v1.CustomAttribute.numbers]
should be set. Otherwise, an INVALID_ARGUMENT error is returned.
The textual values of this custom attribute. For example, ["yellow",
"green"] when the key is "color".
Empty string is not allowed. Otherwise, an INVALID_ARGUMENT error is
returned.
Exactly one of
[CustomAttribute.text][google.cloud.discoveryengine.v1.CustomAttribute.text]
or
[CustomAttribute.numbers][google.cloud.discoveryengine.v1.CustomAttribute.numbers]
should be set. Otherwise, an INVALID_ARGUMENT error is returned.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe latest version of the \u003ccode\u003eCustomAttribute\u003c/code\u003e class for the Discovery Engine v1 API is 1.6.0, with previous versions available for reference, including versions 1.5.0, 1.4.0, 1.3.0, 1.2.0, 1.1.0 and 1.0.0-beta06.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eCustomAttribute\u003c/code\u003e is a sealed class that implements several interfaces including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThis class represents a custom attribute not explicitly modeled in a resource, such as in a \u003ccode\u003eUserEvent\u003c/code\u003e, and it can be used to represent numerical or textual data.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eCustomAttribute\u003c/code\u003e class contains two main properties: \u003ccode\u003eNumbers\u003c/code\u003e, a \u003ccode\u003eRepeatedField\u003c/code\u003e of double values, and \u003ccode\u003eText\u003c/code\u003e, a \u003ccode\u003eRepeatedField\u003c/code\u003e of strings, to store numerical and textual attribute data respectively.\u003c/p\u003e\n"],["\u003cp\u003eThere are two contructors available: one default, and one that takes a \u003ccode\u003eCustomAttribute\u003c/code\u003e for parameter, allowing the creation of a custom attribute instance by passing another custom attribute.\u003c/p\u003e\n"]]],[],null,["# Discovery Engine v1 API - Class CustomAttribute (1.9.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.9.0 (latest)](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.CustomAttribute)\n- [1.8.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.8.0/Google.Cloud.DiscoveryEngine.V1.CustomAttribute)\n- [1.7.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.7.0/Google.Cloud.DiscoveryEngine.V1.CustomAttribute)\n- [1.6.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.6.0/Google.Cloud.DiscoveryEngine.V1.CustomAttribute)\n- [1.5.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.5.0/Google.Cloud.DiscoveryEngine.V1.CustomAttribute)\n- [1.4.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.4.0/Google.Cloud.DiscoveryEngine.V1.CustomAttribute)\n- [1.3.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.3.0/Google.Cloud.DiscoveryEngine.V1.CustomAttribute)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.2.0/Google.Cloud.DiscoveryEngine.V1.CustomAttribute)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.1.0/Google.Cloud.DiscoveryEngine.V1.CustomAttribute)\n- [1.0.0-beta06](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.0.0-beta06/Google.Cloud.DiscoveryEngine.V1.CustomAttribute) \n\n public sealed class CustomAttribute : IMessage\u003cCustomAttribute\u003e, IEquatable\u003cCustomAttribute\u003e, IDeepCloneable\u003cCustomAttribute\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Discovery Engine v1 API class CustomAttribute.\n\nA custom attribute that is not explicitly modeled in a resource, e.g.\n\\[UserEvent\\]\\[google.cloud.discoveryengine.v1.UserEvent\\]. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e CustomAttribute \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[CustomAttribute](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.CustomAttribute), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[CustomAttribute](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.CustomAttribute), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[CustomAttribute](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.CustomAttribute), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.DiscoveryEngine.V1](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.DiscoveryEngine.V1.dll\n\nConstructors\n------------\n\n### CustomAttribute()\n\n public CustomAttribute()\n\n### CustomAttribute(CustomAttribute)\n\n public CustomAttribute(CustomAttribute other)\n\nProperties\n----------\n\n### Numbers\n\n public RepeatedField\u003cdouble\u003e Numbers { get; }\n\nThe numerical values of this custom attribute. For example, `[2.3, 15.4]`\nwhen the key is \"lengths_cm\".\n\nExactly one of\n\\[CustomAttribute.text\\]\\[google.cloud.discoveryengine.v1.CustomAttribute.text\\]\nor\n\\[CustomAttribute.numbers\\]\\[google.cloud.discoveryengine.v1.CustomAttribute.numbers\\]\nshould be set. Otherwise, an `INVALID_ARGUMENT` error is returned.\n\n### Text\n\n public RepeatedField\u003cstring\u003e Text { get; }\n\nThe textual values of this custom attribute. For example, `[\"yellow\",\n\"green\"]` when the key is \"color\".\n\nEmpty string is not allowed. Otherwise, an `INVALID_ARGUMENT` error is\nreturned.\n\nExactly one of\n\\[CustomAttribute.text\\]\\[google.cloud.discoveryengine.v1.CustomAttribute.text\\]\nor\n\\[CustomAttribute.numbers\\]\\[google.cloud.discoveryengine.v1.CustomAttribute.numbers\\]\nshould be set. Otherwise, an `INVALID_ARGUMENT` error is returned."]]