google-cloud-language-v1beta2 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,129 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Copyright 2020 Google LLC
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # https://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
-
19
-
20
- module Google
21
- module Protobuf
22
- # A Timestamp represents a point in time independent of any time zone or local
23
- # calendar, encoded as a count of seconds and fractions of seconds at
24
- # nanosecond resolution. The count is relative to an epoch at UTC midnight on
25
- # January 1, 1970, in the proleptic Gregorian calendar which extends the
26
- # Gregorian calendar backwards to year one.
27
- #
28
- # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
29
- # second table is needed for interpretation, using a [24-hour linear
30
- # smear](https://developers.google.com/time/smear).
31
- #
32
- # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
33
- # restricting to that range, we ensure that we can convert to and from [RFC
34
- # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
35
- #
36
- # # Examples
37
- #
38
- # Example 1: Compute Timestamp from POSIX `time()`.
39
- #
40
- # Timestamp timestamp;
41
- # timestamp.set_seconds(time(NULL));
42
- # timestamp.set_nanos(0);
43
- #
44
- # Example 2: Compute Timestamp from POSIX `gettimeofday()`.
45
- #
46
- # struct timeval tv;
47
- # gettimeofday(&tv, NULL);
48
- #
49
- # Timestamp timestamp;
50
- # timestamp.set_seconds(tv.tv_sec);
51
- # timestamp.set_nanos(tv.tv_usec * 1000);
52
- #
53
- # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
54
- #
55
- # FILETIME ft;
56
- # GetSystemTimeAsFileTime(&ft);
57
- # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
58
- #
59
- # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
60
- # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
61
- # Timestamp timestamp;
62
- # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
63
- # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
64
- #
65
- # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
66
- #
67
- # long millis = System.currentTimeMillis();
68
- #
69
- # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
70
- # .setNanos((int) ((millis % 1000) * 1000000)).build();
71
- #
72
- #
73
- # Example 5: Compute Timestamp from Java `Instant.now()`.
74
- #
75
- # Instant now = Instant.now();
76
- #
77
- # Timestamp timestamp =
78
- # Timestamp.newBuilder().setSeconds(now.getEpochSecond())
79
- # .setNanos(now.getNano()).build();
80
- #
81
- #
82
- # Example 6: Compute Timestamp from current time in Python.
83
- #
84
- # timestamp = Timestamp()
85
- # timestamp.GetCurrentTime()
86
- #
87
- # # JSON Mapping
88
- #
89
- # In JSON format, the Timestamp type is encoded as a string in the
90
- # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
91
- # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z"
92
- # where \\{year} is always expressed using four digits while \\{month}, \\{day},
93
- # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional
94
- # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
95
- # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
96
- # is required. A proto3 JSON serializer should always use UTC (as indicated by
97
- # "Z") when printing the Timestamp type and a proto3 JSON parser should be
98
- # able to accept both UTC and other timezones (as indicated by an offset).
99
- #
100
- # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
101
- # 01:30 UTC on January 15, 2017.
102
- #
103
- # In JavaScript, one can convert a Date object to this format using the
104
- # standard
105
- # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
106
- # method. In Python, a standard `datetime.datetime` object can be converted
107
- # to this format using
108
- # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
109
- # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
110
- # the Joda Time's [`ISODateTimeFormat.dateTime()`](
111
- # http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
112
- # ) to obtain a formatter capable of generating timestamps in this format.
113
- # @!attribute [rw] seconds
114
- # @return [::Integer]
115
- # Represents seconds of UTC time since Unix epoch
116
- # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
117
- # 9999-12-31T23:59:59Z inclusive.
118
- # @!attribute [rw] nanos
119
- # @return [::Integer]
120
- # Non-negative fractions of a second at nanosecond resolution. Negative
121
- # second values with fractions must still have non-negative nanos values
122
- # that count forward in time. Must be from 0 to 999,999,999
123
- # inclusive.
124
- class Timestamp
125
- include ::Google::Protobuf::MessageExts
126
- extend ::Google::Protobuf::MessageExts::ClassMethods
127
- end
128
- end
129
- end