public CalendarPeriod CalendarPeriod { get; set; }
Optional. Specifies to track usage for recurring calendar period.
For example, assume that CalendarPeriod.QUARTER is set. The budget
tracks usage from April 1 to June 30, when the current calendar month is
April, May, June. After that, it tracks usage from July 1 to
September 30 when the current calendar month is July, August, September,
so on.
Optional. If
[Filter.credit_types_treatment][google.cloud.billing.budgets.v1.Filter.credit_types_treatment]
is INCLUDE_SPECIFIED_CREDITS, this is a list of credit types to be
subtracted from gross cost to determine the spend for threshold
calculations. See a list of acceptable credit type
values.
If
[Filter.credit_types_treatment][google.cloud.billing.budgets.v1.Filter.credit_types_treatment]
is not INCLUDE_SPECIFIED_CREDITS, this field must be empty.
public MapField<string, ListValue> Labels { get; }
Optional. A single label and value pair specifying that usage from only
this set of labeled resources should be included in the budget. If omitted,
the report includes all labeled and unlabeled usage.
An object containing a single "key": value pair. Example: { "name":
"wrench" }.
Currently, multiple entries or multiple values per entry are not
allowed.
Optional. A set of projects of the form projects/{project},
specifying that usage from only this set of projects should be
included in the budget. If omitted, the report includes all usage for
the billing account, regardless of which project the usage occurred on.
public RepeatedField<string> ResourceAncestors { get; }
Optional. A set of folder and organization names of the form
folders/{folderId} or organizations/{organizationId}, specifying that
usage from only this set of folders and organizations should be included in
the budget. If omitted, the budget includes all usage that the billing
account pays for. If the folder or organization contains projects that are
paid for by a different Cloud Billing account, the budget doesn't apply
to those projects.
Optional. A set of services of the form services/{service_id},
specifying that usage from only this set of services should be
included in the budget. If omitted, the report includes usage for
all the services.
The service names are available through the Catalog API:
https://cloud.google.com/billing/v1/how-tos/catalog-api.
Optional. A set of subaccounts of the form billingAccounts/{account_id},
specifying that usage from only this set of subaccounts should be included
in the budget. If a subaccount is set to the name of the parent account,
usage from the parent account is included. If the field is omitted,
the report includes usage from the parent account and all subaccounts,
if they exist.
[[["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 \u003ccode\u003eFilter\u003c/code\u003e class in the Google Cloud Billing Budget v1 API allows users to define the scope of costs for budget calculations.\u003c/p\u003e\n"],["\u003cp\u003eUsers can filter budget calculations by specifying a \u003ccode\u003eCalendarPeriod\u003c/code\u003e for recurring periods or a \u003ccode\u003eCustomPeriod\u003c/code\u003e for a static time frame.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eFilter\u003c/code\u003e class offers options to include or exclude specific credit types using \u003ccode\u003eCreditTypes\u003c/code\u003e and \u003ccode\u003eCreditTypesTreatment\u003c/code\u003e, which impacts spend calculations.\u003c/p\u003e\n"],["\u003cp\u003eThe API provides filtering options by \u003ccode\u003eProjects\u003c/code\u003e, \u003ccode\u003eResourceAncestors\u003c/code\u003e, \u003ccode\u003eServices\u003c/code\u003e, \u003ccode\u003eSubaccounts\u003c/code\u003e, and specific resource \u003ccode\u003eLabels\u003c/code\u003e, allowing for granular control over included usage.\u003c/p\u003e\n"],["\u003cp\u003eThe most recent version is 2.6.0, and the documentation includes prior versions going as far back as 1.1.0, accessible via their respective URLs.\u003c/p\u003e\n"]]],[],null,["# Cloud Billing Budget v1 API - Class Filter (2.6.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.6.0 (latest)](/dotnet/docs/reference/Google.Cloud.Billing.Budgets.V1/latest/Google.Cloud.Billing.Budgets.V1.Filter)\n- [2.5.0](/dotnet/docs/reference/Google.Cloud.Billing.Budgets.V1/2.5.0/Google.Cloud.Billing.Budgets.V1.Filter)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.Billing.Budgets.V1/2.4.0/Google.Cloud.Billing.Budgets.V1.Filter)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.Billing.Budgets.V1/2.3.0/Google.Cloud.Billing.Budgets.V1.Filter)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.Billing.Budgets.V1/2.2.0/Google.Cloud.Billing.Budgets.V1.Filter)\n- [2.1.0](/dotnet/docs/reference/Google.Cloud.Billing.Budgets.V1/2.1.0/Google.Cloud.Billing.Budgets.V1.Filter)\n- [2.0.0](/dotnet/docs/reference/Google.Cloud.Billing.Budgets.V1/2.0.0/Google.Cloud.Billing.Budgets.V1.Filter)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.Billing.Budgets.V1/1.2.0/Google.Cloud.Billing.Budgets.V1.Filter)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.Billing.Budgets.V1/1.1.0/Google.Cloud.Billing.Budgets.V1.Filter) \n\n public sealed class Filter : IMessage\u003cFilter\u003e, IEquatable\u003cFilter\u003e, IDeepCloneable\u003cFilter\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Cloud Billing Budget v1 API class Filter.\n\nA filter for a budget, limiting the scope of the cost to calculate. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e Filter \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[Filter](/dotnet/docs/reference/Google.Cloud.Billing.Budgets.V1/latest/Google.Cloud.Billing.Budgets.V1.Filter), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[Filter](/dotnet/docs/reference/Google.Cloud.Billing.Budgets.V1/latest/Google.Cloud.Billing.Budgets.V1.Filter), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[Filter](/dotnet/docs/reference/Google.Cloud.Billing.Budgets.V1/latest/Google.Cloud.Billing.Budgets.V1.Filter), [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.Billing.Budgets.V1](/dotnet/docs/reference/Google.Cloud.Billing.Budgets.V1/latest/Google.Cloud.Billing.Budgets.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Billing.Budgets.V1.dll\n\nConstructors\n------------\n\n### Filter()\n\n public Filter()\n\n### Filter(Filter)\n\n public Filter(Filter other)\n\nProperties\n----------\n\n### CalendarPeriod\n\n public CalendarPeriod CalendarPeriod { get; set; }\n\nOptional. Specifies to track usage for recurring calendar period.\nFor example, assume that CalendarPeriod.QUARTER is set. The budget\ntracks usage from April 1 to June 30, when the current calendar month is\nApril, May, June. After that, it tracks usage from July 1 to\nSeptember 30 when the current calendar month is July, August, September,\nso on.\n\n### CreditTypes\n\n public RepeatedField\u003cstring\u003e CreditTypes { get; }\n\nOptional. If\n\\[Filter.credit_types_treatment\\]\\[google.cloud.billing.budgets.v1.Filter.credit_types_treatment\\]\nis INCLUDE_SPECIFIED_CREDITS, this is a list of credit types to be\nsubtracted from gross cost to determine the spend for threshold\ncalculations. See [a list of acceptable credit type\nvalues](https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#credits-type).\n\nIf\n\\[Filter.credit_types_treatment\\]\\[google.cloud.billing.budgets.v1.Filter.credit_types_treatment\\]\nis **not** INCLUDE_SPECIFIED_CREDITS, this field must be empty.\n\n### CreditTypesTreatment\n\n public Filter.Types.CreditTypesTreatment CreditTypesTreatment { get; set; }\n\nOptional. If not set, default behavior is `INCLUDE_ALL_CREDITS`.\n\n### CustomPeriod\n\n public CustomPeriod CustomPeriod { get; set; }\n\nOptional. Specifies to track usage from any start date (required) to any\nend date (optional). This time period is static, it does not recur.\n\n### HasCalendarPeriod\n\n public bool HasCalendarPeriod { get; }\n\nGets whether the \"calendar_period\" field is set\n\n### Labels\n\n public MapField\u003cstring, ListValue\u003e Labels { get; }\n\nOptional. A single label and value pair specifying that usage from only\nthis set of labeled resources should be included in the budget. If omitted,\nthe report includes all labeled and unlabeled usage.\n\nAn object containing a single `\"key\": value` pair. Example: `{ \"name\":\n\"wrench\" }`.\n\n*Currently, multiple entries or multiple values per entry are not\nallowed.*\n\n### Projects\n\n public RepeatedField\u003cstring\u003e Projects { get; }\n\nOptional. A set of projects of the form `projects/{project}`,\nspecifying that usage from only this set of projects should be\nincluded in the budget. If omitted, the report includes all usage for\nthe billing account, regardless of which project the usage occurred on.\n\n### ResourceAncestors\n\n public RepeatedField\u003cstring\u003e ResourceAncestors { get; }\n\nOptional. A set of folder and organization names of the form\n`folders/{folderId}` or `organizations/{organizationId}`, specifying that\nusage from only this set of folders and organizations should be included in\nthe budget. If omitted, the budget includes all usage that the billing\naccount pays for. If the folder or organization contains projects that are\npaid for by a different Cloud Billing account, the budget *doesn't* apply\nto those projects.\n\n### Services\n\n public RepeatedField\u003cstring\u003e Services { get; }\n\nOptional. A set of services of the form `services/{service_id}`,\nspecifying that usage from only this set of services should be\nincluded in the budget. If omitted, the report includes usage for\nall the services.\nThe service names are available through the Catalog API:\n\u003chttps://cloud.google.com/billing/v1/how-tos/catalog-api\u003e.\n\n### Subaccounts\n\n public RepeatedField\u003cstring\u003e Subaccounts { get; }\n\nOptional. A set of subaccounts of the form `billingAccounts/{account_id}`,\nspecifying that usage from only this set of subaccounts should be included\nin the budget. If a subaccount is set to the name of the parent account,\nusage from the parent account is included. If the field is omitted,\nthe report includes usage from the parent account and all subaccounts,\nif they exist.\n\n### UsagePeriodCase\n\n public Filter.UsagePeriodOneofCase UsagePeriodCase { get; }"]]