public sealed class Billing : IMessage<Billing>, IEquatable<Billing>, IDeepCloneable<Billing>, IBufferMessage, IMessage
Billing related configuration of the service.
The following example shows how to configure monitored resources and metrics
for billing, consumer_destinations is the only supported destination and
the monitored resources need at least one label key
cloud.googleapis.com/location to indicate the location of the billing
usage, using different monitored resources between monitoring and billing is
recommended so they can be evolved independently:
monitored_resources:
- type: library.googleapis.com/billing_branch
labels:
- key: cloud.googleapis.com/location
description: |
Predefined label to support billing location restriction.
- key: city
description: |
Custom label to define the city where the library branch is located
in.
- key: name
description: Custom label to define the name of the library branch.
metrics:
- name: library.googleapis.com/book/borrowed_count
metric_kind: DELTA
value_type: INT64
unit: "1"
billing:
consumer_destinations:
- monitored_resource: library.googleapis.com/billing_branch
metrics:
- library.googleapis.com/book/borrowed_count
public RepeatedField<Billing.Types.BillingDestination> ConsumerDestinations { get; }
Billing configurations for sending metrics to the consumer project.
There can be multiple consumer destinations per service, each one must have
a different monitored resource type. A metric can be used in at most
one consumer destination.
[[["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\u003eBilling\u003c/code\u003e class is used for configuring billing-related aspects of a service, primarily through \u003ccode\u003econsumer_destinations\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eBilling\u003c/code\u003e allows for the configuration of monitored resources and metrics, exemplified by a library billing scenario with custom labels like \u003ccode\u003ecity\u003c/code\u003e and \u003ccode\u003ename\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eConsumerDestinations\u003c/code\u003e property, a \u003ccode\u003eRepeatedField\u003c/code\u003e, enables defining multiple destinations for billing metrics, ensuring each uses a unique monitored resource type.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eBilling\u003c/code\u003e 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, allowing for versatile object manipulation.\u003c/p\u003e\n"],["\u003cp\u003eThe class provides methods for operations like calculating size, cloning, equality checks, hashing, merging, and reading/writing data to streams, such as with \u003ccode\u003eCodedInputStream\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Class Billing (2.17.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.17.0 (latest)](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.Billing)\n- [2.15.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.15.0/Google.Api.Billing)\n- [2.10.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.10.0/Google.Api.Billing)\n- [2.2.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.2.0/Google.Api.Billing) \n\n public sealed class Billing : IMessage\u003cBilling\u003e, IEquatable\u003cBilling\u003e, IDeepCloneable\u003cBilling\u003e, IBufferMessage, IMessage\n\nBilling related configuration of the service.\n\nThe following example shows how to configure monitored resources and metrics\nfor billing, `consumer_destinations` is the only supported destination and\nthe monitored resources need at least one label key\n`cloud.googleapis.com/location` to indicate the location of the billing\nusage, using different monitored resources between monitoring and billing is\nrecommended so they can be evolved independently: \n\n monitored_resources:\n - type: library.googleapis.com/billing_branch\n labels:\n - key: cloud.googleapis.com/location\n description: |\n Predefined label to support billing location restriction.\n - key: city\n description: |\n Custom label to define the city where the library branch is located\n in.\n - key: name\n description: Custom label to define the name of the library branch.\n metrics:\n - name: library.googleapis.com/book/borrowed_count\n metric_kind: DELTA\n value_type: INT64\n unit: \"1\"\n billing:\n consumer_destinations:\n - monitored_resource: library.googleapis.com/billing_branch\n metrics:\n - library.googleapis.com/book/borrowed_count\n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e Billing \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[Billing](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.Billing), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[Billing](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.Billing), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[Billing](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.Billing), [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### Billing()\n\n public Billing()\n\n### Billing(Billing)\n\n public Billing(Billing other)\n\nFields\n------\n\n### ConsumerDestinationsFieldNumber\n\n public const int ConsumerDestinationsFieldNumber = 8\n\nField number for the \"consumer_destinations\" field.\n\nProperties\n----------\n\n### ConsumerDestinations\n\n public RepeatedField\u003cBilling.Types.BillingDestination\u003e ConsumerDestinations { get; }\n\nBilling configurations for sending metrics to the consumer project.\nThere can be multiple consumer destinations per service, each one must have\na different monitored resource type. A metric can be used in at most\none consumer destination.\n\n### Descriptor\n\n public static MessageDescriptor Descriptor { get; }\n\n### Parser\n\n public static MessageParser\u003cBilling\u003e Parser { get; }\n\nMethods\n-------\n\n### CalculateSize()\n\n public int CalculateSize()\n\n### Clone()\n\n public Billing Clone()\n\n### Equals(Billing)\n\n public bool Equals(Billing 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(Billing)\n\n public void MergeFrom(Billing 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)"]]