public sealed class BillingAccountName : IResourceName, IEquatable<BillingAccountName>
Resource name for the 'billing account' resource which is widespread across Google Cloud.
While most resource names are generated on a per-API basis, many APIs use a billing account resource, and it's
useful to be able to pass values from one API to another.
If true will successfully store an unparseable resource name into the UnparsedResource
property; otherwise will throw an ArgumentException if an unparseable resource name is
specified.
If true will successfully store an unparseable resource name into the UnparsedResource
property; otherwise will throw an ArgumentException if an unparseable resource name is
specified.
[[["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-03 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eBillingAccountName\u003c/code\u003e class represents a resource name for billing accounts, commonly used across various Google Cloud APIs.\u003c/p\u003e\n"],["\u003cp\u003eThis class is designed to allow passing billing account values between different APIs, and can be created by specifying a billing account ID, or from an unparsed resource name.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eBillingAccountName\u003c/code\u003e class provides methods for parsing, formatting, and validating resource names in the format \u003ccode\u003ebillingAccounts/{billing_account}\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIt implements \u003ccode\u003eIResourceName\u003c/code\u003e and \u003ccode\u003eIEquatable<BillingAccountName>\u003c/code\u003e interfaces and it has properties to access the billing account ID, to know if it is a known pattern, and its type.\u003c/p\u003e\n"],["\u003cp\u003eSeveral versions of this class are available, ranging from version 3.2.0 to the latest version 4.10.0.\u003c/p\u003e\n"]]],[],null,["# Class BillingAccountName (4.10.0)\n\nVersion latestkeyboard_arrow_down\n\n- [4.10.0 (latest)](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.ResourceNames.BillingAccountName)\n- [4.8.0](/dotnet/docs/reference/Google.Api.Gax/4.8.0/Google.Api.Gax.ResourceNames.BillingAccountName)\n- [4.4.0](/dotnet/docs/reference/Google.Api.Gax/4.4.0/Google.Api.Gax.ResourceNames.BillingAccountName)\n- [4.3.1](/dotnet/docs/reference/Google.Api.Gax/4.3.1/Google.Api.Gax.ResourceNames.BillingAccountName)\n- [4.2.0](/dotnet/docs/reference/Google.Api.Gax/4.2.0/Google.Api.Gax.ResourceNames.BillingAccountName)\n- [4.0.0](/dotnet/docs/reference/Google.Api.Gax/4.0.0/Google.Api.Gax.ResourceNames.BillingAccountName)\n- [3.2.0](/dotnet/docs/reference/Google.Api.Gax/3.2.0/Google.Api.Gax.ResourceNames.BillingAccountName) \n\n public sealed class BillingAccountName : IResourceName, IEquatable\u003cBillingAccountName\u003e\n\nResource name for the 'billing account' resource which is widespread across Google Cloud.\nWhile most resource names are generated on a per-API basis, many APIs use a billing account resource, and it's\nuseful to be able to pass values from one API to another. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e BillingAccountName \n\nImplements\n----------\n\n[IResourceName](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.IResourceName), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[BillingAccountName](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.ResourceNames.BillingAccountName) \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.Gax.ResourceNames](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.ResourceNames)\n\nAssembly\n--------\n\nGoogle.Api.Gax.dll\n\nConstructors\n------------\n\n### BillingAccountName(string)\n\n public BillingAccountName(string billingAccountId)\n\nConstructs a new instance of a [BillingAccountName](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.ResourceNames.BillingAccountName) class from the component parts of pattern\n`billingAccounts/{billing_account}`\n\nProperties\n----------\n\n### BillingAccountId\n\n public string BillingAccountId { get; }\n\nThe `BillingAccount` ID. Will not be `null`, unless this instance contains an unparsed resource\nname.\n\n### IsKnownPattern\n\n public bool IsKnownPattern { get; }\n\nWhether this instance contains a resource name with a known pattern.\n\n### Type\n\n public BillingAccountName.ResourceNameType Type { get; }\n\nThe [BillingAccountName.ResourceNameType](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.ResourceNames.BillingAccountName.ResourceNameType) of the contained resource name.\n\n### UnparsedResource\n\n public UnparsedResourceName UnparsedResource { get; }\n\nThe contained [UnparsedResourceName](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.UnparsedResourceName). Only non-`null`if this instance contains an\nunparsed resource name.\n\nMethods\n-------\n\n### Equals(BillingAccountName)\n\n public bool Equals(BillingAccountName other)\n\n### Equals(object)\n\n public override bool Equals(object obj)\n\n**Overrides** \n[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object))\n\n### Format(string)\n\n public static string Format(string billingAccountId)\n\nFormats the IDs into the string representation of this [BillingAccountName](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.ResourceNames.BillingAccountName) with pattern\n`billingAccounts/{billing_account}`.\n\n### FormatBillingAccount(string)\n\n public static string FormatBillingAccount(string billingAccountId)\n\nFormats the IDs into the string representation of this [BillingAccountName](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.ResourceNames.BillingAccountName) with pattern\n`billingAccounts/{billing_account}`.\n\n### FromBillingAccount(string)\n\n public static BillingAccountName FromBillingAccount(string billingAccountId)\n\nCreates a [BillingAccountName](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.ResourceNames.BillingAccountName) with the pattern `billingAccounts/{billing_account}`.\n\n### FromUnparsed(UnparsedResourceName)\n\n public static BillingAccountName FromUnparsed(UnparsedResourceName unparsedResourceName)\n\nCreates a [BillingAccountName](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.ResourceNames.BillingAccountName) containing an unparsed resource name.\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### Parse(string)\n\n public static BillingAccountName Parse(string billingAccountName)\n\nParses the given resource name string into a new [BillingAccountName](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.ResourceNames.BillingAccountName) instance.\n\n**Remarks** \nTo parse successfully, the resource name must be formatted as one of the following:\n\n- `billingAccounts/{billing_account}`\n\n\u003cbr /\u003e\n\n### Parse(string, bool)\n\n public static BillingAccountName Parse(string billingAccountName, bool allowUnparsed)\n\nParses the given resource name string into a new [BillingAccountName](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.ResourceNames.BillingAccountName) instance; optionally\nallowing an unparseable resource name.\n\n**Remarks** \nTo parse successfully, the resource name must be formatted as one of the following:\n\n- `billingAccounts/{billing_account}`\n\nOr may be in any format if `allowUnparsed` is `true`.\n\n\u003cbr /\u003e\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### TryParse(string, out BillingAccountName)\n\n public static bool TryParse(string billingAccountName, out BillingAccountName result)\n\nTries to parse the given resource name string into a new [BillingAccountName](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.ResourceNames.BillingAccountName) instance.\n\n**Remarks** \nTo parse successfully, the resource name must be formatted as one of the following:\n\n- `billingAccounts/{billing_account}`\n\n\u003cbr /\u003e\n\n### TryParse(string, bool, out BillingAccountName)\n\n public static bool TryParse(string billingAccountName, bool allowUnparsed, out BillingAccountName result)\n\nTries to parse the given resource name string into a new [BillingAccountName](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.ResourceNames.BillingAccountName) instance;\noptionally allowing an unparseable resource name.\n\n**Remarks** \nTo parse successfully, the resource name must be formatted as one of the following:\n\n- `billingAccounts/{billing_account}`\n\nOr may be in any format if `allowUnparsed` is `true`.\n\n\u003cbr /\u003e\n\nOperators\n---------\n\n### operator ==(BillingAccountName, BillingAccountName)\n\n public static bool operator ==(BillingAccountName a, BillingAccountName b)\n\n### operator !=(BillingAccountName, BillingAccountName)\n\n public static bool operator !=(BillingAccountName a, BillingAccountName b)"]]