Debian Codegraph @

googleapis/type/decimal/decimal.pb.go

raw
1 // Copyright 2026 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 // Code generated by protoc-gen-go. DO NOT EDIT.
16 // versions:
17 // protoc-gen-go v1.26.0
18 // protoc v4.24.4
19 // source: google/type/decimal.proto
20
21 package decimal
22
23 import (
24 reflect "reflect"
25 sync "sync"
26
27 protoreflect "google.golang.org/protobuf/reflect/protoreflect"
28 protoimpl "google.golang.org/protobuf/runtime/protoimpl"
29 )
30
31 const (
32 // Verify that this generated code is sufficiently up-to-date.
33 _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
34 // Verify that runtime/protoimpl is sufficiently up-to-date.
35 _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
36 )
37
38 // A representation of a decimal value, such as 2.5. Clients may convert values
39 // into language-native decimal formats, such as Java's
40 // [BigDecimal](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/math/BigDecimal.html)
41 // or Python's
42 // [decimal.Decimal](https://docs.python.org/3/library/decimal.html).
43 type Decimal struct {
44 state protoimpl.MessageState
45 sizeCache protoimpl.SizeCache
46 unknownFields protoimpl.UnknownFields
47
48 // The decimal value, as a string.
49 //
50 // The string representation consists of an optional sign, `+` (`U+002B`)
51 // or `-` (`U+002D`), followed by a sequence of zero or more decimal digits
52 // ("the integer"), optionally followed by a fraction, optionally followed
53 // by an exponent. An empty string **should** be interpreted as `0`.
54 //
55 // The fraction consists of a decimal point followed by zero or more decimal
56 // digits. The string must contain at least one digit in either the integer
57 // or the fraction. The number formed by the sign, the integer and the
58 // fraction is referred to as the significand.
59 //
60 // The exponent consists of the character `e` (`U+0065`) or `E` (`U+0045`)
61 // followed by one or more decimal digits.
62 //
63 // Services **should** normalize decimal values before storing them by:
64 //
65 // - Removing an explicitly-provided `+` sign (`+2.5` -> `2.5`).
66 // - Replacing a zero-length integer value with `0` (`.5` -> `0.5`).
67 // - Coercing the exponent character to upper-case, with explicit sign
68 // (`2.5e8` -> `2.5E+8`).
69 // - Removing an explicitly-provided zero exponent (`2.5E0` -> `2.5`).
70 //
71 // Services **may** perform additional normalization based on its own needs
72 // and the internal decimal implementation selected, such as shifting the
73 // decimal point and exponent value together (example: `2.5E-1` <-> `0.25`).
74 // Additionally, services **may** preserve trailing zeroes in the fraction
75 // to indicate increased precision, but are not required to do so.
76 //
77 // Note that only the `.` character is supported to divide the integer
78 // and the fraction; `,` **should not** be supported regardless of locale.
79 // Additionally, thousand separators **should not** be supported. If a
80 // service does support them, values **must** be normalized.
81 //
82 // The ENBF grammar is:
83 //
84 // DecimalString =
85 // '' | [Sign] Significand [Exponent];
86 //
87 // Sign = '+' | '-';
88 //
89 // Significand =
90 // Digits ['.'] [Digits] | [Digits] '.' Digits;
91 //
92 // Exponent = ('e' | 'E') [Sign] Digits;
93 //
94 // Digits = { '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' };
95 //
96 // Services **should** clearly document the range of supported values, the
97 // maximum supported precision (total number of digits), and, if applicable,
98 // the scale (number of digits after the decimal point), as well as how it
99 // behaves when receiving out-of-bounds values.
100 //
101 // Services **may** choose to accept values passed as input even when the
102 // value has a higher precision or scale than the service supports, and
103 // **should** round the value to fit the supported scale. Alternatively, the
104 // service **may** error with `400 Bad Request` (`INVALID_ARGUMENT` in gRPC)
105 // if precision would be lost.
106 //
107 // Services **should** error with `400 Bad Request` (`INVALID_ARGUMENT` in
108 // gRPC) if the service receives a value outside of the supported range.
109 Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
110 }
111
112 func (x *Decimal) Reset() {
113 *x = Decimal{}
114 if protoimpl.UnsafeEnabled {
115 mi := &file_google_type_decimal_proto_msgTypes[0]
116 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
117 ms.StoreMessageInfo(mi)
118 }
119 }
120
121 func (x *Decimal) String() string {
122 return protoimpl.X.MessageStringOf(x)
123 }
124
125 func (*Decimal) ProtoMessage() {}
126
127 func (x *Decimal) ProtoReflect() protoreflect.Message {
128 mi := &file_google_type_decimal_proto_msgTypes[0]
129 if protoimpl.UnsafeEnabled && x != nil {
130 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
131 if ms.LoadMessageInfo() == nil {
132 ms.StoreMessageInfo(mi)
133 }
134 return ms
135 }
136 return mi.MessageOf(x)
137 }
138
139 // Deprecated: Use Decimal.ProtoReflect.Descriptor instead.
140 func (*Decimal) Descriptor() ([]byte, []int) {
141 return file_google_type_decimal_proto_rawDescGZIP(), []int{0}
142 }
143
144 func (x *Decimal) GetValue() string {
145 if x != nil {
146 return x.Value
147 }
148 return ""
149 }
150
151 var File_google_type_decimal_proto protoreflect.FileDescriptor
152
153 var file_google_type_decimal_proto_rawDesc = []byte{
154 0x0a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x64, 0x65,
155 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x67, 0x6f, 0x6f,
156 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x22, 0x1f, 0x0a, 0x07, 0x44, 0x65, 0x63, 0x69,
157 0x6d, 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01,
158 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x63, 0x0a, 0x0f, 0x63, 0x6f, 0x6d,
159 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x42, 0x0c, 0x44, 0x65,
160 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x6f,
161 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f,
162 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61,
163 0x70, 0x69, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c,
164 0x3b, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0xa2, 0x02, 0x03, 0x47, 0x54, 0x50, 0x62, 0x06,
165 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
166 }
167
168 var (
169 file_google_type_decimal_proto_rawDescOnce sync.Once
170 file_google_type_decimal_proto_rawDescData = file_google_type_decimal_proto_rawDesc
171 )
172
173 func file_google_type_decimal_proto_rawDescGZIP() []byte {
174 file_google_type_decimal_proto_rawDescOnce.Do(func() {
175 file_google_type_decimal_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_type_decimal_proto_rawDescData)
176 })
177 return file_google_type_decimal_proto_rawDescData
178 }
179
180 var file_google_type_decimal_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
181 var file_google_type_decimal_proto_goTypes = []interface{}{
182 (*Decimal)(nil), // 0: google.type.Decimal
183 }
184 var file_google_type_decimal_proto_depIdxs = []int32{
185 0, // [0:0] is the sub-list for method output_type
186 0, // [0:0] is the sub-list for method input_type
187 0, // [0:0] is the sub-list for extension type_name
188 0, // [0:0] is the sub-list for extension extendee
189 0, // [0:0] is the sub-list for field type_name
190 }
191
192 func init() { file_google_type_decimal_proto_init() }
193 func file_google_type_decimal_proto_init() {
194 if File_google_type_decimal_proto != nil {
195 return
196 }
197 if !protoimpl.UnsafeEnabled {
198 file_google_type_decimal_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
199 switch v := v.(*Decimal); i {
200 case 0:
201 return &v.state
202 case 1:
203 return &v.sizeCache
204 case 2:
205 return &v.unknownFields
206 default:
207 return nil
208 }
209 }
210 }
211 type x struct{}
212 out := protoimpl.TypeBuilder{
213 File: protoimpl.DescBuilder{
214 GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
215 RawDescriptor: file_google_type_decimal_proto_rawDesc,
216 NumEnums: 0,
217 NumMessages: 1,
218 NumExtensions: 0,
219 NumServices: 0,
220 },
221 GoTypes: file_google_type_decimal_proto_goTypes,
222 DependencyIndexes: file_google_type_decimal_proto_depIdxs,
223 MessageInfos: file_google_type_decimal_proto_msgTypes,
224 }.Build()
225 File_google_type_decimal_proto = out.File
226 file_google_type_decimal_proto_rawDesc = nil
227 file_google_type_decimal_proto_goTypes = nil
228 file_google_type_decimal_proto_depIdxs = nil
229 }