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-08-07 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eOfferName\u003c/code\u003e class, part of the Google Cloud Commerce Consumer Procurement v1 API, represents the resource name for an \u003ccode\u003eOffer\u003c/code\u003e resource.\u003c/p\u003e\n"],["\u003cp\u003eIt can be constructed using a service ID and offer ID, with the pattern \u003ccode\u003eservices/{service}/standardOffers/{offer}\u003c/code\u003e, or by using a consumer billing account ID and an offer ID, using the pattern \u003ccode\u003ebillingAccounts/{consumer_billing_account}/offers/{offer}\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eOfferName\u003c/code\u003e class provides methods for parsing and formatting resource names, including handling unparsed resource names, with string representations of resource names following specific patterns.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version available for the class is 1.4.0, and there are previous versions going as far back as 1.0.0, listed in order of recency.\u003c/p\u003e\n"],["\u003cp\u003eThe class implements \u003ccode\u003eIResourceName\u003c/code\u003e and \u003ccode\u003eIEquatable\u003c/code\u003e and inherits from \u003ccode\u003eobject\u003c/code\u003e, meaning that it has features allowing it to work with resources and to compare instances of the class.\u003c/p\u003e\n"]]],[],null,["# Cloud Commerce Consumer Procurement v1 API - Class OfferName (1.5.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.5.0 (latest)](/dotnet/docs/reference/Google.Cloud.Commerce.Consumer.Procurement.V1/latest/Google.Cloud.Commerce.Consumer.Procurement.V1.OfferName)\n- [1.4.0](/dotnet/docs/reference/Google.Cloud.Commerce.Consumer.Procurement.V1/1.4.0/Google.Cloud.Commerce.Consumer.Procurement.V1.OfferName)\n- [1.3.0](/dotnet/docs/reference/Google.Cloud.Commerce.Consumer.Procurement.V1/1.3.0/Google.Cloud.Commerce.Consumer.Procurement.V1.OfferName)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.Commerce.Consumer.Procurement.V1/1.2.0/Google.Cloud.Commerce.Consumer.Procurement.V1.OfferName)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.Commerce.Consumer.Procurement.V1/1.1.0/Google.Cloud.Commerce.Consumer.Procurement.V1.OfferName)\n- [1.0.0](/dotnet/docs/reference/Google.Cloud.Commerce.Consumer.Procurement.V1/1.0.0/Google.Cloud.Commerce.Consumer.Procurement.V1.OfferName) \n\n public sealed class OfferName : IResourceName, IEquatable\u003cOfferName\u003e\n\nReference documentation and code samples for the Cloud Commerce Consumer Procurement v1 API class OfferName.\n\nResource name for the `Offer` resource. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e OfferName \n\nImplements\n----------\n\n[IResourceName](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.IResourceName.html), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[OfferName](/dotnet/docs/reference/Google.Cloud.Commerce.Consumer.Procurement.V1/latest/Google.Cloud.Commerce.Consumer.Procurement.V1.OfferName) \n\nInherited Members\n-----------------\n\n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype)\n\nNamespace\n---------\n\n[Google.Cloud.Commerce.Consumer.Procurement.V1](/dotnet/docs/reference/Google.Cloud.Commerce.Consumer.Procurement.V1/latest/Google.Cloud.Commerce.Consumer.Procurement.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Commerce.Consumer.Procurement.V1.dll\n\nConstructors\n------------\n\n### OfferName(string, string)\n\n public OfferName(string serviceId, string offerId)\n\nConstructs a new instance of a [OfferName](/dotnet/docs/reference/Google.Cloud.Commerce.Consumer.Procurement.V1/latest/Google.Cloud.Commerce.Consumer.Procurement.V1.OfferName) class from the component parts of pattern\n`services/{service}/standardOffers/{offer}`\n\nProperties\n----------\n\n### ConsumerBillingAccountId\n\n public string ConsumerBillingAccountId { get; }\n\nThe `ConsumerBillingAccount` ID. May be `null`, depending on which resource name is contained by\nthis instance.\n\n### IsKnownPattern\n\n public bool IsKnownPattern { get; }\n\nWhether this instance contains a resource name with a known pattern.\n\n### OfferId\n\n public string OfferId { get; }\n\nThe `Offer` ID. May be `null`, depending on which resource name is contained by this instance.\n\n### ServiceId\n\n public string ServiceId { get; }\n\nThe `Service` ID. May be `null`, depending on which resource name is contained by this instance.\n\n### Type\n\n public OfferName.ResourceNameType Type { get; }\n\nThe [OfferName.ResourceNameType](/dotnet/docs/reference/Google.Cloud.Commerce.Consumer.Procurement.V1/latest/Google.Cloud.Commerce.Consumer.Procurement.V1.OfferName.ResourceNameType) of the contained resource name.\n\n### UnparsedResource\n\n public UnparsedResourceName UnparsedResource { get; }\n\nThe contained [UnparsedResourceName](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.UnparsedResourceName.html). Only non-`null` if this instance contains an\nunparsed resource name.\n\nMethods\n-------\n\n### Format(string, string)\n\n public static string Format(string serviceId, string offerId)\n\nFormats the IDs into the string representation of this [OfferName](/dotnet/docs/reference/Google.Cloud.Commerce.Consumer.Procurement.V1/latest/Google.Cloud.Commerce.Consumer.Procurement.V1.OfferName) with pattern\n`services/{service}/standardOffers/{offer}`.\n\n### FormatConsumerBillingAccountOffer(string, string)\n\n public static string FormatConsumerBillingAccountOffer(string consumerBillingAccountId, string offerId)\n\nFormats the IDs into the string representation of this [OfferName](/dotnet/docs/reference/Google.Cloud.Commerce.Consumer.Procurement.V1/latest/Google.Cloud.Commerce.Consumer.Procurement.V1.OfferName) with pattern\n`billingAccounts/{consumer_billing_account}/offers/{offer}`.\n\n### FormatServiceOffer(string, string)\n\n public static string FormatServiceOffer(string serviceId, string offerId)\n\nFormats the IDs into the string representation of this [OfferName](/dotnet/docs/reference/Google.Cloud.Commerce.Consumer.Procurement.V1/latest/Google.Cloud.Commerce.Consumer.Procurement.V1.OfferName) with pattern\n`services/{service}/standardOffers/{offer}`.\n\n### FromConsumerBillingAccountOffer(string, string)\n\n public static OfferName FromConsumerBillingAccountOffer(string consumerBillingAccountId, string offerId)\n\nCreates a [OfferName](/dotnet/docs/reference/Google.Cloud.Commerce.Consumer.Procurement.V1/latest/Google.Cloud.Commerce.Consumer.Procurement.V1.OfferName) with the pattern\n`billingAccounts/{consumer_billing_account}/offers/{offer}`.\n\n### FromServiceOffer(string, string)\n\n public static OfferName FromServiceOffer(string serviceId, string offerId)\n\nCreates a [OfferName](/dotnet/docs/reference/Google.Cloud.Commerce.Consumer.Procurement.V1/latest/Google.Cloud.Commerce.Consumer.Procurement.V1.OfferName) with the pattern `services/{service}/standardOffers/{offer}`.\n\n### FromUnparsed(UnparsedResourceName)\n\n public static OfferName FromUnparsed(UnparsedResourceName unparsedResourceName)\n\nCreates a [OfferName](/dotnet/docs/reference/Google.Cloud.Commerce.Consumer.Procurement.V1/latest/Google.Cloud.Commerce.Consumer.Procurement.V1.OfferName) containing an unparsed resource name.\n\n### GetHashCode()\n\n public override int GetHashCode()\n\nReturns a hash code for this resource name.\n\n**Overrides** \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode)\n\n### Parse(string)\n\n public static OfferName Parse(string offerName)\n\nParses the given resource name string into a new [OfferName](/dotnet/docs/reference/Google.Cloud.Commerce.Consumer.Procurement.V1/latest/Google.Cloud.Commerce.Consumer.Procurement.V1.OfferName) instance.\n\n**Remarks** \nTo parse successfully, the resource name must be formatted as one of the following:\n\n- `services/{service}/standardOffers/{offer}`\n- `billingAccounts/{consumer_billing_account}/offers/{offer}`\n\n\u003cbr /\u003e\n\n### Parse(string, bool)\n\n public static OfferName Parse(string offerName, bool allowUnparsed)\n\nParses the given resource name string into a new [OfferName](/dotnet/docs/reference/Google.Cloud.Commerce.Consumer.Procurement.V1/latest/Google.Cloud.Commerce.Consumer.Procurement.V1.OfferName) instance; optionally allowing an\nunparseable resource name.\n\n**Remarks** \nTo parse successfully, the resource name must be formatted as one of the following:\n\n- `services/{service}/standardOffers/{offer}`\n- `billingAccounts/{consumer_billing_account}/offers/{offer}`\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\nThe string representation of the resource name.\n\n**Overrides** \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\n### TryParse(string, out OfferName)\n\n public static bool TryParse(string offerName, out OfferName result)\n\nTries to parse the given resource name string into a new [OfferName](/dotnet/docs/reference/Google.Cloud.Commerce.Consumer.Procurement.V1/latest/Google.Cloud.Commerce.Consumer.Procurement.V1.OfferName) instance.\n\n**Remarks** \nTo parse successfully, the resource name must be formatted as one of the following:\n\n- `services/{service}/standardOffers/{offer}`\n- `billingAccounts/{consumer_billing_account}/offers/{offer}`\n\n\u003cbr /\u003e\n\n### TryParse(string, bool, out OfferName)\n\n public static bool TryParse(string offerName, bool allowUnparsed, out OfferName result)\n\nTries to parse the given resource name string into a new [OfferName](/dotnet/docs/reference/Google.Cloud.Commerce.Consumer.Procurement.V1/latest/Google.Cloud.Commerce.Consumer.Procurement.V1.OfferName) 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- `services/{service}/standardOffers/{offer}`\n- `billingAccounts/{consumer_billing_account}/offers/{offer}`\n\nOr may be in any format if `allowUnparsed` is `true`.\n\n\u003cbr /\u003e\n\nOperators\n---------\n\n### operator ==(OfferName, OfferName)\n\n public static bool operator ==(OfferName a, OfferName b)\n\nDetermines whether two specified resource names have the same value.\n\n### operator !=(OfferName, OfferName)\n\n public static bool operator !=(OfferName a, OfferName b)\n\nDetermines whether two specified resource names have different values."]]