massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stubs / protobuf / google / protobuf / duration_pb2.pyi
1 """
2 @generated by mypy-protobuf.  Do not edit manually!
3 isort:skip_file
4 """
5 import builtins
6 import google.protobuf.descriptor
7 import google.protobuf.internal.well_known_types
8 import google.protobuf.message
9 import typing_extensions
10
11 DESCRIPTOR: google.protobuf.descriptor.FileDescriptor = ...
12
13 class Duration(google.protobuf.message.Message, google.protobuf.internal.well_known_types.Duration):
14     """A Duration represents a signed, fixed-length span of time represented
15     as a count of seconds and fractions of seconds at nanosecond
16     resolution. It is independent of any calendar and concepts like "day"
17     or "month". It is related to Timestamp in that the difference between
18     two Timestamp values is a Duration and it can be added or subtracted
19     from a Timestamp. Range is approximately +-10,000 years.
20
21     # Examples
22
23     Example 1: Compute Duration from two Timestamps in pseudo code.
24
25         Timestamp start = ...;
26         Timestamp end = ...;
27         Duration duration = ...;
28
29         duration.seconds = end.seconds - start.seconds;
30         duration.nanos = end.nanos - start.nanos;
31
32         if (duration.seconds < 0 && duration.nanos > 0) {
33           duration.seconds += 1;
34           duration.nanos -= 1000000000;
35         } else if (duration.seconds > 0 && duration.nanos < 0) {
36           duration.seconds -= 1;
37           duration.nanos += 1000000000;
38         }
39
40     Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
41
42         Timestamp start = ...;
43         Duration duration = ...;
44         Timestamp end = ...;
45
46         end.seconds = start.seconds + duration.seconds;
47         end.nanos = start.nanos + duration.nanos;
48
49         if (end.nanos < 0) {
50           end.seconds -= 1;
51           end.nanos += 1000000000;
52         } else if (end.nanos >= 1000000000) {
53           end.seconds += 1;
54           end.nanos -= 1000000000;
55         }
56
57     Example 3: Compute Duration from datetime.timedelta in Python.
58
59         td = datetime.timedelta(days=3, minutes=10)
60         duration = Duration()
61         duration.FromTimedelta(td)
62
63     # JSON Mapping
64
65     In JSON format, the Duration type is encoded as a string rather than an
66     object, where the string ends in the suffix "s" (indicating seconds) and
67     is preceded by the number of seconds, with nanoseconds expressed as
68     fractional seconds. For example, 3 seconds with 0 nanoseconds should be
69     encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
70     be expressed in JSON format as "3.000000001s", and 3 seconds and 1
71     microsecond should be expressed in JSON format as "3.000001s".
72     """
73     DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
74     SECONDS_FIELD_NUMBER: builtins.int
75     NANOS_FIELD_NUMBER: builtins.int
76     seconds: builtins.int = ...
77     """Signed seconds of the span of time. Must be from -315,576,000,000
78     to +315,576,000,000 inclusive. Note: these bounds are computed from:
79     60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
80     """
81
82     nanos: builtins.int = ...
83     """Signed fractions of a second at nanosecond resolution of the span
84     of time. Durations less than one second are represented with a 0
85     `seconds` field and a positive or negative `nanos` field. For durations
86     of one second or more, a non-zero value for the `nanos` field must be
87     of the same sign as the `seconds` field. Must be from -999,999,999
88     to +999,999,999 inclusive.
89     """
90
91     def __init__(self,
92         *,
93         seconds : builtins.int = ...,
94         nanos : builtins.int = ...,
95         ) -> None: ...
96     def ClearField(self, field_name: typing_extensions.Literal["nanos",b"nanos","seconds",b"seconds"]) -> None: ...
97 global___Duration = Duration