public sealed class ResourceReference : IMessage<ResourceReference>, IEquatable<ResourceReference>, IDeepCloneable<ResourceReference>, IBufferMessage, IMessage
Defines a proto annotation that describes a string field that refers to
an API resource.
The resource type of a child collection that the annotated field
references. This is useful for annotating the parent field that
doesn't have a fixed resource type.
[[["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-08-28 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eResourceReference\u003c/code\u003e class in the \u003ccode\u003eGoogle.Api.CommonProtos\u003c/code\u003e assembly defines a proto annotation for string fields that refer to API resources.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eResourceReference\u003c/code\u003e implements interfaces like \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, allowing for message handling, comparison, cloning, and buffered operations.\u003c/p\u003e\n"],["\u003cp\u003eThe class provides constructors, including a default constructor and one that accepts another \u003ccode\u003eResourceReference\u003c/code\u003e for creating copies.\u003c/p\u003e\n"],["\u003cp\u003eIt has properties \u003ccode\u003eChildType\u003c/code\u003e and \u003ccode\u003eType\u003c/code\u003e, which define the resource type and the child collection type for fields referencing API resources.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eResourceReference\u003c/code\u003e class includes methods for calculating size, cloning, comparison, hashing, merging, and string representation.\u003c/p\u003e\n"]]],[],null,["# Class ResourceReference (2.17.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.17.0 (latest)](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.ResourceReference)\n- [2.15.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.15.0/Google.Api.ResourceReference)\n- [2.10.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.10.0/Google.Api.ResourceReference)\n- [2.2.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.2.0/Google.Api.ResourceReference) \n\n public sealed class ResourceReference : IMessage\u003cResourceReference\u003e, IEquatable\u003cResourceReference\u003e, IDeepCloneable\u003cResourceReference\u003e, IBufferMessage, IMessage\n\nDefines a proto annotation that describes a string field that refers to\nan API resource. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e ResourceReference \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[ResourceReference](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.ResourceReference), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[ResourceReference](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.ResourceReference), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[ResourceReference](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.ResourceReference), [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.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals)\n\nNamespace\n---------\n\n[Google.Api](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api)\n\nAssembly\n--------\n\nGoogle.Api.CommonProtos.dll\n\nConstructors\n------------\n\n### ResourceReference()\n\n public ResourceReference()\n\n### ResourceReference(ResourceReference)\n\n public ResourceReference(ResourceReference other)\n\nFields\n------\n\n### ChildTypeFieldNumber\n\n public const int ChildTypeFieldNumber = 2\n\nField number for the \"child_type\" field.\n\n### TypeFieldNumber\n\n public const int TypeFieldNumber = 1\n\nField number for the \"type\" field.\n\nProperties\n----------\n\n### ChildType\n\n public string ChildType { get; set; }\n\nThe resource type of a child collection that the annotated field\nreferences. This is useful for annotating the `parent` field that\ndoesn't have a fixed resource type.\n\nExample: \n\n message ListLogEntriesRequest {\n string parent = 1 [(google.api.resource_reference) = {\n child_type: \"logging.googleapis.com/LogEntry\"\n };\n }\n\n### Descriptor\n\n public static MessageDescriptor Descriptor { get; }\n\n### Parser\n\n public static MessageParser\u003cResourceReference\u003e Parser { get; }\n\n### Type\n\n public string Type { get; set; }\n\nThe resource type that the annotated field references.\n\nExample: \n\n message Subscription {\n string topic = 2 [(google.api.resource_reference) = {\n type: \"pubsub.googleapis.com/Topic\"\n }];\n }\n\nOccasionally, a field may reference an arbitrary resource. In this case,\nAPIs use the special value \\* in their resource reference.\n\nExample: \n\n message GetIamPolicyRequest {\n string resource = 2 [(google.api.resource_reference) = {\n type: \"*\"\n }];\n }\n\nMethods\n-------\n\n### CalculateSize()\n\n public int CalculateSize()\n\n### Clone()\n\n public ResourceReference Clone()\n\n### Equals(ResourceReference)\n\n public bool Equals(ResourceReference other)\n\n### Equals(object)\n\n public override bool Equals(object other)\n\n**Overrides** \n[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object))\n\n### GetHashCode()\n\n public override int GetHashCode()\n\n**Overrides** \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode)\n\n### MergeFrom(ResourceReference)\n\n public void MergeFrom(ResourceReference other)\n\n### MergeFrom(CodedInputStream)\n\n public void MergeFrom(CodedInputStream input)\n\n### ToString()\n\n public override string ToString()\n\n**Overrides** \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\n### WriteTo(CodedOutputStream)\n\n public void WriteTo(CodedOutputStream output)"]]