aboutsummaryrefslogtreecommitdiffhomepage
path: root/objectivec/google/protobuf/Duration.pbobjc.h
diff options
context:
space:
mode:
Diffstat (limited to 'objectivec/google/protobuf/Duration.pbobjc.h')
-rw-r--r--objectivec/google/protobuf/Duration.pbobjc.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/objectivec/google/protobuf/Duration.pbobjc.h b/objectivec/google/protobuf/Duration.pbobjc.h
index e70138a0..d9a388ac 100644
--- a/objectivec/google/protobuf/Duration.pbobjc.h
+++ b/objectivec/google/protobuf/Duration.pbobjc.h
@@ -59,6 +59,8 @@ typedef GPB_ENUM(GPBDuration_FieldNumber) {
* two Timestamp values is a Duration and it can be added or subtracted
* from a Timestamp. Range is approximately +-10,000 years.
*
+ * # Examples
+ *
* Example 1: Compute Duration from two Timestamps in pseudo code.
*
* Timestamp start = ...;
@@ -98,12 +100,23 @@ typedef GPB_ENUM(GPBDuration_FieldNumber) {
* td = datetime.timedelta(days=3, minutes=10)
* duration = Duration()
* duration.FromTimedelta(td)
+ *
+ * # JSON Mapping
+ *
+ * In JSON format, the Duration type is encoded as a string rather than an
+ * object, where the string ends in the suffix "s" (indicating seconds) and
+ * is preceded by the number of seconds, with nanoseconds expressed as
+ * fractional seconds. For example, 3 seconds with 0 nanoseconds should be
+ * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
+ * be expressed in JSON format as "3.000000001s", and 3 seconds and 1
+ * microsecond should be expressed in JSON format as "3.000001s".
**/
@interface GPBDuration : GPBMessage
/**
* Signed seconds of the span of time. Must be from -315,576,000,000
- * to +315,576,000,000 inclusive.
+ * to +315,576,000,000 inclusive. Note: these bounds are computed from:
+ * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
**/
@property(nonatomic, readwrite) int64_t seconds;