Duration
Stay organized with collections
Save and categorize content based on your preferences.
Describes the length of a period of a time.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-08-06 UTC.
[[["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 2024-08-06 UTC."],[[["\u003cp\u003e\u003ccode\u003eDuration\u003c/code\u003e describes the length of a period of time using a JSON representation with \u003ccode\u003eunit\u003c/code\u003e and \u003ccode\u003ecount\u003c/code\u003e fields.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eunit\u003c/code\u003e specifies the frequency of the period (e.g., MONTH, DAY, HOUR) and \u003ccode\u003ecount\u003c/code\u003e indicates the number of units.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eUNIT_UNSPECIFIED\u003c/code\u003e is a reserved value for invalid or unexpected cases, while \u003ccode\u003eMONTH\u003c/code\u003e, \u003ccode\u003eDAY\u003c/code\u003e, and \u003ccode\u003eHOUR\u003c/code\u003e represent calendar month, day, and hour respectively.\u003c/p\u003e\n"]]],["The duration is defined by a JSON object with two fields: `unit` and `count`. `unit` specifies the time unit (e.g., `MONTH`, `DAY`, `HOUR`) and `count` specifies the number of those units. Valid units include `MONTH`, `DAY`, `HOUR`, and `UNIT_UNSPECIFIED` as a default. The unit describes the time frequency, `count` determines the extent of that time duration.\n"],null,["# Duration\n\n- [JSON representation](#SCHEMA_REPRESENTATION)\n- [Unit](#Unit)\n\nDescribes the length of a period of a time.\n\n| JSON representation |\n|--------------------------------------------------------------------------------------------------------------|\n| ``` { \"unit\": enum (/payments/reseller/subscription/reference/rest/v1/Duration#Unit), \"count\": integer } ``` |\n\n| Fields ||\n|---------|-------------------------------------------------------------------------------------------------------------------|\n| `unit` | `enum (`[Unit](/payments/reseller/subscription/reference/rest/v1/Duration#Unit)`)` The unit used for the duration |\n| `count` | `integer` number of duration units to be included. |\n\nUnit\n----\n\nFrequency of the period.\n\n| Enums ||\n|--------------------|---------------------------------------------------------------|\n| `UNIT_UNSPECIFIED` | Default value, reserved as an invalid or an unexpected value. |\n| `MONTH` | Unit of a calendar month. |\n| `DAY` | Unit of a day. |\n| `HOUR` | Unit of an hour. It is used for testing. |"]]