mirror of https://github.com/grpc/grpc-dart.git
Compare commits
277 Commits
Author | SHA1 | Date |
---|---|---|
|
c2581f952e | |
|
c737e3d87e | |
|
79f277e7b9 | |
|
4e35b1689d | |
|
aebb65cbf2 | |
|
a6b94850a1 | |
|
d297a29cb7 | |
|
5ba3745779 | |
|
aa915bf15b | |
|
9a0b4642ef | |
|
f077328341 | |
|
ebc838b66d | |
|
6dfb4b43f3 | |
|
5ba28e3a1c | |
|
840661415d | |
|
7f9042f79e | |
|
9a9c01752c | |
|
3e94fecd14 | |
|
6676c20df2 | |
|
f61b9a3b37 | |
|
c0630106a9 | |
|
04ba68eb91 | |
|
f8bbdce629 | |
|
071ebc5f31 | |
|
81776333d9 | |
|
38ca626e0a | |
|
4f6fe9b111 | |
|
c18e185bb0 | |
|
b999b64502 | |
|
bf8bbde34c | |
|
4aa4c8cb8d | |
|
dee1b2b43b | |
|
52023d404e | |
|
ebb7368fa4 | |
|
4e65d4b795 | |
|
14954537f6 | |
|
6586b74969 | |
|
9f65399e28 | |
|
0d02e4386f | |
|
078fd23bca | |
|
bdbe5f5003 | |
|
bb8b6e5950 | |
|
b05fafe77c | |
|
aece2a4e3f | |
|
4a043fa236 | |
|
e54366e1e4 | |
|
d1e6c8ce11 | |
|
f6ca15b599 | |
|
9781c57262 | |
|
b7f9115b98 | |
|
e24550ae32 | |
|
6a92a47115 | |
|
5e2fb6a30a | |
|
c1fa94951a | |
|
dae290cc5a | |
|
cba40da0d8 | |
|
3f05c37367 | |
|
4ccd8a0e3d | |
|
a6322db468 | |
|
9dadc31cba | |
|
1c18e38252 | |
|
c7e07a09a5 | |
|
8886dfd24b | |
|
b7df4c8290 | |
|
517cde91a6 | |
|
36c19af11a | |
|
03f07e9535 | |
|
aae487d12f | |
|
870ac192fa | |
|
754289be88 | |
|
a8cc164cee | |
|
d9553ca73f | |
|
1f8d992da7 | |
|
ceb879d769 | |
|
3894d5abc1 | |
|
f420b77a22 | |
|
244dea0361 | |
|
201aaa2f99 | |
|
14824dd5d8 | |
|
7be6275f03 | |
|
a1a8e92e38 | |
|
e8893cd08a | |
|
20bad4c410 | |
|
d8adea21fb | |
|
eb833d3f1c | |
|
b757b80769 | |
|
3f223823ea | |
|
375d1f3e75 | |
|
d4d0f80d02 | |
|
867d1173fa | |
|
26deabdfd2 | |
|
d0e3a4c706 | |
|
4dc6e2b252 | |
|
60311a7492 | |
|
6c0829ed8b | |
|
dbf5421eb6 | |
|
19ba902d7e | |
|
e97711aece | |
|
27a235976a | |
|
b8f872a3dc | |
|
af965f15f7 | |
|
94b71a3e1c | |
|
7e2c2665cf | |
|
151fa904b4 | |
|
276fd5a70f | |
|
7cced9282a | |
|
c2fb47c8a4 | |
|
acd2e93a25 | |
|
4775078b8c | |
|
e9ad5ab16b | |
|
c982597fae | |
|
6d9bb1057a | |
|
f5508d9801 | |
|
f23070ee85 | |
|
d4504dacf1 | |
|
7c8fca7195 | |
|
e88b84a993 | |
|
b272632450 | |
|
2f5ef8c663 | |
|
9a4493f934 | |
|
6c16fceb2a | |
|
fb0c27a78a | |
|
ee0e7ec351 | |
|
def1a19339 | |
|
7e8952c352 | |
|
eedc9acdc8 | |
|
afea2e71d8 | |
|
97b8e47224 | |
|
d7dc79971e | |
|
b437d1089d | |
|
1327ad7416 | |
|
32fbc03c63 | |
|
cbec527ba7 | |
|
b8adf24ec4 | |
|
1e1831a187 | |
|
d3f0ec7f37 | |
|
17c0d37ae5 | |
|
2584a5e536 | |
|
0eb331f157 | |
|
b2f1f697be | |
|
f28a9d9d6d | |
|
fbcb426f21 | |
|
93c21feb56 | |
|
ed960c26c6 | |
|
c48af638a5 | |
|
e51c5a3d5d | |
|
5b0e9429b8 | |
|
275cc544c9 | |
|
f1c475603f | |
|
e634f9749f | |
|
b8197a5897 | |
|
8b71a9dab2 | |
|
52bea07000 | |
|
5b3a125914 | |
|
1ea269916d | |
|
4d55137ef4 | |
|
3a1c57530f | |
|
0c4d83ab7a | |
|
63f551b14b | |
|
8e353d4675 | |
|
cb1c0ea8b3 | |
|
9f83e124e9 | |
|
0589503800 | |
|
21529c6be7 | |
|
7ea15a8160 | |
|
b6e40c34e3 | |
|
3d731e0690 | |
|
2957ec003f | |
|
e2f3d74087 | |
|
f593d21694 | |
|
fa6b127dca | |
|
831f5d8cfb | |
|
a657916168 | |
|
a774583de0 | |
|
bb4eab0f1f | |
|
dd34af2de4 | |
|
b70f069671 | |
|
afacaa30e0 | |
|
17a40219ba | |
|
3414356950 | |
|
6fa4616bac | |
|
ad2c0f6f3e | |
|
5891eb81bb | |
|
3d9c8c760c | |
|
ae0a7df169 | |
|
e4947e2909 | |
|
98ff843751 | |
|
27d9164f28 | |
|
449faa80ee | |
|
9ed03b6b96 | |
|
c513e1467f | |
|
39c751128c | |
|
03ecb84064 | |
|
4ba2a13b16 | |
|
496c8b07d1 | |
|
63dd99e3f3 | |
|
7d3b3749e8 | |
|
ae17e712e4 | |
|
caa1a31bb8 | |
|
6061512afa | |
|
fd92060ad0 | |
|
588c21e542 | |
|
e70ea6f2d0 | |
|
7ed8b741cd | |
|
7af96e5ced | |
|
20352dd718 | |
|
8e23f00f41 | |
|
b7be3af34b | |
|
78dcb0f4f1 | |
|
992e2dcc29 | |
|
5ac5d6a1e4 | |
|
1213bc546b | |
|
3aeafa77cb | |
|
c305f0d685 | |
|
9d2a469655 | |
|
6d485375ba | |
|
dcac905a13 | |
|
054ac9de3c | |
|
91564ff7aa | |
|
e65c52070b | |
|
6c0f61aaf6 | |
|
c9c4e40088 | |
|
c415d0f4e2 | |
|
0c8f5ae057 | |
|
c65afe9ec0 | |
|
f3e1e32973 | |
|
0cbc5401c8 | |
|
56c77f84ae | |
|
92731e1a71 | |
|
d7ae930e7f | |
|
d58659507c | |
|
76159960e2 | |
|
f48144271c | |
|
d62009e9fb | |
|
eafca2ab28 | |
|
ae9a7c7142 | |
|
6428b4e2f7 | |
|
e0d0516c9c | |
|
921f4df0b9 | |
|
c252ada1a5 | |
|
175910c58a | |
|
c02c5c46de | |
|
3e3ba6682f | |
|
97e47bd3e7 | |
|
1051232d17 | |
|
561f8fe716 | |
|
17ce11f7fc | |
|
238fd7ec67 | |
|
c32a9e97be | |
|
72aac2adbe | |
|
9e1f296a3f | |
|
ee1b0f9141 | |
|
847a3625e1 | |
|
694332921a | |
|
7428ab3b51 | |
|
b8e5c5c2c5 | |
|
696413339f | |
|
88485bad11 | |
|
38ad37e2ef | |
|
8a397d8c86 | |
|
686ecb3943 | |
|
0393703f58 | |
|
c914f67c11 | |
|
d9c6f6ed77 | |
|
db484e154e | |
|
00bab79945 | |
|
d9dea0e489 | |
|
9ef437d2be | |
|
f6126c5325 | |
|
26cb308d36 | |
|
40ffab8da5 | |
|
582ca1b60d | |
|
3f60746689 | |
|
325eadec8c | |
|
ab92276174 | |
|
7621132097 | |
|
c082e5b673 |
|
@ -0,0 +1,40 @@
|
|||
# Set update schedule for GitHub Actions
|
||||
# See https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/keeping-your-actions-up-to-date-with-dependabot
|
||||
|
||||
version: 2
|
||||
enable-beta-ecosystems: true
|
||||
updates:
|
||||
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "monthly"
|
||||
|
||||
- package-ecosystem: "pub"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
- package-ecosystem: "pub"
|
||||
directory: "/example/googleapis"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
- package-ecosystem: "pub"
|
||||
directory: "/example/grpc-web"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
- package-ecosystem: "pub"
|
||||
directory: "/example/helloworld"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
- package-ecosystem: "pub"
|
||||
directory: "/example/metadata"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
- package-ecosystem: "pub"
|
||||
directory: "/example/route_guide"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
- package-ecosystem: "pub"
|
||||
directory: "/interop"
|
||||
schedule:
|
||||
interval: "weekly"
|
|
@ -0,0 +1,97 @@
|
|||
name: Dart
|
||||
|
||||
on:
|
||||
# Run CI on pushes to the master branch, and on PRs against master.
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
branches: [master]
|
||||
schedule:
|
||||
- cron: "0 0 * * 0"
|
||||
|
||||
jobs:
|
||||
# Check code formatting and static analysis on a single OS (linux)
|
||||
# against Dart dev.
|
||||
analyze:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
sdk: [stable, dev]
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
|
||||
with:
|
||||
sdk: ${{ matrix.sdk }}
|
||||
- name: Report version
|
||||
run: dart --version
|
||||
- name: Install dependencies
|
||||
run: dart pub get
|
||||
- name: Check formatting (using dev dartfmt release)
|
||||
if: ${{ matrix.sdk == 'stable' }}
|
||||
run: dart format --output=none --set-exit-if-changed .
|
||||
- name: Analyze code (introp and examples)
|
||||
run: |
|
||||
for example in interop example/*/; do
|
||||
pushd $example
|
||||
echo [Getting dependencies in $example]
|
||||
dart pub get
|
||||
popd
|
||||
done
|
||||
shell: bash
|
||||
- name: Analyze code
|
||||
run: dart analyze --fatal-infos .
|
||||
- name: Check that grpc-web sample builds with DDC
|
||||
if: ${{ matrix.sdk == 'dev' }}
|
||||
# build_runner build --no-release to force compilation with DDC.
|
||||
run: |
|
||||
pushd example/grpc-web
|
||||
rm -rf build
|
||||
dart pub run build_runner build --no-release -o web:build
|
||||
test -f ./build/main.dart.js
|
||||
popd
|
||||
|
||||
# Run tests on a matrix consisting of three dimensions:
|
||||
# 1. OS: mac, windows, linux
|
||||
# 2. release channel: dev
|
||||
# 3. TODO: Dart execution mode: native, web
|
||||
test:
|
||||
needs: analyze
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
sdk: [stable, dev]
|
||||
platform: [vm, chrome]
|
||||
exclude:
|
||||
# We only run Chrome tests on Linux. No need to run them
|
||||
# on Windows and Mac because they are platform independent.
|
||||
- os: windows-latest
|
||||
platform: chrome
|
||||
- os: macos-latest
|
||||
platform: chrome
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
|
||||
with:
|
||||
sdk: ${{ matrix.sdk }}
|
||||
- name: Report version
|
||||
run: dart --version
|
||||
- name: Install envoy
|
||||
if: ${{ matrix.platform == 'chrome' }}
|
||||
run: |
|
||||
ENVOY_VERSION="1.19.0"
|
||||
wget https://archive.tetratelabs.io/envoy/download/v${ENVOY_VERSION}/envoy-v${ENVOY_VERSION}-linux-amd64.tar.xz
|
||||
tar -xf envoy-v${ENVOY_VERSION}-linux-amd64.tar.xz
|
||||
chmod +x envoy-v${ENVOY_VERSION}-linux-amd64/bin/envoy
|
||||
sudo mv envoy-v${ENVOY_VERSION}-linux-amd64/bin/envoy /usr/bin/envoy
|
||||
rm -rf envoy-v${ENVOY_VERSION}-linux-amd64.tar.xz envoy-v${ENVOY_VERSION}-linux-amd64
|
||||
env:
|
||||
MATRIX_OS: ${{ matrix.os }}
|
||||
shell: bash
|
||||
- name: Install dependencies
|
||||
run: dart pub get
|
||||
- name: Run tests
|
||||
run: dart test --platform ${{ matrix.platform }}
|
||||
- name: Run vmservice test
|
||||
if: ${{ matrix.platform != 'chrome' }}
|
||||
run: dart run --enable-vm-service --timeline-streams=Dart test/timeline_test.dart
|
|
@ -0,0 +1,14 @@
|
|||
name: Health
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
types: [opened, synchronize, reopened, labeled, unlabeled]
|
||||
|
||||
jobs:
|
||||
health:
|
||||
uses: dart-lang/ecosystem/.github/workflows/health.yaml@main
|
||||
with:
|
||||
checks: "changelog,do-not-submit,breaking,leaking"
|
||||
permissions:
|
||||
pull-requests: write
|
|
@ -0,0 +1,18 @@
|
|||
name: Comment on the pull request
|
||||
|
||||
on:
|
||||
# Trigger this workflow after the given workflows completes.
|
||||
# This workflow will have permissions to do things like create comments on the
|
||||
# PR, even if the original workflow couldn't.
|
||||
workflow_run:
|
||||
workflows:
|
||||
- Health
|
||||
- Publish
|
||||
types:
|
||||
- completed
|
||||
|
||||
jobs:
|
||||
upload:
|
||||
uses: dart-lang/ecosystem/.github/workflows/post_summaries.yaml@main
|
||||
permissions:
|
||||
pull-requests: write
|
|
@ -0,0 +1,18 @@
|
|||
# A CI configuration to auto-publish pub packages.
|
||||
|
||||
name: Publish
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
push:
|
||||
tags: [ 'v[0-9]+.[0-9]+.[0-9]+' ]
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
uses: dart-lang/ecosystem/.github/workflows/publish.yaml@main
|
||||
with:
|
||||
write-comments: false
|
||||
permissions:
|
||||
id-token: write
|
||||
pull-requests: write
|
|
@ -1,4 +1,5 @@
|
|||
# Files and directories created by pub
|
||||
.dart_tool/
|
||||
.packages
|
||||
.pub/
|
||||
build/
|
||||
|
@ -9,3 +10,8 @@ pubspec.lock
|
|||
# Directory created by dartdoc
|
||||
doc/api/
|
||||
|
||||
# Directory created by WebStorm
|
||||
.idea/
|
||||
|
||||
# Macos
|
||||
.DS_Store
|
38
.travis.yml
38
.travis.yml
|
@ -1,38 +0,0 @@
|
|||
language: dart
|
||||
sudo: false
|
||||
|
||||
# Run against dev and stable channels.
|
||||
dart:
|
||||
- dev
|
||||
- stable
|
||||
|
||||
# Define test tasks to run.
|
||||
dart_task:
|
||||
- test: --platform vm
|
||||
|
||||
# Only run one instance of the formatter and the analyzer, rather than running
|
||||
# them against each Dart version.
|
||||
matrix:
|
||||
include:
|
||||
- dart: stable
|
||||
dart_task: dartfmt
|
||||
# Wish we could exclude `example` in `analysis_options.yaml` but it seems
|
||||
# blocked by https://github.com/dart-lang/sdk/issues/26212
|
||||
- dart: dev
|
||||
script:
|
||||
- dartanalyzer lib test
|
||||
- for example in example/*; do (cd $example; echo [Analyzing $example]; pub get; dartanalyzer .); done
|
||||
- (cd interop; echo [Analyzing interop]; pub get; dartanalyzer .)
|
||||
|
||||
|
||||
# Only building master means that we don't run two builds for each pull request.
|
||||
branches:
|
||||
only: [master]
|
||||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.pub-cache
|
2
AUTHORS
2
AUTHORS
|
@ -4,3 +4,5 @@
|
|||
# Name/Organization <email address>
|
||||
|
||||
Google Inc.
|
||||
German Saprykin <saprykin.h@gmail.com>
|
||||
Alexandre Ardhuin <alexandre.ardhuin@gmail.com>
|
||||
|
|
353
CHANGELOG.md
353
CHANGELOG.md
|
@ -1,23 +1,368 @@
|
|||
## 0.2.1 - 2018-01-18
|
||||
## 4.2.0-wip
|
||||
|
||||
- Require Dart 3.8.
|
||||
- Export a protobuf generated symbol (`Any`)
|
||||
- Dart format all files for the new 3.8 formatter.
|
||||
- Require package:googleapis_auth
|
||||
- Require package:http 1.4.0
|
||||
- Require package:lints 6.0.0
|
||||
- Require package:protobuf 4.1.0
|
||||
- Simplify hierarchy of `ResponseFuture` (no longer have a private class in the
|
||||
type hierarchy)
|
||||
|
||||
## 4.1.0
|
||||
|
||||
* Add a `serverInterceptors` argument to `ConnectionServer`. These interceptors
|
||||
are acting as middleware, wrapping a `ServiceMethod` invocation.
|
||||
* Make sure that `CallOptions.mergeWith` is symmetric: given `WebCallOptions`
|
||||
it should return `WebCallOptions`.
|
||||
|
||||
## 4.0.4
|
||||
|
||||
* Allow the latest `package:googleapis_auth`.
|
||||
|
||||
## 4.0.3
|
||||
|
||||
* Widen `package:protobuf` constraint to allow version 4.0.0.
|
||||
|
||||
## 4.0.2
|
||||
|
||||
* Internal optimization to client code.
|
||||
* Small fixes, such as ports in testing and enabling `timeline_test.dart`.
|
||||
* When the keep alive manager runs into a timeout, it will finish the transport
|
||||
instead of closing the connection, as defined in the gRPC spec.
|
||||
* Upgrade to `package:lints` version 5.0.0 and Dart SDK version 3.5.0.
|
||||
* Upgrade `example/grpc-web` code.
|
||||
* Update xhr transport to migrate off legacy JS/HTML apis.
|
||||
* Use `package:web` to get `HttpStatus`.
|
||||
* Fix `package:web` deprecations.
|
||||
|
||||
## 4.0.1
|
||||
|
||||
* Fix header and trailing not completing if the call is terminated. Fixes [#727](https://github.com/grpc/grpc-dart/issues/727)
|
||||
|
||||
## 4.0.0
|
||||
|
||||
* Set compressed flag correctly for grpc-encoding = identity. Fixes [#669](https://github.com/grpc/grpc-dart/issues/669) (https://github.com/grpc/grpc-dart/pull/693)
|
||||
* Remove generated status codes.
|
||||
* Remove dependency on `package:archive`.
|
||||
* Move `codec.dart`.
|
||||
* Work around hang during Flutter hot restart by adding default case handler in _GrpcWebConversionSink.add.
|
||||
|
||||
## 3.2.4
|
||||
|
||||
* Forward internal `GrpcError` on when throwing while sending a request.
|
||||
* Add support for proxies, see [#33](https://github.com/grpc/grpc-dart/issues/33).
|
||||
* Remove canceled `ServerHandler`s from tracking list.
|
||||
* Fix regression on fetching the remote address of a closed socket.
|
||||
|
||||
## 3.2.3
|
||||
|
||||
* Add const constructor to `GrpcError` fixing #606.
|
||||
* Make `GrpcError` non-final to allow implementations.
|
||||
* Only send keepalive pings on open connections.
|
||||
* Fix interop tests.
|
||||
|
||||
## 3.2.2
|
||||
|
||||
* Remove `base` qualifier on `ResponseStream`.
|
||||
* Add support for clients to send KEEPALIVE pings.
|
||||
|
||||
## 3.2.1
|
||||
|
||||
* `package:http` now supports more versions: `>=0.13.0 <2.0.0`.
|
||||
* `package:protobuf` new supports more versions: `>=2.0.0 <4.0.0`.
|
||||
|
||||
## 3.2.0
|
||||
|
||||
* `ChannelOptions` now exposes `connectTimeout`, which is used on the
|
||||
socket connect. This is used to specify the maximum allowed time to wait
|
||||
for a connection to be established. If `connectTime` is longer than the system
|
||||
level timeout duration, a timeout may occur sooner than specified in
|
||||
`connectTimeout`. On timeout, a `SocketException` is thrown.
|
||||
* Require Dart 2.17 or greater.
|
||||
* Fix issue [#51](https://github.com/grpc/grpc-dart/issues/51), add support for custom error handling.
|
||||
* Expose client IP address to server
|
||||
* Add a `channelShutdownHandler` argument to `ClientChannel` and the subclasses.
|
||||
This callback can be used to react to channel shutdown or termination.
|
||||
* Export the `Code` protobuf enum from the `grpc.dart` library.
|
||||
* Require Dart 3.0.0 or greater.
|
||||
|
||||
## 3.1.0
|
||||
|
||||
* Expose a stream for connection state changes on ClientChannel to address
|
||||
[#428](https://github.com/grpc/grpc-dart/issues/428).
|
||||
This allows users to react to state changes in the connection.
|
||||
* Fix [#576](https://github.com/grpc/grpc-dart/issues/576): set default
|
||||
`:authority` value for UDS connections to `localhost` instead of using
|
||||
UDS path. Using path triggers checks in HTTP2 servers which
|
||||
attempt to validate `:authority` value.
|
||||
|
||||
## 3.0.2
|
||||
|
||||
* Fix compilation on the Web with DDC.
|
||||
|
||||
## 3.0.1
|
||||
|
||||
* Require `package:googleapis_auth` `^1.1.0`
|
||||
* Fix issues [#421](https://github.com/grpc/grpc-dart/issues/421) and
|
||||
[#458](https://github.com/grpc/grpc-dart/issues/458). Validate
|
||||
responses according to gRPC/gRPC-Web protocol specifications: require
|
||||
200 HTTP status and a supported `Content-Type` header to be present, as well
|
||||
as `grpc-status: 0` header. When handling malformed responses make effort
|
||||
to translate HTTP statuses into gRPC statuses.
|
||||
* Add GrpcOrGrpcWebClientChannel which uses gRPC on all platforms except web,
|
||||
on which it uses gRPC-web.
|
||||
* `GrpcError` now exposes response trailers via `GrpcError.trailers`.
|
||||
|
||||
## 3.0.0
|
||||
|
||||
* Migrate library and tests to null safety.
|
||||
* Require Dart 2.12 or greater.
|
||||
|
||||
## 2.9.0
|
||||
|
||||
* Added support for compression/decompression, which can be configured through
|
||||
`ChannelOptions` constructor's `codecRegistry` parameter or adding the
|
||||
`grpc-accept-encoding` to `metadata` parameter of `CallOptions` on the client
|
||||
side and `codecRegistry` parameter to `Server` on the server side.
|
||||
Outgoing rpc can be compressed using the `compression` parameter on the
|
||||
`CallOptions`.
|
||||
* Fix issue [#206](https://github.com/grpc/grpc-dart/issues/206). Prevent an
|
||||
exception to be thrown when a web connection stream is closed.
|
||||
* Add XHR raw response to the GrpcError for a better debugging
|
||||
([PR #423](https://github.com/grpc/grpc-dart/pulls/423)).
|
||||
|
||||
Note: this is the last release supporting SDK < 2.12. Next release will
|
||||
be nullsafe and thus require SDK >= 2.12.
|
||||
|
||||
## 2.8.0
|
||||
|
||||
* Added support for client interceptors, which can be configured through
|
||||
`Client` constructor's `interceptors` parameter. Interceptors will be
|
||||
executed by `Client.$createStreamingCall` and `Client.$createUnaryCall`.
|
||||
Using interceptors requires regenerating client stubs using version 19.2.0 or
|
||||
newer of protobuf compiler plugin.
|
||||
* `Client.$createCall` is deprecated because it does not invoke client
|
||||
interceptors.
|
||||
* Fix issue [#380](https://github.com/grpc/grpc-dart/issues/380) causing
|
||||
incorrect duplicated headers in gRPC-Web requests.
|
||||
* Change minimum required Dart SDK to 2.8 to enable access to Unix domain sockets.
|
||||
* Add support for Unix domain sockets in `Socket.serve` and `ClientChannel`.
|
||||
* Fix issue [#331](https://github.com/grpc/grpc-dart/issues/331) causing
|
||||
an exception in `GrpcWebClientChannel.terminate()`.
|
||||
|
||||
## 2.7.0
|
||||
|
||||
* Added decoding/parsing of `grpc-status-details-bin` to pass all response
|
||||
exception details to the `GrpcError` thrown in Dart, via
|
||||
[#349](https://github.com/grpc/grpc-dart/pull/349).
|
||||
* Dart SDK constraint is bumped to `>=2.3.0 <3.0.0` due to language version
|
||||
in the generated protobuf code.
|
||||
|
||||
## 2.6.0
|
||||
|
||||
* Create gRPC servers and clients with [Server|Client]TransportConnection.
|
||||
This allows callers to provide their own transport configuration, such
|
||||
as their own implementation of streams and sinks instead of sockets.
|
||||
|
||||
## 2.5.0
|
||||
|
||||
* Expose a `validateClient` method for server credentials so gRPC server
|
||||
users may know when clients are loopback addresses.
|
||||
|
||||
## 2.4.1
|
||||
|
||||
* Plumb stacktraces through request / response stream error handlers.
|
||||
* Catch and forward any errors decoding the response.
|
||||
|
||||
## 2.4.0
|
||||
|
||||
* Add the ability to bypass CORS preflight requests.
|
||||
|
||||
## 2.3.0
|
||||
|
||||
* Revert [PR #287](https://github.com/grpc/grpc-dart/pull/287), which allowed
|
||||
using gRPC-web in native environments but also broke streaming.
|
||||
|
||||
## 2.2.0+1
|
||||
|
||||
* Relax `crypto` version dependency constraint from `^2.1.5` to `^2.1.4`.
|
||||
|
||||
## 2.2.0
|
||||
|
||||
* Added `applicationDefaultCredentialsAuthenticator` function for creating an
|
||||
authenticator using [Application Default Credentials](https://cloud.google.com/docs/authentication/production).
|
||||
* Less latency by using the `tcpNoDelay` option for sockets.
|
||||
* Support grpc-web in a non-web setting.
|
||||
|
||||
## 2.1.3
|
||||
|
||||
* Fix bug in grpc-web when receiving an empty trailer.
|
||||
* Fix a state bug in the server.
|
||||
|
||||
## 2.1.2
|
||||
|
||||
* Fix bug introduced in 2.1.1 where the port would be added to the default authority when making a
|
||||
secure connection.
|
||||
|
||||
## 2.1.1
|
||||
|
||||
* Fix bug introduced in 2.1.0 where an explicit `authority` would not be used when making a secure
|
||||
connection.
|
||||
|
||||
## 2.1.0
|
||||
|
||||
* Do a health check of the http2-connection before making request.
|
||||
* Introduce `ChannelOptions.connectionLimit` the longest time a single connection is used for new
|
||||
requests.
|
||||
* Use Tcp.nodelay to improve client call speed.
|
||||
* Use SecureSocket supportedProtocols to save a round trip when establishing a secure connection.
|
||||
* Allow passing http2 `ServerSettings` to `Server.serve`.
|
||||
|
||||
## 2.0.3
|
||||
|
||||
* GrpcError now implements Exception to indicate it can be reasonably handled.
|
||||
|
||||
## 2.0.2
|
||||
|
||||
* Fix computation of the audience given to metadata providers to include the scheme.
|
||||
|
||||
## 2.0.1
|
||||
|
||||
* Fix computation of authority. This should fix authorization.
|
||||
|
||||
## 2.0.0+1
|
||||
|
||||
* Fix imports to ensure `grpc_web.dart` has no accidental transitive dependencies on dart:io.
|
||||
|
||||
## 2.0.0
|
||||
|
||||
* Add initial support for grpc-web.
|
||||
See `example/grpc-web` for an example of this working.
|
||||
* **Breaking**: `grpc.dart` no longer exposes `ClientConnection`. It was supposed to be an internal
|
||||
abstraction.
|
||||
* **Breaking**: `grpc.dart` no longer exposes the deprecated `ServerHandler`.
|
||||
It was supposed to be an internal abstraction.
|
||||
* `service_api.dart` no longer exports Server - it has never been used by the generated code.
|
||||
|
||||
## 1.0.3
|
||||
|
||||
* Allow custom user agent with a `userAgent` argument for `ChannelOptions()`.
|
||||
* Allow specifying `authority` for `ChannelCredentials.insecure()`.
|
||||
* Add `userAgent` as an optional named argument for `clientConnection.createCallHeaders()`.
|
||||
|
||||
## 1.0.2
|
||||
|
||||
* Fix bug where the server would crash if the client would break the connection.
|
||||
|
||||
## 1.0.1
|
||||
|
||||
* Add `service_api.dart` that only contains the minimal imports needed by the code generated by
|
||||
protoc_plugin.
|
||||
|
||||
## 1.0.0+1
|
||||
|
||||
* Support package:http2 1.0.0.
|
||||
|
||||
## 1.0.0
|
||||
|
||||
* Graduate package to 1.0.
|
||||
|
||||
## 0.6.8+1
|
||||
|
||||
* Removes stray files that where published by accident in version 0.6.8.
|
||||
|
||||
## 0.6.8
|
||||
|
||||
* Calling `terminate()` or `shutdown()` on a channel doesn't throw error if the
|
||||
channel is not yet open.
|
||||
|
||||
## 0.6.7
|
||||
|
||||
* Support package:test 1.5.
|
||||
|
||||
## 0.6.6
|
||||
|
||||
* Support `package:http` `>=0.11.3+17 <0.13.0`.
|
||||
* Update `package:googleapis_auth` to `^0.2.5+3`.
|
||||
|
||||
## 0.6.5
|
||||
|
||||
* Interceptors are now async.
|
||||
|
||||
## 0.6.4
|
||||
|
||||
* Update dependencies to be compatible with Dart 2.
|
||||
|
||||
## 0.6.3
|
||||
|
||||
* Make fields of `StatusCode` const rather than final.
|
||||
|
||||
## 0.6.2
|
||||
|
||||
* Allow for non-ascii header values.
|
||||
|
||||
## 0.6.1
|
||||
|
||||
* More fixes to update to Dart 2 core library APIs.
|
||||
|
||||
## 0.6.0+1
|
||||
|
||||
* Updated implementation to use new Dart 2 APIs using
|
||||
[dart2_fix](https://github.com/dart-lang/dart2_fix).
|
||||
|
||||
## 0.6.0
|
||||
|
||||
* Dart SDK upper constraint raised to declare compatibility with Dart 2.0 stable.
|
||||
|
||||
## 0.5.0
|
||||
|
||||
* Breaking change: The package now exclusively supports Dart 2.
|
||||
* Fixed tests to pass in Dart 2.
|
||||
* Added support for Interceptors ([issue #79](https://github.com/grpc/grpc-dart/issues/79)); thanks to [@mogol](https://github.com/mogol) for contributing!
|
||||
|
||||
## 0.4.1
|
||||
|
||||
* Fixes for supporting Dart 2.
|
||||
|
||||
## 0.4.0
|
||||
|
||||
* Moved TLS credentials for server into a separate class.
|
||||
* Added support for specifying the address for the server, and support for
|
||||
serving on an ephemeral port.
|
||||
|
||||
## 0.3.1
|
||||
|
||||
* Split out TLS credentials to a separate class.
|
||||
|
||||
## 0.3.0
|
||||
|
||||
* Added authentication metadata providers, optimized for use with Google Cloud.
|
||||
* Added service URI to metadata provider API, needed for Json Web Token generation.
|
||||
* Added authenticated cloud-to-prod interoperability tests.
|
||||
* Refactored connection logic to throw initial connection errors early.
|
||||
|
||||
## 0.2.1
|
||||
|
||||
* Updated generated code in examples using latest protoc compiler plugin.
|
||||
* Dart 2.0 fixes.
|
||||
* Changed license to Apache 2.0.
|
||||
|
||||
## 0.2.0 - 2017-12-15
|
||||
## 0.2.0
|
||||
|
||||
* Implemented support for per-RPC metadata providers. This can be used for
|
||||
authentication providers which may need to obtain or refresh a token before
|
||||
the RPC is sent.
|
||||
|
||||
## 0.1.0 - 2017-10-12
|
||||
## 0.1.0
|
||||
|
||||
* Core gRPC functionality is implemented and passes
|
||||
[gRPC compliance tests](https://github.com/grpc/grpc/blob/master/doc/interop-test-descriptions.md).
|
||||
|
||||
The API is shaping up, but may still change as more advanced features are implemented.
|
||||
|
||||
## 0.0.1 - 2017-07-05
|
||||
## 0.0.1
|
||||
|
||||
* Initial version.
|
||||
|
||||
|
|
|
@ -1,12 +1,3 @@
|
|||
We expect contributors to act professionally and respectfully, and we
|
||||
expect our social spaces to be safe and dignified environments.
|
||||
## Community Code of Conduct
|
||||
|
||||
Specifically:
|
||||
|
||||
* Respect people, their identities, their culture, and their work.
|
||||
|
||||
* Be kind. Be courteous. Be welcoming.
|
||||
|
||||
* Listen. Consider and acknowledge people’s points before responding.
|
||||
|
||||
We will not tolerate harrasment from anyone in our community.
|
||||
gRPC follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md).
|
||||
|
|
|
@ -25,7 +25,7 @@ it should raise analysis issues as you edit; alternatively validate from the
|
|||
Terminal:
|
||||
|
||||
```
|
||||
dartanalyzer lib test
|
||||
dart analyze
|
||||
```
|
||||
|
||||
All analysis warnings and errors must be fixed; hints should be considered.
|
||||
|
@ -33,10 +33,13 @@ All analysis warnings and errors must be fixed; hints should be considered.
|
|||
## Running tests
|
||||
|
||||
```
|
||||
pub get
|
||||
pub run test
|
||||
dart test
|
||||
```
|
||||
|
||||
gRPC-web tests require [`envoy`](
|
||||
https://www.envoyproxy.io/docs/envoy/latest/start/start.html) binary to be
|
||||
available in the PATH.
|
||||
|
||||
## Guidelines for Pull Requests
|
||||
|
||||
How to get your contributions merged smoothly and quickly.
|
||||
|
@ -63,3 +66,6 @@ early on.
|
|||
|
||||
- Exceptions to the rules can be made if there's a compelling reason for doing
|
||||
so.
|
||||
|
||||
## Updating protobuf definitions
|
||||
Sometimes we might need to update the generated dart files from the protos included in `lib/src/protos`. To do this, run the script `tool/regenerate.sh` from the project root and it will update the generated dart files in `lib/src/generated`.
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
This page lists all active maintainers of this repository. If you were a
|
||||
maintainer and would like to add your name to the Emeritus list, please send us a
|
||||
PR.
|
||||
|
||||
See [CONTRIBUTING.md](https://github.com/grpc/grpc-community/blob/master/CONTRIBUTING.md)
|
||||
for general contribution guidelines.
|
||||
|
||||
## Maintainers (in alphabetical order)
|
||||
- [mit-mit](https://github.com/mit-mit), Google LLC
|
||||
- [nichite](https://github.com/nichite), Google LLC
|
||||
- [szakarias](https://github.com/szakarias), Google LLC
|
||||
- [sigurdm](https://github.com/sigurdm), Google LLC
|
||||
|
||||
## Emeritus Maintainers (in alphabetical order)
|
||||
- [jakobr-google](https://github.com/jakobr-google), Google LLC
|
30
README.md
30
README.md
|
@ -1,21 +1,27 @@
|
|||
The [Dart](https://www.dartlang.org/) implementation of
|
||||
[](https://github.com/grpc/grpc-dart/actions/workflows/dart.yml)
|
||||
[](https://pub.dev/packages/grpc)
|
||||
|
||||
The [Dart](https://www.dart.dev/) implementation of
|
||||
[gRPC](https://grpc.io/): A high performance, open source, general RPC framework that puts mobile and HTTP/2 first.
|
||||
|
||||
[](https://travis-ci.org/dart-lang/grpc-dart)
|
||||
## Learn more
|
||||
|
||||
# Usage
|
||||
- [Quick Start](https://grpc.io/docs/languages/dart/quickstart) - get an app running in minutes
|
||||
- [Examples](https://github.com/grpc/grpc-dart/tree/master/example)
|
||||
- [API reference](https://grpc.io/docs/languages/dart/api)
|
||||
|
||||
See the [route_guide example](example/route_guide/) for an example on how to
|
||||
use this package.
|
||||
For complete documentation, see [Dart gRPC](https://grpc.io/docs/languages/dart).
|
||||
|
||||
# Status
|
||||
## Supported platforms
|
||||
|
||||
This package is currently in *beta*: It is available for general usage,
|
||||
and is considered feature complete.
|
||||
- [Dart native](https://dart.dev/platforms)
|
||||
- [Flutter](https://flutter.dev)
|
||||
|
||||
If you experience issues, or if you have feature requests,
|
||||
please [open an issue](https://github.com/dart-lang/grpc-dart/issues).
|
||||
> **Note:** [grpc-web](https://github.com/grpc/grpc-web) is supported by `package:grpc/grpc_web.dart`.
|
||||
> **UDS-unix domain socket** is supported with sdk version >= 2.8.0.
|
||||
|
||||
# Notes
|
||||
## Contributing
|
||||
|
||||
This library requires Dart SDK version 1.24.3 or later.
|
||||
If you experience problems or have feature requests, [open an issue](https://github.com/dart-lang/grpc-dart/issues/new).
|
||||
|
||||
Note that we have limited bandwidth to accept PRs, and that all PRs require signing the [EasyCLA](https://lfcla.com).
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
# Security Policy
|
||||
|
||||
For information on the gRPC-Dart security policy, please see https://dart.dev/security.
|
|
@ -1,21 +1,21 @@
|
|||
analyzer:
|
||||
strong-mode: true
|
||||
# exclude:
|
||||
# - path/to/excluded/files/**
|
||||
include: package:lints/recommended.yaml
|
||||
|
||||
analyzer:
|
||||
errors:
|
||||
# These should be fixed or ignored in the proto generator.
|
||||
implementation_imports: ignore
|
||||
no_leading_underscores_for_local_identifiers: ignore
|
||||
unintended_html_in_doc_comment: ignore
|
||||
|
||||
# Lint rules and documentation, see http://dart-lang.github.io/linter/lints
|
||||
linter:
|
||||
rules:
|
||||
- avoid_init_to_null
|
||||
- always_declare_return_types
|
||||
- cancel_subscriptions
|
||||
- close_sinks
|
||||
- directives_ordering
|
||||
- hash_and_equals
|
||||
- iterable_contains_unrelated_type
|
||||
- list_remove_unrelated_type
|
||||
- prefer_final_fields
|
||||
- omit_local_variable_types
|
||||
- prefer_final_locals
|
||||
- prefer_is_not_empty
|
||||
- prefer_relative_imports
|
||||
- prefer_single_quotes
|
||||
- strict_top_level_inference
|
||||
- test_types_in_equals
|
||||
- unrelated_type_equality_checks
|
||||
- valid_regexps
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
targets:
|
||||
$default:
|
||||
sources:
|
||||
exclude:
|
||||
- example/**
|
|
@ -0,0 +1,15 @@
|
|||
Four code examples are available:
|
||||
|
||||
1. [helloworld](https://github.com/grpc/grpc-dart/tree/master/example/helloworld):
|
||||
A demonstration of using the Dart gRPC library to perform unary RPCs.
|
||||
|
||||
1. [googleapis](https://github.com/grpc/grpc-dart/tree/master/example/googleapis):
|
||||
A demonstration of using the Dart gRPC library to communicate with Google APIs.
|
||||
|
||||
1. [metadata](https://github.com/grpc/grpc-dart/tree/master/example/metadata):
|
||||
A demonstration of how to handle custom metadata, cancellation, and timeouts in Dart gRPC.
|
||||
|
||||
1. [route_guide](https://github.com/grpc/grpc-dart/tree/master/example/route_guide):
|
||||
A demonstration of how to perform unary, client streaming, server streaming and full duplex RPCs.
|
||||
|
||||
For a complete, step-wise working example, see the [Dart gRPC Quick Start](https://grpc.io/docs/quickstart/dart).
|
|
@ -19,13 +19,13 @@ To run the example, assuming you are in the root of the googleapis folder, i.e.,
|
|||
.../example/googleapis/, first get the dependencies by running:
|
||||
|
||||
```sh
|
||||
$ pub get
|
||||
$ dart pub get
|
||||
```
|
||||
|
||||
Then, to run the logging client sample:
|
||||
|
||||
```sh
|
||||
$ pub run googleapis:logging
|
||||
$ dart run bin/logging.dart
|
||||
```
|
||||
|
||||
# Regenerate the stubs
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
include: ../../analysis_options.yaml
|
|
@ -14,77 +14,21 @@
|
|||
// limitations under the License.
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:googleapis_auth/auth_io.dart' as auth;
|
||||
import 'package:grpc/grpc.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
import 'package:googleapis/src/generated/google/api/monitored_resource.pb.dart';
|
||||
import 'package:googleapis/src/generated/google/logging/type/log_severity.pb.dart';
|
||||
import 'package:googleapis/src/generated/google/logging/v2/log_entry.pb.dart';
|
||||
import 'package:googleapis/src/generated/google/logging/v2/logging.pbgrpc.dart';
|
||||
import 'package:grpc/grpc.dart';
|
||||
|
||||
const _tokenExpirationThreshold = const Duration(seconds: 30);
|
||||
|
||||
class ServiceAccountAuthenticator {
|
||||
auth.ServiceAccountCredentials _serviceAccountCredentials;
|
||||
final List<String> _scopes;
|
||||
String _projectId;
|
||||
|
||||
auth.AccessToken _accessToken;
|
||||
Future<CallOptions> _call;
|
||||
|
||||
ServiceAccountAuthenticator(String serviceAccountJson, this._scopes) {
|
||||
final serviceAccount = JSON.decode(serviceAccountJson);
|
||||
_serviceAccountCredentials =
|
||||
new auth.ServiceAccountCredentials.fromJson(serviceAccount);
|
||||
_projectId = serviceAccount['project_id'];
|
||||
}
|
||||
|
||||
String get projectId => _projectId;
|
||||
|
||||
Future authenticate(Map<String, String> metadata) async {
|
||||
if (_accessToken == null || _accessToken.hasExpired) {
|
||||
await _obtainAccessCredentials();
|
||||
}
|
||||
|
||||
metadata['authorization'] = 'Bearer ${_accessToken.data}';
|
||||
|
||||
if (_tokenExpiresSoon) {
|
||||
// Token is about to expire. Extend it prematurely.
|
||||
_obtainAccessCredentials().catchError((_) {});
|
||||
}
|
||||
}
|
||||
|
||||
bool get _tokenExpiresSoon => _accessToken.expiry
|
||||
.subtract(_tokenExpirationThreshold)
|
||||
.isBefore(new DateTime.now().toUtc());
|
||||
|
||||
Future _obtainAccessCredentials() {
|
||||
if (_call == null) {
|
||||
final authClient = new http.Client();
|
||||
_call = auth
|
||||
.obtainAccessCredentialsViaServiceAccount(
|
||||
_serviceAccountCredentials, _scopes, authClient)
|
||||
.then((credentials) {
|
||||
_accessToken = credentials.accessToken;
|
||||
_call = null;
|
||||
authClient.close();
|
||||
});
|
||||
}
|
||||
return _call;
|
||||
}
|
||||
|
||||
CallOptions get toCallOptions => new CallOptions(providers: [authenticate]);
|
||||
}
|
||||
|
||||
Future<Null> main() async {
|
||||
final serviceAccountFile = new File('logging-service-account.json');
|
||||
Future<void> main() async {
|
||||
final serviceAccountFile = File('logging-service-account.json');
|
||||
if (!serviceAccountFile.existsSync()) {
|
||||
print('File logging-service-account.json not found. Please follow the '
|
||||
'steps in README.md to create it.');
|
||||
print(
|
||||
'File logging-service-account.json not found. Please follow the '
|
||||
'steps in README.md to create it.',
|
||||
);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
|
@ -93,21 +37,26 @@ Future<Null> main() async {
|
|||
'https://www.googleapis.com/auth/logging.write',
|
||||
];
|
||||
|
||||
final authenticator = new ServiceAccountAuthenticator(
|
||||
serviceAccountFile.readAsStringSync(), scopes);
|
||||
final authenticator = ServiceAccountAuthenticator(
|
||||
serviceAccountFile.readAsStringSync(),
|
||||
scopes,
|
||||
);
|
||||
final projectId = authenticator.projectId;
|
||||
|
||||
final channel = new ClientChannel('logging.googleapis.com',
|
||||
options: const ChannelOptions.secure());
|
||||
final logging =
|
||||
new LoggingServiceV2Client(channel, options: authenticator.toCallOptions);
|
||||
final channel = ClientChannel('logging.googleapis.com');
|
||||
final logging = LoggingServiceV2Client(
|
||||
channel,
|
||||
options: authenticator.toCallOptions,
|
||||
);
|
||||
|
||||
final request = new WriteLogEntriesRequest()
|
||||
..entries.add(new LogEntry()
|
||||
final request = WriteLogEntriesRequest()
|
||||
..entries.add(
|
||||
LogEntry()
|
||||
..logName = 'projects/$projectId/logs/example'
|
||||
..severity = LogSeverity.INFO
|
||||
..resource = (new MonitoredResource()..type = 'global')
|
||||
..textPayload = 'This is a log entry!');
|
||||
..resource = (MonitoredResource()..type = 'global')
|
||||
..textPayload = 'This is a log entry!',
|
||||
);
|
||||
await logging.writeLogEntries(request);
|
||||
|
||||
await channel.shutdown();
|
||||
|
|
|
@ -1,78 +1,125 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.api_label;
|
||||
// source: google/api/label.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore: UNUSED_SHOWN_NAME
|
||||
import 'dart:core' show int, bool, double, String, List, override;
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'package:protobuf/protobuf.dart';
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
import 'label.pbenum.dart';
|
||||
|
||||
export 'label.pbenum.dart';
|
||||
|
||||
class LabelDescriptor extends GeneratedMessage {
|
||||
static final BuilderInfo _i = new BuilderInfo('LabelDescriptor')
|
||||
..aOS(1, 'key')
|
||||
/// A description of a label.
|
||||
class LabelDescriptor extends $pb.GeneratedMessage {
|
||||
factory LabelDescriptor({
|
||||
$core.String? key,
|
||||
LabelDescriptor_ValueType? valueType,
|
||||
$core.String? description,
|
||||
}) {
|
||||
final result = create();
|
||||
if (key != null) {
|
||||
result.key = key;
|
||||
}
|
||||
if (valueType != null) {
|
||||
result.valueType = valueType;
|
||||
}
|
||||
if (description != null) {
|
||||
result.description = description;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
LabelDescriptor._() : super();
|
||||
factory LabelDescriptor.fromBuffer($core.List<$core.int> i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(i, r);
|
||||
factory LabelDescriptor.fromJson($core.String i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(i, r);
|
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
_omitMessageNames ? '' : 'LabelDescriptor',
|
||||
package: const $pb.PackageName(_omitMessageNames ? '' : 'google.api'),
|
||||
createEmptyInstance: create)
|
||||
..aOS(1, _omitFieldNames ? '' : 'key')
|
||||
..e<LabelDescriptor_ValueType>(
|
||||
2,
|
||||
'valueType',
|
||||
PbFieldType.OE,
|
||||
LabelDescriptor_ValueType.STRING,
|
||||
LabelDescriptor_ValueType.valueOf,
|
||||
LabelDescriptor_ValueType.values)
|
||||
..aOS(3, 'description')
|
||||
2, _omitFieldNames ? '' : 'valueType', $pb.PbFieldType.OE,
|
||||
defaultOrMaker: LabelDescriptor_ValueType.STRING,
|
||||
valueOf: LabelDescriptor_ValueType.valueOf,
|
||||
enumValues: LabelDescriptor_ValueType.values)
|
||||
..aOS(3, _omitFieldNames ? '' : 'description')
|
||||
..hasRequiredFields = false;
|
||||
|
||||
LabelDescriptor() : super();
|
||||
LabelDescriptor.fromBuffer(List<int> i,
|
||||
[ExtensionRegistry r = ExtensionRegistry.EMPTY])
|
||||
: super.fromBuffer(i, r);
|
||||
LabelDescriptor.fromJson(String i,
|
||||
[ExtensionRegistry r = ExtensionRegistry.EMPTY])
|
||||
: super.fromJson(i, r);
|
||||
LabelDescriptor clone() => new LabelDescriptor()..mergeFromMessage(this);
|
||||
BuilderInfo get info_ => _i;
|
||||
static LabelDescriptor create() => new LabelDescriptor();
|
||||
static PbList<LabelDescriptor> createRepeated() =>
|
||||
new PbList<LabelDescriptor>();
|
||||
static LabelDescriptor getDefault() {
|
||||
if (_defaultInstance == null)
|
||||
_defaultInstance = new _ReadonlyLabelDescriptor();
|
||||
return _defaultInstance;
|
||||
}
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
LabelDescriptor clone() => LabelDescriptor()..mergeFromMessage(this);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
LabelDescriptor copyWith(void Function(LabelDescriptor) updates) =>
|
||||
super.copyWith((message) => updates(message as LabelDescriptor))
|
||||
as LabelDescriptor;
|
||||
|
||||
static LabelDescriptor _defaultInstance;
|
||||
static void $checkItem(LabelDescriptor v) {
|
||||
if (v is! LabelDescriptor) checkItemFailed(v, 'LabelDescriptor');
|
||||
}
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
String get key => $_getS(0, '');
|
||||
set key(String v) {
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static LabelDescriptor create() => LabelDescriptor._();
|
||||
LabelDescriptor createEmptyInstance() => create();
|
||||
static $pb.PbList<LabelDescriptor> createRepeated() =>
|
||||
$pb.PbList<LabelDescriptor>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static LabelDescriptor getDefault() => _defaultInstance ??=
|
||||
$pb.GeneratedMessage.$_defaultFor<LabelDescriptor>(create);
|
||||
static LabelDescriptor? _defaultInstance;
|
||||
|
||||
/// The label key.
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get key => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set key($core.String v) {
|
||||
$_setString(0, v);
|
||||
}
|
||||
|
||||
bool hasKey() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasKey() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearKey() => clearField(1);
|
||||
|
||||
/// The type of data that can be assigned to the label.
|
||||
@$pb.TagNumber(2)
|
||||
LabelDescriptor_ValueType get valueType => $_getN(1);
|
||||
@$pb.TagNumber(2)
|
||||
set valueType(LabelDescriptor_ValueType v) {
|
||||
setField(2, v);
|
||||
}
|
||||
|
||||
bool hasValueType() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasValueType() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearValueType() => clearField(2);
|
||||
|
||||
String get description => $_getS(2, '');
|
||||
set description(String v) {
|
||||
/// A human-readable description for the label.
|
||||
@$pb.TagNumber(3)
|
||||
$core.String get description => $_getSZ(2);
|
||||
@$pb.TagNumber(3)
|
||||
set description($core.String v) {
|
||||
$_setString(2, v);
|
||||
}
|
||||
|
||||
bool hasDescription() => $_has(2);
|
||||
@$pb.TagNumber(3)
|
||||
$core.bool hasDescription() => $_has(2);
|
||||
@$pb.TagNumber(3)
|
||||
void clearDescription() => clearField(3);
|
||||
}
|
||||
|
||||
class _ReadonlyLabelDescriptor extends LabelDescriptor
|
||||
with ReadonlyMessageMixin {}
|
||||
const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names');
|
||||
const _omitMessageNames =
|
||||
$core.bool.fromEnvironment('protobuf.omit_message_names');
|
||||
|
|
|
@ -1,35 +1,39 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.api_label_pbenum;
|
||||
// source: google/api/label.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: UNDEFINED_SHOWN_NAME,UNUSED_SHOWN_NAME
|
||||
import 'dart:core' show int, dynamic, String, List, Map;
|
||||
import 'package:protobuf/protobuf.dart';
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
class LabelDescriptor_ValueType extends ProtobufEnum {
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
/// Value types that can be used as label values.
|
||||
class LabelDescriptor_ValueType extends $pb.ProtobufEnum {
|
||||
static const LabelDescriptor_ValueType STRING =
|
||||
const LabelDescriptor_ValueType._(0, 'STRING');
|
||||
LabelDescriptor_ValueType._(0, _omitEnumNames ? '' : 'STRING');
|
||||
static const LabelDescriptor_ValueType BOOL =
|
||||
const LabelDescriptor_ValueType._(1, 'BOOL');
|
||||
LabelDescriptor_ValueType._(1, _omitEnumNames ? '' : 'BOOL');
|
||||
static const LabelDescriptor_ValueType INT64 =
|
||||
const LabelDescriptor_ValueType._(2, 'INT64');
|
||||
LabelDescriptor_ValueType._(2, _omitEnumNames ? '' : 'INT64');
|
||||
|
||||
static const List<LabelDescriptor_ValueType> values =
|
||||
const <LabelDescriptor_ValueType>[
|
||||
static const $core.List<LabelDescriptor_ValueType> values =
|
||||
<LabelDescriptor_ValueType>[
|
||||
STRING,
|
||||
BOOL,
|
||||
INT64,
|
||||
];
|
||||
|
||||
static final Map<int, dynamic> _byValue = ProtobufEnum.initByValue(values);
|
||||
static LabelDescriptor_ValueType valueOf(int value) =>
|
||||
_byValue[value] as LabelDescriptor_ValueType;
|
||||
static void $checkItem(LabelDescriptor_ValueType v) {
|
||||
if (v is! LabelDescriptor_ValueType)
|
||||
checkItemFailed(v, 'LabelDescriptor_ValueType');
|
||||
}
|
||||
static final $core.Map<$core.int, LabelDescriptor_ValueType> _byValue =
|
||||
$pb.ProtobufEnum.initByValue(values);
|
||||
static LabelDescriptor_ValueType? valueOf($core.int value) => _byValue[value];
|
||||
|
||||
const LabelDescriptor_ValueType._(int v, String n) : super(v, n);
|
||||
const LabelDescriptor_ValueType._($core.int v, $core.String n) : super(v, n);
|
||||
}
|
||||
|
||||
const _omitEnumNames = $core.bool.fromEnvironment('protobuf.omit_enum_names');
|
||||
|
|
|
@ -1,14 +1,24 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.api_label_pbjson;
|
||||
// source: google/api/label.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
const LabelDescriptor$json = const {
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:core' as $core;
|
||||
import 'dart:typed_data' as $typed_data;
|
||||
|
||||
@$core.Deprecated('Use labelDescriptorDescriptor instead')
|
||||
const LabelDescriptor$json = {
|
||||
'1': 'LabelDescriptor',
|
||||
'2': const [
|
||||
const {'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'},
|
||||
const {
|
||||
'2': [
|
||||
{'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'},
|
||||
{
|
||||
'1': 'value_type',
|
||||
'3': 2,
|
||||
'4': 1,
|
||||
|
@ -16,16 +26,24 @@ const LabelDescriptor$json = const {
|
|||
'6': '.google.api.LabelDescriptor.ValueType',
|
||||
'10': 'valueType'
|
||||
},
|
||||
const {'1': 'description', '3': 3, '4': 1, '5': 9, '10': 'description'},
|
||||
{'1': 'description', '3': 3, '4': 1, '5': 9, '10': 'description'},
|
||||
],
|
||||
'4': const [LabelDescriptor_ValueType$json],
|
||||
'4': [LabelDescriptor_ValueType$json],
|
||||
};
|
||||
|
||||
const LabelDescriptor_ValueType$json = const {
|
||||
@$core.Deprecated('Use labelDescriptorDescriptor instead')
|
||||
const LabelDescriptor_ValueType$json = {
|
||||
'1': 'ValueType',
|
||||
'2': const [
|
||||
const {'1': 'STRING', '2': 0},
|
||||
const {'1': 'BOOL', '2': 1},
|
||||
const {'1': 'INT64', '2': 2},
|
||||
'2': [
|
||||
{'1': 'STRING', '2': 0},
|
||||
{'1': 'BOOL', '2': 1},
|
||||
{'1': 'INT64', '2': 2},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `LabelDescriptor`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List labelDescriptorDescriptor = $convert.base64Decode(
|
||||
'Cg9MYWJlbERlc2NyaXB0b3ISEAoDa2V5GAEgASgJUgNrZXkSRAoKdmFsdWVfdHlwZRgCIAEoDj'
|
||||
'IlLmdvb2dsZS5hcGkuTGFiZWxEZXNjcmlwdG9yLlZhbHVlVHlwZVIJdmFsdWVUeXBlEiAKC2Rl'
|
||||
'c2NyaXB0aW9uGAMgASgJUgtkZXNjcmlwdGlvbiIsCglWYWx1ZVR5cGUSCgoGU1RSSU5HEAASCA'
|
||||
'oEQk9PTBABEgkKBUlOVDY0EAI=');
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: google/api/launch_stage.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:core' as $core;
|
||||
|
||||
export 'launch_stage.pbenum.dart';
|
|
@ -0,0 +1,53 @@
|
|||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: google/api/launch_stage.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
/// The launch stage as defined by [Google Cloud Platform
|
||||
/// Launch Stages](https://cloud.google.com/terms/launch-stages).
|
||||
class LaunchStage extends $pb.ProtobufEnum {
|
||||
static const LaunchStage LAUNCH_STAGE_UNSPECIFIED =
|
||||
LaunchStage._(0, _omitEnumNames ? '' : 'LAUNCH_STAGE_UNSPECIFIED');
|
||||
static const LaunchStage UNIMPLEMENTED =
|
||||
LaunchStage._(6, _omitEnumNames ? '' : 'UNIMPLEMENTED');
|
||||
static const LaunchStage PRELAUNCH =
|
||||
LaunchStage._(7, _omitEnumNames ? '' : 'PRELAUNCH');
|
||||
static const LaunchStage EARLY_ACCESS =
|
||||
LaunchStage._(1, _omitEnumNames ? '' : 'EARLY_ACCESS');
|
||||
static const LaunchStage ALPHA =
|
||||
LaunchStage._(2, _omitEnumNames ? '' : 'ALPHA');
|
||||
static const LaunchStage BETA =
|
||||
LaunchStage._(3, _omitEnumNames ? '' : 'BETA');
|
||||
static const LaunchStage GA = LaunchStage._(4, _omitEnumNames ? '' : 'GA');
|
||||
static const LaunchStage DEPRECATED =
|
||||
LaunchStage._(5, _omitEnumNames ? '' : 'DEPRECATED');
|
||||
|
||||
static const $core.List<LaunchStage> values = <LaunchStage>[
|
||||
LAUNCH_STAGE_UNSPECIFIED,
|
||||
UNIMPLEMENTED,
|
||||
PRELAUNCH,
|
||||
EARLY_ACCESS,
|
||||
ALPHA,
|
||||
BETA,
|
||||
GA,
|
||||
DEPRECATED,
|
||||
];
|
||||
|
||||
static final $core.Map<$core.int, LaunchStage> _byValue =
|
||||
$pb.ProtobufEnum.initByValue(values);
|
||||
static LaunchStage? valueOf($core.int value) => _byValue[value];
|
||||
|
||||
const LaunchStage._($core.int v, $core.String n) : super(v, n);
|
||||
}
|
||||
|
||||
const _omitEnumNames = $core.bool.fromEnvironment('protobuf.omit_enum_names');
|
|
@ -0,0 +1,35 @@
|
|||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: google/api/launch_stage.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:core' as $core;
|
||||
import 'dart:typed_data' as $typed_data;
|
||||
|
||||
@$core.Deprecated('Use launchStageDescriptor instead')
|
||||
const LaunchStage$json = {
|
||||
'1': 'LaunchStage',
|
||||
'2': [
|
||||
{'1': 'LAUNCH_STAGE_UNSPECIFIED', '2': 0},
|
||||
{'1': 'UNIMPLEMENTED', '2': 6},
|
||||
{'1': 'PRELAUNCH', '2': 7},
|
||||
{'1': 'EARLY_ACCESS', '2': 1},
|
||||
{'1': 'ALPHA', '2': 2},
|
||||
{'1': 'BETA', '2': 3},
|
||||
{'1': 'GA', '2': 4},
|
||||
{'1': 'DEPRECATED', '2': 5},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `LaunchStage`. Decode as a `google.protobuf.EnumDescriptorProto`.
|
||||
final $typed_data.Uint8List launchStageDescriptor = $convert.base64Decode(
|
||||
'CgtMYXVuY2hTdGFnZRIcChhMQVVOQ0hfU1RBR0VfVU5TUEVDSUZJRUQQABIRCg1VTklNUExFTU'
|
||||
'VOVEVEEAYSDQoJUFJFTEFVTkNIEAcSEAoMRUFSTFlfQUNDRVNTEAESCQoFQUxQSEEQAhIICgRC'
|
||||
'RVRBEAMSBgoCR0EQBBIOCgpERVBSRUNBVEVEEAU=');
|
|
@ -1,186 +1,395 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: google/api/monitored_resource.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
import '../protobuf/struct.pb.dart' as $1;
|
||||
import 'label.pb.dart' as $0;
|
||||
import 'launch_stage.pbenum.dart' as $2;
|
||||
|
||||
/// An object that describes the schema of a
|
||||
/// [MonitoredResource][google.api.MonitoredResource] object using a type name
|
||||
/// and a set of labels. For example, the monitored resource descriptor for
|
||||
/// Google Compute Engine VM instances has a type of
|
||||
/// `"gce_instance"` and specifies the use of the labels `"instance_id"` and
|
||||
/// `"zone"` to identify particular VM instances.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.api_monitored_resource;
|
||||
/// Different APIs can support different monitored resource types. APIs generally
|
||||
/// provide a `list` method that returns the monitored resource descriptors used
|
||||
/// by the API.
|
||||
class MonitoredResourceDescriptor extends $pb.GeneratedMessage {
|
||||
factory MonitoredResourceDescriptor({
|
||||
$core.String? type,
|
||||
$core.String? displayName,
|
||||
$core.String? description,
|
||||
$core.Iterable<$0.LabelDescriptor>? labels,
|
||||
$core.String? name,
|
||||
$2.LaunchStage? launchStage,
|
||||
}) {
|
||||
final result = create();
|
||||
if (type != null) {
|
||||
result.type = type;
|
||||
}
|
||||
if (displayName != null) {
|
||||
result.displayName = displayName;
|
||||
}
|
||||
if (description != null) {
|
||||
result.description = description;
|
||||
}
|
||||
if (labels != null) {
|
||||
result.labels.addAll(labels);
|
||||
}
|
||||
if (name != null) {
|
||||
result.name = name;
|
||||
}
|
||||
if (launchStage != null) {
|
||||
result.launchStage = launchStage;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
MonitoredResourceDescriptor._() : super();
|
||||
factory MonitoredResourceDescriptor.fromBuffer($core.List<$core.int> i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(i, r);
|
||||
factory MonitoredResourceDescriptor.fromJson($core.String i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(i, r);
|
||||
|
||||
// ignore: UNUSED_SHOWN_NAME
|
||||
import 'dart:core' show int, bool, double, String, List, override;
|
||||
|
||||
import 'package:protobuf/protobuf.dart';
|
||||
|
||||
import 'label.pb.dart';
|
||||
|
||||
class MonitoredResourceDescriptor extends GeneratedMessage {
|
||||
static final BuilderInfo _i = new BuilderInfo('MonitoredResourceDescriptor')
|
||||
..aOS(1, 'type')
|
||||
..aOS(2, 'displayName')
|
||||
..aOS(3, 'description')
|
||||
..pp<LabelDescriptor>(4, 'labels', PbFieldType.PM,
|
||||
LabelDescriptor.$checkItem, LabelDescriptor.create)
|
||||
..aOS(5, 'name')
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
_omitMessageNames ? '' : 'MonitoredResourceDescriptor',
|
||||
package: const $pb.PackageName(_omitMessageNames ? '' : 'google.api'),
|
||||
createEmptyInstance: create)
|
||||
..aOS(1, _omitFieldNames ? '' : 'type')
|
||||
..aOS(2, _omitFieldNames ? '' : 'displayName')
|
||||
..aOS(3, _omitFieldNames ? '' : 'description')
|
||||
..pc<$0.LabelDescriptor>(
|
||||
4, _omitFieldNames ? '' : 'labels', $pb.PbFieldType.PM,
|
||||
subBuilder: $0.LabelDescriptor.create)
|
||||
..aOS(5, _omitFieldNames ? '' : 'name')
|
||||
..e<$2.LaunchStage>(
|
||||
7, _omitFieldNames ? '' : 'launchStage', $pb.PbFieldType.OE,
|
||||
defaultOrMaker: $2.LaunchStage.LAUNCH_STAGE_UNSPECIFIED,
|
||||
valueOf: $2.LaunchStage.valueOf,
|
||||
enumValues: $2.LaunchStage.values)
|
||||
..hasRequiredFields = false;
|
||||
|
||||
MonitoredResourceDescriptor() : super();
|
||||
MonitoredResourceDescriptor.fromBuffer(List<int> i,
|
||||
[ExtensionRegistry r = ExtensionRegistry.EMPTY])
|
||||
: super.fromBuffer(i, r);
|
||||
MonitoredResourceDescriptor.fromJson(String i,
|
||||
[ExtensionRegistry r = ExtensionRegistry.EMPTY])
|
||||
: super.fromJson(i, r);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
MonitoredResourceDescriptor clone() =>
|
||||
new MonitoredResourceDescriptor()..mergeFromMessage(this);
|
||||
BuilderInfo get info_ => _i;
|
||||
MonitoredResourceDescriptor()..mergeFromMessage(this);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
MonitoredResourceDescriptor copyWith(
|
||||
void Function(MonitoredResourceDescriptor) updates) =>
|
||||
super.copyWith(
|
||||
(message) => updates(message as MonitoredResourceDescriptor))
|
||||
as MonitoredResourceDescriptor;
|
||||
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static MonitoredResourceDescriptor create() =>
|
||||
new MonitoredResourceDescriptor();
|
||||
static PbList<MonitoredResourceDescriptor> createRepeated() =>
|
||||
new PbList<MonitoredResourceDescriptor>();
|
||||
static MonitoredResourceDescriptor getDefault() {
|
||||
if (_defaultInstance == null)
|
||||
_defaultInstance = new _ReadonlyMonitoredResourceDescriptor();
|
||||
return _defaultInstance;
|
||||
}
|
||||
MonitoredResourceDescriptor._();
|
||||
MonitoredResourceDescriptor createEmptyInstance() => create();
|
||||
static $pb.PbList<MonitoredResourceDescriptor> createRepeated() =>
|
||||
$pb.PbList<MonitoredResourceDescriptor>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static MonitoredResourceDescriptor getDefault() => _defaultInstance ??=
|
||||
$pb.GeneratedMessage.$_defaultFor<MonitoredResourceDescriptor>(create);
|
||||
static MonitoredResourceDescriptor? _defaultInstance;
|
||||
|
||||
static MonitoredResourceDescriptor _defaultInstance;
|
||||
static void $checkItem(MonitoredResourceDescriptor v) {
|
||||
if (v is! MonitoredResourceDescriptor)
|
||||
checkItemFailed(v, 'MonitoredResourceDescriptor');
|
||||
}
|
||||
|
||||
String get type => $_getS(0, '');
|
||||
set type(String v) {
|
||||
/// Required. The monitored resource type. For example, the type
|
||||
/// `"cloudsql_database"` represents databases in Google Cloud SQL.
|
||||
/// For a list of types, see [Monitoring resource
|
||||
/// types](https://cloud.google.com/monitoring/api/resources)
|
||||
/// and [Logging resource
|
||||
/// types](https://cloud.google.com/logging/docs/api/v2/resource-list).
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get type => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set type($core.String v) {
|
||||
$_setString(0, v);
|
||||
}
|
||||
|
||||
bool hasType() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasType() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearType() => clearField(1);
|
||||
|
||||
String get displayName => $_getS(1, '');
|
||||
set displayName(String v) {
|
||||
/// Optional. A concise name for the monitored resource type that might be
|
||||
/// displayed in user interfaces. It should be a Title Cased Noun Phrase,
|
||||
/// without any article or other determiners. For example,
|
||||
/// `"Google Cloud SQL Database"`.
|
||||
@$pb.TagNumber(2)
|
||||
$core.String get displayName => $_getSZ(1);
|
||||
@$pb.TagNumber(2)
|
||||
set displayName($core.String v) {
|
||||
$_setString(1, v);
|
||||
}
|
||||
|
||||
bool hasDisplayName() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasDisplayName() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearDisplayName() => clearField(2);
|
||||
|
||||
String get description => $_getS(2, '');
|
||||
set description(String v) {
|
||||
/// Optional. A detailed description of the monitored resource type that might
|
||||
/// be used in documentation.
|
||||
@$pb.TagNumber(3)
|
||||
$core.String get description => $_getSZ(2);
|
||||
@$pb.TagNumber(3)
|
||||
set description($core.String v) {
|
||||
$_setString(2, v);
|
||||
}
|
||||
|
||||
bool hasDescription() => $_has(2);
|
||||
@$pb.TagNumber(3)
|
||||
$core.bool hasDescription() => $_has(2);
|
||||
@$pb.TagNumber(3)
|
||||
void clearDescription() => clearField(3);
|
||||
|
||||
List<LabelDescriptor> get labels => $_getN(3);
|
||||
/// Required. A set of labels used to describe instances of this monitored
|
||||
/// resource type. For example, an individual Google Cloud SQL database is
|
||||
/// identified by values for the labels `"database_id"` and `"zone"`.
|
||||
@$pb.TagNumber(4)
|
||||
$core.List<$0.LabelDescriptor> get labels => $_getList(3);
|
||||
|
||||
String get name => $_getS(4, '');
|
||||
set name(String v) {
|
||||
/// Optional. The resource name of the monitored resource descriptor:
|
||||
/// `"projects/{project_id}/monitoredResourceDescriptors/{type}"` where
|
||||
/// {type} is the value of the `type` field in this object and
|
||||
/// {project_id} is a project ID that provides API-specific context for
|
||||
/// accessing the type. APIs that do not use project information can use the
|
||||
/// resource name format `"monitoredResourceDescriptors/{type}"`.
|
||||
@$pb.TagNumber(5)
|
||||
$core.String get name => $_getSZ(4);
|
||||
@$pb.TagNumber(5)
|
||||
set name($core.String v) {
|
||||
$_setString(4, v);
|
||||
}
|
||||
|
||||
bool hasName() => $_has(4);
|
||||
@$pb.TagNumber(5)
|
||||
$core.bool hasName() => $_has(4);
|
||||
@$pb.TagNumber(5)
|
||||
void clearName() => clearField(5);
|
||||
|
||||
/// Optional. The launch stage of the monitored resource definition.
|
||||
@$pb.TagNumber(7)
|
||||
$2.LaunchStage get launchStage => $_getN(5);
|
||||
@$pb.TagNumber(7)
|
||||
set launchStage($2.LaunchStage v) {
|
||||
setField(7, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(7)
|
||||
$core.bool hasLaunchStage() => $_has(5);
|
||||
@$pb.TagNumber(7)
|
||||
void clearLaunchStage() => clearField(7);
|
||||
}
|
||||
|
||||
class _ReadonlyMonitoredResourceDescriptor extends MonitoredResourceDescriptor
|
||||
with ReadonlyMessageMixin {}
|
||||
/// An object representing a resource that can be used for monitoring, logging,
|
||||
/// billing, or other purposes. Examples include virtual machine instances,
|
||||
/// databases, and storage devices such as disks. The `type` field identifies a
|
||||
/// [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] object
|
||||
/// that describes the resource's schema. Information in the `labels` field
|
||||
/// identifies the actual resource and its attributes according to the schema.
|
||||
/// For example, a particular Compute Engine VM instance could be represented by
|
||||
/// the following object, because the
|
||||
/// [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] for
|
||||
/// `"gce_instance"` has labels
|
||||
/// `"project_id"`, `"instance_id"` and `"zone"`:
|
||||
///
|
||||
/// { "type": "gce_instance",
|
||||
/// "labels": { "project_id": "my-project",
|
||||
/// "instance_id": "12345678901234",
|
||||
/// "zone": "us-central1-a" }}
|
||||
class MonitoredResource extends $pb.GeneratedMessage {
|
||||
factory MonitoredResource({
|
||||
$core.String? type,
|
||||
$core.Map<$core.String, $core.String>? labels,
|
||||
}) {
|
||||
final result = create();
|
||||
if (type != null) {
|
||||
result.type = type;
|
||||
}
|
||||
if (labels != null) {
|
||||
result.labels.addAll(labels);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
MonitoredResource._() : super();
|
||||
factory MonitoredResource.fromBuffer($core.List<$core.int> i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(i, r);
|
||||
factory MonitoredResource.fromJson($core.String i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(i, r);
|
||||
|
||||
class MonitoredResource_LabelsEntry extends GeneratedMessage {
|
||||
static final BuilderInfo _i = new BuilderInfo('MonitoredResource_LabelsEntry')
|
||||
..aOS(1, 'key')
|
||||
..aOS(2, 'value')
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
_omitMessageNames ? '' : 'MonitoredResource',
|
||||
package: const $pb.PackageName(_omitMessageNames ? '' : 'google.api'),
|
||||
createEmptyInstance: create)
|
||||
..aOS(1, _omitFieldNames ? '' : 'type')
|
||||
..m<$core.String, $core.String>(2, _omitFieldNames ? '' : 'labels',
|
||||
entryClassName: 'MonitoredResource.LabelsEntry',
|
||||
keyFieldType: $pb.PbFieldType.OS,
|
||||
valueFieldType: $pb.PbFieldType.OS,
|
||||
packageName: const $pb.PackageName('google.api'))
|
||||
..hasRequiredFields = false;
|
||||
|
||||
MonitoredResource_LabelsEntry() : super();
|
||||
MonitoredResource_LabelsEntry.fromBuffer(List<int> i,
|
||||
[ExtensionRegistry r = ExtensionRegistry.EMPTY])
|
||||
: super.fromBuffer(i, r);
|
||||
MonitoredResource_LabelsEntry.fromJson(String i,
|
||||
[ExtensionRegistry r = ExtensionRegistry.EMPTY])
|
||||
: super.fromJson(i, r);
|
||||
MonitoredResource_LabelsEntry clone() =>
|
||||
new MonitoredResource_LabelsEntry()..mergeFromMessage(this);
|
||||
BuilderInfo get info_ => _i;
|
||||
static MonitoredResource_LabelsEntry create() =>
|
||||
new MonitoredResource_LabelsEntry();
|
||||
static PbList<MonitoredResource_LabelsEntry> createRepeated() =>
|
||||
new PbList<MonitoredResource_LabelsEntry>();
|
||||
static MonitoredResource_LabelsEntry getDefault() {
|
||||
if (_defaultInstance == null)
|
||||
_defaultInstance = new _ReadonlyMonitoredResource_LabelsEntry();
|
||||
return _defaultInstance;
|
||||
}
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
MonitoredResource clone() => MonitoredResource()..mergeFromMessage(this);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
MonitoredResource copyWith(void Function(MonitoredResource) updates) =>
|
||||
super.copyWith((message) => updates(message as MonitoredResource))
|
||||
as MonitoredResource;
|
||||
|
||||
static MonitoredResource_LabelsEntry _defaultInstance;
|
||||
static void $checkItem(MonitoredResource_LabelsEntry v) {
|
||||
if (v is! MonitoredResource_LabelsEntry)
|
||||
checkItemFailed(v, 'MonitoredResource_LabelsEntry');
|
||||
}
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
String get key => $_getS(0, '');
|
||||
set key(String v) {
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static MonitoredResource create() => MonitoredResource._();
|
||||
MonitoredResource createEmptyInstance() => create();
|
||||
static $pb.PbList<MonitoredResource> createRepeated() =>
|
||||
$pb.PbList<MonitoredResource>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static MonitoredResource getDefault() => _defaultInstance ??=
|
||||
$pb.GeneratedMessage.$_defaultFor<MonitoredResource>(create);
|
||||
static MonitoredResource? _defaultInstance;
|
||||
|
||||
/// Required. The monitored resource type. This field must match
|
||||
/// the `type` field of a
|
||||
/// [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor]
|
||||
/// object. For example, the type of a Compute Engine VM instance is
|
||||
/// `gce_instance`. Some descriptors include the service name in the type; for
|
||||
/// example, the type of a Datastream stream is
|
||||
/// `datastream.googleapis.com/Stream`.
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get type => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set type($core.String v) {
|
||||
$_setString(0, v);
|
||||
}
|
||||
|
||||
bool hasKey() => $_has(0);
|
||||
void clearKey() => clearField(1);
|
||||
|
||||
String get value => $_getS(1, '');
|
||||
set value(String v) {
|
||||
$_setString(1, v);
|
||||
}
|
||||
|
||||
bool hasValue() => $_has(1);
|
||||
void clearValue() => clearField(2);
|
||||
}
|
||||
|
||||
class _ReadonlyMonitoredResource_LabelsEntry
|
||||
extends MonitoredResource_LabelsEntry with ReadonlyMessageMixin {}
|
||||
|
||||
class MonitoredResource extends GeneratedMessage {
|
||||
static final BuilderInfo _i = new BuilderInfo('MonitoredResource')
|
||||
..aOS(1, 'type')
|
||||
..pp<MonitoredResource_LabelsEntry>(
|
||||
2,
|
||||
'labels',
|
||||
PbFieldType.PM,
|
||||
MonitoredResource_LabelsEntry.$checkItem,
|
||||
MonitoredResource_LabelsEntry.create)
|
||||
..hasRequiredFields = false;
|
||||
|
||||
MonitoredResource() : super();
|
||||
MonitoredResource.fromBuffer(List<int> i,
|
||||
[ExtensionRegistry r = ExtensionRegistry.EMPTY])
|
||||
: super.fromBuffer(i, r);
|
||||
MonitoredResource.fromJson(String i,
|
||||
[ExtensionRegistry r = ExtensionRegistry.EMPTY])
|
||||
: super.fromJson(i, r);
|
||||
MonitoredResource clone() => new MonitoredResource()..mergeFromMessage(this);
|
||||
BuilderInfo get info_ => _i;
|
||||
static MonitoredResource create() => new MonitoredResource();
|
||||
static PbList<MonitoredResource> createRepeated() =>
|
||||
new PbList<MonitoredResource>();
|
||||
static MonitoredResource getDefault() {
|
||||
if (_defaultInstance == null)
|
||||
_defaultInstance = new _ReadonlyMonitoredResource();
|
||||
return _defaultInstance;
|
||||
}
|
||||
|
||||
static MonitoredResource _defaultInstance;
|
||||
static void $checkItem(MonitoredResource v) {
|
||||
if (v is! MonitoredResource) checkItemFailed(v, 'MonitoredResource');
|
||||
}
|
||||
|
||||
String get type => $_getS(0, '');
|
||||
set type(String v) {
|
||||
$_setString(0, v);
|
||||
}
|
||||
|
||||
bool hasType() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasType() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearType() => clearField(1);
|
||||
|
||||
List<MonitoredResource_LabelsEntry> get labels => $_getN(1);
|
||||
/// Required. Values for all of the labels listed in the associated monitored
|
||||
/// resource descriptor. For example, Compute Engine VM instances use the
|
||||
/// labels `"project_id"`, `"instance_id"`, and `"zone"`.
|
||||
@$pb.TagNumber(2)
|
||||
$core.Map<$core.String, $core.String> get labels => $_getMap(1);
|
||||
}
|
||||
|
||||
class _ReadonlyMonitoredResource extends MonitoredResource
|
||||
with ReadonlyMessageMixin {}
|
||||
/// Auxiliary metadata for a [MonitoredResource][google.api.MonitoredResource]
|
||||
/// object. [MonitoredResource][google.api.MonitoredResource] objects contain the
|
||||
/// minimum set of information to uniquely identify a monitored resource
|
||||
/// instance. There is some other useful auxiliary metadata. Monitoring and
|
||||
/// Logging use an ingestion pipeline to extract metadata for cloud resources of
|
||||
/// all types, and store the metadata in this message.
|
||||
class MonitoredResourceMetadata extends $pb.GeneratedMessage {
|
||||
factory MonitoredResourceMetadata({
|
||||
$1.Struct? systemLabels,
|
||||
$core.Map<$core.String, $core.String>? userLabels,
|
||||
}) {
|
||||
final result = create();
|
||||
if (systemLabels != null) {
|
||||
result.systemLabels = systemLabels;
|
||||
}
|
||||
if (userLabels != null) {
|
||||
result.userLabels.addAll(userLabels);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
MonitoredResourceMetadata._() : super();
|
||||
factory MonitoredResourceMetadata.fromBuffer($core.List<$core.int> i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(i, r);
|
||||
factory MonitoredResourceMetadata.fromJson($core.String i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(i, r);
|
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
_omitMessageNames ? '' : 'MonitoredResourceMetadata',
|
||||
package: const $pb.PackageName(_omitMessageNames ? '' : 'google.api'),
|
||||
createEmptyInstance: create)
|
||||
..aOM<$1.Struct>(1, _omitFieldNames ? '' : 'systemLabels',
|
||||
subBuilder: $1.Struct.create)
|
||||
..m<$core.String, $core.String>(2, _omitFieldNames ? '' : 'userLabels',
|
||||
entryClassName: 'MonitoredResourceMetadata.UserLabelsEntry',
|
||||
keyFieldType: $pb.PbFieldType.OS,
|
||||
valueFieldType: $pb.PbFieldType.OS,
|
||||
packageName: const $pb.PackageName('google.api'))
|
||||
..hasRequiredFields = false;
|
||||
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
MonitoredResourceMetadata clone() =>
|
||||
MonitoredResourceMetadata()..mergeFromMessage(this);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
MonitoredResourceMetadata copyWith(
|
||||
void Function(MonitoredResourceMetadata) updates) =>
|
||||
super.copyWith((message) => updates(message as MonitoredResourceMetadata))
|
||||
as MonitoredResourceMetadata;
|
||||
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static MonitoredResourceMetadata create() => MonitoredResourceMetadata._();
|
||||
MonitoredResourceMetadata createEmptyInstance() => create();
|
||||
static $pb.PbList<MonitoredResourceMetadata> createRepeated() =>
|
||||
$pb.PbList<MonitoredResourceMetadata>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static MonitoredResourceMetadata getDefault() => _defaultInstance ??=
|
||||
$pb.GeneratedMessage.$_defaultFor<MonitoredResourceMetadata>(create);
|
||||
static MonitoredResourceMetadata? _defaultInstance;
|
||||
|
||||
/// Output only. Values for predefined system metadata labels.
|
||||
/// System labels are a kind of metadata extracted by Google, including
|
||||
/// "machine_image", "vpc", "subnet_id",
|
||||
/// "security_group", "name", etc.
|
||||
/// System label values can be only strings, Boolean values, or a list of
|
||||
/// strings. For example:
|
||||
///
|
||||
/// { "name": "my-test-instance",
|
||||
/// "security_group": ["a", "b", "c"],
|
||||
/// "spot_instance": false }
|
||||
@$pb.TagNumber(1)
|
||||
$1.Struct get systemLabels => $_getN(0);
|
||||
@$pb.TagNumber(1)
|
||||
set systemLabels($1.Struct v) {
|
||||
setField(1, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasSystemLabels() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearSystemLabels() => clearField(1);
|
||||
@$pb.TagNumber(1)
|
||||
$1.Struct ensureSystemLabels() => $_ensure(0);
|
||||
|
||||
/// Output only. A map of user-defined metadata labels.
|
||||
@$pb.TagNumber(2)
|
||||
$core.Map<$core.String, $core.String> get userLabels => $_getMap(1);
|
||||
}
|
||||
|
||||
const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names');
|
||||
const _omitMessageNames =
|
||||
$core.bool.fromEnvironment('protobuf.omit_message_names');
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.api_monitored_resource_pbenum;
|
||||
// source: google/api/monitored_resource.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
|
|
@ -1,17 +1,27 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.api_monitored_resource_pbjson;
|
||||
// source: google/api/monitored_resource.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
const MonitoredResourceDescriptor$json = const {
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:core' as $core;
|
||||
import 'dart:typed_data' as $typed_data;
|
||||
|
||||
@$core.Deprecated('Use monitoredResourceDescriptorDescriptor instead')
|
||||
const MonitoredResourceDescriptor$json = {
|
||||
'1': 'MonitoredResourceDescriptor',
|
||||
'2': const [
|
||||
const {'1': 'name', '3': 5, '4': 1, '5': 9, '10': 'name'},
|
||||
const {'1': 'type', '3': 1, '4': 1, '5': 9, '10': 'type'},
|
||||
const {'1': 'display_name', '3': 2, '4': 1, '5': 9, '10': 'displayName'},
|
||||
const {'1': 'description', '3': 3, '4': 1, '5': 9, '10': 'description'},
|
||||
const {
|
||||
'2': [
|
||||
{'1': 'name', '3': 5, '4': 1, '5': 9, '10': 'name'},
|
||||
{'1': 'type', '3': 1, '4': 1, '5': 9, '10': 'type'},
|
||||
{'1': 'display_name', '3': 2, '4': 1, '5': 9, '10': 'displayName'},
|
||||
{'1': 'description', '3': 3, '4': 1, '5': 9, '10': 'description'},
|
||||
{
|
||||
'1': 'labels',
|
||||
'3': 4,
|
||||
'4': 3,
|
||||
|
@ -19,14 +29,31 @@ const MonitoredResourceDescriptor$json = const {
|
|||
'6': '.google.api.LabelDescriptor',
|
||||
'10': 'labels'
|
||||
},
|
||||
{
|
||||
'1': 'launch_stage',
|
||||
'3': 7,
|
||||
'4': 1,
|
||||
'5': 14,
|
||||
'6': '.google.api.LaunchStage',
|
||||
'10': 'launchStage'
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const MonitoredResource$json = const {
|
||||
/// Descriptor for `MonitoredResourceDescriptor`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List monitoredResourceDescriptorDescriptor = $convert.base64Decode(
|
||||
'ChtNb25pdG9yZWRSZXNvdXJjZURlc2NyaXB0b3ISEgoEbmFtZRgFIAEoCVIEbmFtZRISCgR0eX'
|
||||
'BlGAEgASgJUgR0eXBlEiEKDGRpc3BsYXlfbmFtZRgCIAEoCVILZGlzcGxheU5hbWUSIAoLZGVz'
|
||||
'Y3JpcHRpb24YAyABKAlSC2Rlc2NyaXB0aW9uEjMKBmxhYmVscxgEIAMoCzIbLmdvb2dsZS5hcG'
|
||||
'kuTGFiZWxEZXNjcmlwdG9yUgZsYWJlbHMSOgoMbGF1bmNoX3N0YWdlGAcgASgOMhcuZ29vZ2xl'
|
||||
'LmFwaS5MYXVuY2hTdGFnZVILbGF1bmNoU3RhZ2U=');
|
||||
|
||||
@$core.Deprecated('Use monitoredResourceDescriptor instead')
|
||||
const MonitoredResource$json = {
|
||||
'1': 'MonitoredResource',
|
||||
'2': const [
|
||||
const {'1': 'type', '3': 1, '4': 1, '5': 9, '10': 'type'},
|
||||
const {
|
||||
'2': [
|
||||
{'1': 'type', '3': 1, '4': 1, '5': 9, '10': 'type'},
|
||||
{
|
||||
'1': 'labels',
|
||||
'3': 2,
|
||||
'4': 3,
|
||||
|
@ -35,14 +62,63 @@ const MonitoredResource$json = const {
|
|||
'10': 'labels'
|
||||
},
|
||||
],
|
||||
'3': const [MonitoredResource_LabelsEntry$json],
|
||||
'3': [MonitoredResource_LabelsEntry$json],
|
||||
};
|
||||
|
||||
const MonitoredResource_LabelsEntry$json = const {
|
||||
@$core.Deprecated('Use monitoredResourceDescriptor instead')
|
||||
const MonitoredResource_LabelsEntry$json = {
|
||||
'1': 'LabelsEntry',
|
||||
'2': const [
|
||||
const {'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'},
|
||||
const {'1': 'value', '3': 2, '4': 1, '5': 9, '10': 'value'},
|
||||
'2': [
|
||||
{'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'},
|
||||
{'1': 'value', '3': 2, '4': 1, '5': 9, '10': 'value'},
|
||||
],
|
||||
'7': const {'7': true},
|
||||
'7': {'7': true},
|
||||
};
|
||||
|
||||
/// Descriptor for `MonitoredResource`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List monitoredResourceDescriptor = $convert.base64Decode(
|
||||
'ChFNb25pdG9yZWRSZXNvdXJjZRISCgR0eXBlGAEgASgJUgR0eXBlEkEKBmxhYmVscxgCIAMoCz'
|
||||
'IpLmdvb2dsZS5hcGkuTW9uaXRvcmVkUmVzb3VyY2UuTGFiZWxzRW50cnlSBmxhYmVscxo5CgtM'
|
||||
'YWJlbHNFbnRyeRIQCgNrZXkYASABKAlSA2tleRIUCgV2YWx1ZRgCIAEoCVIFdmFsdWU6AjgB');
|
||||
|
||||
@$core.Deprecated('Use monitoredResourceMetadataDescriptor instead')
|
||||
const MonitoredResourceMetadata$json = {
|
||||
'1': 'MonitoredResourceMetadata',
|
||||
'2': [
|
||||
{
|
||||
'1': 'system_labels',
|
||||
'3': 1,
|
||||
'4': 1,
|
||||
'5': 11,
|
||||
'6': '.google.protobuf.Struct',
|
||||
'10': 'systemLabels'
|
||||
},
|
||||
{
|
||||
'1': 'user_labels',
|
||||
'3': 2,
|
||||
'4': 3,
|
||||
'5': 11,
|
||||
'6': '.google.api.MonitoredResourceMetadata.UserLabelsEntry',
|
||||
'10': 'userLabels'
|
||||
},
|
||||
],
|
||||
'3': [MonitoredResourceMetadata_UserLabelsEntry$json],
|
||||
};
|
||||
|
||||
@$core.Deprecated('Use monitoredResourceMetadataDescriptor instead')
|
||||
const MonitoredResourceMetadata_UserLabelsEntry$json = {
|
||||
'1': 'UserLabelsEntry',
|
||||
'2': [
|
||||
{'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'},
|
||||
{'1': 'value', '3': 2, '4': 1, '5': 9, '10': 'value'},
|
||||
],
|
||||
'7': {'7': true},
|
||||
};
|
||||
|
||||
/// Descriptor for `MonitoredResourceMetadata`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List monitoredResourceMetadataDescriptor = $convert.base64Decode(
|
||||
'ChlNb25pdG9yZWRSZXNvdXJjZU1ldGFkYXRhEjwKDXN5c3RlbV9sYWJlbHMYASABKAsyFy5nb2'
|
||||
'9nbGUucHJvdG9idWYuU3RydWN0UgxzeXN0ZW1MYWJlbHMSVgoLdXNlcl9sYWJlbHMYAiADKAsy'
|
||||
'NS5nb29nbGUuYXBpLk1vbml0b3JlZFJlc291cmNlTWV0YWRhdGEuVXNlckxhYmVsc0VudHJ5Ug'
|
||||
'p1c2VyTGFiZWxzGj0KD1VzZXJMYWJlbHNFbnRyeRIQCgNrZXkYASABKAlSA2tleRIUCgV2YWx1'
|
||||
'ZRgCIAEoCVIFdmFsdWU6AjgB');
|
||||
|
|
|
@ -1,177 +1,359 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.logging.type_http_request;
|
||||
// source: google/logging/type/http_request.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore: UNUSED_SHOWN_NAME
|
||||
import 'dart:core' show int, bool, double, String, List, override;
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'package:fixnum/fixnum.dart';
|
||||
import 'package:protobuf/protobuf.dart';
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import '../../protobuf/duration.pb.dart' as $google$protobuf;
|
||||
import 'package:fixnum/fixnum.dart' as $fixnum;
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
class HttpRequest extends GeneratedMessage {
|
||||
static final BuilderInfo _i = new BuilderInfo('HttpRequest')
|
||||
..aOS(1, 'requestMethod')
|
||||
..aOS(2, 'requestUrl')
|
||||
..aInt64(3, 'requestSize')
|
||||
..a<int>(4, 'status', PbFieldType.O3)
|
||||
..aInt64(5, 'responseSize')
|
||||
..aOS(6, 'userAgent')
|
||||
..aOS(7, 'remoteIp')
|
||||
..aOS(8, 'referer')
|
||||
..aOB(9, 'cacheHit')
|
||||
..aOB(10, 'cacheValidatedWithOriginServer')
|
||||
..aOB(11, 'cacheLookup')
|
||||
..aInt64(12, 'cacheFillBytes')
|
||||
..aOS(13, 'serverIp')
|
||||
..a<$google$protobuf.Duration>(14, 'latency', PbFieldType.OM,
|
||||
$google$protobuf.Duration.getDefault, $google$protobuf.Duration.create)
|
||||
..aOS(15, 'protocol')
|
||||
import '../../protobuf/duration.pb.dart' as $0;
|
||||
|
||||
/// A common proto for logging HTTP requests. Only contains semantics
|
||||
/// defined by the HTTP specification. Product-specific logging
|
||||
/// information MUST be defined in a separate message.
|
||||
class HttpRequest extends $pb.GeneratedMessage {
|
||||
factory HttpRequest({
|
||||
$core.String? requestMethod,
|
||||
$core.String? requestUrl,
|
||||
$fixnum.Int64? requestSize,
|
||||
$core.int? status,
|
||||
$fixnum.Int64? responseSize,
|
||||
$core.String? userAgent,
|
||||
$core.String? remoteIp,
|
||||
$core.String? referer,
|
||||
$core.bool? cacheHit,
|
||||
$core.bool? cacheValidatedWithOriginServer,
|
||||
$core.bool? cacheLookup,
|
||||
$fixnum.Int64? cacheFillBytes,
|
||||
$core.String? serverIp,
|
||||
$0.Duration? latency,
|
||||
$core.String? protocol,
|
||||
}) {
|
||||
final result = create();
|
||||
if (requestMethod != null) {
|
||||
result.requestMethod = requestMethod;
|
||||
}
|
||||
if (requestUrl != null) {
|
||||
result.requestUrl = requestUrl;
|
||||
}
|
||||
if (requestSize != null) {
|
||||
result.requestSize = requestSize;
|
||||
}
|
||||
if (status != null) {
|
||||
result.status = status;
|
||||
}
|
||||
if (responseSize != null) {
|
||||
result.responseSize = responseSize;
|
||||
}
|
||||
if (userAgent != null) {
|
||||
result.userAgent = userAgent;
|
||||
}
|
||||
if (remoteIp != null) {
|
||||
result.remoteIp = remoteIp;
|
||||
}
|
||||
if (referer != null) {
|
||||
result.referer = referer;
|
||||
}
|
||||
if (cacheHit != null) {
|
||||
result.cacheHit = cacheHit;
|
||||
}
|
||||
if (cacheValidatedWithOriginServer != null) {
|
||||
result.cacheValidatedWithOriginServer = cacheValidatedWithOriginServer;
|
||||
}
|
||||
if (cacheLookup != null) {
|
||||
result.cacheLookup = cacheLookup;
|
||||
}
|
||||
if (cacheFillBytes != null) {
|
||||
result.cacheFillBytes = cacheFillBytes;
|
||||
}
|
||||
if (serverIp != null) {
|
||||
result.serverIp = serverIp;
|
||||
}
|
||||
if (latency != null) {
|
||||
result.latency = latency;
|
||||
}
|
||||
if (protocol != null) {
|
||||
result.protocol = protocol;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
HttpRequest._() : super();
|
||||
factory HttpRequest.fromBuffer($core.List<$core.int> i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(i, r);
|
||||
factory HttpRequest.fromJson($core.String i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(i, r);
|
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
_omitMessageNames ? '' : 'HttpRequest',
|
||||
package:
|
||||
const $pb.PackageName(_omitMessageNames ? '' : 'google.logging.type'),
|
||||
createEmptyInstance: create)
|
||||
..aOS(1, _omitFieldNames ? '' : 'requestMethod')
|
||||
..aOS(2, _omitFieldNames ? '' : 'requestUrl')
|
||||
..aInt64(3, _omitFieldNames ? '' : 'requestSize')
|
||||
..a<$core.int>(4, _omitFieldNames ? '' : 'status', $pb.PbFieldType.O3)
|
||||
..aInt64(5, _omitFieldNames ? '' : 'responseSize')
|
||||
..aOS(6, _omitFieldNames ? '' : 'userAgent')
|
||||
..aOS(7, _omitFieldNames ? '' : 'remoteIp')
|
||||
..aOS(8, _omitFieldNames ? '' : 'referer')
|
||||
..aOB(9, _omitFieldNames ? '' : 'cacheHit')
|
||||
..aOB(10, _omitFieldNames ? '' : 'cacheValidatedWithOriginServer')
|
||||
..aOB(11, _omitFieldNames ? '' : 'cacheLookup')
|
||||
..aInt64(12, _omitFieldNames ? '' : 'cacheFillBytes')
|
||||
..aOS(13, _omitFieldNames ? '' : 'serverIp')
|
||||
..aOM<$0.Duration>(14, _omitFieldNames ? '' : 'latency',
|
||||
subBuilder: $0.Duration.create)
|
||||
..aOS(15, _omitFieldNames ? '' : 'protocol')
|
||||
..hasRequiredFields = false;
|
||||
|
||||
HttpRequest() : super();
|
||||
HttpRequest.fromBuffer(List<int> i,
|
||||
[ExtensionRegistry r = ExtensionRegistry.EMPTY])
|
||||
: super.fromBuffer(i, r);
|
||||
HttpRequest.fromJson(String i,
|
||||
[ExtensionRegistry r = ExtensionRegistry.EMPTY])
|
||||
: super.fromJson(i, r);
|
||||
HttpRequest clone() => new HttpRequest()..mergeFromMessage(this);
|
||||
BuilderInfo get info_ => _i;
|
||||
static HttpRequest create() => new HttpRequest();
|
||||
static PbList<HttpRequest> createRepeated() => new PbList<HttpRequest>();
|
||||
static HttpRequest getDefault() {
|
||||
if (_defaultInstance == null) _defaultInstance = new _ReadonlyHttpRequest();
|
||||
return _defaultInstance;
|
||||
}
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
HttpRequest clone() => HttpRequest()..mergeFromMessage(this);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
HttpRequest copyWith(void Function(HttpRequest) updates) =>
|
||||
super.copyWith((message) => updates(message as HttpRequest))
|
||||
as HttpRequest;
|
||||
|
||||
static HttpRequest _defaultInstance;
|
||||
static void $checkItem(HttpRequest v) {
|
||||
if (v is! HttpRequest) checkItemFailed(v, 'HttpRequest');
|
||||
}
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
String get requestMethod => $_getS(0, '');
|
||||
set requestMethod(String v) {
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static HttpRequest create() => HttpRequest._();
|
||||
HttpRequest createEmptyInstance() => create();
|
||||
static $pb.PbList<HttpRequest> createRepeated() => $pb.PbList<HttpRequest>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static HttpRequest getDefault() => _defaultInstance ??=
|
||||
$pb.GeneratedMessage.$_defaultFor<HttpRequest>(create);
|
||||
static HttpRequest? _defaultInstance;
|
||||
|
||||
/// The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`.
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get requestMethod => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set requestMethod($core.String v) {
|
||||
$_setString(0, v);
|
||||
}
|
||||
|
||||
bool hasRequestMethod() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasRequestMethod() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearRequestMethod() => clearField(1);
|
||||
|
||||
String get requestUrl => $_getS(1, '');
|
||||
set requestUrl(String v) {
|
||||
/// The scheme (http, https), the host name, the path and the query
|
||||
/// portion of the URL that was requested.
|
||||
/// Example: `"http://example.com/some/info?color=red"`.
|
||||
@$pb.TagNumber(2)
|
||||
$core.String get requestUrl => $_getSZ(1);
|
||||
@$pb.TagNumber(2)
|
||||
set requestUrl($core.String v) {
|
||||
$_setString(1, v);
|
||||
}
|
||||
|
||||
bool hasRequestUrl() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasRequestUrl() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearRequestUrl() => clearField(2);
|
||||
|
||||
Int64 get requestSize => $_getI64(2);
|
||||
set requestSize(Int64 v) {
|
||||
/// The size of the HTTP request message in bytes, including the request
|
||||
/// headers and the request body.
|
||||
@$pb.TagNumber(3)
|
||||
$fixnum.Int64 get requestSize => $_getI64(2);
|
||||
@$pb.TagNumber(3)
|
||||
set requestSize($fixnum.Int64 v) {
|
||||
$_setInt64(2, v);
|
||||
}
|
||||
|
||||
bool hasRequestSize() => $_has(2);
|
||||
@$pb.TagNumber(3)
|
||||
$core.bool hasRequestSize() => $_has(2);
|
||||
@$pb.TagNumber(3)
|
||||
void clearRequestSize() => clearField(3);
|
||||
|
||||
int get status => $_get(3, 0);
|
||||
set status(int v) {
|
||||
$_setUnsignedInt32(3, v);
|
||||
/// The response code indicating the status of response.
|
||||
/// Examples: 200, 404.
|
||||
@$pb.TagNumber(4)
|
||||
$core.int get status => $_getIZ(3);
|
||||
@$pb.TagNumber(4)
|
||||
set status($core.int v) {
|
||||
$_setSignedInt32(3, v);
|
||||
}
|
||||
|
||||
bool hasStatus() => $_has(3);
|
||||
@$pb.TagNumber(4)
|
||||
$core.bool hasStatus() => $_has(3);
|
||||
@$pb.TagNumber(4)
|
||||
void clearStatus() => clearField(4);
|
||||
|
||||
Int64 get responseSize => $_getI64(4);
|
||||
set responseSize(Int64 v) {
|
||||
/// The size of the HTTP response message sent back to the client, in bytes,
|
||||
/// including the response headers and the response body.
|
||||
@$pb.TagNumber(5)
|
||||
$fixnum.Int64 get responseSize => $_getI64(4);
|
||||
@$pb.TagNumber(5)
|
||||
set responseSize($fixnum.Int64 v) {
|
||||
$_setInt64(4, v);
|
||||
}
|
||||
|
||||
bool hasResponseSize() => $_has(4);
|
||||
@$pb.TagNumber(5)
|
||||
$core.bool hasResponseSize() => $_has(4);
|
||||
@$pb.TagNumber(5)
|
||||
void clearResponseSize() => clearField(5);
|
||||
|
||||
String get userAgent => $_getS(5, '');
|
||||
set userAgent(String v) {
|
||||
/// The user agent sent by the client. Example:
|
||||
/// `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET
|
||||
/// CLR 1.0.3705)"`.
|
||||
@$pb.TagNumber(6)
|
||||
$core.String get userAgent => $_getSZ(5);
|
||||
@$pb.TagNumber(6)
|
||||
set userAgent($core.String v) {
|
||||
$_setString(5, v);
|
||||
}
|
||||
|
||||
bool hasUserAgent() => $_has(5);
|
||||
@$pb.TagNumber(6)
|
||||
$core.bool hasUserAgent() => $_has(5);
|
||||
@$pb.TagNumber(6)
|
||||
void clearUserAgent() => clearField(6);
|
||||
|
||||
String get remoteIp => $_getS(6, '');
|
||||
set remoteIp(String v) {
|
||||
/// The IP address (IPv4 or IPv6) of the client that issued the HTTP
|
||||
/// request. This field can include port information. Examples:
|
||||
/// `"192.168.1.1"`, `"10.0.0.1:80"`, `"FE80::0202:B3FF:FE1E:8329"`.
|
||||
@$pb.TagNumber(7)
|
||||
$core.String get remoteIp => $_getSZ(6);
|
||||
@$pb.TagNumber(7)
|
||||
set remoteIp($core.String v) {
|
||||
$_setString(6, v);
|
||||
}
|
||||
|
||||
bool hasRemoteIp() => $_has(6);
|
||||
@$pb.TagNumber(7)
|
||||
$core.bool hasRemoteIp() => $_has(6);
|
||||
@$pb.TagNumber(7)
|
||||
void clearRemoteIp() => clearField(7);
|
||||
|
||||
String get referer => $_getS(7, '');
|
||||
set referer(String v) {
|
||||
/// The referer URL of the request, as defined in
|
||||
/// [HTTP/1.1 Header Field
|
||||
/// Definitions](https://datatracker.ietf.org/doc/html/rfc2616#section-14.36).
|
||||
@$pb.TagNumber(8)
|
||||
$core.String get referer => $_getSZ(7);
|
||||
@$pb.TagNumber(8)
|
||||
set referer($core.String v) {
|
||||
$_setString(7, v);
|
||||
}
|
||||
|
||||
bool hasReferer() => $_has(7);
|
||||
@$pb.TagNumber(8)
|
||||
$core.bool hasReferer() => $_has(7);
|
||||
@$pb.TagNumber(8)
|
||||
void clearReferer() => clearField(8);
|
||||
|
||||
bool get cacheHit => $_get(8, false);
|
||||
set cacheHit(bool v) {
|
||||
/// Whether or not an entity was served from cache
|
||||
/// (with or without validation).
|
||||
@$pb.TagNumber(9)
|
||||
$core.bool get cacheHit => $_getBF(8);
|
||||
@$pb.TagNumber(9)
|
||||
set cacheHit($core.bool v) {
|
||||
$_setBool(8, v);
|
||||
}
|
||||
|
||||
bool hasCacheHit() => $_has(8);
|
||||
@$pb.TagNumber(9)
|
||||
$core.bool hasCacheHit() => $_has(8);
|
||||
@$pb.TagNumber(9)
|
||||
void clearCacheHit() => clearField(9);
|
||||
|
||||
bool get cacheValidatedWithOriginServer => $_get(9, false);
|
||||
set cacheValidatedWithOriginServer(bool v) {
|
||||
/// Whether or not the response was validated with the origin server before
|
||||
/// being served from cache. This field is only meaningful if `cache_hit` is
|
||||
/// True.
|
||||
@$pb.TagNumber(10)
|
||||
$core.bool get cacheValidatedWithOriginServer => $_getBF(9);
|
||||
@$pb.TagNumber(10)
|
||||
set cacheValidatedWithOriginServer($core.bool v) {
|
||||
$_setBool(9, v);
|
||||
}
|
||||
|
||||
bool hasCacheValidatedWithOriginServer() => $_has(9);
|
||||
@$pb.TagNumber(10)
|
||||
$core.bool hasCacheValidatedWithOriginServer() => $_has(9);
|
||||
@$pb.TagNumber(10)
|
||||
void clearCacheValidatedWithOriginServer() => clearField(10);
|
||||
|
||||
bool get cacheLookup => $_get(10, false);
|
||||
set cacheLookup(bool v) {
|
||||
/// Whether or not a cache lookup was attempted.
|
||||
@$pb.TagNumber(11)
|
||||
$core.bool get cacheLookup => $_getBF(10);
|
||||
@$pb.TagNumber(11)
|
||||
set cacheLookup($core.bool v) {
|
||||
$_setBool(10, v);
|
||||
}
|
||||
|
||||
bool hasCacheLookup() => $_has(10);
|
||||
@$pb.TagNumber(11)
|
||||
$core.bool hasCacheLookup() => $_has(10);
|
||||
@$pb.TagNumber(11)
|
||||
void clearCacheLookup() => clearField(11);
|
||||
|
||||
Int64 get cacheFillBytes => $_getI64(11);
|
||||
set cacheFillBytes(Int64 v) {
|
||||
/// The number of HTTP response bytes inserted into cache. Set only when a
|
||||
/// cache fill was attempted.
|
||||
@$pb.TagNumber(12)
|
||||
$fixnum.Int64 get cacheFillBytes => $_getI64(11);
|
||||
@$pb.TagNumber(12)
|
||||
set cacheFillBytes($fixnum.Int64 v) {
|
||||
$_setInt64(11, v);
|
||||
}
|
||||
|
||||
bool hasCacheFillBytes() => $_has(11);
|
||||
@$pb.TagNumber(12)
|
||||
$core.bool hasCacheFillBytes() => $_has(11);
|
||||
@$pb.TagNumber(12)
|
||||
void clearCacheFillBytes() => clearField(12);
|
||||
|
||||
String get serverIp => $_getS(12, '');
|
||||
set serverIp(String v) {
|
||||
/// The IP address (IPv4 or IPv6) of the origin server that the request was
|
||||
/// sent to. This field can include port information. Examples:
|
||||
/// `"192.168.1.1"`, `"10.0.0.1:80"`, `"FE80::0202:B3FF:FE1E:8329"`.
|
||||
@$pb.TagNumber(13)
|
||||
$core.String get serverIp => $_getSZ(12);
|
||||
@$pb.TagNumber(13)
|
||||
set serverIp($core.String v) {
|
||||
$_setString(12, v);
|
||||
}
|
||||
|
||||
bool hasServerIp() => $_has(12);
|
||||
@$pb.TagNumber(13)
|
||||
$core.bool hasServerIp() => $_has(12);
|
||||
@$pb.TagNumber(13)
|
||||
void clearServerIp() => clearField(13);
|
||||
|
||||
$google$protobuf.Duration get latency => $_getN(13);
|
||||
set latency($google$protobuf.Duration v) {
|
||||
/// The request processing latency on the server, from the time the request was
|
||||
/// received until the response was sent.
|
||||
@$pb.TagNumber(14)
|
||||
$0.Duration get latency => $_getN(13);
|
||||
@$pb.TagNumber(14)
|
||||
set latency($0.Duration v) {
|
||||
setField(14, v);
|
||||
}
|
||||
|
||||
bool hasLatency() => $_has(13);
|
||||
@$pb.TagNumber(14)
|
||||
$core.bool hasLatency() => $_has(13);
|
||||
@$pb.TagNumber(14)
|
||||
void clearLatency() => clearField(14);
|
||||
@$pb.TagNumber(14)
|
||||
$0.Duration ensureLatency() => $_ensure(13);
|
||||
|
||||
String get protocol => $_getS(14, '');
|
||||
set protocol(String v) {
|
||||
/// Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket"
|
||||
@$pb.TagNumber(15)
|
||||
$core.String get protocol => $_getSZ(14);
|
||||
@$pb.TagNumber(15)
|
||||
set protocol($core.String v) {
|
||||
$_setString(14, v);
|
||||
}
|
||||
|
||||
bool hasProtocol() => $_has(14);
|
||||
@$pb.TagNumber(15)
|
||||
$core.bool hasProtocol() => $_has(14);
|
||||
@$pb.TagNumber(15)
|
||||
void clearProtocol() => clearField(15);
|
||||
}
|
||||
|
||||
class _ReadonlyHttpRequest extends HttpRequest with ReadonlyMessageMixin {}
|
||||
const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names');
|
||||
const _omitMessageNames =
|
||||
$core.bool.fromEnvironment('protobuf.omit_message_names');
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.logging.type_http_request_pbenum;
|
||||
// source: google/logging/type/http_request.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
|
|
@ -1,28 +1,32 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.logging.type_http_request_pbjson;
|
||||
// source: google/logging/type/http_request.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
const HttpRequest$json = const {
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:core' as $core;
|
||||
import 'dart:typed_data' as $typed_data;
|
||||
|
||||
@$core.Deprecated('Use httpRequestDescriptor instead')
|
||||
const HttpRequest$json = {
|
||||
'1': 'HttpRequest',
|
||||
'2': const [
|
||||
const {
|
||||
'1': 'request_method',
|
||||
'3': 1,
|
||||
'4': 1,
|
||||
'5': 9,
|
||||
'10': 'requestMethod'
|
||||
},
|
||||
const {'1': 'request_url', '3': 2, '4': 1, '5': 9, '10': 'requestUrl'},
|
||||
const {'1': 'request_size', '3': 3, '4': 1, '5': 3, '10': 'requestSize'},
|
||||
const {'1': 'status', '3': 4, '4': 1, '5': 5, '10': 'status'},
|
||||
const {'1': 'response_size', '3': 5, '4': 1, '5': 3, '10': 'responseSize'},
|
||||
const {'1': 'user_agent', '3': 6, '4': 1, '5': 9, '10': 'userAgent'},
|
||||
const {'1': 'remote_ip', '3': 7, '4': 1, '5': 9, '10': 'remoteIp'},
|
||||
const {'1': 'server_ip', '3': 13, '4': 1, '5': 9, '10': 'serverIp'},
|
||||
const {'1': 'referer', '3': 8, '4': 1, '5': 9, '10': 'referer'},
|
||||
const {
|
||||
'2': [
|
||||
{'1': 'request_method', '3': 1, '4': 1, '5': 9, '10': 'requestMethod'},
|
||||
{'1': 'request_url', '3': 2, '4': 1, '5': 9, '10': 'requestUrl'},
|
||||
{'1': 'request_size', '3': 3, '4': 1, '5': 3, '10': 'requestSize'},
|
||||
{'1': 'status', '3': 4, '4': 1, '5': 5, '10': 'status'},
|
||||
{'1': 'response_size', '3': 5, '4': 1, '5': 3, '10': 'responseSize'},
|
||||
{'1': 'user_agent', '3': 6, '4': 1, '5': 9, '10': 'userAgent'},
|
||||
{'1': 'remote_ip', '3': 7, '4': 1, '5': 9, '10': 'remoteIp'},
|
||||
{'1': 'server_ip', '3': 13, '4': 1, '5': 9, '10': 'serverIp'},
|
||||
{'1': 'referer', '3': 8, '4': 1, '5': 9, '10': 'referer'},
|
||||
{
|
||||
'1': 'latency',
|
||||
'3': 14,
|
||||
'4': 1,
|
||||
|
@ -30,22 +34,30 @@ const HttpRequest$json = const {
|
|||
'6': '.google.protobuf.Duration',
|
||||
'10': 'latency'
|
||||
},
|
||||
const {'1': 'cache_lookup', '3': 11, '4': 1, '5': 8, '10': 'cacheLookup'},
|
||||
const {'1': 'cache_hit', '3': 9, '4': 1, '5': 8, '10': 'cacheHit'},
|
||||
const {
|
||||
{'1': 'cache_lookup', '3': 11, '4': 1, '5': 8, '10': 'cacheLookup'},
|
||||
{'1': 'cache_hit', '3': 9, '4': 1, '5': 8, '10': 'cacheHit'},
|
||||
{
|
||||
'1': 'cache_validated_with_origin_server',
|
||||
'3': 10,
|
||||
'4': 1,
|
||||
'5': 8,
|
||||
'10': 'cacheValidatedWithOriginServer'
|
||||
},
|
||||
const {
|
||||
'1': 'cache_fill_bytes',
|
||||
'3': 12,
|
||||
'4': 1,
|
||||
'5': 3,
|
||||
'10': 'cacheFillBytes'
|
||||
},
|
||||
const {'1': 'protocol', '3': 15, '4': 1, '5': 9, '10': 'protocol'},
|
||||
{'1': 'cache_fill_bytes', '3': 12, '4': 1, '5': 3, '10': 'cacheFillBytes'},
|
||||
{'1': 'protocol', '3': 15, '4': 1, '5': 9, '10': 'protocol'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `HttpRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List httpRequestDescriptor = $convert.base64Decode(
|
||||
'CgtIdHRwUmVxdWVzdBIlCg5yZXF1ZXN0X21ldGhvZBgBIAEoCVINcmVxdWVzdE1ldGhvZBIfCg'
|
||||
'tyZXF1ZXN0X3VybBgCIAEoCVIKcmVxdWVzdFVybBIhCgxyZXF1ZXN0X3NpemUYAyABKANSC3Jl'
|
||||
'cXVlc3RTaXplEhYKBnN0YXR1cxgEIAEoBVIGc3RhdHVzEiMKDXJlc3BvbnNlX3NpemUYBSABKA'
|
||||
'NSDHJlc3BvbnNlU2l6ZRIdCgp1c2VyX2FnZW50GAYgASgJUgl1c2VyQWdlbnQSGwoJcmVtb3Rl'
|
||||
'X2lwGAcgASgJUghyZW1vdGVJcBIbCglzZXJ2ZXJfaXAYDSABKAlSCHNlcnZlcklwEhgKB3JlZm'
|
||||
'VyZXIYCCABKAlSB3JlZmVyZXISMwoHbGF0ZW5jeRgOIAEoCzIZLmdvb2dsZS5wcm90b2J1Zi5E'
|
||||
'dXJhdGlvblIHbGF0ZW5jeRIhCgxjYWNoZV9sb29rdXAYCyABKAhSC2NhY2hlTG9va3VwEhsKCW'
|
||||
'NhY2hlX2hpdBgJIAEoCFIIY2FjaGVIaXQSSgoiY2FjaGVfdmFsaWRhdGVkX3dpdGhfb3JpZ2lu'
|
||||
'X3NlcnZlchgKIAEoCFIeY2FjaGVWYWxpZGF0ZWRXaXRoT3JpZ2luU2VydmVyEigKEGNhY2hlX2'
|
||||
'ZpbGxfYnl0ZXMYDCABKANSDmNhY2hlRmlsbEJ5dGVzEhoKCHByb3RvY29sGA8gASgJUghwcm90'
|
||||
'b2NvbA==');
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.logging.type_log_severity;
|
||||
// source: google/logging/type/log_severity.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore: UNUSED_SHOWN_NAME
|
||||
import 'dart:core' show int, bool, double, String, List, override;
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:core' as $core;
|
||||
|
||||
export 'log_severity.pbenum.dart';
|
||||
|
|
|
@ -1,25 +1,54 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: google/logging/type/log_severity.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
/// The severity of the event described in a log entry, expressed as one of the
|
||||
/// standard severity levels listed below. For your reference, the levels are
|
||||
/// assigned the listed numeric values. The effect of using numeric values other
|
||||
/// than those listed is undefined.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.logging.type_log_severity_pbenum;
|
||||
/// You can filter for log entries by severity. For example, the following
|
||||
/// filter expression will match log entries with severities `INFO`, `NOTICE`,
|
||||
/// and `WARNING`:
|
||||
///
|
||||
/// severity > DEBUG AND severity <= WARNING
|
||||
///
|
||||
/// If you are writing log entries, you should map other severity encodings to
|
||||
/// one of these standard levels. For example, you might map all of Java's FINE,
|
||||
/// FINER, and FINEST levels to `LogSeverity.DEBUG`. You can preserve the
|
||||
/// original severity level in the log entry payload if you wish.
|
||||
class LogSeverity extends $pb.ProtobufEnum {
|
||||
static const LogSeverity DEFAULT =
|
||||
LogSeverity._(0, _omitEnumNames ? '' : 'DEFAULT');
|
||||
static const LogSeverity DEBUG =
|
||||
LogSeverity._(100, _omitEnumNames ? '' : 'DEBUG');
|
||||
static const LogSeverity INFO =
|
||||
LogSeverity._(200, _omitEnumNames ? '' : 'INFO');
|
||||
static const LogSeverity NOTICE =
|
||||
LogSeverity._(300, _omitEnumNames ? '' : 'NOTICE');
|
||||
static const LogSeverity WARNING =
|
||||
LogSeverity._(400, _omitEnumNames ? '' : 'WARNING');
|
||||
static const LogSeverity ERROR =
|
||||
LogSeverity._(500, _omitEnumNames ? '' : 'ERROR');
|
||||
static const LogSeverity CRITICAL =
|
||||
LogSeverity._(600, _omitEnumNames ? '' : 'CRITICAL');
|
||||
static const LogSeverity ALERT =
|
||||
LogSeverity._(700, _omitEnumNames ? '' : 'ALERT');
|
||||
static const LogSeverity EMERGENCY =
|
||||
LogSeverity._(800, _omitEnumNames ? '' : 'EMERGENCY');
|
||||
|
||||
// ignore_for_file: UNDEFINED_SHOWN_NAME,UNUSED_SHOWN_NAME
|
||||
import 'dart:core' show int, dynamic, String, List, Map;
|
||||
import 'package:protobuf/protobuf.dart';
|
||||
|
||||
class LogSeverity extends ProtobufEnum {
|
||||
static const LogSeverity DEFAULT = const LogSeverity._(0, 'DEFAULT');
|
||||
static const LogSeverity DEBUG = const LogSeverity._(100, 'DEBUG');
|
||||
static const LogSeverity INFO = const LogSeverity._(200, 'INFO');
|
||||
static const LogSeverity NOTICE = const LogSeverity._(300, 'NOTICE');
|
||||
static const LogSeverity WARNING = const LogSeverity._(400, 'WARNING');
|
||||
static const LogSeverity ERROR = const LogSeverity._(500, 'ERROR');
|
||||
static const LogSeverity CRITICAL = const LogSeverity._(600, 'CRITICAL');
|
||||
static const LogSeverity ALERT = const LogSeverity._(700, 'ALERT');
|
||||
static const LogSeverity EMERGENCY = const LogSeverity._(800, 'EMERGENCY');
|
||||
|
||||
static const List<LogSeverity> values = const <LogSeverity>[
|
||||
static const $core.List<LogSeverity> values = <LogSeverity>[
|
||||
DEFAULT,
|
||||
DEBUG,
|
||||
INFO,
|
||||
|
@ -31,11 +60,11 @@ class LogSeverity extends ProtobufEnum {
|
|||
EMERGENCY,
|
||||
];
|
||||
|
||||
static final Map<int, dynamic> _byValue = ProtobufEnum.initByValue(values);
|
||||
static LogSeverity valueOf(int value) => _byValue[value] as LogSeverity;
|
||||
static void $checkItem(LogSeverity v) {
|
||||
if (v is! LogSeverity) checkItemFailed(v, 'LogSeverity');
|
||||
}
|
||||
static final $core.Map<$core.int, LogSeverity> _byValue =
|
||||
$pb.ProtobufEnum.initByValue(values);
|
||||
static LogSeverity? valueOf($core.int value) => _byValue[value];
|
||||
|
||||
const LogSeverity._(int v, String n) : super(v, n);
|
||||
const LogSeverity._($core.int v, $core.String n) : super(v, n);
|
||||
}
|
||||
|
||||
const _omitEnumNames = $core.bool.fromEnvironment('protobuf.omit_enum_names');
|
||||
|
|
|
@ -1,20 +1,36 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.logging.type_log_severity_pbjson;
|
||||
// source: google/logging/type/log_severity.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
const LogSeverity$json = const {
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:core' as $core;
|
||||
import 'dart:typed_data' as $typed_data;
|
||||
|
||||
@$core.Deprecated('Use logSeverityDescriptor instead')
|
||||
const LogSeverity$json = {
|
||||
'1': 'LogSeverity',
|
||||
'2': const [
|
||||
const {'1': 'DEFAULT', '2': 0},
|
||||
const {'1': 'DEBUG', '2': 100},
|
||||
const {'1': 'INFO', '2': 200},
|
||||
const {'1': 'NOTICE', '2': 300},
|
||||
const {'1': 'WARNING', '2': 400},
|
||||
const {'1': 'ERROR', '2': 500},
|
||||
const {'1': 'CRITICAL', '2': 600},
|
||||
const {'1': 'ALERT', '2': 700},
|
||||
const {'1': 'EMERGENCY', '2': 800},
|
||||
'2': [
|
||||
{'1': 'DEFAULT', '2': 0},
|
||||
{'1': 'DEBUG', '2': 100},
|
||||
{'1': 'INFO', '2': 200},
|
||||
{'1': 'NOTICE', '2': 300},
|
||||
{'1': 'WARNING', '2': 400},
|
||||
{'1': 'ERROR', '2': 500},
|
||||
{'1': 'CRITICAL', '2': 600},
|
||||
{'1': 'ALERT', '2': 700},
|
||||
{'1': 'EMERGENCY', '2': 800},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `LogSeverity`. Decode as a `google.protobuf.EnumDescriptorProto`.
|
||||
final $typed_data.Uint8List logSeverityDescriptor = $convert.base64Decode(
|
||||
'CgtMb2dTZXZlcml0eRILCgdERUZBVUxUEAASCQoFREVCVUcQZBIJCgRJTkZPEMgBEgsKBk5PVE'
|
||||
'lDRRCsAhIMCgdXQVJOSU5HEJADEgoKBUVSUk9SEPQDEg0KCENSSVRJQ0FMENgEEgoKBUFMRVJU'
|
||||
'ELwFEg4KCUVNRVJHRU5DWRCgBg==');
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,10 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.logging.v2_log_entry_pbenum;
|
||||
// source: google/logging/v2/log_entry.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
|
|
@ -1,22 +1,33 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.logging.v2_log_entry_pbjson;
|
||||
// source: google/logging/v2/log_entry.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
const LogEntry$json = const {
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:core' as $core;
|
||||
import 'dart:typed_data' as $typed_data;
|
||||
|
||||
@$core.Deprecated('Use logEntryDescriptor instead')
|
||||
const LogEntry$json = {
|
||||
'1': 'LogEntry',
|
||||
'2': const [
|
||||
const {'1': 'log_name', '3': 12, '4': 1, '5': 9, '10': 'logName'},
|
||||
const {
|
||||
'2': [
|
||||
{'1': 'log_name', '3': 12, '4': 1, '5': 9, '8': {}, '10': 'logName'},
|
||||
{
|
||||
'1': 'resource',
|
||||
'3': 8,
|
||||
'4': 1,
|
||||
'5': 11,
|
||||
'6': '.google.api.MonitoredResource',
|
||||
'8': {},
|
||||
'10': 'resource'
|
||||
},
|
||||
const {
|
||||
{
|
||||
'1': 'proto_payload',
|
||||
'3': 2,
|
||||
'4': 1,
|
||||
|
@ -25,15 +36,8 @@ const LogEntry$json = const {
|
|||
'9': 0,
|
||||
'10': 'protoPayload'
|
||||
},
|
||||
const {
|
||||
'1': 'text_payload',
|
||||
'3': 3,
|
||||
'4': 1,
|
||||
'5': 9,
|
||||
'9': 0,
|
||||
'10': 'textPayload'
|
||||
},
|
||||
const {
|
||||
{'1': 'text_payload', '3': 3, '4': 1, '5': 9, '9': 0, '10': 'textPayload'},
|
||||
{
|
||||
'1': 'json_payload',
|
||||
'3': 6,
|
||||
'4': 1,
|
||||
|
@ -42,96 +46,176 @@ const LogEntry$json = const {
|
|||
'9': 0,
|
||||
'10': 'jsonPayload'
|
||||
},
|
||||
const {
|
||||
{
|
||||
'1': 'timestamp',
|
||||
'3': 9,
|
||||
'4': 1,
|
||||
'5': 11,
|
||||
'6': '.google.protobuf.Timestamp',
|
||||
'8': {},
|
||||
'10': 'timestamp'
|
||||
},
|
||||
const {
|
||||
{
|
||||
'1': 'receive_timestamp',
|
||||
'3': 24,
|
||||
'4': 1,
|
||||
'5': 11,
|
||||
'6': '.google.protobuf.Timestamp',
|
||||
'8': {},
|
||||
'10': 'receiveTimestamp'
|
||||
},
|
||||
const {
|
||||
{
|
||||
'1': 'severity',
|
||||
'3': 10,
|
||||
'4': 1,
|
||||
'5': 14,
|
||||
'6': '.google.logging.type.LogSeverity',
|
||||
'8': {},
|
||||
'10': 'severity'
|
||||
},
|
||||
const {'1': 'insert_id', '3': 4, '4': 1, '5': 9, '10': 'insertId'},
|
||||
const {
|
||||
{'1': 'insert_id', '3': 4, '4': 1, '5': 9, '8': {}, '10': 'insertId'},
|
||||
{
|
||||
'1': 'http_request',
|
||||
'3': 7,
|
||||
'4': 1,
|
||||
'5': 11,
|
||||
'6': '.google.logging.type.HttpRequest',
|
||||
'8': {},
|
||||
'10': 'httpRequest'
|
||||
},
|
||||
const {
|
||||
{
|
||||
'1': 'labels',
|
||||
'3': 11,
|
||||
'4': 3,
|
||||
'5': 11,
|
||||
'6': '.google.logging.v2.LogEntry.LabelsEntry',
|
||||
'8': {},
|
||||
'10': 'labels'
|
||||
},
|
||||
const {
|
||||
{
|
||||
'1': 'operation',
|
||||
'3': 15,
|
||||
'4': 1,
|
||||
'5': 11,
|
||||
'6': '.google.logging.v2.LogEntryOperation',
|
||||
'8': {},
|
||||
'10': 'operation'
|
||||
},
|
||||
const {'1': 'trace', '3': 22, '4': 1, '5': 9, '10': 'trace'},
|
||||
const {'1': 'span_id', '3': 27, '4': 1, '5': 9, '10': 'spanId'},
|
||||
const {
|
||||
{'1': 'trace', '3': 22, '4': 1, '5': 9, '8': {}, '10': 'trace'},
|
||||
{'1': 'span_id', '3': 27, '4': 1, '5': 9, '8': {}, '10': 'spanId'},
|
||||
{
|
||||
'1': 'trace_sampled',
|
||||
'3': 30,
|
||||
'4': 1,
|
||||
'5': 8,
|
||||
'8': {},
|
||||
'10': 'traceSampled'
|
||||
},
|
||||
{
|
||||
'1': 'source_location',
|
||||
'3': 23,
|
||||
'4': 1,
|
||||
'5': 11,
|
||||
'6': '.google.logging.v2.LogEntrySourceLocation',
|
||||
'8': {},
|
||||
'10': 'sourceLocation'
|
||||
},
|
||||
{
|
||||
'1': 'split',
|
||||
'3': 35,
|
||||
'4': 1,
|
||||
'5': 11,
|
||||
'6': '.google.logging.v2.LogSplit',
|
||||
'8': {},
|
||||
'10': 'split'
|
||||
},
|
||||
],
|
||||
'3': const [LogEntry_LabelsEntry$json],
|
||||
'8': const [
|
||||
const {'1': 'payload'},
|
||||
'3': [LogEntry_LabelsEntry$json],
|
||||
'7': {},
|
||||
'8': [
|
||||
{'1': 'payload'},
|
||||
],
|
||||
};
|
||||
|
||||
const LogEntry_LabelsEntry$json = const {
|
||||
@$core.Deprecated('Use logEntryDescriptor instead')
|
||||
const LogEntry_LabelsEntry$json = {
|
||||
'1': 'LabelsEntry',
|
||||
'2': const [
|
||||
const {'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'},
|
||||
const {'1': 'value', '3': 2, '4': 1, '5': 9, '10': 'value'},
|
||||
'2': [
|
||||
{'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'},
|
||||
{'1': 'value', '3': 2, '4': 1, '5': 9, '10': 'value'},
|
||||
],
|
||||
'7': const {'7': true},
|
||||
'7': {'7': true},
|
||||
};
|
||||
|
||||
const LogEntryOperation$json = const {
|
||||
/// Descriptor for `LogEntry`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List logEntryDescriptor = $convert.base64Decode(
|
||||
'CghMb2dFbnRyeRIeCghsb2dfbmFtZRgMIAEoCUID4EECUgdsb2dOYW1lEj4KCHJlc291cmNlGA'
|
||||
'ggASgLMh0uZ29vZ2xlLmFwaS5Nb25pdG9yZWRSZXNvdXJjZUID4EECUghyZXNvdXJjZRI7Cg1w'
|
||||
'cm90b19wYXlsb2FkGAIgASgLMhQuZ29vZ2xlLnByb3RvYnVmLkFueUgAUgxwcm90b1BheWxvYW'
|
||||
'QSIwoMdGV4dF9wYXlsb2FkGAMgASgJSABSC3RleHRQYXlsb2FkEjwKDGpzb25fcGF5bG9hZBgG'
|
||||
'IAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3RIAFILanNvblBheWxvYWQSPQoJdGltZXN0YW'
|
||||
'1wGAkgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcEID4EEBUgl0aW1lc3RhbXASTAoR'
|
||||
'cmVjZWl2ZV90aW1lc3RhbXAYGCABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wQgPgQQ'
|
||||
'NSEHJlY2VpdmVUaW1lc3RhbXASQQoIc2V2ZXJpdHkYCiABKA4yIC5nb29nbGUubG9nZ2luZy50'
|
||||
'eXBlLkxvZ1NldmVyaXR5QgPgQQFSCHNldmVyaXR5EiAKCWluc2VydF9pZBgEIAEoCUID4EEBUg'
|
||||
'hpbnNlcnRJZBJICgxodHRwX3JlcXVlc3QYByABKAsyIC5nb29nbGUubG9nZ2luZy50eXBlLkh0'
|
||||
'dHBSZXF1ZXN0QgPgQQFSC2h0dHBSZXF1ZXN0EkQKBmxhYmVscxgLIAMoCzInLmdvb2dsZS5sb2'
|
||||
'dnaW5nLnYyLkxvZ0VudHJ5LkxhYmVsc0VudHJ5QgPgQQFSBmxhYmVscxJHCglvcGVyYXRpb24Y'
|
||||
'DyABKAsyJC5nb29nbGUubG9nZ2luZy52Mi5Mb2dFbnRyeU9wZXJhdGlvbkID4EEBUglvcGVyYX'
|
||||
'Rpb24SGQoFdHJhY2UYFiABKAlCA+BBAVIFdHJhY2USHAoHc3Bhbl9pZBgbIAEoCUID4EEBUgZz'
|
||||
'cGFuSWQSKAoNdHJhY2Vfc2FtcGxlZBgeIAEoCEID4EEBUgx0cmFjZVNhbXBsZWQSVwoPc291cm'
|
||||
'NlX2xvY2F0aW9uGBcgASgLMikuZ29vZ2xlLmxvZ2dpbmcudjIuTG9nRW50cnlTb3VyY2VMb2Nh'
|
||||
'dGlvbkID4EEBUg5zb3VyY2VMb2NhdGlvbhI2CgVzcGxpdBgjIAEoCzIbLmdvb2dsZS5sb2dnaW'
|
||||
'5nLnYyLkxvZ1NwbGl0QgPgQQFSBXNwbGl0GjkKC0xhYmVsc0VudHJ5EhAKA2tleRgBIAEoCVID'
|
||||
'a2V5EhQKBXZhbHVlGAIgASgJUgV2YWx1ZToCOAE6vQHqQbkBChpsb2dnaW5nLmdvb2dsZWFwaX'
|
||||
'MuY29tL0xvZxIdcHJvamVjdHMve3Byb2plY3R9L2xvZ3Mve2xvZ30SJ29yZ2FuaXphdGlvbnMv'
|
||||
'e29yZ2FuaXphdGlvbn0vbG9ncy97bG9nfRIbZm9sZGVycy97Zm9sZGVyfS9sb2dzL3tsb2d9Ei'
|
||||
'xiaWxsaW5nQWNjb3VudHMve2JpbGxpbmdfYWNjb3VudH0vbG9ncy97bG9nfRoIbG9nX25hbWVC'
|
||||
'CQoHcGF5bG9hZA==');
|
||||
|
||||
@$core.Deprecated('Use logEntryOperationDescriptor instead')
|
||||
const LogEntryOperation$json = {
|
||||
'1': 'LogEntryOperation',
|
||||
'2': const [
|
||||
const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'},
|
||||
const {'1': 'producer', '3': 2, '4': 1, '5': 9, '10': 'producer'},
|
||||
const {'1': 'first', '3': 3, '4': 1, '5': 8, '10': 'first'},
|
||||
const {'1': 'last', '3': 4, '4': 1, '5': 8, '10': 'last'},
|
||||
'2': [
|
||||
{'1': 'id', '3': 1, '4': 1, '5': 9, '8': {}, '10': 'id'},
|
||||
{'1': 'producer', '3': 2, '4': 1, '5': 9, '8': {}, '10': 'producer'},
|
||||
{'1': 'first', '3': 3, '4': 1, '5': 8, '8': {}, '10': 'first'},
|
||||
{'1': 'last', '3': 4, '4': 1, '5': 8, '8': {}, '10': 'last'},
|
||||
],
|
||||
};
|
||||
|
||||
const LogEntrySourceLocation$json = const {
|
||||
/// Descriptor for `LogEntryOperation`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List logEntryOperationDescriptor = $convert.base64Decode(
|
||||
'ChFMb2dFbnRyeU9wZXJhdGlvbhITCgJpZBgBIAEoCUID4EEBUgJpZBIfCghwcm9kdWNlchgCIA'
|
||||
'EoCUID4EEBUghwcm9kdWNlchIZCgVmaXJzdBgDIAEoCEID4EEBUgVmaXJzdBIXCgRsYXN0GAQg'
|
||||
'ASgIQgPgQQFSBGxhc3Q=');
|
||||
|
||||
@$core.Deprecated('Use logEntrySourceLocationDescriptor instead')
|
||||
const LogEntrySourceLocation$json = {
|
||||
'1': 'LogEntrySourceLocation',
|
||||
'2': const [
|
||||
const {'1': 'file', '3': 1, '4': 1, '5': 9, '10': 'file'},
|
||||
const {'1': 'line', '3': 2, '4': 1, '5': 3, '10': 'line'},
|
||||
const {'1': 'function', '3': 3, '4': 1, '5': 9, '10': 'function'},
|
||||
'2': [
|
||||
{'1': 'file', '3': 1, '4': 1, '5': 9, '8': {}, '10': 'file'},
|
||||
{'1': 'line', '3': 2, '4': 1, '5': 3, '8': {}, '10': 'line'},
|
||||
{'1': 'function', '3': 3, '4': 1, '5': 9, '8': {}, '10': 'function'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `LogEntrySourceLocation`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List logEntrySourceLocationDescriptor = $convert.base64Decode(
|
||||
'ChZMb2dFbnRyeVNvdXJjZUxvY2F0aW9uEhcKBGZpbGUYASABKAlCA+BBAVIEZmlsZRIXCgRsaW'
|
||||
'5lGAIgASgDQgPgQQFSBGxpbmUSHwoIZnVuY3Rpb24YAyABKAlCA+BBAVIIZnVuY3Rpb24=');
|
||||
|
||||
@$core.Deprecated('Use logSplitDescriptor instead')
|
||||
const LogSplit$json = {
|
||||
'1': 'LogSplit',
|
||||
'2': [
|
||||
{'1': 'uid', '3': 1, '4': 1, '5': 9, '10': 'uid'},
|
||||
{'1': 'index', '3': 2, '4': 1, '5': 5, '10': 'index'},
|
||||
{'1': 'total_splits', '3': 3, '4': 1, '5': 5, '10': 'totalSplits'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `LogSplit`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List logSplitDescriptor = $convert.base64Decode(
|
||||
'CghMb2dTcGxpdBIQCgN1aWQYASABKAlSA3VpZBIUCgVpbmRleBgCIAEoBVIFaW5kZXgSIQoMdG'
|
||||
'90YWxfc3BsaXRzGAMgASgFUgt0b3RhbFNwbGl0cw==');
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,47 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.logging.v2_logging_pbenum;
|
||||
// source: google/logging/v2/logging.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
/// An indicator of why entries were omitted.
|
||||
class TailLogEntriesResponse_SuppressionInfo_Reason extends $pb.ProtobufEnum {
|
||||
static const TailLogEntriesResponse_SuppressionInfo_Reason
|
||||
REASON_UNSPECIFIED = TailLogEntriesResponse_SuppressionInfo_Reason._(
|
||||
0, _omitEnumNames ? '' : 'REASON_UNSPECIFIED');
|
||||
static const TailLogEntriesResponse_SuppressionInfo_Reason RATE_LIMIT =
|
||||
TailLogEntriesResponse_SuppressionInfo_Reason._(
|
||||
1, _omitEnumNames ? '' : 'RATE_LIMIT');
|
||||
static const TailLogEntriesResponse_SuppressionInfo_Reason NOT_CONSUMED =
|
||||
TailLogEntriesResponse_SuppressionInfo_Reason._(
|
||||
2, _omitEnumNames ? '' : 'NOT_CONSUMED');
|
||||
|
||||
static const $core.List<TailLogEntriesResponse_SuppressionInfo_Reason>
|
||||
values = <TailLogEntriesResponse_SuppressionInfo_Reason>[
|
||||
REASON_UNSPECIFIED,
|
||||
RATE_LIMIT,
|
||||
NOT_CONSUMED,
|
||||
];
|
||||
|
||||
static final $core
|
||||
.Map<$core.int, TailLogEntriesResponse_SuppressionInfo_Reason> _byValue =
|
||||
$pb.ProtobufEnum.initByValue(values);
|
||||
static TailLogEntriesResponse_SuppressionInfo_Reason? valueOf(
|
||||
$core.int value) =>
|
||||
_byValue[value];
|
||||
|
||||
const TailLogEntriesResponse_SuppressionInfo_Reason._(
|
||||
$core.int v, $core.String n)
|
||||
: super(v, n);
|
||||
}
|
||||
|
||||
const _omitEnumNames = $core.bool.fromEnvironment('protobuf.omit_enum_names');
|
||||
|
|
|
@ -1,170 +1,205 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.logging.v2_logging_pbgrpc;
|
||||
// source: google/logging/v2/logging.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
import 'dart:async';
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'package:grpc/grpc.dart';
|
||||
import 'dart:async' as $async;
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:grpc/service_api.dart' as $grpc;
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
import '../../protobuf/empty.pb.dart' as $1;
|
||||
import 'logging.pb.dart' as $0;
|
||||
|
||||
import '../../protobuf/empty.pb.dart' as $google$protobuf;
|
||||
import 'logging.pb.dart';
|
||||
export 'logging.pb.dart';
|
||||
|
||||
class LoggingServiceV2Client extends Client {
|
||||
static final _$deleteLog =
|
||||
new ClientMethod<DeleteLogRequest, $google$protobuf.Empty>(
|
||||
@$pb.GrpcServiceName('google.logging.v2.LoggingServiceV2')
|
||||
class LoggingServiceV2Client extends $grpc.Client {
|
||||
static final _$deleteLog = $grpc.ClientMethod<$0.DeleteLogRequest, $1.Empty>(
|
||||
'/google.logging.v2.LoggingServiceV2/DeleteLog',
|
||||
(DeleteLogRequest value) => value.writeToBuffer(),
|
||||
(List<int> value) => new $google$protobuf.Empty.fromBuffer(value));
|
||||
($0.DeleteLogRequest value) => value.writeToBuffer(),
|
||||
($core.List<$core.int> value) => $1.Empty.fromBuffer(value));
|
||||
static final _$writeLogEntries =
|
||||
new ClientMethod<WriteLogEntriesRequest, WriteLogEntriesResponse>(
|
||||
$grpc.ClientMethod<$0.WriteLogEntriesRequest, $0.WriteLogEntriesResponse>(
|
||||
'/google.logging.v2.LoggingServiceV2/WriteLogEntries',
|
||||
(WriteLogEntriesRequest value) => value.writeToBuffer(),
|
||||
(List<int> value) => new WriteLogEntriesResponse.fromBuffer(value));
|
||||
($0.WriteLogEntriesRequest value) => value.writeToBuffer(),
|
||||
($core.List<$core.int> value) =>
|
||||
$0.WriteLogEntriesResponse.fromBuffer(value));
|
||||
static final _$listLogEntries =
|
||||
new ClientMethod<ListLogEntriesRequest, ListLogEntriesResponse>(
|
||||
$grpc.ClientMethod<$0.ListLogEntriesRequest, $0.ListLogEntriesResponse>(
|
||||
'/google.logging.v2.LoggingServiceV2/ListLogEntries',
|
||||
(ListLogEntriesRequest value) => value.writeToBuffer(),
|
||||
(List<int> value) => new ListLogEntriesResponse.fromBuffer(value));
|
||||
static final _$listMonitoredResourceDescriptors = new ClientMethod<
|
||||
ListMonitoredResourceDescriptorsRequest,
|
||||
ListMonitoredResourceDescriptorsResponse>(
|
||||
($0.ListLogEntriesRequest value) => value.writeToBuffer(),
|
||||
($core.List<$core.int> value) =>
|
||||
$0.ListLogEntriesResponse.fromBuffer(value));
|
||||
static final _$listMonitoredResourceDescriptors = $grpc.ClientMethod<
|
||||
$0.ListMonitoredResourceDescriptorsRequest,
|
||||
$0.ListMonitoredResourceDescriptorsResponse>(
|
||||
'/google.logging.v2.LoggingServiceV2/ListMonitoredResourceDescriptors',
|
||||
(ListMonitoredResourceDescriptorsRequest value) => value.writeToBuffer(),
|
||||
(List<int> value) =>
|
||||
new ListMonitoredResourceDescriptorsResponse.fromBuffer(value));
|
||||
static final _$listLogs = new ClientMethod<ListLogsRequest, ListLogsResponse>(
|
||||
($0.ListMonitoredResourceDescriptorsRequest value) =>
|
||||
value.writeToBuffer(),
|
||||
($core.List<$core.int> value) =>
|
||||
$0.ListMonitoredResourceDescriptorsResponse.fromBuffer(value));
|
||||
static final _$listLogs =
|
||||
$grpc.ClientMethod<$0.ListLogsRequest, $0.ListLogsResponse>(
|
||||
'/google.logging.v2.LoggingServiceV2/ListLogs',
|
||||
(ListLogsRequest value) => value.writeToBuffer(),
|
||||
(List<int> value) => new ListLogsResponse.fromBuffer(value));
|
||||
($0.ListLogsRequest value) => value.writeToBuffer(),
|
||||
($core.List<$core.int> value) =>
|
||||
$0.ListLogsResponse.fromBuffer(value));
|
||||
static final _$tailLogEntries =
|
||||
$grpc.ClientMethod<$0.TailLogEntriesRequest, $0.TailLogEntriesResponse>(
|
||||
'/google.logging.v2.LoggingServiceV2/TailLogEntries',
|
||||
($0.TailLogEntriesRequest value) => value.writeToBuffer(),
|
||||
($core.List<$core.int> value) =>
|
||||
$0.TailLogEntriesResponse.fromBuffer(value));
|
||||
|
||||
LoggingServiceV2Client(ClientChannel channel, {CallOptions options})
|
||||
: super(channel, options: options);
|
||||
LoggingServiceV2Client($grpc.ClientChannel channel,
|
||||
{$grpc.CallOptions? options,
|
||||
$core.Iterable<$grpc.ClientInterceptor>? interceptors})
|
||||
: super(channel, options: options, interceptors: interceptors);
|
||||
|
||||
ResponseFuture<$google$protobuf.Empty> deleteLog(DeleteLogRequest request,
|
||||
{CallOptions options}) {
|
||||
final call = $createCall(_$deleteLog, new Stream.fromIterable([request]),
|
||||
options: options);
|
||||
return new ResponseFuture(call);
|
||||
$grpc.ResponseFuture<$1.Empty> deleteLog($0.DeleteLogRequest request,
|
||||
{$grpc.CallOptions? options}) {
|
||||
return $createUnaryCall(_$deleteLog, request, options: options);
|
||||
}
|
||||
|
||||
ResponseFuture<WriteLogEntriesResponse> writeLogEntries(
|
||||
WriteLogEntriesRequest request,
|
||||
{CallOptions options}) {
|
||||
final call = $createCall(
|
||||
_$writeLogEntries, new Stream.fromIterable([request]),
|
||||
options: options);
|
||||
return new ResponseFuture(call);
|
||||
$grpc.ResponseFuture<$0.WriteLogEntriesResponse> writeLogEntries(
|
||||
$0.WriteLogEntriesRequest request,
|
||||
{$grpc.CallOptions? options}) {
|
||||
return $createUnaryCall(_$writeLogEntries, request, options: options);
|
||||
}
|
||||
|
||||
ResponseFuture<ListLogEntriesResponse> listLogEntries(
|
||||
ListLogEntriesRequest request,
|
||||
{CallOptions options}) {
|
||||
final call = $createCall(
|
||||
_$listLogEntries, new Stream.fromIterable([request]),
|
||||
options: options);
|
||||
return new ResponseFuture(call);
|
||||
$grpc.ResponseFuture<$0.ListLogEntriesResponse> listLogEntries(
|
||||
$0.ListLogEntriesRequest request,
|
||||
{$grpc.CallOptions? options}) {
|
||||
return $createUnaryCall(_$listLogEntries, request, options: options);
|
||||
}
|
||||
|
||||
ResponseFuture<ListMonitoredResourceDescriptorsResponse>
|
||||
$grpc.ResponseFuture<$0.ListMonitoredResourceDescriptorsResponse>
|
||||
listMonitoredResourceDescriptors(
|
||||
ListMonitoredResourceDescriptorsRequest request,
|
||||
{CallOptions options}) {
|
||||
final call = $createCall(
|
||||
_$listMonitoredResourceDescriptors, new Stream.fromIterable([request]),
|
||||
$0.ListMonitoredResourceDescriptorsRequest request,
|
||||
{$grpc.CallOptions? options}) {
|
||||
return $createUnaryCall(_$listMonitoredResourceDescriptors, request,
|
||||
options: options);
|
||||
return new ResponseFuture(call);
|
||||
}
|
||||
|
||||
ResponseFuture<ListLogsResponse> listLogs(ListLogsRequest request,
|
||||
{CallOptions options}) {
|
||||
final call = $createCall(_$listLogs, new Stream.fromIterable([request]),
|
||||
options: options);
|
||||
return new ResponseFuture(call);
|
||||
$grpc.ResponseFuture<$0.ListLogsResponse> listLogs($0.ListLogsRequest request,
|
||||
{$grpc.CallOptions? options}) {
|
||||
return $createUnaryCall(_$listLogs, request, options: options);
|
||||
}
|
||||
|
||||
$grpc.ResponseStream<$0.TailLogEntriesResponse> tailLogEntries(
|
||||
$async.Stream<$0.TailLogEntriesRequest> request,
|
||||
{$grpc.CallOptions? options}) {
|
||||
return $createStreamingCall(_$tailLogEntries, request, options: options);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class LoggingServiceV2ServiceBase extends Service {
|
||||
String get $name => 'google.logging.v2.LoggingServiceV2';
|
||||
@$pb.GrpcServiceName('google.logging.v2.LoggingServiceV2')
|
||||
abstract class LoggingServiceV2ServiceBase extends $grpc.Service {
|
||||
$core.String get $name => 'google.logging.v2.LoggingServiceV2';
|
||||
|
||||
LoggingServiceV2ServiceBase() {
|
||||
$addMethod(new ServiceMethod<DeleteLogRequest, $google$protobuf.Empty>(
|
||||
$addMethod($grpc.ServiceMethod<$0.DeleteLogRequest, $1.Empty>(
|
||||
'DeleteLog',
|
||||
deleteLog_Pre,
|
||||
false,
|
||||
false,
|
||||
(List<int> value) => new DeleteLogRequest.fromBuffer(value),
|
||||
($google$protobuf.Empty value) => value.writeToBuffer()));
|
||||
$addMethod(
|
||||
new ServiceMethod<WriteLogEntriesRequest, WriteLogEntriesResponse>(
|
||||
($core.List<$core.int> value) => $0.DeleteLogRequest.fromBuffer(value),
|
||||
($1.Empty value) => value.writeToBuffer()));
|
||||
$addMethod($grpc.ServiceMethod<$0.WriteLogEntriesRequest,
|
||||
$0.WriteLogEntriesResponse>(
|
||||
'WriteLogEntries',
|
||||
writeLogEntries_Pre,
|
||||
false,
|
||||
false,
|
||||
(List<int> value) => new WriteLogEntriesRequest.fromBuffer(value),
|
||||
(WriteLogEntriesResponse value) => value.writeToBuffer()));
|
||||
$addMethod(new ServiceMethod<ListLogEntriesRequest, ListLogEntriesResponse>(
|
||||
($core.List<$core.int> value) =>
|
||||
$0.WriteLogEntriesRequest.fromBuffer(value),
|
||||
($0.WriteLogEntriesResponse value) => value.writeToBuffer()));
|
||||
$addMethod($grpc.ServiceMethod<$0.ListLogEntriesRequest,
|
||||
$0.ListLogEntriesResponse>(
|
||||
'ListLogEntries',
|
||||
listLogEntries_Pre,
|
||||
false,
|
||||
false,
|
||||
(List<int> value) => new ListLogEntriesRequest.fromBuffer(value),
|
||||
(ListLogEntriesResponse value) => value.writeToBuffer()));
|
||||
$addMethod(new ServiceMethod<ListMonitoredResourceDescriptorsRequest,
|
||||
ListMonitoredResourceDescriptorsResponse>(
|
||||
($core.List<$core.int> value) =>
|
||||
$0.ListLogEntriesRequest.fromBuffer(value),
|
||||
($0.ListLogEntriesResponse value) => value.writeToBuffer()));
|
||||
$addMethod($grpc.ServiceMethod<$0.ListMonitoredResourceDescriptorsRequest,
|
||||
$0.ListMonitoredResourceDescriptorsResponse>(
|
||||
'ListMonitoredResourceDescriptors',
|
||||
listMonitoredResourceDescriptors_Pre,
|
||||
false,
|
||||
false,
|
||||
(List<int> value) =>
|
||||
new ListMonitoredResourceDescriptorsRequest.fromBuffer(value),
|
||||
(ListMonitoredResourceDescriptorsResponse value) =>
|
||||
($core.List<$core.int> value) =>
|
||||
$0.ListMonitoredResourceDescriptorsRequest.fromBuffer(value),
|
||||
($0.ListMonitoredResourceDescriptorsResponse value) =>
|
||||
value.writeToBuffer()));
|
||||
$addMethod(new ServiceMethod<ListLogsRequest, ListLogsResponse>(
|
||||
$addMethod($grpc.ServiceMethod<$0.ListLogsRequest, $0.ListLogsResponse>(
|
||||
'ListLogs',
|
||||
listLogs_Pre,
|
||||
false,
|
||||
false,
|
||||
(List<int> value) => new ListLogsRequest.fromBuffer(value),
|
||||
(ListLogsResponse value) => value.writeToBuffer()));
|
||||
($core.List<$core.int> value) => $0.ListLogsRequest.fromBuffer(value),
|
||||
($0.ListLogsResponse value) => value.writeToBuffer()));
|
||||
$addMethod($grpc.ServiceMethod<$0.TailLogEntriesRequest,
|
||||
$0.TailLogEntriesResponse>(
|
||||
'TailLogEntries',
|
||||
tailLogEntries,
|
||||
true,
|
||||
true,
|
||||
($core.List<$core.int> value) =>
|
||||
$0.TailLogEntriesRequest.fromBuffer(value),
|
||||
($0.TailLogEntriesResponse value) => value.writeToBuffer()));
|
||||
}
|
||||
|
||||
Future<$google$protobuf.Empty> deleteLog_Pre(
|
||||
ServiceCall call, Future<DeleteLogRequest> request) async {
|
||||
$async.Future<$1.Empty> deleteLog_Pre($grpc.ServiceCall call,
|
||||
$async.Future<$0.DeleteLogRequest> request) async {
|
||||
return deleteLog(call, await request);
|
||||
}
|
||||
|
||||
Future<WriteLogEntriesResponse> writeLogEntries_Pre(
|
||||
ServiceCall call, Future<WriteLogEntriesRequest> request) async {
|
||||
$async.Future<$0.WriteLogEntriesResponse> writeLogEntries_Pre(
|
||||
$grpc.ServiceCall call,
|
||||
$async.Future<$0.WriteLogEntriesRequest> request) async {
|
||||
return writeLogEntries(call, await request);
|
||||
}
|
||||
|
||||
Future<ListLogEntriesResponse> listLogEntries_Pre(
|
||||
ServiceCall call, Future<ListLogEntriesRequest> request) async {
|
||||
$async.Future<$0.ListLogEntriesResponse> listLogEntries_Pre(
|
||||
$grpc.ServiceCall call,
|
||||
$async.Future<$0.ListLogEntriesRequest> request) async {
|
||||
return listLogEntries(call, await request);
|
||||
}
|
||||
|
||||
Future<ListMonitoredResourceDescriptorsResponse>
|
||||
listMonitoredResourceDescriptors_Pre(ServiceCall call,
|
||||
Future<ListMonitoredResourceDescriptorsRequest> request) async {
|
||||
$async.Future<$0.ListMonitoredResourceDescriptorsResponse>
|
||||
listMonitoredResourceDescriptors_Pre(
|
||||
$grpc.ServiceCall call,
|
||||
$async.Future<$0.ListMonitoredResourceDescriptorsRequest>
|
||||
request) async {
|
||||
return listMonitoredResourceDescriptors(call, await request);
|
||||
}
|
||||
|
||||
Future<ListLogsResponse> listLogs_Pre(
|
||||
ServiceCall call, Future<ListLogsRequest> request) async {
|
||||
$async.Future<$0.ListLogsResponse> listLogs_Pre(
|
||||
$grpc.ServiceCall call, $async.Future<$0.ListLogsRequest> request) async {
|
||||
return listLogs(call, await request);
|
||||
}
|
||||
|
||||
Future<$google$protobuf.Empty> deleteLog(
|
||||
ServiceCall call, DeleteLogRequest request);
|
||||
Future<WriteLogEntriesResponse> writeLogEntries(
|
||||
ServiceCall call, WriteLogEntriesRequest request);
|
||||
Future<ListLogEntriesResponse> listLogEntries(
|
||||
ServiceCall call, ListLogEntriesRequest request);
|
||||
Future<ListMonitoredResourceDescriptorsResponse>
|
||||
listMonitoredResourceDescriptors(
|
||||
ServiceCall call, ListMonitoredResourceDescriptorsRequest request);
|
||||
Future<ListLogsResponse> listLogs(ServiceCall call, ListLogsRequest request);
|
||||
$async.Future<$1.Empty> deleteLog(
|
||||
$grpc.ServiceCall call, $0.DeleteLogRequest request);
|
||||
$async.Future<$0.WriteLogEntriesResponse> writeLogEntries(
|
||||
$grpc.ServiceCall call, $0.WriteLogEntriesRequest request);
|
||||
$async.Future<$0.ListLogEntriesResponse> listLogEntries(
|
||||
$grpc.ServiceCall call, $0.ListLogEntriesRequest request);
|
||||
$async.Future<$0.ListMonitoredResourceDescriptorsResponse>
|
||||
listMonitoredResourceDescriptors($grpc.ServiceCall call,
|
||||
$0.ListMonitoredResourceDescriptorsRequest request);
|
||||
$async.Future<$0.ListLogsResponse> listLogs(
|
||||
$grpc.ServiceCall call, $0.ListLogsRequest request);
|
||||
$async.Stream<$0.TailLogEntriesResponse> tailLogEntries(
|
||||
$grpc.ServiceCall call, $async.Stream<$0.TailLogEntriesRequest> request);
|
||||
}
|
||||
|
|
|
@ -1,72 +1,111 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.logging.v2_logging_pbjson;
|
||||
// source: google/logging/v2/logging.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
const DeleteLogRequest$json = const {
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:core' as $core;
|
||||
import 'dart:typed_data' as $typed_data;
|
||||
|
||||
@$core.Deprecated('Use deleteLogRequestDescriptor instead')
|
||||
const DeleteLogRequest$json = {
|
||||
'1': 'DeleteLogRequest',
|
||||
'2': const [
|
||||
const {'1': 'log_name', '3': 1, '4': 1, '5': 9, '10': 'logName'},
|
||||
'2': [
|
||||
{'1': 'log_name', '3': 1, '4': 1, '5': 9, '8': {}, '10': 'logName'},
|
||||
],
|
||||
};
|
||||
|
||||
const WriteLogEntriesRequest$json = const {
|
||||
/// Descriptor for `DeleteLogRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List deleteLogRequestDescriptor = $convert.base64Decode(
|
||||
'ChBEZWxldGVMb2dSZXF1ZXN0Ej0KCGxvZ19uYW1lGAEgASgJQiLgQQL6QRwKGmxvZ2dpbmcuZ2'
|
||||
'9vZ2xlYXBpcy5jb20vTG9nUgdsb2dOYW1l');
|
||||
|
||||
@$core.Deprecated('Use writeLogEntriesRequestDescriptor instead')
|
||||
const WriteLogEntriesRequest$json = {
|
||||
'1': 'WriteLogEntriesRequest',
|
||||
'2': const [
|
||||
const {'1': 'log_name', '3': 1, '4': 1, '5': 9, '10': 'logName'},
|
||||
const {
|
||||
'2': [
|
||||
{'1': 'log_name', '3': 1, '4': 1, '5': 9, '8': {}, '10': 'logName'},
|
||||
{
|
||||
'1': 'resource',
|
||||
'3': 2,
|
||||
'4': 1,
|
||||
'5': 11,
|
||||
'6': '.google.api.MonitoredResource',
|
||||
'8': {},
|
||||
'10': 'resource'
|
||||
},
|
||||
const {
|
||||
{
|
||||
'1': 'labels',
|
||||
'3': 3,
|
||||
'4': 3,
|
||||
'5': 11,
|
||||
'6': '.google.logging.v2.WriteLogEntriesRequest.LabelsEntry',
|
||||
'8': {},
|
||||
'10': 'labels'
|
||||
},
|
||||
const {
|
||||
{
|
||||
'1': 'entries',
|
||||
'3': 4,
|
||||
'4': 3,
|
||||
'5': 11,
|
||||
'6': '.google.logging.v2.LogEntry',
|
||||
'8': {},
|
||||
'10': 'entries'
|
||||
},
|
||||
const {
|
||||
{
|
||||
'1': 'partial_success',
|
||||
'3': 5,
|
||||
'4': 1,
|
||||
'5': 8,
|
||||
'8': {},
|
||||
'10': 'partialSuccess'
|
||||
},
|
||||
{'1': 'dry_run', '3': 6, '4': 1, '5': 8, '8': {}, '10': 'dryRun'},
|
||||
],
|
||||
'3': const [WriteLogEntriesRequest_LabelsEntry$json],
|
||||
'3': [WriteLogEntriesRequest_LabelsEntry$json],
|
||||
};
|
||||
|
||||
const WriteLogEntriesRequest_LabelsEntry$json = const {
|
||||
@$core.Deprecated('Use writeLogEntriesRequestDescriptor instead')
|
||||
const WriteLogEntriesRequest_LabelsEntry$json = {
|
||||
'1': 'LabelsEntry',
|
||||
'2': const [
|
||||
const {'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'},
|
||||
const {'1': 'value', '3': 2, '4': 1, '5': 9, '10': 'value'},
|
||||
'2': [
|
||||
{'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'},
|
||||
{'1': 'value', '3': 2, '4': 1, '5': 9, '10': 'value'},
|
||||
],
|
||||
'7': const {'7': true},
|
||||
'7': {'7': true},
|
||||
};
|
||||
|
||||
const WriteLogEntriesResponse$json = const {
|
||||
/// Descriptor for `WriteLogEntriesRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List writeLogEntriesRequestDescriptor = $convert.base64Decode(
|
||||
'ChZXcml0ZUxvZ0VudHJpZXNSZXF1ZXN0Ej0KCGxvZ19uYW1lGAEgASgJQiLgQQH6QRwKGmxvZ2'
|
||||
'dpbmcuZ29vZ2xlYXBpcy5jb20vTG9nUgdsb2dOYW1lEj4KCHJlc291cmNlGAIgASgLMh0uZ29v'
|
||||
'Z2xlLmFwaS5Nb25pdG9yZWRSZXNvdXJjZUID4EEBUghyZXNvdXJjZRJSCgZsYWJlbHMYAyADKA'
|
||||
'syNS5nb29nbGUubG9nZ2luZy52Mi5Xcml0ZUxvZ0VudHJpZXNSZXF1ZXN0LkxhYmVsc0VudHJ5'
|
||||
'QgPgQQFSBmxhYmVscxI6CgdlbnRyaWVzGAQgAygLMhsuZ29vZ2xlLmxvZ2dpbmcudjIuTG9nRW'
|
||||
'50cnlCA+BBAlIHZW50cmllcxIsCg9wYXJ0aWFsX3N1Y2Nlc3MYBSABKAhCA+BBAVIOcGFydGlh'
|
||||
'bFN1Y2Nlc3MSHAoHZHJ5X3J1bhgGIAEoCEID4EEBUgZkcnlSdW4aOQoLTGFiZWxzRW50cnkSEA'
|
||||
'oDa2V5GAEgASgJUgNrZXkSFAoFdmFsdWUYAiABKAlSBXZhbHVlOgI4AQ==');
|
||||
|
||||
@$core.Deprecated('Use writeLogEntriesResponseDescriptor instead')
|
||||
const WriteLogEntriesResponse$json = {
|
||||
'1': 'WriteLogEntriesResponse',
|
||||
};
|
||||
|
||||
const WriteLogEntriesPartialErrors$json = const {
|
||||
/// Descriptor for `WriteLogEntriesResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List writeLogEntriesResponseDescriptor =
|
||||
$convert.base64Decode('ChdXcml0ZUxvZ0VudHJpZXNSZXNwb25zZQ==');
|
||||
|
||||
@$core.Deprecated('Use writeLogEntriesPartialErrorsDescriptor instead')
|
||||
const WriteLogEntriesPartialErrors$json = {
|
||||
'1': 'WriteLogEntriesPartialErrors',
|
||||
'2': const [
|
||||
const {
|
||||
'2': [
|
||||
{
|
||||
'1': 'log_entry_errors',
|
||||
'3': 1,
|
||||
'4': 3,
|
||||
|
@ -76,14 +115,15 @@ const WriteLogEntriesPartialErrors$json = const {
|
|||
'10': 'logEntryErrors'
|
||||
},
|
||||
],
|
||||
'3': const [WriteLogEntriesPartialErrors_LogEntryErrorsEntry$json],
|
||||
'3': [WriteLogEntriesPartialErrors_LogEntryErrorsEntry$json],
|
||||
};
|
||||
|
||||
const WriteLogEntriesPartialErrors_LogEntryErrorsEntry$json = const {
|
||||
@$core.Deprecated('Use writeLogEntriesPartialErrorsDescriptor instead')
|
||||
const WriteLogEntriesPartialErrors_LogEntryErrorsEntry$json = {
|
||||
'1': 'LogEntryErrorsEntry',
|
||||
'2': const [
|
||||
const {'1': 'key', '3': 1, '4': 1, '5': 5, '10': 'key'},
|
||||
const {
|
||||
'2': [
|
||||
{'1': 'key', '3': 1, '4': 1, '5': 5, '10': 'key'},
|
||||
{
|
||||
'1': 'value',
|
||||
'3': 2,
|
||||
'4': 1,
|
||||
|
@ -92,31 +132,49 @@ const WriteLogEntriesPartialErrors_LogEntryErrorsEntry$json = const {
|
|||
'10': 'value'
|
||||
},
|
||||
],
|
||||
'7': const {'7': true},
|
||||
'7': {'7': true},
|
||||
};
|
||||
|
||||
const ListLogEntriesRequest$json = const {
|
||||
/// Descriptor for `WriteLogEntriesPartialErrors`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List writeLogEntriesPartialErrorsDescriptor = $convert.base64Decode(
|
||||
'ChxXcml0ZUxvZ0VudHJpZXNQYXJ0aWFsRXJyb3JzEm0KEGxvZ19lbnRyeV9lcnJvcnMYASADKA'
|
||||
'syQy5nb29nbGUubG9nZ2luZy52Mi5Xcml0ZUxvZ0VudHJpZXNQYXJ0aWFsRXJyb3JzLkxvZ0Vu'
|
||||
'dHJ5RXJyb3JzRW50cnlSDmxvZ0VudHJ5RXJyb3JzGlUKE0xvZ0VudHJ5RXJyb3JzRW50cnkSEA'
|
||||
'oDa2V5GAEgASgFUgNrZXkSKAoFdmFsdWUYAiABKAsyEi5nb29nbGUucnBjLlN0YXR1c1IFdmFs'
|
||||
'dWU6AjgB');
|
||||
|
||||
@$core.Deprecated('Use listLogEntriesRequestDescriptor instead')
|
||||
const ListLogEntriesRequest$json = {
|
||||
'1': 'ListLogEntriesRequest',
|
||||
'2': const [
|
||||
const {'1': 'project_ids', '3': 1, '4': 3, '5': 9, '10': 'projectIds'},
|
||||
const {
|
||||
'2': [
|
||||
{
|
||||
'1': 'resource_names',
|
||||
'3': 8,
|
||||
'4': 3,
|
||||
'5': 9,
|
||||
'8': {},
|
||||
'10': 'resourceNames'
|
||||
},
|
||||
const {'1': 'filter', '3': 2, '4': 1, '5': 9, '10': 'filter'},
|
||||
const {'1': 'order_by', '3': 3, '4': 1, '5': 9, '10': 'orderBy'},
|
||||
const {'1': 'page_size', '3': 4, '4': 1, '5': 5, '10': 'pageSize'},
|
||||
const {'1': 'page_token', '3': 5, '4': 1, '5': 9, '10': 'pageToken'},
|
||||
{'1': 'filter', '3': 2, '4': 1, '5': 9, '8': {}, '10': 'filter'},
|
||||
{'1': 'order_by', '3': 3, '4': 1, '5': 9, '8': {}, '10': 'orderBy'},
|
||||
{'1': 'page_size', '3': 4, '4': 1, '5': 5, '8': {}, '10': 'pageSize'},
|
||||
{'1': 'page_token', '3': 5, '4': 1, '5': 9, '8': {}, '10': 'pageToken'},
|
||||
],
|
||||
};
|
||||
|
||||
const ListLogEntriesResponse$json = const {
|
||||
/// Descriptor for `ListLogEntriesRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List listLogEntriesRequestDescriptor = $convert.base64Decode(
|
||||
'ChVMaXN0TG9nRW50cmllc1JlcXVlc3QSSQoOcmVzb3VyY2VfbmFtZXMYCCADKAlCIuBBAvpBHB'
|
||||
'IabG9nZ2luZy5nb29nbGVhcGlzLmNvbS9Mb2dSDXJlc291cmNlTmFtZXMSGwoGZmlsdGVyGAIg'
|
||||
'ASgJQgPgQQFSBmZpbHRlchIeCghvcmRlcl9ieRgDIAEoCUID4EEBUgdvcmRlckJ5EiAKCXBhZ2'
|
||||
'Vfc2l6ZRgEIAEoBUID4EEBUghwYWdlU2l6ZRIiCgpwYWdlX3Rva2VuGAUgASgJQgPgQQFSCXBh'
|
||||
'Z2VUb2tlbg==');
|
||||
|
||||
@$core.Deprecated('Use listLogEntriesResponseDescriptor instead')
|
||||
const ListLogEntriesResponse$json = {
|
||||
'1': 'ListLogEntriesResponse',
|
||||
'2': const [
|
||||
const {
|
||||
'2': [
|
||||
{
|
||||
'1': 'entries',
|
||||
'3': 1,
|
||||
'4': 3,
|
||||
|
@ -124,28 +182,38 @@ const ListLogEntriesResponse$json = const {
|
|||
'6': '.google.logging.v2.LogEntry',
|
||||
'10': 'entries'
|
||||
},
|
||||
const {
|
||||
'1': 'next_page_token',
|
||||
'3': 2,
|
||||
'4': 1,
|
||||
'5': 9,
|
||||
'10': 'nextPageToken'
|
||||
},
|
||||
{'1': 'next_page_token', '3': 2, '4': 1, '5': 9, '10': 'nextPageToken'},
|
||||
],
|
||||
};
|
||||
|
||||
const ListMonitoredResourceDescriptorsRequest$json = const {
|
||||
/// Descriptor for `ListLogEntriesResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List listLogEntriesResponseDescriptor = $convert.base64Decode(
|
||||
'ChZMaXN0TG9nRW50cmllc1Jlc3BvbnNlEjUKB2VudHJpZXMYASADKAsyGy5nb29nbGUubG9nZ2'
|
||||
'luZy52Mi5Mb2dFbnRyeVIHZW50cmllcxImCg9uZXh0X3BhZ2VfdG9rZW4YAiABKAlSDW5leHRQ'
|
||||
'YWdlVG9rZW4=');
|
||||
|
||||
@$core
|
||||
.Deprecated('Use listMonitoredResourceDescriptorsRequestDescriptor instead')
|
||||
const ListMonitoredResourceDescriptorsRequest$json = {
|
||||
'1': 'ListMonitoredResourceDescriptorsRequest',
|
||||
'2': const [
|
||||
const {'1': 'page_size', '3': 1, '4': 1, '5': 5, '10': 'pageSize'},
|
||||
const {'1': 'page_token', '3': 2, '4': 1, '5': 9, '10': 'pageToken'},
|
||||
'2': [
|
||||
{'1': 'page_size', '3': 1, '4': 1, '5': 5, '8': {}, '10': 'pageSize'},
|
||||
{'1': 'page_token', '3': 2, '4': 1, '5': 9, '8': {}, '10': 'pageToken'},
|
||||
],
|
||||
};
|
||||
|
||||
const ListMonitoredResourceDescriptorsResponse$json = const {
|
||||
/// Descriptor for `ListMonitoredResourceDescriptorsRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List listMonitoredResourceDescriptorsRequestDescriptor =
|
||||
$convert.base64Decode(
|
||||
'CidMaXN0TW9uaXRvcmVkUmVzb3VyY2VEZXNjcmlwdG9yc1JlcXVlc3QSIAoJcGFnZV9zaXplGA'
|
||||
'EgASgFQgPgQQFSCHBhZ2VTaXplEiIKCnBhZ2VfdG9rZW4YAiABKAlCA+BBAVIJcGFnZVRva2Vu');
|
||||
|
||||
@$core.Deprecated(
|
||||
'Use listMonitoredResourceDescriptorsResponseDescriptor instead')
|
||||
const ListMonitoredResourceDescriptorsResponse$json = {
|
||||
'1': 'ListMonitoredResourceDescriptorsResponse',
|
||||
'2': const [
|
||||
const {
|
||||
'2': [
|
||||
{
|
||||
'1': 'resource_descriptors',
|
||||
'3': 1,
|
||||
'4': 3,
|
||||
|
@ -153,35 +221,146 @@ const ListMonitoredResourceDescriptorsResponse$json = const {
|
|||
'6': '.google.api.MonitoredResourceDescriptor',
|
||||
'10': 'resourceDescriptors'
|
||||
},
|
||||
const {
|
||||
'1': 'next_page_token',
|
||||
'3': 2,
|
||||
'4': 1,
|
||||
'5': 9,
|
||||
'10': 'nextPageToken'
|
||||
},
|
||||
{'1': 'next_page_token', '3': 2, '4': 1, '5': 9, '10': 'nextPageToken'},
|
||||
],
|
||||
};
|
||||
|
||||
const ListLogsRequest$json = const {
|
||||
/// Descriptor for `ListMonitoredResourceDescriptorsResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List listMonitoredResourceDescriptorsResponseDescriptor =
|
||||
$convert.base64Decode(
|
||||
'CihMaXN0TW9uaXRvcmVkUmVzb3VyY2VEZXNjcmlwdG9yc1Jlc3BvbnNlEloKFHJlc291cmNlX2'
|
||||
'Rlc2NyaXB0b3JzGAEgAygLMicuZ29vZ2xlLmFwaS5Nb25pdG9yZWRSZXNvdXJjZURlc2NyaXB0'
|
||||
'b3JSE3Jlc291cmNlRGVzY3JpcHRvcnMSJgoPbmV4dF9wYWdlX3Rva2VuGAIgASgJUg1uZXh0UG'
|
||||
'FnZVRva2Vu');
|
||||
|
||||
@$core.Deprecated('Use listLogsRequestDescriptor instead')
|
||||
const ListLogsRequest$json = {
|
||||
'1': 'ListLogsRequest',
|
||||
'2': const [
|
||||
const {'1': 'parent', '3': 1, '4': 1, '5': 9, '10': 'parent'},
|
||||
const {'1': 'page_size', '3': 2, '4': 1, '5': 5, '10': 'pageSize'},
|
||||
const {'1': 'page_token', '3': 3, '4': 1, '5': 9, '10': 'pageToken'},
|
||||
'2': [
|
||||
{'1': 'parent', '3': 1, '4': 1, '5': 9, '8': {}, '10': 'parent'},
|
||||
{
|
||||
'1': 'resource_names',
|
||||
'3': 8,
|
||||
'4': 3,
|
||||
'5': 9,
|
||||
'8': {},
|
||||
'10': 'resourceNames'
|
||||
},
|
||||
{'1': 'page_size', '3': 2, '4': 1, '5': 5, '8': {}, '10': 'pageSize'},
|
||||
{'1': 'page_token', '3': 3, '4': 1, '5': 9, '8': {}, '10': 'pageToken'},
|
||||
],
|
||||
};
|
||||
|
||||
const ListLogsResponse$json = const {
|
||||
/// Descriptor for `ListLogsRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List listLogsRequestDescriptor = $convert.base64Decode(
|
||||
'Cg9MaXN0TG9nc1JlcXVlc3QSOgoGcGFyZW50GAEgASgJQiLgQQL6QRwSGmxvZ2dpbmcuZ29vZ2'
|
||||
'xlYXBpcy5jb20vTG9nUgZwYXJlbnQSSQoOcmVzb3VyY2VfbmFtZXMYCCADKAlCIuBBAfpBHBIa'
|
||||
'bG9nZ2luZy5nb29nbGVhcGlzLmNvbS9Mb2dSDXJlc291cmNlTmFtZXMSIAoJcGFnZV9zaXplGA'
|
||||
'IgASgFQgPgQQFSCHBhZ2VTaXplEiIKCnBhZ2VfdG9rZW4YAyABKAlCA+BBAVIJcGFnZVRva2Vu');
|
||||
|
||||
@$core.Deprecated('Use listLogsResponseDescriptor instead')
|
||||
const ListLogsResponse$json = {
|
||||
'1': 'ListLogsResponse',
|
||||
'2': const [
|
||||
const {'1': 'log_names', '3': 3, '4': 3, '5': 9, '10': 'logNames'},
|
||||
const {
|
||||
'1': 'next_page_token',
|
||||
'3': 2,
|
||||
'4': 1,
|
||||
'2': [
|
||||
{'1': 'log_names', '3': 3, '4': 3, '5': 9, '10': 'logNames'},
|
||||
{'1': 'next_page_token', '3': 2, '4': 1, '5': 9, '10': 'nextPageToken'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `ListLogsResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List listLogsResponseDescriptor = $convert.base64Decode(
|
||||
'ChBMaXN0TG9nc1Jlc3BvbnNlEhsKCWxvZ19uYW1lcxgDIAMoCVIIbG9nTmFtZXMSJgoPbmV4dF'
|
||||
'9wYWdlX3Rva2VuGAIgASgJUg1uZXh0UGFnZVRva2Vu');
|
||||
|
||||
@$core.Deprecated('Use tailLogEntriesRequestDescriptor instead')
|
||||
const TailLogEntriesRequest$json = {
|
||||
'1': 'TailLogEntriesRequest',
|
||||
'2': [
|
||||
{
|
||||
'1': 'resource_names',
|
||||
'3': 1,
|
||||
'4': 3,
|
||||
'5': 9,
|
||||
'10': 'nextPageToken'
|
||||
'8': {},
|
||||
'10': 'resourceNames'
|
||||
},
|
||||
{'1': 'filter', '3': 2, '4': 1, '5': 9, '8': {}, '10': 'filter'},
|
||||
{
|
||||
'1': 'buffer_window',
|
||||
'3': 3,
|
||||
'4': 1,
|
||||
'5': 11,
|
||||
'6': '.google.protobuf.Duration',
|
||||
'8': {},
|
||||
'10': 'bufferWindow'
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `TailLogEntriesRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List tailLogEntriesRequestDescriptor = $convert.base64Decode(
|
||||
'ChVUYWlsTG9nRW50cmllc1JlcXVlc3QSKgoOcmVzb3VyY2VfbmFtZXMYASADKAlCA+BBAlINcm'
|
||||
'Vzb3VyY2VOYW1lcxIbCgZmaWx0ZXIYAiABKAlCA+BBAVIGZmlsdGVyEkMKDWJ1ZmZlcl93aW5k'
|
||||
'b3cYAyABKAsyGS5nb29nbGUucHJvdG9idWYuRHVyYXRpb25CA+BBAVIMYnVmZmVyV2luZG93');
|
||||
|
||||
@$core.Deprecated('Use tailLogEntriesResponseDescriptor instead')
|
||||
const TailLogEntriesResponse$json = {
|
||||
'1': 'TailLogEntriesResponse',
|
||||
'2': [
|
||||
{
|
||||
'1': 'entries',
|
||||
'3': 1,
|
||||
'4': 3,
|
||||
'5': 11,
|
||||
'6': '.google.logging.v2.LogEntry',
|
||||
'10': 'entries'
|
||||
},
|
||||
{
|
||||
'1': 'suppression_info',
|
||||
'3': 2,
|
||||
'4': 3,
|
||||
'5': 11,
|
||||
'6': '.google.logging.v2.TailLogEntriesResponse.SuppressionInfo',
|
||||
'10': 'suppressionInfo'
|
||||
},
|
||||
],
|
||||
'3': [TailLogEntriesResponse_SuppressionInfo$json],
|
||||
};
|
||||
|
||||
@$core.Deprecated('Use tailLogEntriesResponseDescriptor instead')
|
||||
const TailLogEntriesResponse_SuppressionInfo$json = {
|
||||
'1': 'SuppressionInfo',
|
||||
'2': [
|
||||
{
|
||||
'1': 'reason',
|
||||
'3': 1,
|
||||
'4': 1,
|
||||
'5': 14,
|
||||
'6': '.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason',
|
||||
'10': 'reason'
|
||||
},
|
||||
{'1': 'suppressed_count', '3': 2, '4': 1, '5': 5, '10': 'suppressedCount'},
|
||||
],
|
||||
'4': [TailLogEntriesResponse_SuppressionInfo_Reason$json],
|
||||
};
|
||||
|
||||
@$core.Deprecated('Use tailLogEntriesResponseDescriptor instead')
|
||||
const TailLogEntriesResponse_SuppressionInfo_Reason$json = {
|
||||
'1': 'Reason',
|
||||
'2': [
|
||||
{'1': 'REASON_UNSPECIFIED', '2': 0},
|
||||
{'1': 'RATE_LIMIT', '2': 1},
|
||||
{'1': 'NOT_CONSUMED', '2': 2},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `TailLogEntriesResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List tailLogEntriesResponseDescriptor = $convert.base64Decode(
|
||||
'ChZUYWlsTG9nRW50cmllc1Jlc3BvbnNlEjUKB2VudHJpZXMYASADKAsyGy5nb29nbGUubG9nZ2'
|
||||
'luZy52Mi5Mb2dFbnRyeVIHZW50cmllcxJkChBzdXBwcmVzc2lvbl9pbmZvGAIgAygLMjkuZ29v'
|
||||
'Z2xlLmxvZ2dpbmcudjIuVGFpbExvZ0VudHJpZXNSZXNwb25zZS5TdXBwcmVzc2lvbkluZm9SD3'
|
||||
'N1cHByZXNzaW9uSW5mbxraAQoPU3VwcHJlc3Npb25JbmZvElgKBnJlYXNvbhgBIAEoDjJALmdv'
|
||||
'b2dsZS5sb2dnaW5nLnYyLlRhaWxMb2dFbnRyaWVzUmVzcG9uc2UuU3VwcHJlc3Npb25JbmZvLl'
|
||||
'JlYXNvblIGcmVhc29uEikKEHN1cHByZXNzZWRfY291bnQYAiABKAVSD3N1cHByZXNzZWRDb3Vu'
|
||||
'dCJCCgZSZWFzb24SFgoSUkVBU09OX1VOU1BFQ0lGSUVEEAASDgoKUkFURV9MSU1JVBABEhAKDE'
|
||||
'5PVF9DT05TVU1FRBAC');
|
||||
|
|
|
@ -1,54 +1,224 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: google/protobuf/any.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
import 'package:protobuf/src/protobuf/mixins/well_known.dart' as $mixin;
|
||||
|
||||
/// `Any` contains an arbitrary serialized protocol buffer message along with a
|
||||
/// URL that describes the type of the serialized message.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.protobuf_any;
|
||||
/// Protobuf library provides support to pack/unpack Any values in the form
|
||||
/// of utility functions or additional generated methods of the Any type.
|
||||
///
|
||||
/// Example 1: Pack and unpack a message in C++.
|
||||
///
|
||||
/// Foo foo = ...;
|
||||
/// Any any;
|
||||
/// any.PackFrom(foo);
|
||||
/// ...
|
||||
/// if (any.UnpackTo(&foo)) {
|
||||
/// ...
|
||||
/// }
|
||||
///
|
||||
/// Example 2: Pack and unpack a message in Java.
|
||||
///
|
||||
/// Foo foo = ...;
|
||||
/// Any any = Any.pack(foo);
|
||||
/// ...
|
||||
/// if (any.is(Foo.class)) {
|
||||
/// foo = any.unpack(Foo.class);
|
||||
/// }
|
||||
/// // or ...
|
||||
/// if (any.isSameTypeAs(Foo.getDefaultInstance())) {
|
||||
/// foo = any.unpack(Foo.getDefaultInstance());
|
||||
/// }
|
||||
///
|
||||
/// Example 3: Pack and unpack a message in Python.
|
||||
///
|
||||
/// foo = Foo(...)
|
||||
/// any = Any()
|
||||
/// any.Pack(foo)
|
||||
/// ...
|
||||
/// if any.Is(Foo.DESCRIPTOR):
|
||||
/// any.Unpack(foo)
|
||||
/// ...
|
||||
///
|
||||
/// Example 4: Pack and unpack a message in Go
|
||||
///
|
||||
/// foo := &pb.Foo{...}
|
||||
/// any, err := anypb.New(foo)
|
||||
/// if err != nil {
|
||||
/// ...
|
||||
/// }
|
||||
/// ...
|
||||
/// foo := &pb.Foo{}
|
||||
/// if err := any.UnmarshalTo(foo); err != nil {
|
||||
/// ...
|
||||
/// }
|
||||
///
|
||||
/// The pack methods provided by protobuf library will by default use
|
||||
/// 'type.googleapis.com/full.type.name' as the type URL and the unpack
|
||||
/// methods only use the fully qualified type name after the last '/'
|
||||
/// in the type URL, for example "foo.bar.com/x/y.z" will yield type
|
||||
/// name "y.z".
|
||||
///
|
||||
/// JSON
|
||||
/// ====
|
||||
/// The JSON representation of an `Any` value uses the regular
|
||||
/// representation of the deserialized, embedded message, with an
|
||||
/// additional field `@type` which contains the type URL. Example:
|
||||
///
|
||||
/// package google.profile;
|
||||
/// message Person {
|
||||
/// string first_name = 1;
|
||||
/// string last_name = 2;
|
||||
/// }
|
||||
///
|
||||
/// {
|
||||
/// "@type": "type.googleapis.com/google.profile.Person",
|
||||
/// "firstName": <string>,
|
||||
/// "lastName": <string>
|
||||
/// }
|
||||
///
|
||||
/// If the embedded message type is well-known and has a custom JSON
|
||||
/// representation, that representation will be embedded adding a field
|
||||
/// `value` which holds the custom JSON in addition to the `@type`
|
||||
/// field. Example (for message [google.protobuf.Duration][]):
|
||||
///
|
||||
/// {
|
||||
/// "@type": "type.googleapis.com/google.protobuf.Duration",
|
||||
/// "value": "1.212s"
|
||||
/// }
|
||||
class Any extends $pb.GeneratedMessage with $mixin.AnyMixin {
|
||||
factory Any({
|
||||
$core.String? typeUrl,
|
||||
$core.List<$core.int>? value,
|
||||
}) {
|
||||
final result = create();
|
||||
if (typeUrl != null) {
|
||||
result.typeUrl = typeUrl;
|
||||
}
|
||||
if (value != null) {
|
||||
result.value = value;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
Any._() : super();
|
||||
factory Any.fromBuffer($core.List<$core.int> i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(i, r);
|
||||
factory Any.fromJson($core.String i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(i, r);
|
||||
|
||||
// ignore: UNUSED_SHOWN_NAME
|
||||
import 'dart:core' show int, bool, double, String, List, override;
|
||||
|
||||
import 'package:protobuf/protobuf.dart';
|
||||
|
||||
class Any extends GeneratedMessage {
|
||||
static final BuilderInfo _i = new BuilderInfo('Any')
|
||||
..aOS(1, 'typeUrl')
|
||||
..a<List<int>>(2, 'value', PbFieldType.OY)
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
_omitMessageNames ? '' : 'Any',
|
||||
package:
|
||||
const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'),
|
||||
createEmptyInstance: create,
|
||||
toProto3Json: $mixin.AnyMixin.toProto3JsonHelper,
|
||||
fromProto3Json: $mixin.AnyMixin.fromProto3JsonHelper)
|
||||
..aOS(1, _omitFieldNames ? '' : 'typeUrl')
|
||||
..a<$core.List<$core.int>>(
|
||||
2, _omitFieldNames ? '' : 'value', $pb.PbFieldType.OY)
|
||||
..hasRequiredFields = false;
|
||||
|
||||
Any() : super();
|
||||
Any.fromBuffer(List<int> i, [ExtensionRegistry r = ExtensionRegistry.EMPTY])
|
||||
: super.fromBuffer(i, r);
|
||||
Any.fromJson(String i, [ExtensionRegistry r = ExtensionRegistry.EMPTY])
|
||||
: super.fromJson(i, r);
|
||||
Any clone() => new Any()..mergeFromMessage(this);
|
||||
BuilderInfo get info_ => _i;
|
||||
static Any create() => new Any();
|
||||
static PbList<Any> createRepeated() => new PbList<Any>();
|
||||
static Any getDefault() {
|
||||
if (_defaultInstance == null) _defaultInstance = new _ReadonlyAny();
|
||||
return _defaultInstance;
|
||||
}
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
Any clone() => Any()..mergeFromMessage(this);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
Any copyWith(void Function(Any) updates) =>
|
||||
super.copyWith((message) => updates(message as Any)) as Any;
|
||||
|
||||
static Any _defaultInstance;
|
||||
static void $checkItem(Any v) {
|
||||
if (v is! Any) checkItemFailed(v, 'Any');
|
||||
}
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
String get typeUrl => $_getS(0, '');
|
||||
set typeUrl(String v) {
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Any create() => Any._();
|
||||
Any createEmptyInstance() => create();
|
||||
static $pb.PbList<Any> createRepeated() => $pb.PbList<Any>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Any getDefault() =>
|
||||
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Any>(create);
|
||||
static Any? _defaultInstance;
|
||||
|
||||
/// A URL/resource name that uniquely identifies the type of the serialized
|
||||
/// protocol buffer message. This string must contain at least
|
||||
/// one "/" character. The last segment of the URL's path must represent
|
||||
/// the fully qualified name of the type (as in
|
||||
/// `path/google.protobuf.Duration`). The name should be in a canonical form
|
||||
/// (e.g., leading "." is not accepted).
|
||||
///
|
||||
/// In practice, teams usually precompile into the binary all types that they
|
||||
/// expect it to use in the context of Any. However, for URLs which use the
|
||||
/// scheme `http`, `https`, or no scheme, one can optionally set up a type
|
||||
/// server that maps type URLs to message definitions as follows:
|
||||
///
|
||||
/// * If no scheme is provided, `https` is assumed.
|
||||
/// * An HTTP GET on the URL must yield a [google.protobuf.Type][]
|
||||
/// value in binary format, or produce an error.
|
||||
/// * Applications are allowed to cache lookup results based on the
|
||||
/// URL, or have them precompiled into a binary to avoid any
|
||||
/// lookup. Therefore, binary compatibility needs to be preserved
|
||||
/// on changes to types. (Use versioned type names to manage
|
||||
/// breaking changes.)
|
||||
///
|
||||
/// Note: this functionality is not currently available in the official
|
||||
/// protobuf release, and it is not used for type URLs beginning with
|
||||
/// type.googleapis.com. As of May 2023, there are no widely used type server
|
||||
/// implementations and no plans to implement one.
|
||||
///
|
||||
/// Schemes other than `http`, `https` (or the empty scheme) might be
|
||||
/// used with implementation specific semantics.
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get typeUrl => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set typeUrl($core.String v) {
|
||||
$_setString(0, v);
|
||||
}
|
||||
|
||||
bool hasTypeUrl() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasTypeUrl() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearTypeUrl() => clearField(1);
|
||||
|
||||
List<int> get value => $_getN(1);
|
||||
set value(List<int> v) {
|
||||
/// Must be a valid serialized protocol buffer of the above specified type.
|
||||
@$pb.TagNumber(2)
|
||||
$core.List<$core.int> get value => $_getN(1);
|
||||
@$pb.TagNumber(2)
|
||||
set value($core.List<$core.int> v) {
|
||||
$_setBytes(1, v);
|
||||
}
|
||||
|
||||
bool hasValue() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasValue() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearValue() => clearField(2);
|
||||
|
||||
/// Creates a new [Any] encoding [message].
|
||||
///
|
||||
/// The [typeUrl] will be [typeUrlPrefix]/`fullName` where `fullName` is
|
||||
/// the fully qualified name of the type of [message].
|
||||
static Any pack($pb.GeneratedMessage message,
|
||||
{$core.String typeUrlPrefix = 'type.googleapis.com'}) {
|
||||
final result = create();
|
||||
$mixin.AnyMixin.packIntoAny(result, message, typeUrlPrefix: typeUrlPrefix);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
class _ReadonlyAny extends Any with ReadonlyMessageMixin {}
|
||||
const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names');
|
||||
const _omitMessageNames =
|
||||
$core.bool.fromEnvironment('protobuf.omit_message_names');
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.protobuf_any_pbenum;
|
||||
// source: google/protobuf/any.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
|
|
@ -1,13 +1,27 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.protobuf_any_pbjson;
|
||||
// source: google/protobuf/any.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
const Any$json = const {
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:core' as $core;
|
||||
import 'dart:typed_data' as $typed_data;
|
||||
|
||||
@$core.Deprecated('Use anyDescriptor instead')
|
||||
const Any$json = {
|
||||
'1': 'Any',
|
||||
'2': const [
|
||||
const {'1': 'type_url', '3': 1, '4': 1, '5': 9, '10': 'typeUrl'},
|
||||
const {'1': 'value', '3': 2, '4': 1, '5': 12, '10': 'value'},
|
||||
'2': [
|
||||
{'1': 'type_url', '3': 1, '4': 1, '5': 9, '10': 'typeUrl'},
|
||||
{'1': 'value', '3': 2, '4': 1, '5': 12, '10': 'value'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `Any`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List anyDescriptor = $convert.base64Decode(
|
||||
'CgNBbnkSGQoIdHlwZV91cmwYASABKAlSB3R5cGVVcmwSFAoFdmFsdWUYAiABKAxSBXZhbHVl');
|
||||
|
|
|
@ -1,56 +1,166 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: google/protobuf/duration.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:fixnum/fixnum.dart' as $fixnum;
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
import 'package:protobuf/src/protobuf/mixins/well_known.dart' as $mixin;
|
||||
|
||||
/// A Duration represents a signed, fixed-length span of time represented
|
||||
/// as a count of seconds and fractions of seconds at nanosecond
|
||||
/// resolution. It is independent of any calendar and concepts like "day"
|
||||
/// or "month". It is related to Timestamp in that the difference between
|
||||
/// two Timestamp values is a Duration and it can be added or subtracted
|
||||
/// from a Timestamp. Range is approximately +-10,000 years.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.protobuf_duration;
|
||||
/// # Examples
|
||||
///
|
||||
/// Example 1: Compute Duration from two Timestamps in pseudo code.
|
||||
///
|
||||
/// Timestamp start = ...;
|
||||
/// Timestamp end = ...;
|
||||
/// Duration duration = ...;
|
||||
///
|
||||
/// duration.seconds = end.seconds - start.seconds;
|
||||
/// duration.nanos = end.nanos - start.nanos;
|
||||
///
|
||||
/// if (duration.seconds < 0 && duration.nanos > 0) {
|
||||
/// duration.seconds += 1;
|
||||
/// duration.nanos -= 1000000000;
|
||||
/// } else if (duration.seconds > 0 && duration.nanos < 0) {
|
||||
/// duration.seconds -= 1;
|
||||
/// duration.nanos += 1000000000;
|
||||
/// }
|
||||
///
|
||||
/// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
|
||||
///
|
||||
/// Timestamp start = ...;
|
||||
/// Duration duration = ...;
|
||||
/// Timestamp end = ...;
|
||||
///
|
||||
/// end.seconds = start.seconds + duration.seconds;
|
||||
/// end.nanos = start.nanos + duration.nanos;
|
||||
///
|
||||
/// if (end.nanos < 0) {
|
||||
/// end.seconds -= 1;
|
||||
/// end.nanos += 1000000000;
|
||||
/// } else if (end.nanos >= 1000000000) {
|
||||
/// end.seconds += 1;
|
||||
/// end.nanos -= 1000000000;
|
||||
/// }
|
||||
///
|
||||
/// Example 3: Compute Duration from datetime.timedelta in Python.
|
||||
///
|
||||
/// 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".
|
||||
class Duration extends $pb.GeneratedMessage with $mixin.DurationMixin {
|
||||
factory Duration({
|
||||
$fixnum.Int64? seconds,
|
||||
$core.int? nanos,
|
||||
}) {
|
||||
final result = create();
|
||||
if (seconds != null) {
|
||||
result.seconds = seconds;
|
||||
}
|
||||
if (nanos != null) {
|
||||
result.nanos = nanos;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
Duration._() : super();
|
||||
factory Duration.fromBuffer($core.List<$core.int> i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(i, r);
|
||||
factory Duration.fromJson($core.String i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(i, r);
|
||||
|
||||
// ignore: UNUSED_SHOWN_NAME
|
||||
import 'dart:core' show int, bool, double, String, List, override;
|
||||
|
||||
import 'package:fixnum/fixnum.dart';
|
||||
import 'package:protobuf/protobuf.dart';
|
||||
|
||||
class Duration extends GeneratedMessage {
|
||||
static final BuilderInfo _i = new BuilderInfo('Duration')
|
||||
..aInt64(1, 'seconds')
|
||||
..a<int>(2, 'nanos', PbFieldType.O3)
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
_omitMessageNames ? '' : 'Duration',
|
||||
package:
|
||||
const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'),
|
||||
createEmptyInstance: create,
|
||||
toProto3Json: $mixin.DurationMixin.toProto3JsonHelper,
|
||||
fromProto3Json: $mixin.DurationMixin.fromProto3JsonHelper)
|
||||
..aInt64(1, _omitFieldNames ? '' : 'seconds')
|
||||
..a<$core.int>(2, _omitFieldNames ? '' : 'nanos', $pb.PbFieldType.O3)
|
||||
..hasRequiredFields = false;
|
||||
|
||||
Duration() : super();
|
||||
Duration.fromBuffer(List<int> i,
|
||||
[ExtensionRegistry r = ExtensionRegistry.EMPTY])
|
||||
: super.fromBuffer(i, r);
|
||||
Duration.fromJson(String i, [ExtensionRegistry r = ExtensionRegistry.EMPTY])
|
||||
: super.fromJson(i, r);
|
||||
Duration clone() => new Duration()..mergeFromMessage(this);
|
||||
BuilderInfo get info_ => _i;
|
||||
static Duration create() => new Duration();
|
||||
static PbList<Duration> createRepeated() => new PbList<Duration>();
|
||||
static Duration getDefault() {
|
||||
if (_defaultInstance == null) _defaultInstance = new _ReadonlyDuration();
|
||||
return _defaultInstance;
|
||||
}
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
Duration clone() => Duration()..mergeFromMessage(this);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
Duration copyWith(void Function(Duration) updates) =>
|
||||
super.copyWith((message) => updates(message as Duration)) as Duration;
|
||||
|
||||
static Duration _defaultInstance;
|
||||
static void $checkItem(Duration v) {
|
||||
if (v is! Duration) checkItemFailed(v, 'Duration');
|
||||
}
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
Int64 get seconds => $_getI64(0);
|
||||
set seconds(Int64 v) {
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Duration create() => Duration._();
|
||||
Duration createEmptyInstance() => create();
|
||||
static $pb.PbList<Duration> createRepeated() => $pb.PbList<Duration>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Duration getDefault() =>
|
||||
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Duration>(create);
|
||||
static Duration? _defaultInstance;
|
||||
|
||||
/// Signed seconds of the span of time. Must be from -315,576,000,000
|
||||
/// 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
|
||||
@$pb.TagNumber(1)
|
||||
$fixnum.Int64 get seconds => $_getI64(0);
|
||||
@$pb.TagNumber(1)
|
||||
set seconds($fixnum.Int64 v) {
|
||||
$_setInt64(0, v);
|
||||
}
|
||||
|
||||
bool hasSeconds() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasSeconds() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearSeconds() => clearField(1);
|
||||
|
||||
int get nanos => $_get(1, 0);
|
||||
set nanos(int v) {
|
||||
$_setUnsignedInt32(1, v);
|
||||
/// Signed fractions of a second at nanosecond resolution of the span
|
||||
/// of time. Durations less than one second are represented with a 0
|
||||
/// `seconds` field and a positive or negative `nanos` field. For durations
|
||||
/// of one second or more, a non-zero value for the `nanos` field must be
|
||||
/// of the same sign as the `seconds` field. Must be from -999,999,999
|
||||
/// to +999,999,999 inclusive.
|
||||
@$pb.TagNumber(2)
|
||||
$core.int get nanos => $_getIZ(1);
|
||||
@$pb.TagNumber(2)
|
||||
set nanos($core.int v) {
|
||||
$_setSignedInt32(1, v);
|
||||
}
|
||||
|
||||
bool hasNanos() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasNanos() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearNanos() => clearField(2);
|
||||
}
|
||||
|
||||
class _ReadonlyDuration extends Duration with ReadonlyMessageMixin {}
|
||||
const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names');
|
||||
const _omitMessageNames =
|
||||
$core.bool.fromEnvironment('protobuf.omit_message_names');
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.protobuf_duration_pbenum;
|
||||
// source: google/protobuf/duration.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
|
|
@ -1,13 +1,28 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.protobuf_duration_pbjson;
|
||||
// source: google/protobuf/duration.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
const Duration$json = const {
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:core' as $core;
|
||||
import 'dart:typed_data' as $typed_data;
|
||||
|
||||
@$core.Deprecated('Use durationDescriptor instead')
|
||||
const Duration$json = {
|
||||
'1': 'Duration',
|
||||
'2': const [
|
||||
const {'1': 'seconds', '3': 1, '4': 1, '5': 3, '10': 'seconds'},
|
||||
const {'1': 'nanos', '3': 2, '4': 1, '5': 5, '10': 'nanos'},
|
||||
'2': [
|
||||
{'1': 'seconds', '3': 1, '4': 1, '5': 3, '10': 'seconds'},
|
||||
{'1': 'nanos', '3': 2, '4': 1, '5': 5, '10': 'nanos'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `Duration`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List durationDescriptor = $convert.base64Decode(
|
||||
'CghEdXJhdGlvbhIYCgdzZWNvbmRzGAEgASgDUgdzZWNvbmRzEhQKBW5hbm9zGAIgASgFUgVuYW'
|
||||
'5vcw==');
|
||||
|
|
|
@ -1,36 +1,63 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: google/protobuf/empty.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
/// A generic empty message that you can re-use to avoid defining duplicated
|
||||
/// empty messages in your APIs. A typical example is to use it as the request
|
||||
/// or the response type of an API method. For instance:
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.protobuf_empty;
|
||||
/// service Foo {
|
||||
/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
|
||||
/// }
|
||||
class Empty extends $pb.GeneratedMessage {
|
||||
factory Empty() => create();
|
||||
Empty._() : super();
|
||||
factory Empty.fromBuffer($core.List<$core.int> i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(i, r);
|
||||
factory Empty.fromJson($core.String i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(i, r);
|
||||
|
||||
// ignore: UNUSED_SHOWN_NAME
|
||||
import 'dart:core' show int, bool, double, String, List, override;
|
||||
|
||||
import 'package:protobuf/protobuf.dart';
|
||||
|
||||
class Empty extends GeneratedMessage {
|
||||
static final BuilderInfo _i = new BuilderInfo('Empty')
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
_omitMessageNames ? '' : 'Empty',
|
||||
package:
|
||||
const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'),
|
||||
createEmptyInstance: create)
|
||||
..hasRequiredFields = false;
|
||||
|
||||
Empty() : super();
|
||||
Empty.fromBuffer(List<int> i, [ExtensionRegistry r = ExtensionRegistry.EMPTY])
|
||||
: super.fromBuffer(i, r);
|
||||
Empty.fromJson(String i, [ExtensionRegistry r = ExtensionRegistry.EMPTY])
|
||||
: super.fromJson(i, r);
|
||||
Empty clone() => new Empty()..mergeFromMessage(this);
|
||||
BuilderInfo get info_ => _i;
|
||||
static Empty create() => new Empty();
|
||||
static PbList<Empty> createRepeated() => new PbList<Empty>();
|
||||
static Empty getDefault() {
|
||||
if (_defaultInstance == null) _defaultInstance = new _ReadonlyEmpty();
|
||||
return _defaultInstance;
|
||||
}
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
Empty clone() => Empty()..mergeFromMessage(this);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
Empty copyWith(void Function(Empty) updates) =>
|
||||
super.copyWith((message) => updates(message as Empty)) as Empty;
|
||||
|
||||
static Empty _defaultInstance;
|
||||
static void $checkItem(Empty v) {
|
||||
if (v is! Empty) checkItemFailed(v, 'Empty');
|
||||
}
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Empty create() => Empty._();
|
||||
Empty createEmptyInstance() => create();
|
||||
static $pb.PbList<Empty> createRepeated() => $pb.PbList<Empty>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Empty getDefault() =>
|
||||
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Empty>(create);
|
||||
static Empty? _defaultInstance;
|
||||
}
|
||||
|
||||
class _ReadonlyEmpty extends Empty with ReadonlyMessageMixin {}
|
||||
const _omitMessageNames =
|
||||
$core.bool.fromEnvironment('protobuf.omit_message_names');
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.protobuf_empty_pbenum;
|
||||
// source: google/protobuf/empty.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
|
|
@ -1,9 +1,23 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.protobuf_empty_pbjson;
|
||||
// source: google/protobuf/empty.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
const Empty$json = const {
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:core' as $core;
|
||||
import 'dart:typed_data' as $typed_data;
|
||||
|
||||
@$core.Deprecated('Use emptyDescriptor instead')
|
||||
const Empty$json = {
|
||||
'1': 'Empty',
|
||||
};
|
||||
|
||||
/// Descriptor for `Empty`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List emptyDescriptor =
|
||||
$convert.base64Decode('CgVFbXB0eQ==');
|
||||
|
|
|
@ -1,208 +1,341 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.protobuf_struct;
|
||||
// source: google/protobuf/struct.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore: UNUSED_SHOWN_NAME
|
||||
import 'dart:core' show int, bool, double, String, List, override;
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'package:protobuf/protobuf.dart';
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
import 'package:protobuf/src/protobuf/mixins/well_known.dart' as $mixin;
|
||||
|
||||
import 'struct.pbenum.dart';
|
||||
|
||||
export 'struct.pbenum.dart';
|
||||
|
||||
class Struct_FieldsEntry extends GeneratedMessage {
|
||||
static final BuilderInfo _i = new BuilderInfo('Struct_FieldsEntry')
|
||||
..aOS(1, 'key')
|
||||
..a<Value>(2, 'value', PbFieldType.OM, Value.getDefault, Value.create)
|
||||
/// `Struct` represents a structured data value, consisting of fields
|
||||
/// which map to dynamically typed values. In some languages, `Struct`
|
||||
/// might be supported by a native representation. For example, in
|
||||
/// scripting languages like JS a struct is represented as an
|
||||
/// object. The details of that representation are described together
|
||||
/// with the proto support for the language.
|
||||
///
|
||||
/// The JSON representation for `Struct` is JSON object.
|
||||
class Struct extends $pb.GeneratedMessage with $mixin.StructMixin {
|
||||
factory Struct({
|
||||
$core.Map<$core.String, Value>? fields,
|
||||
}) {
|
||||
final result = create();
|
||||
if (fields != null) {
|
||||
result.fields.addAll(fields);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
Struct._() : super();
|
||||
factory Struct.fromBuffer($core.List<$core.int> i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(i, r);
|
||||
factory Struct.fromJson($core.String i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(i, r);
|
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
_omitMessageNames ? '' : 'Struct',
|
||||
package:
|
||||
const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'),
|
||||
createEmptyInstance: create,
|
||||
toProto3Json: $mixin.StructMixin.toProto3JsonHelper,
|
||||
fromProto3Json: $mixin.StructMixin.fromProto3JsonHelper)
|
||||
..m<$core.String, Value>(1, _omitFieldNames ? '' : 'fields',
|
||||
entryClassName: 'Struct.FieldsEntry',
|
||||
keyFieldType: $pb.PbFieldType.OS,
|
||||
valueFieldType: $pb.PbFieldType.OM,
|
||||
valueCreator: Value.create,
|
||||
valueDefaultOrMaker: Value.getDefault,
|
||||
packageName: const $pb.PackageName('google.protobuf'))
|
||||
..hasRequiredFields = false;
|
||||
|
||||
Struct_FieldsEntry() : super();
|
||||
Struct_FieldsEntry.fromBuffer(List<int> i,
|
||||
[ExtensionRegistry r = ExtensionRegistry.EMPTY])
|
||||
: super.fromBuffer(i, r);
|
||||
Struct_FieldsEntry.fromJson(String i,
|
||||
[ExtensionRegistry r = ExtensionRegistry.EMPTY])
|
||||
: super.fromJson(i, r);
|
||||
Struct_FieldsEntry clone() =>
|
||||
new Struct_FieldsEntry()..mergeFromMessage(this);
|
||||
BuilderInfo get info_ => _i;
|
||||
static Struct_FieldsEntry create() => new Struct_FieldsEntry();
|
||||
static PbList<Struct_FieldsEntry> createRepeated() =>
|
||||
new PbList<Struct_FieldsEntry>();
|
||||
static Struct_FieldsEntry getDefault() {
|
||||
if (_defaultInstance == null)
|
||||
_defaultInstance = new _ReadonlyStruct_FieldsEntry();
|
||||
return _defaultInstance;
|
||||
}
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
Struct clone() => Struct()..mergeFromMessage(this);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
Struct copyWith(void Function(Struct) updates) =>
|
||||
super.copyWith((message) => updates(message as Struct)) as Struct;
|
||||
|
||||
static Struct_FieldsEntry _defaultInstance;
|
||||
static void $checkItem(Struct_FieldsEntry v) {
|
||||
if (v is! Struct_FieldsEntry) checkItemFailed(v, 'Struct_FieldsEntry');
|
||||
}
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
String get key => $_getS(0, '');
|
||||
set key(String v) {
|
||||
$_setString(0, v);
|
||||
}
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Struct create() => Struct._();
|
||||
Struct createEmptyInstance() => create();
|
||||
static $pb.PbList<Struct> createRepeated() => $pb.PbList<Struct>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Struct getDefault() =>
|
||||
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Struct>(create);
|
||||
static Struct? _defaultInstance;
|
||||
|
||||
bool hasKey() => $_has(0);
|
||||
void clearKey() => clearField(1);
|
||||
|
||||
Value get value => $_getN(1);
|
||||
set value(Value v) {
|
||||
setField(2, v);
|
||||
}
|
||||
|
||||
bool hasValue() => $_has(1);
|
||||
void clearValue() => clearField(2);
|
||||
/// Unordered map of dynamically typed values.
|
||||
@$pb.TagNumber(1)
|
||||
$core.Map<$core.String, Value> get fields => $_getMap(0);
|
||||
}
|
||||
|
||||
class _ReadonlyStruct_FieldsEntry extends Struct_FieldsEntry
|
||||
with ReadonlyMessageMixin {}
|
||||
|
||||
class Struct extends GeneratedMessage {
|
||||
static final BuilderInfo _i = new BuilderInfo('Struct')
|
||||
..pp<Struct_FieldsEntry>(1, 'fields', PbFieldType.PM,
|
||||
Struct_FieldsEntry.$checkItem, Struct_FieldsEntry.create)
|
||||
..hasRequiredFields = false;
|
||||
|
||||
Struct() : super();
|
||||
Struct.fromBuffer(List<int> i,
|
||||
[ExtensionRegistry r = ExtensionRegistry.EMPTY])
|
||||
: super.fromBuffer(i, r);
|
||||
Struct.fromJson(String i, [ExtensionRegistry r = ExtensionRegistry.EMPTY])
|
||||
: super.fromJson(i, r);
|
||||
Struct clone() => new Struct()..mergeFromMessage(this);
|
||||
BuilderInfo get info_ => _i;
|
||||
static Struct create() => new Struct();
|
||||
static PbList<Struct> createRepeated() => new PbList<Struct>();
|
||||
static Struct getDefault() {
|
||||
if (_defaultInstance == null) _defaultInstance = new _ReadonlyStruct();
|
||||
return _defaultInstance;
|
||||
}
|
||||
|
||||
static Struct _defaultInstance;
|
||||
static void $checkItem(Struct v) {
|
||||
if (v is! Struct) checkItemFailed(v, 'Struct');
|
||||
}
|
||||
|
||||
List<Struct_FieldsEntry> get fields => $_getN(0);
|
||||
enum Value_Kind {
|
||||
nullValue,
|
||||
numberValue,
|
||||
stringValue,
|
||||
boolValue,
|
||||
structValue,
|
||||
listValue,
|
||||
notSet
|
||||
}
|
||||
|
||||
class _ReadonlyStruct extends Struct with ReadonlyMessageMixin {}
|
||||
/// `Value` represents a dynamically typed value which can be either
|
||||
/// null, a number, a string, a boolean, a recursive struct value, or a
|
||||
/// list of values. A producer of value is expected to set one of these
|
||||
/// variants. Absence of any variant indicates an error.
|
||||
///
|
||||
/// The JSON representation for `Value` is JSON value.
|
||||
class Value extends $pb.GeneratedMessage with $mixin.ValueMixin {
|
||||
factory Value({
|
||||
NullValue? nullValue,
|
||||
$core.double? numberValue,
|
||||
$core.String? stringValue,
|
||||
$core.bool? boolValue,
|
||||
Struct? structValue,
|
||||
ListValue? listValue,
|
||||
}) {
|
||||
final result = create();
|
||||
if (nullValue != null) {
|
||||
result.nullValue = nullValue;
|
||||
}
|
||||
if (numberValue != null) {
|
||||
result.numberValue = numberValue;
|
||||
}
|
||||
if (stringValue != null) {
|
||||
result.stringValue = stringValue;
|
||||
}
|
||||
if (boolValue != null) {
|
||||
result.boolValue = boolValue;
|
||||
}
|
||||
if (structValue != null) {
|
||||
result.structValue = structValue;
|
||||
}
|
||||
if (listValue != null) {
|
||||
result.listValue = listValue;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
Value._() : super();
|
||||
factory Value.fromBuffer($core.List<$core.int> i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(i, r);
|
||||
factory Value.fromJson($core.String i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(i, r);
|
||||
|
||||
class Value extends GeneratedMessage {
|
||||
static final BuilderInfo _i = new BuilderInfo('Value')
|
||||
..e<NullValue>(1, 'nullValue', PbFieldType.OE, NullValue.NULL_VALUE,
|
||||
NullValue.valueOf, NullValue.values)
|
||||
..a<double>(2, 'numberValue', PbFieldType.OD)
|
||||
..aOS(3, 'stringValue')
|
||||
..aOB(4, 'boolValue')
|
||||
..a<Struct>(
|
||||
5, 'structValue', PbFieldType.OM, Struct.getDefault, Struct.create)
|
||||
..a<ListValue>(
|
||||
6, 'listValue', PbFieldType.OM, ListValue.getDefault, ListValue.create)
|
||||
static const $core.Map<$core.int, Value_Kind> _Value_KindByTag = {
|
||||
1: Value_Kind.nullValue,
|
||||
2: Value_Kind.numberValue,
|
||||
3: Value_Kind.stringValue,
|
||||
4: Value_Kind.boolValue,
|
||||
5: Value_Kind.structValue,
|
||||
6: Value_Kind.listValue,
|
||||
0: Value_Kind.notSet
|
||||
};
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
_omitMessageNames ? '' : 'Value',
|
||||
package:
|
||||
const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'),
|
||||
createEmptyInstance: create,
|
||||
toProto3Json: $mixin.ValueMixin.toProto3JsonHelper,
|
||||
fromProto3Json: $mixin.ValueMixin.fromProto3JsonHelper)
|
||||
..oo(0, [1, 2, 3, 4, 5, 6])
|
||||
..e<NullValue>(1, _omitFieldNames ? '' : 'nullValue', $pb.PbFieldType.OE,
|
||||
defaultOrMaker: NullValue.NULL_VALUE,
|
||||
valueOf: NullValue.valueOf,
|
||||
enumValues: NullValue.values)
|
||||
..a<$core.double>(
|
||||
2, _omitFieldNames ? '' : 'numberValue', $pb.PbFieldType.OD)
|
||||
..aOS(3, _omitFieldNames ? '' : 'stringValue')
|
||||
..aOB(4, _omitFieldNames ? '' : 'boolValue')
|
||||
..aOM<Struct>(5, _omitFieldNames ? '' : 'structValue',
|
||||
subBuilder: Struct.create)
|
||||
..aOM<ListValue>(6, _omitFieldNames ? '' : 'listValue',
|
||||
subBuilder: ListValue.create)
|
||||
..hasRequiredFields = false;
|
||||
|
||||
Value() : super();
|
||||
Value.fromBuffer(List<int> i, [ExtensionRegistry r = ExtensionRegistry.EMPTY])
|
||||
: super.fromBuffer(i, r);
|
||||
Value.fromJson(String i, [ExtensionRegistry r = ExtensionRegistry.EMPTY])
|
||||
: super.fromJson(i, r);
|
||||
Value clone() => new Value()..mergeFromMessage(this);
|
||||
BuilderInfo get info_ => _i;
|
||||
static Value create() => new Value();
|
||||
static PbList<Value> createRepeated() => new PbList<Value>();
|
||||
static Value getDefault() {
|
||||
if (_defaultInstance == null) _defaultInstance = new _ReadonlyValue();
|
||||
return _defaultInstance;
|
||||
}
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
Value clone() => Value()..mergeFromMessage(this);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
Value copyWith(void Function(Value) updates) =>
|
||||
super.copyWith((message) => updates(message as Value)) as Value;
|
||||
|
||||
static Value _defaultInstance;
|
||||
static void $checkItem(Value v) {
|
||||
if (v is! Value) checkItemFailed(v, 'Value');
|
||||
}
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Value create() => Value._();
|
||||
Value createEmptyInstance() => create();
|
||||
static $pb.PbList<Value> createRepeated() => $pb.PbList<Value>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Value getDefault() =>
|
||||
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Value>(create);
|
||||
static Value? _defaultInstance;
|
||||
|
||||
Value_Kind whichKind() => _Value_KindByTag[$_whichOneof(0)]!;
|
||||
void clearKind() => clearField($_whichOneof(0));
|
||||
|
||||
/// Represents a null value.
|
||||
@$pb.TagNumber(1)
|
||||
NullValue get nullValue => $_getN(0);
|
||||
@$pb.TagNumber(1)
|
||||
set nullValue(NullValue v) {
|
||||
setField(1, v);
|
||||
}
|
||||
|
||||
bool hasNullValue() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasNullValue() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearNullValue() => clearField(1);
|
||||
|
||||
double get numberValue => $_getN(1);
|
||||
set numberValue(double v) {
|
||||
/// Represents a double value.
|
||||
@$pb.TagNumber(2)
|
||||
$core.double get numberValue => $_getN(1);
|
||||
@$pb.TagNumber(2)
|
||||
set numberValue($core.double v) {
|
||||
$_setDouble(1, v);
|
||||
}
|
||||
|
||||
bool hasNumberValue() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasNumberValue() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearNumberValue() => clearField(2);
|
||||
|
||||
String get stringValue => $_getS(2, '');
|
||||
set stringValue(String v) {
|
||||
/// Represents a string value.
|
||||
@$pb.TagNumber(3)
|
||||
$core.String get stringValue => $_getSZ(2);
|
||||
@$pb.TagNumber(3)
|
||||
set stringValue($core.String v) {
|
||||
$_setString(2, v);
|
||||
}
|
||||
|
||||
bool hasStringValue() => $_has(2);
|
||||
@$pb.TagNumber(3)
|
||||
$core.bool hasStringValue() => $_has(2);
|
||||
@$pb.TagNumber(3)
|
||||
void clearStringValue() => clearField(3);
|
||||
|
||||
bool get boolValue => $_get(3, false);
|
||||
set boolValue(bool v) {
|
||||
/// Represents a boolean value.
|
||||
@$pb.TagNumber(4)
|
||||
$core.bool get boolValue => $_getBF(3);
|
||||
@$pb.TagNumber(4)
|
||||
set boolValue($core.bool v) {
|
||||
$_setBool(3, v);
|
||||
}
|
||||
|
||||
bool hasBoolValue() => $_has(3);
|
||||
@$pb.TagNumber(4)
|
||||
$core.bool hasBoolValue() => $_has(3);
|
||||
@$pb.TagNumber(4)
|
||||
void clearBoolValue() => clearField(4);
|
||||
|
||||
/// Represents a structured value.
|
||||
@$pb.TagNumber(5)
|
||||
Struct get structValue => $_getN(4);
|
||||
@$pb.TagNumber(5)
|
||||
set structValue(Struct v) {
|
||||
setField(5, v);
|
||||
}
|
||||
|
||||
bool hasStructValue() => $_has(4);
|
||||
@$pb.TagNumber(5)
|
||||
$core.bool hasStructValue() => $_has(4);
|
||||
@$pb.TagNumber(5)
|
||||
void clearStructValue() => clearField(5);
|
||||
@$pb.TagNumber(5)
|
||||
Struct ensureStructValue() => $_ensure(4);
|
||||
|
||||
/// Represents a repeated `Value`.
|
||||
@$pb.TagNumber(6)
|
||||
ListValue get listValue => $_getN(5);
|
||||
@$pb.TagNumber(6)
|
||||
set listValue(ListValue v) {
|
||||
setField(6, v);
|
||||
}
|
||||
|
||||
bool hasListValue() => $_has(5);
|
||||
@$pb.TagNumber(6)
|
||||
$core.bool hasListValue() => $_has(5);
|
||||
@$pb.TagNumber(6)
|
||||
void clearListValue() => clearField(6);
|
||||
@$pb.TagNumber(6)
|
||||
ListValue ensureListValue() => $_ensure(5);
|
||||
}
|
||||
|
||||
class _ReadonlyValue extends Value with ReadonlyMessageMixin {}
|
||||
/// `ListValue` is a wrapper around a repeated field of values.
|
||||
///
|
||||
/// The JSON representation for `ListValue` is JSON array.
|
||||
class ListValue extends $pb.GeneratedMessage with $mixin.ListValueMixin {
|
||||
factory ListValue({
|
||||
$core.Iterable<Value>? values,
|
||||
}) {
|
||||
final result = create();
|
||||
if (values != null) {
|
||||
result.values.addAll(values);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
ListValue._() : super();
|
||||
factory ListValue.fromBuffer($core.List<$core.int> i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(i, r);
|
||||
factory ListValue.fromJson($core.String i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(i, r);
|
||||
|
||||
class ListValue extends GeneratedMessage {
|
||||
static final BuilderInfo _i = new BuilderInfo('ListValue')
|
||||
..pp<Value>(1, 'values', PbFieldType.PM, Value.$checkItem, Value.create)
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
_omitMessageNames ? '' : 'ListValue',
|
||||
package:
|
||||
const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'),
|
||||
createEmptyInstance: create,
|
||||
toProto3Json: $mixin.ListValueMixin.toProto3JsonHelper,
|
||||
fromProto3Json: $mixin.ListValueMixin.fromProto3JsonHelper)
|
||||
..pc<Value>(1, _omitFieldNames ? '' : 'values', $pb.PbFieldType.PM,
|
||||
subBuilder: Value.create)
|
||||
..hasRequiredFields = false;
|
||||
|
||||
ListValue() : super();
|
||||
ListValue.fromBuffer(List<int> i,
|
||||
[ExtensionRegistry r = ExtensionRegistry.EMPTY])
|
||||
: super.fromBuffer(i, r);
|
||||
ListValue.fromJson(String i, [ExtensionRegistry r = ExtensionRegistry.EMPTY])
|
||||
: super.fromJson(i, r);
|
||||
ListValue clone() => new ListValue()..mergeFromMessage(this);
|
||||
BuilderInfo get info_ => _i;
|
||||
static ListValue create() => new ListValue();
|
||||
static PbList<ListValue> createRepeated() => new PbList<ListValue>();
|
||||
static ListValue getDefault() {
|
||||
if (_defaultInstance == null) _defaultInstance = new _ReadonlyListValue();
|
||||
return _defaultInstance;
|
||||
}
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
ListValue clone() => ListValue()..mergeFromMessage(this);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
ListValue copyWith(void Function(ListValue) updates) =>
|
||||
super.copyWith((message) => updates(message as ListValue)) as ListValue;
|
||||
|
||||
static ListValue _defaultInstance;
|
||||
static void $checkItem(ListValue v) {
|
||||
if (v is! ListValue) checkItemFailed(v, 'ListValue');
|
||||
}
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
List<Value> get values => $_getN(0);
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static ListValue create() => ListValue._();
|
||||
ListValue createEmptyInstance() => create();
|
||||
static $pb.PbList<ListValue> createRepeated() => $pb.PbList<ListValue>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static ListValue getDefault() =>
|
||||
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<ListValue>(create);
|
||||
static ListValue? _defaultInstance;
|
||||
|
||||
/// Repeated field of dynamically typed values.
|
||||
@$pb.TagNumber(1)
|
||||
$core.List<Value> get values => $_getList(0);
|
||||
}
|
||||
|
||||
class _ReadonlyListValue extends ListValue with ReadonlyMessageMixin {}
|
||||
const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names');
|
||||
const _omitMessageNames =
|
||||
$core.bool.fromEnvironment('protobuf.omit_message_names');
|
||||
|
|
|
@ -1,25 +1,35 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: google/protobuf/struct.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
/// `NullValue` is a singleton enumeration to represent the null value for the
|
||||
/// `Value` type union.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.protobuf_struct_pbenum;
|
||||
/// The JSON representation for `NullValue` is JSON `null`.
|
||||
class NullValue extends $pb.ProtobufEnum {
|
||||
static const NullValue NULL_VALUE =
|
||||
NullValue._(0, _omitEnumNames ? '' : 'NULL_VALUE');
|
||||
|
||||
// ignore_for_file: UNDEFINED_SHOWN_NAME,UNUSED_SHOWN_NAME
|
||||
import 'dart:core' show int, dynamic, String, List, Map;
|
||||
import 'package:protobuf/protobuf.dart';
|
||||
|
||||
class NullValue extends ProtobufEnum {
|
||||
static const NullValue NULL_VALUE = const NullValue._(0, 'NULL_VALUE');
|
||||
|
||||
static const List<NullValue> values = const <NullValue>[
|
||||
static const $core.List<NullValue> values = <NullValue>[
|
||||
NULL_VALUE,
|
||||
];
|
||||
|
||||
static final Map<int, dynamic> _byValue = ProtobufEnum.initByValue(values);
|
||||
static NullValue valueOf(int value) => _byValue[value] as NullValue;
|
||||
static void $checkItem(NullValue v) {
|
||||
if (v is! NullValue) checkItemFailed(v, 'NullValue');
|
||||
}
|
||||
static final $core.Map<$core.int, NullValue> _byValue =
|
||||
$pb.ProtobufEnum.initByValue(values);
|
||||
static NullValue? valueOf($core.int value) => _byValue[value];
|
||||
|
||||
const NullValue._(int v, String n) : super(v, n);
|
||||
const NullValue._($core.int v, $core.String n) : super(v, n);
|
||||
}
|
||||
|
||||
const _omitEnumNames = $core.bool.fromEnvironment('protobuf.omit_enum_names');
|
||||
|
|
|
@ -1,20 +1,35 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.protobuf_struct_pbjson;
|
||||
// source: google/protobuf/struct.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
const NullValue$json = const {
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:core' as $core;
|
||||
import 'dart:typed_data' as $typed_data;
|
||||
|
||||
@$core.Deprecated('Use nullValueDescriptor instead')
|
||||
const NullValue$json = {
|
||||
'1': 'NullValue',
|
||||
'2': const [
|
||||
const {'1': 'NULL_VALUE', '2': 0},
|
||||
'2': [
|
||||
{'1': 'NULL_VALUE', '2': 0},
|
||||
],
|
||||
};
|
||||
|
||||
const Struct$json = const {
|
||||
/// Descriptor for `NullValue`. Decode as a `google.protobuf.EnumDescriptorProto`.
|
||||
final $typed_data.Uint8List nullValueDescriptor =
|
||||
$convert.base64Decode('CglOdWxsVmFsdWUSDgoKTlVMTF9WQUxVRRAA');
|
||||
|
||||
@$core.Deprecated('Use structDescriptor instead')
|
||||
const Struct$json = {
|
||||
'1': 'Struct',
|
||||
'2': const [
|
||||
const {
|
||||
'2': [
|
||||
{
|
||||
'1': 'fields',
|
||||
'3': 1,
|
||||
'4': 3,
|
||||
|
@ -23,14 +38,15 @@ const Struct$json = const {
|
|||
'10': 'fields'
|
||||
},
|
||||
],
|
||||
'3': const [Struct_FieldsEntry$json],
|
||||
'3': [Struct_FieldsEntry$json],
|
||||
};
|
||||
|
||||
const Struct_FieldsEntry$json = const {
|
||||
@$core.Deprecated('Use structDescriptor instead')
|
||||
const Struct_FieldsEntry$json = {
|
||||
'1': 'FieldsEntry',
|
||||
'2': const [
|
||||
const {'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'},
|
||||
const {
|
||||
'2': [
|
||||
{'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'},
|
||||
{
|
||||
'1': 'value',
|
||||
'3': 2,
|
||||
'4': 1,
|
||||
|
@ -39,13 +55,20 @@ const Struct_FieldsEntry$json = const {
|
|||
'10': 'value'
|
||||
},
|
||||
],
|
||||
'7': const {'7': true},
|
||||
'7': {'7': true},
|
||||
};
|
||||
|
||||
const Value$json = const {
|
||||
/// Descriptor for `Struct`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List structDescriptor = $convert.base64Decode(
|
||||
'CgZTdHJ1Y3QSOwoGZmllbGRzGAEgAygLMiMuZ29vZ2xlLnByb3RvYnVmLlN0cnVjdC5GaWVsZH'
|
||||
'NFbnRyeVIGZmllbGRzGlEKC0ZpZWxkc0VudHJ5EhAKA2tleRgBIAEoCVIDa2V5EiwKBXZhbHVl'
|
||||
'GAIgASgLMhYuZ29vZ2xlLnByb3RvYnVmLlZhbHVlUgV2YWx1ZToCOAE=');
|
||||
|
||||
@$core.Deprecated('Use valueDescriptor instead')
|
||||
const Value$json = {
|
||||
'1': 'Value',
|
||||
'2': const [
|
||||
const {
|
||||
'2': [
|
||||
{
|
||||
'1': 'null_value',
|
||||
'3': 1,
|
||||
'4': 1,
|
||||
|
@ -54,31 +77,10 @@ const Value$json = const {
|
|||
'9': 0,
|
||||
'10': 'nullValue'
|
||||
},
|
||||
const {
|
||||
'1': 'number_value',
|
||||
'3': 2,
|
||||
'4': 1,
|
||||
'5': 1,
|
||||
'9': 0,
|
||||
'10': 'numberValue'
|
||||
},
|
||||
const {
|
||||
'1': 'string_value',
|
||||
'3': 3,
|
||||
'4': 1,
|
||||
'5': 9,
|
||||
'9': 0,
|
||||
'10': 'stringValue'
|
||||
},
|
||||
const {
|
||||
'1': 'bool_value',
|
||||
'3': 4,
|
||||
'4': 1,
|
||||
'5': 8,
|
||||
'9': 0,
|
||||
'10': 'boolValue'
|
||||
},
|
||||
const {
|
||||
{'1': 'number_value', '3': 2, '4': 1, '5': 1, '9': 0, '10': 'numberValue'},
|
||||
{'1': 'string_value', '3': 3, '4': 1, '5': 9, '9': 0, '10': 'stringValue'},
|
||||
{'1': 'bool_value', '3': 4, '4': 1, '5': 8, '9': 0, '10': 'boolValue'},
|
||||
{
|
||||
'1': 'struct_value',
|
||||
'3': 5,
|
||||
'4': 1,
|
||||
|
@ -87,7 +89,7 @@ const Value$json = const {
|
|||
'9': 0,
|
||||
'10': 'structValue'
|
||||
},
|
||||
const {
|
||||
{
|
||||
'1': 'list_value',
|
||||
'3': 6,
|
||||
'4': 1,
|
||||
|
@ -97,15 +99,25 @@ const Value$json = const {
|
|||
'10': 'listValue'
|
||||
},
|
||||
],
|
||||
'8': const [
|
||||
const {'1': 'kind'},
|
||||
'8': [
|
||||
{'1': 'kind'},
|
||||
],
|
||||
};
|
||||
|
||||
const ListValue$json = const {
|
||||
/// Descriptor for `Value`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List valueDescriptor = $convert.base64Decode(
|
||||
'CgVWYWx1ZRI7CgpudWxsX3ZhbHVlGAEgASgOMhouZ29vZ2xlLnByb3RvYnVmLk51bGxWYWx1ZU'
|
||||
'gAUgludWxsVmFsdWUSIwoMbnVtYmVyX3ZhbHVlGAIgASgBSABSC251bWJlclZhbHVlEiMKDHN0'
|
||||
'cmluZ192YWx1ZRgDIAEoCUgAUgtzdHJpbmdWYWx1ZRIfCgpib29sX3ZhbHVlGAQgASgISABSCW'
|
||||
'Jvb2xWYWx1ZRI8CgxzdHJ1Y3RfdmFsdWUYBSABKAsyFy5nb29nbGUucHJvdG9idWYuU3RydWN0'
|
||||
'SABSC3N0cnVjdFZhbHVlEjsKCmxpc3RfdmFsdWUYBiABKAsyGi5nb29nbGUucHJvdG9idWYuTG'
|
||||
'lzdFZhbHVlSABSCWxpc3RWYWx1ZUIGCgRraW5k');
|
||||
|
||||
@$core.Deprecated('Use listValueDescriptor instead')
|
||||
const ListValue$json = {
|
||||
'1': 'ListValue',
|
||||
'2': const [
|
||||
const {
|
||||
'2': [
|
||||
{
|
||||
'1': 'values',
|
||||
'3': 1,
|
||||
'4': 3,
|
||||
|
@ -115,3 +127,8 @@ const ListValue$json = const {
|
|||
},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `ListValue`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List listValueDescriptor = $convert.base64Decode(
|
||||
'CglMaXN0VmFsdWUSLgoGdmFsdWVzGAEgAygLMhYuZ29vZ2xlLnByb3RvYnVmLlZhbHVlUgZ2YW'
|
||||
'x1ZXM=');
|
||||
|
|
|
@ -1,56 +1,204 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: google/protobuf/timestamp.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:fixnum/fixnum.dart' as $fixnum;
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
import 'package:protobuf/src/protobuf/mixins/well_known.dart' as $mixin;
|
||||
|
||||
/// A Timestamp represents a point in time independent of any time zone or local
|
||||
/// calendar, encoded as a count of seconds and fractions of seconds at
|
||||
/// nanosecond resolution. The count is relative to an epoch at UTC midnight on
|
||||
/// January 1, 1970, in the proleptic Gregorian calendar which extends the
|
||||
/// Gregorian calendar backwards to year one.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.protobuf_timestamp;
|
||||
/// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
|
||||
/// second table is needed for interpretation, using a [24-hour linear
|
||||
/// smear](https://developers.google.com/time/smear).
|
||||
///
|
||||
/// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
|
||||
/// restricting to that range, we ensure that we can convert to and from [RFC
|
||||
/// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// Example 1: Compute Timestamp from POSIX `time()`.
|
||||
///
|
||||
/// Timestamp timestamp;
|
||||
/// timestamp.set_seconds(time(NULL));
|
||||
/// timestamp.set_nanos(0);
|
||||
///
|
||||
/// Example 2: Compute Timestamp from POSIX `gettimeofday()`.
|
||||
///
|
||||
/// struct timeval tv;
|
||||
/// gettimeofday(&tv, NULL);
|
||||
///
|
||||
/// Timestamp timestamp;
|
||||
/// timestamp.set_seconds(tv.tv_sec);
|
||||
/// timestamp.set_nanos(tv.tv_usec * 1000);
|
||||
///
|
||||
/// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
|
||||
///
|
||||
/// FILETIME ft;
|
||||
/// GetSystemTimeAsFileTime(&ft);
|
||||
/// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
|
||||
///
|
||||
/// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
|
||||
/// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
|
||||
/// Timestamp timestamp;
|
||||
/// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
|
||||
/// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
|
||||
///
|
||||
/// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
|
||||
///
|
||||
/// long millis = System.currentTimeMillis();
|
||||
///
|
||||
/// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
|
||||
/// .setNanos((int) ((millis % 1000) * 1000000)).build();
|
||||
///
|
||||
/// Example 5: Compute Timestamp from Java `Instant.now()`.
|
||||
///
|
||||
/// Instant now = Instant.now();
|
||||
///
|
||||
/// Timestamp timestamp =
|
||||
/// Timestamp.newBuilder().setSeconds(now.getEpochSecond())
|
||||
/// .setNanos(now.getNano()).build();
|
||||
///
|
||||
/// Example 6: Compute Timestamp from current time in Python.
|
||||
///
|
||||
/// timestamp = Timestamp()
|
||||
/// timestamp.GetCurrentTime()
|
||||
///
|
||||
/// # JSON Mapping
|
||||
///
|
||||
/// In JSON format, the Timestamp type is encoded as a string in the
|
||||
/// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
|
||||
/// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
|
||||
/// where {year} is always expressed using four digits while {month}, {day},
|
||||
/// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
||||
/// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
||||
/// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
||||
/// is required. A proto3 JSON serializer should always use UTC (as indicated by
|
||||
/// "Z") when printing the Timestamp type and a proto3 JSON parser should be
|
||||
/// able to accept both UTC and other timezones (as indicated by an offset).
|
||||
///
|
||||
/// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
||||
/// 01:30 UTC on January 15, 2017.
|
||||
///
|
||||
/// In JavaScript, one can convert a Date object to this format using the
|
||||
/// standard
|
||||
/// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
||||
/// method. In Python, a standard `datetime.datetime` object can be converted
|
||||
/// to this format using
|
||||
/// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
|
||||
/// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
|
||||
/// the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
||||
/// http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
|
||||
/// ) to obtain a formatter capable of generating timestamps in this format.
|
||||
class Timestamp extends $pb.GeneratedMessage with $mixin.TimestampMixin {
|
||||
factory Timestamp({
|
||||
$fixnum.Int64? seconds,
|
||||
$core.int? nanos,
|
||||
}) {
|
||||
final result = create();
|
||||
if (seconds != null) {
|
||||
result.seconds = seconds;
|
||||
}
|
||||
if (nanos != null) {
|
||||
result.nanos = nanos;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
Timestamp._() : super();
|
||||
factory Timestamp.fromBuffer($core.List<$core.int> i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(i, r);
|
||||
factory Timestamp.fromJson($core.String i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(i, r);
|
||||
|
||||
// ignore: UNUSED_SHOWN_NAME
|
||||
import 'dart:core' show int, bool, double, String, List, override;
|
||||
|
||||
import 'package:fixnum/fixnum.dart';
|
||||
import 'package:protobuf/protobuf.dart';
|
||||
|
||||
class Timestamp extends GeneratedMessage {
|
||||
static final BuilderInfo _i = new BuilderInfo('Timestamp')
|
||||
..aInt64(1, 'seconds')
|
||||
..a<int>(2, 'nanos', PbFieldType.O3)
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
_omitMessageNames ? '' : 'Timestamp',
|
||||
package:
|
||||
const $pb.PackageName(_omitMessageNames ? '' : 'google.protobuf'),
|
||||
createEmptyInstance: create,
|
||||
toProto3Json: $mixin.TimestampMixin.toProto3JsonHelper,
|
||||
fromProto3Json: $mixin.TimestampMixin.fromProto3JsonHelper)
|
||||
..aInt64(1, _omitFieldNames ? '' : 'seconds')
|
||||
..a<$core.int>(2, _omitFieldNames ? '' : 'nanos', $pb.PbFieldType.O3)
|
||||
..hasRequiredFields = false;
|
||||
|
||||
Timestamp() : super();
|
||||
Timestamp.fromBuffer(List<int> i,
|
||||
[ExtensionRegistry r = ExtensionRegistry.EMPTY])
|
||||
: super.fromBuffer(i, r);
|
||||
Timestamp.fromJson(String i, [ExtensionRegistry r = ExtensionRegistry.EMPTY])
|
||||
: super.fromJson(i, r);
|
||||
Timestamp clone() => new Timestamp()..mergeFromMessage(this);
|
||||
BuilderInfo get info_ => _i;
|
||||
static Timestamp create() => new Timestamp();
|
||||
static PbList<Timestamp> createRepeated() => new PbList<Timestamp>();
|
||||
static Timestamp getDefault() {
|
||||
if (_defaultInstance == null) _defaultInstance = new _ReadonlyTimestamp();
|
||||
return _defaultInstance;
|
||||
}
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
Timestamp clone() => Timestamp()..mergeFromMessage(this);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
Timestamp copyWith(void Function(Timestamp) updates) =>
|
||||
super.copyWith((message) => updates(message as Timestamp)) as Timestamp;
|
||||
|
||||
static Timestamp _defaultInstance;
|
||||
static void $checkItem(Timestamp v) {
|
||||
if (v is! Timestamp) checkItemFailed(v, 'Timestamp');
|
||||
}
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
Int64 get seconds => $_getI64(0);
|
||||
set seconds(Int64 v) {
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Timestamp create() => Timestamp._();
|
||||
Timestamp createEmptyInstance() => create();
|
||||
static $pb.PbList<Timestamp> createRepeated() => $pb.PbList<Timestamp>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Timestamp getDefault() =>
|
||||
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Timestamp>(create);
|
||||
static Timestamp? _defaultInstance;
|
||||
|
||||
/// Represents seconds of UTC time since Unix epoch
|
||||
/// 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
|
||||
/// 9999-12-31T23:59:59Z inclusive.
|
||||
@$pb.TagNumber(1)
|
||||
$fixnum.Int64 get seconds => $_getI64(0);
|
||||
@$pb.TagNumber(1)
|
||||
set seconds($fixnum.Int64 v) {
|
||||
$_setInt64(0, v);
|
||||
}
|
||||
|
||||
bool hasSeconds() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasSeconds() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearSeconds() => clearField(1);
|
||||
|
||||
int get nanos => $_get(1, 0);
|
||||
set nanos(int v) {
|
||||
$_setUnsignedInt32(1, v);
|
||||
/// Non-negative fractions of a second at nanosecond resolution. Negative
|
||||
/// second values with fractions must still have non-negative nanos values
|
||||
/// that count forward in time. Must be from 0 to 999,999,999
|
||||
/// inclusive.
|
||||
@$pb.TagNumber(2)
|
||||
$core.int get nanos => $_getIZ(1);
|
||||
@$pb.TagNumber(2)
|
||||
set nanos($core.int v) {
|
||||
$_setSignedInt32(1, v);
|
||||
}
|
||||
|
||||
bool hasNanos() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasNanos() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearNanos() => clearField(2);
|
||||
|
||||
/// Creates a new instance from [dateTime].
|
||||
///
|
||||
/// Time zone information will not be preserved.
|
||||
static Timestamp fromDateTime($core.DateTime dateTime) {
|
||||
final result = create();
|
||||
$mixin.TimestampMixin.setFromDateTime(result, dateTime);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
class _ReadonlyTimestamp extends Timestamp with ReadonlyMessageMixin {}
|
||||
const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names');
|
||||
const _omitMessageNames =
|
||||
$core.bool.fromEnvironment('protobuf.omit_message_names');
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.protobuf_timestamp_pbenum;
|
||||
// source: google/protobuf/timestamp.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
|
|
@ -1,13 +1,28 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.protobuf_timestamp_pbjson;
|
||||
// source: google/protobuf/timestamp.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
const Timestamp$json = const {
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:core' as $core;
|
||||
import 'dart:typed_data' as $typed_data;
|
||||
|
||||
@$core.Deprecated('Use timestampDescriptor instead')
|
||||
const Timestamp$json = {
|
||||
'1': 'Timestamp',
|
||||
'2': const [
|
||||
const {'1': 'seconds', '3': 1, '4': 1, '5': 3, '10': 'seconds'},
|
||||
const {'1': 'nanos', '3': 2, '4': 1, '5': 5, '10': 'nanos'},
|
||||
'2': [
|
||||
{'1': 'seconds', '3': 1, '4': 1, '5': 3, '10': 'seconds'},
|
||||
{'1': 'nanos', '3': 2, '4': 1, '5': 5, '10': 'nanos'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `Timestamp`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List timestampDescriptor = $convert.base64Decode(
|
||||
'CglUaW1lc3RhbXASGAoHc2Vjb25kcxgBIAEoA1IHc2Vjb25kcxIUCgVuYW5vcxgCIAEoBVIFbm'
|
||||
'Fub3M=');
|
||||
|
|
|
@ -1,61 +1,120 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: google/rpc/status.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
import '../protobuf/any.pb.dart' as $0;
|
||||
|
||||
/// The `Status` type defines a logical error model that is suitable for
|
||||
/// different programming environments, including REST APIs and RPC APIs. It is
|
||||
/// used by [gRPC](https://github.com/grpc). Each `Status` message contains
|
||||
/// three pieces of data: error code, error message, and error details.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.rpc_status;
|
||||
/// You can find out more about this error model and how to work with it in the
|
||||
/// [API Design Guide](https://cloud.google.com/apis/design/errors).
|
||||
class Status extends $pb.GeneratedMessage {
|
||||
factory Status({
|
||||
$core.int? code,
|
||||
$core.String? message,
|
||||
$core.Iterable<$0.Any>? details,
|
||||
}) {
|
||||
final result = create();
|
||||
if (code != null) {
|
||||
result.code = code;
|
||||
}
|
||||
if (message != null) {
|
||||
result.message = message;
|
||||
}
|
||||
if (details != null) {
|
||||
result.details.addAll(details);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
Status._() : super();
|
||||
factory Status.fromBuffer($core.List<$core.int> i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(i, r);
|
||||
factory Status.fromJson($core.String i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(i, r);
|
||||
|
||||
// ignore: UNUSED_SHOWN_NAME
|
||||
import 'dart:core' show int, bool, double, String, List, override;
|
||||
|
||||
import 'package:protobuf/protobuf.dart';
|
||||
|
||||
import '../protobuf/any.pb.dart' as $google$protobuf;
|
||||
|
||||
class Status extends GeneratedMessage {
|
||||
static final BuilderInfo _i = new BuilderInfo('Status')
|
||||
..a<int>(1, 'code', PbFieldType.O3)
|
||||
..aOS(2, 'message')
|
||||
..pp<$google$protobuf.Any>(3, 'details', PbFieldType.PM,
|
||||
$google$protobuf.Any.$checkItem, $google$protobuf.Any.create)
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
_omitMessageNames ? '' : 'Status',
|
||||
package: const $pb.PackageName(_omitMessageNames ? '' : 'google.rpc'),
|
||||
createEmptyInstance: create)
|
||||
..a<$core.int>(1, _omitFieldNames ? '' : 'code', $pb.PbFieldType.O3)
|
||||
..aOS(2, _omitFieldNames ? '' : 'message')
|
||||
..pc<$0.Any>(3, _omitFieldNames ? '' : 'details', $pb.PbFieldType.PM,
|
||||
subBuilder: $0.Any.create)
|
||||
..hasRequiredFields = false;
|
||||
|
||||
Status() : super();
|
||||
Status.fromBuffer(List<int> i,
|
||||
[ExtensionRegistry r = ExtensionRegistry.EMPTY])
|
||||
: super.fromBuffer(i, r);
|
||||
Status.fromJson(String i, [ExtensionRegistry r = ExtensionRegistry.EMPTY])
|
||||
: super.fromJson(i, r);
|
||||
Status clone() => new Status()..mergeFromMessage(this);
|
||||
BuilderInfo get info_ => _i;
|
||||
static Status create() => new Status();
|
||||
static PbList<Status> createRepeated() => new PbList<Status>();
|
||||
static Status getDefault() {
|
||||
if (_defaultInstance == null) _defaultInstance = new _ReadonlyStatus();
|
||||
return _defaultInstance;
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
Status clone() => Status()..mergeFromMessage(this);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
Status copyWith(void Function(Status) updates) =>
|
||||
super.copyWith((message) => updates(message as Status)) as Status;
|
||||
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Status create() => Status._();
|
||||
Status createEmptyInstance() => create();
|
||||
static $pb.PbList<Status> createRepeated() => $pb.PbList<Status>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Status getDefault() =>
|
||||
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Status>(create);
|
||||
static Status? _defaultInstance;
|
||||
|
||||
/// The status code, which should be an enum value of
|
||||
/// [google.rpc.Code][google.rpc.Code].
|
||||
@$pb.TagNumber(1)
|
||||
$core.int get code => $_getIZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set code($core.int v) {
|
||||
$_setSignedInt32(0, v);
|
||||
}
|
||||
|
||||
static Status _defaultInstance;
|
||||
static void $checkItem(Status v) {
|
||||
if (v is! Status) checkItemFailed(v, 'Status');
|
||||
}
|
||||
|
||||
int get code => $_get(0, 0);
|
||||
set code(int v) {
|
||||
$_setUnsignedInt32(0, v);
|
||||
}
|
||||
|
||||
bool hasCode() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasCode() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearCode() => clearField(1);
|
||||
|
||||
String get message => $_getS(1, '');
|
||||
set message(String v) {
|
||||
/// A developer-facing error message, which should be in English. Any
|
||||
/// user-facing error message should be localized and sent in the
|
||||
/// [google.rpc.Status.details][google.rpc.Status.details] field, or localized
|
||||
/// by the client.
|
||||
@$pb.TagNumber(2)
|
||||
$core.String get message => $_getSZ(1);
|
||||
@$pb.TagNumber(2)
|
||||
set message($core.String v) {
|
||||
$_setString(1, v);
|
||||
}
|
||||
|
||||
bool hasMessage() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasMessage() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearMessage() => clearField(2);
|
||||
|
||||
List<$google$protobuf.Any> get details => $_getN(2);
|
||||
/// A list of messages that carry the error details. There is a common set of
|
||||
/// message types for APIs to use.
|
||||
@$pb.TagNumber(3)
|
||||
$core.List<$0.Any> get details => $_getList(2);
|
||||
}
|
||||
|
||||
class _ReadonlyStatus extends Status with ReadonlyMessageMixin {}
|
||||
const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names');
|
||||
const _omitMessageNames =
|
||||
$core.bool.fromEnvironment('protobuf.omit_message_names');
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.rpc_status_pbenum;
|
||||
// source: google/rpc/status.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
|
|
@ -1,15 +1,25 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library google.rpc_status_pbjson;
|
||||
// source: google/rpc/status.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
const Status$json = const {
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:core' as $core;
|
||||
import 'dart:typed_data' as $typed_data;
|
||||
|
||||
@$core.Deprecated('Use statusDescriptor instead')
|
||||
const Status$json = {
|
||||
'1': 'Status',
|
||||
'2': const [
|
||||
const {'1': 'code', '3': 1, '4': 1, '5': 5, '10': 'code'},
|
||||
const {'1': 'message', '3': 2, '4': 1, '5': 9, '10': 'message'},
|
||||
const {
|
||||
'2': [
|
||||
{'1': 'code', '3': 1, '4': 1, '5': 5, '10': 'code'},
|
||||
{'1': 'message', '3': 2, '4': 1, '5': 9, '10': 'message'},
|
||||
{
|
||||
'1': 'details',
|
||||
'3': 3,
|
||||
'4': 3,
|
||||
|
@ -19,3 +29,8 @@ const Status$json = const {
|
|||
},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `Status`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List statusDescriptor = $convert.base64Decode(
|
||||
'CgZTdGF0dXMSEgoEY29kZRgBIAEoBVIEY29kZRIYCgdtZXNzYWdlGAIgASgJUgdtZXNzYWdlEi'
|
||||
'4KB2RldGFpbHMYAyADKAsyFC5nb29nbGUucHJvdG9idWYuQW55UgdkZXRhaWxz');
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
name: googleapis
|
||||
description: Dart gRPC client sample for Google APIs
|
||||
version: 0.0.1
|
||||
homepage: https://github.com/dart-lang/grpc-dart
|
||||
publish_to: none
|
||||
|
||||
environment:
|
||||
sdk: '>=1.24.3 <2.0.0'
|
||||
sdk: ^3.8.0
|
||||
|
||||
dependencies:
|
||||
async: ^1.13.3
|
||||
googleapis_auth: ^0.2.3+6
|
||||
async: ^2.13.0
|
||||
fixnum: ^1.1.1
|
||||
grpc:
|
||||
path: ../../
|
||||
protobuf: ^0.7.0
|
||||
protobuf: ^4.1.0
|
||||
|
||||
dev_dependencies:
|
||||
test: ^0.12.0
|
||||
lints: ^6.0.0
|
||||
test: ^1.26.2
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
if [ ! -d "$PROTOBUF" ]; then
|
||||
echo "Please set the PROTOBUF environment variable to your clone of google/protobuf."
|
||||
echo "Please set the PROTOBUF environment variable to your clone of protocolbuffers/protobuf."
|
||||
exit -1
|
||||
fi
|
||||
|
||||
|
@ -19,6 +19,7 @@ $PROTOC $GOOGLEAPIS/google/logging/type/http_request.proto
|
|||
|
||||
$PROTOC $GOOGLEAPIS/google/api/monitored_resource.proto
|
||||
$PROTOC $GOOGLEAPIS/google/api/label.proto
|
||||
$PROTOC $GOOGLEAPIS/google/api/launch_stage.proto
|
||||
|
||||
$PROTOC $GOOGLEAPIS/google/rpc/status.proto
|
||||
|
||||
|
@ -28,4 +29,4 @@ $PROTOC $PROTOBUF/src/google/protobuf/empty.proto
|
|||
$PROTOC $PROTOBUF/src/google/protobuf/struct.proto
|
||||
$PROTOC $PROTOBUF/src/google/protobuf/timestamp.proto
|
||||
|
||||
dartfmt -w lib/src/generated
|
||||
dart format lib/src/generated
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
# Description
|
||||
The grpc-web example shows how to use the Dart gRPC library with a gRPC-Web capable server.
|
||||
|
||||
This is meant to be used with the echo example provided by the grpc-web repository. The definition of the service is given in echo.proto.
|
||||
|
||||
# Prerequisites
|
||||
|
||||
Install 'webdev', by running
|
||||
|
||||
```sh
|
||||
$ dart pub global activate webdev
|
||||
```
|
||||
|
||||
You will need a clone of the [grpc-web](https://github.com/grpc/grpc-web) repository to run the example server.
|
||||
|
||||
# Run the sample code
|
||||
Follow the instructions for starting the grpc-web example server. The simplest version of this involves running the grpc-web server in a docker container with:
|
||||
|
||||
```sh
|
||||
$ docker-compose up node-server envoy commonjs-client
|
||||
```
|
||||
|
||||
To compile and run the example, assuming you are in the root of the grpc-web
|
||||
folder, i.e., .../example/grpc-web/, first get the dependencies by running:
|
||||
|
||||
```sh
|
||||
$ dart pub get
|
||||
```
|
||||
|
||||
Compile and run the website with:
|
||||
|
||||
```sh
|
||||
$ webdev serve web:9000
|
||||
```
|
||||
|
||||
Note that the alternate port (9000) is necessary because the grpc-web server runs the grpc server on port 8080 by default (the same as webdev).
|
||||
|
||||
You can then navigate to http://localhost:9000/ to try out the example.
|
||||
|
||||
# Regenerate the stubs
|
||||
|
||||
If you have made changes to the message or service definition in
|
||||
`protos/echo.proto` and need to regenerate the corresponding Dart files,
|
||||
you will need to have protoc version 3.0.0 or higher and the Dart protoc plugin
|
||||
version 16.0.0 or higher on your PATH.
|
||||
|
||||
To install protoc, see the instructions on
|
||||
[the Protocol Buffers website](https://developers.google.com/protocol-buffers/).
|
||||
|
||||
The easiest way to get the Dart protoc plugin is by running
|
||||
|
||||
```sh
|
||||
$ dart pub global activate protoc_plugin
|
||||
```
|
||||
|
||||
and follow the directions to add `~/.pub-cache/bin` to your PATH, if you haven't
|
||||
already done so.
|
||||
|
||||
You can now regenerate the Dart files by running
|
||||
|
||||
```sh
|
||||
$ protoc --dart_out=grpc:lib/src/generated -Iprotos protos/echo.proto
|
||||
```
|
|
@ -0,0 +1 @@
|
|||
include: package:lints/recommended.yaml
|
|
@ -0,0 +1,90 @@
|
|||
// Copyright (c) 2024, the gRPC project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import 'dart:async';
|
||||
import 'package:web/web.dart';
|
||||
import 'src/generated/echo.pbgrpc.dart';
|
||||
|
||||
class EchoApp {
|
||||
final EchoServiceClient _service;
|
||||
|
||||
EchoApp(this._service);
|
||||
|
||||
Future<void> echo(String message) async {
|
||||
_addLeftMessage(message);
|
||||
|
||||
try {
|
||||
final response = await _service.echo(EchoRequest()..message = message);
|
||||
_addRightMessage(response.message);
|
||||
} catch (error) {
|
||||
_addRightMessage(error.toString());
|
||||
}
|
||||
}
|
||||
|
||||
void repeatEcho(String message, int count) {
|
||||
_addLeftMessage(message);
|
||||
final request = ServerStreamingEchoRequest()
|
||||
..message = message
|
||||
..messageCount = count
|
||||
..messageInterval = 500;
|
||||
_service
|
||||
.serverStreamingEcho(request)
|
||||
.listen(
|
||||
(response) {
|
||||
_addRightMessage(response.message);
|
||||
},
|
||||
onError: (error) {
|
||||
_addRightMessage(error.toString());
|
||||
},
|
||||
onDone: () => print('Closed connection to server.'),
|
||||
);
|
||||
}
|
||||
|
||||
void _addLeftMessage(String message) {
|
||||
_addMessage(message, 'label-primary pull-left');
|
||||
}
|
||||
|
||||
void _addRightMessage(String message) {
|
||||
_addMessage(message, 'label-default pull-right');
|
||||
}
|
||||
|
||||
void _addMessage(String message, String cssClass) {
|
||||
document
|
||||
.querySelector('#first')!
|
||||
.after(
|
||||
HTMLDivElement()
|
||||
..classList.add('row')
|
||||
..append(
|
||||
HTMLHeadingElement.h2()..append(
|
||||
HTMLSpanElement()
|
||||
..classList.add('label')
|
||||
..classList.addAll(cssClass)
|
||||
..textContent = message,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// The documentation of DOMTokenList.add implies it can handle multiple classes,
|
||||
// but in Chrome at least it does not.
|
||||
extension AddAll on DOMTokenList {
|
||||
void addAll(String cssClass) {
|
||||
final classes = cssClass.split(' ');
|
||||
for (final c in classes) {
|
||||
add(c);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,307 @@
|
|||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: echo.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
class EchoRequest extends $pb.GeneratedMessage {
|
||||
factory EchoRequest({
|
||||
$core.String? message,
|
||||
}) {
|
||||
final result = create();
|
||||
if (message != null) {
|
||||
result.message = message;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
EchoRequest._() : super();
|
||||
factory EchoRequest.fromBuffer($core.List<$core.int> i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(i, r);
|
||||
factory EchoRequest.fromJson($core.String i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(i, r);
|
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
_omitMessageNames ? '' : 'EchoRequest',
|
||||
package: const $pb.PackageName(
|
||||
_omitMessageNames ? '' : 'grpc.gateway.testing'),
|
||||
createEmptyInstance: create)
|
||||
..aOS(1, _omitFieldNames ? '' : 'message')
|
||||
..hasRequiredFields = false;
|
||||
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
EchoRequest clone() => EchoRequest()..mergeFromMessage(this);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
EchoRequest copyWith(void Function(EchoRequest) updates) =>
|
||||
super.copyWith((message) => updates(message as EchoRequest))
|
||||
as EchoRequest;
|
||||
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static EchoRequest create() => EchoRequest._();
|
||||
EchoRequest createEmptyInstance() => create();
|
||||
static $pb.PbList<EchoRequest> createRepeated() => $pb.PbList<EchoRequest>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static EchoRequest getDefault() => _defaultInstance ??=
|
||||
$pb.GeneratedMessage.$_defaultFor<EchoRequest>(create);
|
||||
static EchoRequest? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get message => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set message($core.String v) {
|
||||
$_setString(0, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasMessage() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearMessage() => clearField(1);
|
||||
}
|
||||
|
||||
class EchoResponse extends $pb.GeneratedMessage {
|
||||
factory EchoResponse({
|
||||
$core.String? message,
|
||||
}) {
|
||||
final result = create();
|
||||
if (message != null) {
|
||||
result.message = message;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
EchoResponse._() : super();
|
||||
factory EchoResponse.fromBuffer($core.List<$core.int> i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(i, r);
|
||||
factory EchoResponse.fromJson($core.String i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(i, r);
|
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
_omitMessageNames ? '' : 'EchoResponse',
|
||||
package: const $pb.PackageName(
|
||||
_omitMessageNames ? '' : 'grpc.gateway.testing'),
|
||||
createEmptyInstance: create)
|
||||
..aOS(1, _omitFieldNames ? '' : 'message')
|
||||
..hasRequiredFields = false;
|
||||
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
EchoResponse clone() => EchoResponse()..mergeFromMessage(this);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
EchoResponse copyWith(void Function(EchoResponse) updates) =>
|
||||
super.copyWith((message) => updates(message as EchoResponse))
|
||||
as EchoResponse;
|
||||
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static EchoResponse create() => EchoResponse._();
|
||||
EchoResponse createEmptyInstance() => create();
|
||||
static $pb.PbList<EchoResponse> createRepeated() =>
|
||||
$pb.PbList<EchoResponse>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static EchoResponse getDefault() => _defaultInstance ??=
|
||||
$pb.GeneratedMessage.$_defaultFor<EchoResponse>(create);
|
||||
static EchoResponse? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get message => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set message($core.String v) {
|
||||
$_setString(0, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasMessage() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearMessage() => clearField(1);
|
||||
}
|
||||
|
||||
class ServerStreamingEchoRequest extends $pb.GeneratedMessage {
|
||||
factory ServerStreamingEchoRequest({
|
||||
$core.String? message,
|
||||
$core.int? messageCount,
|
||||
$core.int? messageInterval,
|
||||
}) {
|
||||
final result = create();
|
||||
if (message != null) {
|
||||
result.message = message;
|
||||
}
|
||||
if (messageCount != null) {
|
||||
result.messageCount = messageCount;
|
||||
}
|
||||
if (messageInterval != null) {
|
||||
result.messageInterval = messageInterval;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
ServerStreamingEchoRequest._() : super();
|
||||
factory ServerStreamingEchoRequest.fromBuffer($core.List<$core.int> i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(i, r);
|
||||
factory ServerStreamingEchoRequest.fromJson($core.String i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(i, r);
|
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
_omitMessageNames ? '' : 'ServerStreamingEchoRequest',
|
||||
package: const $pb.PackageName(
|
||||
_omitMessageNames ? '' : 'grpc.gateway.testing'),
|
||||
createEmptyInstance: create)
|
||||
..aOS(1, _omitFieldNames ? '' : 'message')
|
||||
..a<$core.int>(2, _omitFieldNames ? '' : 'messageCount', $pb.PbFieldType.O3)
|
||||
..a<$core.int>(
|
||||
3, _omitFieldNames ? '' : 'messageInterval', $pb.PbFieldType.O3)
|
||||
..hasRequiredFields = false;
|
||||
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
ServerStreamingEchoRequest clone() =>
|
||||
ServerStreamingEchoRequest()..mergeFromMessage(this);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
ServerStreamingEchoRequest copyWith(
|
||||
void Function(ServerStreamingEchoRequest) updates) =>
|
||||
super.copyWith(
|
||||
(message) => updates(message as ServerStreamingEchoRequest))
|
||||
as ServerStreamingEchoRequest;
|
||||
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static ServerStreamingEchoRequest create() => ServerStreamingEchoRequest._();
|
||||
ServerStreamingEchoRequest createEmptyInstance() => create();
|
||||
static $pb.PbList<ServerStreamingEchoRequest> createRepeated() =>
|
||||
$pb.PbList<ServerStreamingEchoRequest>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static ServerStreamingEchoRequest getDefault() => _defaultInstance ??=
|
||||
$pb.GeneratedMessage.$_defaultFor<ServerStreamingEchoRequest>(create);
|
||||
static ServerStreamingEchoRequest? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get message => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set message($core.String v) {
|
||||
$_setString(0, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasMessage() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearMessage() => clearField(1);
|
||||
|
||||
@$pb.TagNumber(2)
|
||||
$core.int get messageCount => $_getIZ(1);
|
||||
@$pb.TagNumber(2)
|
||||
set messageCount($core.int v) {
|
||||
$_setSignedInt32(1, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasMessageCount() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearMessageCount() => clearField(2);
|
||||
|
||||
@$pb.TagNumber(3)
|
||||
$core.int get messageInterval => $_getIZ(2);
|
||||
@$pb.TagNumber(3)
|
||||
set messageInterval($core.int v) {
|
||||
$_setSignedInt32(2, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(3)
|
||||
$core.bool hasMessageInterval() => $_has(2);
|
||||
@$pb.TagNumber(3)
|
||||
void clearMessageInterval() => clearField(3);
|
||||
}
|
||||
|
||||
class ServerStreamingEchoResponse extends $pb.GeneratedMessage {
|
||||
factory ServerStreamingEchoResponse({
|
||||
$core.String? message,
|
||||
}) {
|
||||
final result = create();
|
||||
if (message != null) {
|
||||
result.message = message;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
ServerStreamingEchoResponse._() : super();
|
||||
factory ServerStreamingEchoResponse.fromBuffer($core.List<$core.int> i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(i, r);
|
||||
factory ServerStreamingEchoResponse.fromJson($core.String i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(i, r);
|
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
_omitMessageNames ? '' : 'ServerStreamingEchoResponse',
|
||||
package: const $pb.PackageName(
|
||||
_omitMessageNames ? '' : 'grpc.gateway.testing'),
|
||||
createEmptyInstance: create)
|
||||
..aOS(1, _omitFieldNames ? '' : 'message')
|
||||
..hasRequiredFields = false;
|
||||
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
ServerStreamingEchoResponse clone() =>
|
||||
ServerStreamingEchoResponse()..mergeFromMessage(this);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
ServerStreamingEchoResponse copyWith(
|
||||
void Function(ServerStreamingEchoResponse) updates) =>
|
||||
super.copyWith(
|
||||
(message) => updates(message as ServerStreamingEchoResponse))
|
||||
as ServerStreamingEchoResponse;
|
||||
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static ServerStreamingEchoResponse create() =>
|
||||
ServerStreamingEchoResponse._();
|
||||
ServerStreamingEchoResponse createEmptyInstance() => create();
|
||||
static $pb.PbList<ServerStreamingEchoResponse> createRepeated() =>
|
||||
$pb.PbList<ServerStreamingEchoResponse>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static ServerStreamingEchoResponse getDefault() => _defaultInstance ??=
|
||||
$pb.GeneratedMessage.$_defaultFor<ServerStreamingEchoResponse>(create);
|
||||
static ServerStreamingEchoResponse? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get message => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set message($core.String v) {
|
||||
$_setString(0, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasMessage() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearMessage() => clearField(1);
|
||||
}
|
||||
|
||||
const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names');
|
||||
const _omitMessageNames =
|
||||
$core.bool.fromEnvironment('protobuf.omit_message_names');
|
|
@ -0,0 +1,10 @@
|
|||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: echo.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
|
@ -0,0 +1,92 @@
|
|||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: echo.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:async' as $async;
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:grpc/service_api.dart' as $grpc;
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
import 'echo.pb.dart' as $0;
|
||||
|
||||
export 'echo.pb.dart';
|
||||
|
||||
@$pb.GrpcServiceName('grpc.gateway.testing.EchoService')
|
||||
class EchoServiceClient extends $grpc.Client {
|
||||
static final _$echo = $grpc.ClientMethod<$0.EchoRequest, $0.EchoResponse>(
|
||||
'/grpc.gateway.testing.EchoService/Echo',
|
||||
($0.EchoRequest value) => value.writeToBuffer(),
|
||||
($core.List<$core.int> value) => $0.EchoResponse.fromBuffer(value));
|
||||
static final _$serverStreamingEcho = $grpc.ClientMethod<
|
||||
$0.ServerStreamingEchoRequest, $0.ServerStreamingEchoResponse>(
|
||||
'/grpc.gateway.testing.EchoService/ServerStreamingEcho',
|
||||
($0.ServerStreamingEchoRequest value) => value.writeToBuffer(),
|
||||
($core.List<$core.int> value) =>
|
||||
$0.ServerStreamingEchoResponse.fromBuffer(value));
|
||||
|
||||
EchoServiceClient($grpc.ClientChannel channel,
|
||||
{$grpc.CallOptions? options,
|
||||
$core.Iterable<$grpc.ClientInterceptor>? interceptors})
|
||||
: super(channel, options: options, interceptors: interceptors);
|
||||
|
||||
$grpc.ResponseFuture<$0.EchoResponse> echo($0.EchoRequest request,
|
||||
{$grpc.CallOptions? options}) {
|
||||
return $createUnaryCall(_$echo, request, options: options);
|
||||
}
|
||||
|
||||
$grpc.ResponseStream<$0.ServerStreamingEchoResponse> serverStreamingEcho(
|
||||
$0.ServerStreamingEchoRequest request,
|
||||
{$grpc.CallOptions? options}) {
|
||||
return $createStreamingCall(
|
||||
_$serverStreamingEcho, $async.Stream.fromIterable([request]),
|
||||
options: options);
|
||||
}
|
||||
}
|
||||
|
||||
@$pb.GrpcServiceName('grpc.gateway.testing.EchoService')
|
||||
abstract class EchoServiceBase extends $grpc.Service {
|
||||
$core.String get $name => 'grpc.gateway.testing.EchoService';
|
||||
|
||||
EchoServiceBase() {
|
||||
$addMethod($grpc.ServiceMethod<$0.EchoRequest, $0.EchoResponse>(
|
||||
'Echo',
|
||||
echo_Pre,
|
||||
false,
|
||||
false,
|
||||
($core.List<$core.int> value) => $0.EchoRequest.fromBuffer(value),
|
||||
($0.EchoResponse value) => value.writeToBuffer()));
|
||||
$addMethod($grpc.ServiceMethod<$0.ServerStreamingEchoRequest,
|
||||
$0.ServerStreamingEchoResponse>(
|
||||
'ServerStreamingEcho',
|
||||
serverStreamingEcho_Pre,
|
||||
false,
|
||||
true,
|
||||
($core.List<$core.int> value) =>
|
||||
$0.ServerStreamingEchoRequest.fromBuffer(value),
|
||||
($0.ServerStreamingEchoResponse value) => value.writeToBuffer()));
|
||||
}
|
||||
|
||||
$async.Future<$0.EchoResponse> echo_Pre(
|
||||
$grpc.ServiceCall call, $async.Future<$0.EchoRequest> request) async {
|
||||
return echo(call, await request);
|
||||
}
|
||||
|
||||
$async.Stream<$0.ServerStreamingEchoResponse> serverStreamingEcho_Pre(
|
||||
$grpc.ServiceCall call,
|
||||
$async.Future<$0.ServerStreamingEchoRequest> request) async* {
|
||||
yield* serverStreamingEcho(call, await request);
|
||||
}
|
||||
|
||||
$async.Future<$0.EchoResponse> echo(
|
||||
$grpc.ServiceCall call, $0.EchoRequest request);
|
||||
$async.Stream<$0.ServerStreamingEchoResponse> serverStreamingEcho(
|
||||
$grpc.ServiceCall call, $0.ServerStreamingEchoRequest request);
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: echo.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:core' as $core;
|
||||
import 'dart:typed_data' as $typed_data;
|
||||
|
||||
@$core.Deprecated('Use echoRequestDescriptor instead')
|
||||
const EchoRequest$json = {
|
||||
'1': 'EchoRequest',
|
||||
'2': [
|
||||
{'1': 'message', '3': 1, '4': 1, '5': 9, '10': 'message'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `EchoRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List echoRequestDescriptor = $convert
|
||||
.base64Decode('CgtFY2hvUmVxdWVzdBIYCgdtZXNzYWdlGAEgASgJUgdtZXNzYWdl');
|
||||
|
||||
@$core.Deprecated('Use echoResponseDescriptor instead')
|
||||
const EchoResponse$json = {
|
||||
'1': 'EchoResponse',
|
||||
'2': [
|
||||
{'1': 'message', '3': 1, '4': 1, '5': 9, '10': 'message'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `EchoResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List echoResponseDescriptor = $convert
|
||||
.base64Decode('CgxFY2hvUmVzcG9uc2USGAoHbWVzc2FnZRgBIAEoCVIHbWVzc2FnZQ==');
|
||||
|
||||
@$core.Deprecated('Use serverStreamingEchoRequestDescriptor instead')
|
||||
const ServerStreamingEchoRequest$json = {
|
||||
'1': 'ServerStreamingEchoRequest',
|
||||
'2': [
|
||||
{'1': 'message', '3': 1, '4': 1, '5': 9, '10': 'message'},
|
||||
{'1': 'message_count', '3': 2, '4': 1, '5': 5, '10': 'messageCount'},
|
||||
{'1': 'message_interval', '3': 3, '4': 1, '5': 5, '10': 'messageInterval'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `ServerStreamingEchoRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List serverStreamingEchoRequestDescriptor =
|
||||
$convert.base64Decode(
|
||||
'ChpTZXJ2ZXJTdHJlYW1pbmdFY2hvUmVxdWVzdBIYCgdtZXNzYWdlGAEgASgJUgdtZXNzYWdlEi'
|
||||
'MKDW1lc3NhZ2VfY291bnQYAiABKAVSDG1lc3NhZ2VDb3VudBIpChBtZXNzYWdlX2ludGVydmFs'
|
||||
'GAMgASgFUg9tZXNzYWdlSW50ZXJ2YWw=');
|
||||
|
||||
@$core.Deprecated('Use serverStreamingEchoResponseDescriptor instead')
|
||||
const ServerStreamingEchoResponse$json = {
|
||||
'1': 'ServerStreamingEchoResponse',
|
||||
'2': [
|
||||
{'1': 'message', '3': 1, '4': 1, '5': 9, '10': 'message'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `ServerStreamingEchoResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List serverStreamingEchoResponseDescriptor =
|
||||
$convert.base64Decode(
|
||||
'ChtTZXJ2ZXJTdHJlYW1pbmdFY2hvUmVzcG9uc2USGAoHbWVzc2FnZRgBIAEoCVIHbWVzc2FnZQ'
|
||||
'==');
|
|
@ -0,0 +1,41 @@
|
|||
// Copyright 2018 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
package grpc.gateway.testing;
|
||||
|
||||
message EchoRequest {
|
||||
string message = 1;
|
||||
}
|
||||
|
||||
message EchoResponse {
|
||||
string message = 1;
|
||||
}
|
||||
|
||||
message ServerStreamingEchoRequest {
|
||||
string message = 1;
|
||||
int32 message_count = 2;
|
||||
int32 message_interval = 3;
|
||||
}
|
||||
|
||||
message ServerStreamingEchoResponse {
|
||||
string message = 1;
|
||||
}
|
||||
|
||||
service EchoService {
|
||||
rpc Echo(EchoRequest) returns (EchoResponse);
|
||||
rpc ServerStreamingEcho(ServerStreamingEchoRequest)
|
||||
returns (stream ServerStreamingEchoResponse);
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
name: grpc_web
|
||||
description: Dart gRPC-Web sample client
|
||||
publish_to: none
|
||||
|
||||
environment:
|
||||
sdk: ^3.8.0
|
||||
|
||||
dependencies:
|
||||
grpc:
|
||||
path: ../../
|
||||
protobuf: ^4.1.0
|
||||
web: ^1.1.1
|
||||
|
||||
dev_dependencies:
|
||||
build_runner: ^2.4.15
|
||||
build_web_compilers: ^4.1.5
|
||||
lints: ^6.0.0
|
|
@ -0,0 +1,42 @@
|
|||
<!--
|
||||
Copyright (c) 2018, the gRPC project authors. Please see the AUTHORS file
|
||||
for details. All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Echo Example</title>
|
||||
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
|
||||
<script defer src="main.dart.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="row" id="first">
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" id="msg">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-primary" type="button" id="send">Send
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
<p class="help-block">Example: "Hello", "4 Hello"</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,46 @@
|
|||
// Copyright (c) 2018, the gRPC project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
import 'package:grpc/grpc_web.dart';
|
||||
import 'package:grpc_web/app.dart';
|
||||
import 'package:grpc_web/src/generated/echo.pbgrpc.dart';
|
||||
import 'package:web/web.dart';
|
||||
|
||||
void main() {
|
||||
final channel = GrpcWebClientChannel.xhr(Uri.parse('http://localhost:8080'));
|
||||
final service = EchoServiceClient(channel);
|
||||
final app = EchoApp(service);
|
||||
|
||||
final button = document.querySelector('#send') as HTMLButtonElement;
|
||||
button.onClick.listen((e) async {
|
||||
final msg = document.querySelector('#msg') as HTMLInputElement;
|
||||
final value = msg.value.trim();
|
||||
msg.value = '';
|
||||
|
||||
if (value.isEmpty) return;
|
||||
|
||||
if (value.indexOf(' ') > 0) {
|
||||
final countStr = value.substring(0, value.indexOf(' '));
|
||||
final count = int.tryParse(countStr);
|
||||
|
||||
if (count != null) {
|
||||
app.repeatEcho(value.substring(value.indexOf(' ') + 1), count);
|
||||
} else {
|
||||
app.echo(value);
|
||||
}
|
||||
} else {
|
||||
app.echo(value);
|
||||
}
|
||||
});
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
# Description
|
||||
The hello world server and client demonstrate how to use Dart gRPC libraries to
|
||||
perform unary RPCs.
|
||||
|
||||
See the definition of the hello world service in `protos/helloworld.proto`.
|
||||
|
||||
# Run the sample code
|
||||
To compile and run the example, assuming you are in the root of the helloworld
|
||||
folder, i.e., .../example/helloworld/, first get the dependencies by running:
|
||||
|
||||
```sh
|
||||
$ dart pub get
|
||||
```
|
||||
## Run TCP sample code
|
||||
|
||||
Start the server:
|
||||
|
||||
```sh
|
||||
$ dart bin/server.dart
|
||||
```
|
||||
|
||||
Likewise, to run the client:
|
||||
|
||||
```sh
|
||||
$ dart bin/client.dart
|
||||
```
|
||||
## Run UDS sample code
|
||||
|
||||
Start the server:
|
||||
|
||||
```sh
|
||||
$ dart bin/unix_server.dart
|
||||
```
|
||||
|
||||
Likewise, to run the client:
|
||||
|
||||
```sh
|
||||
$ dart bin/unix_client.dart
|
||||
```
|
||||
|
||||
>**Note** the `UDS` only support *nix plantform.
|
||||
|
||||
# Regenerate the stubs
|
||||
|
||||
If you have made changes to the message or service definition in
|
||||
`protos/helloworld.proto` and need to regenerate the corresponding Dart files,
|
||||
you will need to have protoc version 3.0.0 or higher and the Dart protoc plugin
|
||||
version 0.7.9 or higher on your PATH.
|
||||
|
||||
To install protoc, see the instructions on
|
||||
[the Protocol Buffers website](https://developers.google.com/protocol-buffers/).
|
||||
|
||||
The easiest way to get the Dart protoc plugin is by running
|
||||
|
||||
```sh
|
||||
$ pub global activate protoc_plugin
|
||||
```
|
||||
|
||||
and follow the directions to add `~/.pub-cache/bin` to your PATH, if you haven't
|
||||
already done so.
|
||||
|
||||
You can now regenerate the Dart files by running
|
||||
|
||||
```sh
|
||||
$ protoc --dart_out=grpc:lib/src/generated -Iprotos protos/helloworld.proto
|
||||
```
|
|
@ -0,0 +1 @@
|
|||
include: package:lints/recommended.yaml
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright (c) 2018, the gRPC project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import 'package:grpc/grpc.dart';
|
||||
import 'package:helloworld/src/generated/helloworld.pbgrpc.dart';
|
||||
|
||||
/// Dart implementation of the gRPC helloworld.Greeter client.
|
||||
Future<void> main(List<String> args) async {
|
||||
final channel = ClientChannel(
|
||||
'localhost',
|
||||
port: 50051,
|
||||
options: ChannelOptions(
|
||||
credentials: ChannelCredentials.insecure(),
|
||||
codecRegistry: CodecRegistry(
|
||||
codecs: const [GzipCodec(), IdentityCodec()],
|
||||
),
|
||||
),
|
||||
);
|
||||
final stub = GreeterClient(channel);
|
||||
|
||||
final name = args.isNotEmpty ? args[0] : 'world';
|
||||
|
||||
try {
|
||||
final response = await stub.sayHello(
|
||||
HelloRequest()..name = name,
|
||||
options: CallOptions(compression: const GzipCodec()),
|
||||
);
|
||||
print('Greeter client received: ${response.message}');
|
||||
} catch (e) {
|
||||
print('Caught error: $e');
|
||||
}
|
||||
await channel.shutdown();
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
// Copyright (c) 2018, the gRPC project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import 'package:grpc/grpc.dart';
|
||||
import 'package:helloworld/src/generated/helloworld.pbgrpc.dart';
|
||||
|
||||
/// Dart implementation of the gRPC helloworld.Greeter server.
|
||||
class GreeterService extends GreeterServiceBase {
|
||||
@override
|
||||
Future<HelloReply> sayHello(ServiceCall call, HelloRequest request) async {
|
||||
return HelloReply()..message = 'Hello, ${request.name}!';
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> main(List<String> args) async {
|
||||
final server = Server.create(
|
||||
services: [GreeterService()],
|
||||
codecRegistry: CodecRegistry(codecs: const [GzipCodec(), IdentityCodec()]),
|
||||
);
|
||||
await server.serve(port: 50051);
|
||||
print('Server listening on port ${server.port}...');
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
// Copyright (c) 2020, the gRPC project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:grpc/grpc.dart';
|
||||
import 'package:helloworld/src/generated/helloworld.pbgrpc.dart';
|
||||
|
||||
/// Dart implementation of the gRPC helloworld.Greeter client.
|
||||
Future<void> main(List<String> args) async {
|
||||
final udsAddress = InternetAddress(
|
||||
'localhost',
|
||||
type: InternetAddressType.unix,
|
||||
);
|
||||
final channel = ClientChannel(
|
||||
udsAddress,
|
||||
port: 0,
|
||||
options: const ChannelOptions(credentials: ChannelCredentials.insecure()),
|
||||
);
|
||||
final stub = GreeterClient(channel);
|
||||
|
||||
final name = args.isNotEmpty ? args[0] : 'world';
|
||||
|
||||
try {
|
||||
final response = await stub.sayHello(HelloRequest()..name = name);
|
||||
print('Greeter client received: ${response.message}');
|
||||
} catch (e) {
|
||||
print('Caught error: $e');
|
||||
}
|
||||
await channel.shutdown();
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
// Copyright (c) 2020, the gRPC project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:grpc/grpc.dart';
|
||||
import 'package:helloworld/src/generated/helloworld.pbgrpc.dart';
|
||||
|
||||
/// Dart implementation of the gRPC helloworld.Greeter server.
|
||||
class GreeterService extends GreeterServiceBase {
|
||||
@override
|
||||
Future<HelloReply> sayHello(ServiceCall call, HelloRequest request) async {
|
||||
return HelloReply()..message = 'Hello, ${request.name}!';
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> main(List<String> args) async {
|
||||
final udsAddress = InternetAddress(
|
||||
'localhost',
|
||||
type: InternetAddressType.unix,
|
||||
);
|
||||
final server = Server.create(services: [GreeterService()]);
|
||||
await server.serve(address: udsAddress);
|
||||
print('Start UNIX Server @localhost...');
|
||||
}
|
|
@ -0,0 +1,140 @@
|
|||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: helloworld.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
/// The request message containing the user's name.
|
||||
class HelloRequest extends $pb.GeneratedMessage {
|
||||
factory HelloRequest({
|
||||
$core.String? name,
|
||||
}) {
|
||||
final result = create();
|
||||
if (name != null) {
|
||||
result.name = name;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
HelloRequest._() : super();
|
||||
factory HelloRequest.fromBuffer($core.List<$core.int> i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(i, r);
|
||||
factory HelloRequest.fromJson($core.String i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(i, r);
|
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
_omitMessageNames ? '' : 'HelloRequest',
|
||||
package: const $pb.PackageName(_omitMessageNames ? '' : 'helloworld'),
|
||||
createEmptyInstance: create)
|
||||
..aOS(1, _omitFieldNames ? '' : 'name')
|
||||
..hasRequiredFields = false;
|
||||
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
HelloRequest clone() => HelloRequest()..mergeFromMessage(this);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
HelloRequest copyWith(void Function(HelloRequest) updates) =>
|
||||
super.copyWith((message) => updates(message as HelloRequest))
|
||||
as HelloRequest;
|
||||
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static HelloRequest create() => HelloRequest._();
|
||||
HelloRequest createEmptyInstance() => create();
|
||||
static $pb.PbList<HelloRequest> createRepeated() =>
|
||||
$pb.PbList<HelloRequest>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static HelloRequest getDefault() => _defaultInstance ??=
|
||||
$pb.GeneratedMessage.$_defaultFor<HelloRequest>(create);
|
||||
static HelloRequest? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get name => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set name($core.String v) {
|
||||
$_setString(0, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasName() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearName() => clearField(1);
|
||||
}
|
||||
|
||||
/// The response message containing the greetings
|
||||
class HelloReply extends $pb.GeneratedMessage {
|
||||
factory HelloReply({
|
||||
$core.String? message,
|
||||
}) {
|
||||
final result = create();
|
||||
if (message != null) {
|
||||
result.message = message;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
HelloReply._() : super();
|
||||
factory HelloReply.fromBuffer($core.List<$core.int> i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(i, r);
|
||||
factory HelloReply.fromJson($core.String i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(i, r);
|
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
_omitMessageNames ? '' : 'HelloReply',
|
||||
package: const $pb.PackageName(_omitMessageNames ? '' : 'helloworld'),
|
||||
createEmptyInstance: create)
|
||||
..aOS(1, _omitFieldNames ? '' : 'message')
|
||||
..hasRequiredFields = false;
|
||||
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
HelloReply clone() => HelloReply()..mergeFromMessage(this);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
HelloReply copyWith(void Function(HelloReply) updates) =>
|
||||
super.copyWith((message) => updates(message as HelloReply)) as HelloReply;
|
||||
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static HelloReply create() => HelloReply._();
|
||||
HelloReply createEmptyInstance() => create();
|
||||
static $pb.PbList<HelloReply> createRepeated() => $pb.PbList<HelloReply>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static HelloReply getDefault() => _defaultInstance ??=
|
||||
$pb.GeneratedMessage.$_defaultFor<HelloReply>(create);
|
||||
static HelloReply? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get message => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set message($core.String v) {
|
||||
$_setString(0, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasMessage() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearMessage() => clearField(1);
|
||||
}
|
||||
|
||||
const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names');
|
||||
const _omitMessageNames =
|
||||
$core.bool.fromEnvironment('protobuf.omit_message_names');
|
|
@ -0,0 +1,10 @@
|
|||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: helloworld.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
|
@ -0,0 +1,61 @@
|
|||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: helloworld.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:async' as $async;
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:grpc/service_api.dart' as $grpc;
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
import 'helloworld.pb.dart' as $0;
|
||||
|
||||
export 'helloworld.pb.dart';
|
||||
|
||||
@$pb.GrpcServiceName('helloworld.Greeter')
|
||||
class GreeterClient extends $grpc.Client {
|
||||
static final _$sayHello = $grpc.ClientMethod<$0.HelloRequest, $0.HelloReply>(
|
||||
'/helloworld.Greeter/SayHello',
|
||||
($0.HelloRequest value) => value.writeToBuffer(),
|
||||
($core.List<$core.int> value) => $0.HelloReply.fromBuffer(value));
|
||||
|
||||
GreeterClient($grpc.ClientChannel channel,
|
||||
{$grpc.CallOptions? options,
|
||||
$core.Iterable<$grpc.ClientInterceptor>? interceptors})
|
||||
: super(channel, options: options, interceptors: interceptors);
|
||||
|
||||
$grpc.ResponseFuture<$0.HelloReply> sayHello($0.HelloRequest request,
|
||||
{$grpc.CallOptions? options}) {
|
||||
return $createUnaryCall(_$sayHello, request, options: options);
|
||||
}
|
||||
}
|
||||
|
||||
@$pb.GrpcServiceName('helloworld.Greeter')
|
||||
abstract class GreeterServiceBase extends $grpc.Service {
|
||||
$core.String get $name => 'helloworld.Greeter';
|
||||
|
||||
GreeterServiceBase() {
|
||||
$addMethod($grpc.ServiceMethod<$0.HelloRequest, $0.HelloReply>(
|
||||
'SayHello',
|
||||
sayHello_Pre,
|
||||
false,
|
||||
false,
|
||||
($core.List<$core.int> value) => $0.HelloRequest.fromBuffer(value),
|
||||
($0.HelloReply value) => value.writeToBuffer()));
|
||||
}
|
||||
|
||||
$async.Future<$0.HelloReply> sayHello_Pre(
|
||||
$grpc.ServiceCall call, $async.Future<$0.HelloRequest> request) async {
|
||||
return sayHello(call, await request);
|
||||
}
|
||||
|
||||
$async.Future<$0.HelloReply> sayHello(
|
||||
$grpc.ServiceCall call, $0.HelloRequest request);
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
//
|
||||
// Generated code. Do not modify.
|
||||
// source: helloworld.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:core' as $core;
|
||||
import 'dart:typed_data' as $typed_data;
|
||||
|
||||
@$core.Deprecated('Use helloRequestDescriptor instead')
|
||||
const HelloRequest$json = {
|
||||
'1': 'HelloRequest',
|
||||
'2': [
|
||||
{'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `HelloRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List helloRequestDescriptor =
|
||||
$convert.base64Decode('CgxIZWxsb1JlcXVlc3QSEgoEbmFtZRgBIAEoCVIEbmFtZQ==');
|
||||
|
||||
@$core.Deprecated('Use helloReplyDescriptor instead')
|
||||
const HelloReply$json = {
|
||||
'1': 'HelloReply',
|
||||
'2': [
|
||||
{'1': 'message', '3': 1, '4': 1, '5': 9, '10': 'message'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `HelloReply`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List helloReplyDescriptor = $convert
|
||||
.base64Decode('CgpIZWxsb1JlcGx5EhgKB21lc3NhZ2UYASABKAlSB21lc3NhZ2U=');
|
|
@ -0,0 +1,38 @@
|
|||
// Copyright 2015 gRPC authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
option java_multiple_files = true;
|
||||
option java_package = "io.grpc.examples.helloworld";
|
||||
option java_outer_classname = "HelloWorldProto";
|
||||
option objc_class_prefix = "HLW";
|
||||
|
||||
package helloworld;
|
||||
|
||||
// The greeting service definition.
|
||||
service Greeter {
|
||||
// Sends a greeting
|
||||
rpc SayHello (HelloRequest) returns (HelloReply) {}
|
||||
}
|
||||
|
||||
// The request message containing the user's name.
|
||||
message HelloRequest {
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
// The response message containing the greetings
|
||||
message HelloReply {
|
||||
string message = 1;
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
name: helloworld
|
||||
description: Dart gRPC sample client and server.
|
||||
publish_to: none
|
||||
|
||||
environment:
|
||||
sdk: ^3.8.0
|
||||
|
||||
dependencies:
|
||||
async: ^2.13.0
|
||||
grpc:
|
||||
path: ../../
|
||||
protobuf: ^4.1.0
|
||||
|
||||
dev_dependencies:
|
||||
lints: ^6.0.0
|
|
@ -9,7 +9,7 @@ To compile and run the example, assuming you are in the root of the metadata
|
|||
folder, i.e., .../example/metadata/, first get the dependencies by running:
|
||||
|
||||
```sh
|
||||
$ pub get
|
||||
$ dart pub get
|
||||
```
|
||||
|
||||
Then, to run the server:
|
||||
|
@ -23,3 +23,31 @@ Likewise, to run the client:
|
|||
```sh
|
||||
$ dart bin/client.dart
|
||||
```
|
||||
|
||||
# Regenerate the stubs
|
||||
|
||||
If you have made changes to the message or service definition in
|
||||
`protos/route_guide.proto` and need to regenerate the corresponding Dart files,
|
||||
you will need to have protoc version 3.0.0 or higher and the Dart protoc plugin
|
||||
version 0.7.9 or higher on your PATH.
|
||||
|
||||
To install protoc with Dart support, take these steps:
|
||||
|
||||
1. Install the `protoc` matching your development operating system from
|
||||
[the Protocol Buffers releases page](https://github.com/google/protobuf/releases)
|
||||
(e.g. `protoc-3.5.1-osx-x86_64.zip` for macOS).
|
||||
|
||||
1. Get the Dart protoc plugin by running
|
||||
|
||||
```sh
|
||||
$ dart pub global activate protoc_plugin
|
||||
```
|
||||
|
||||
1. Add `~/.pub-cache/bin` to your PATH, if you haven't
|
||||
already done so.
|
||||
|
||||
You can now regenerate the Dart files by running
|
||||
|
||||
```sh
|
||||
$ protoc --dart_out=grpc:lib/src/generated -Iprotos protos/metadata.proto
|
||||
```
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
include: package:lints/recommended.yaml
|
|
@ -15,6 +15,6 @@
|
|||
|
||||
import 'package:metadata/src/client.dart';
|
||||
|
||||
main(List<String> args) {
|
||||
new Client().main(args);
|
||||
void main(List<String> args) {
|
||||
Client().main(args);
|
||||
}
|
||||
|
|
|
@ -15,6 +15,6 @@
|
|||
|
||||
import 'package:metadata/src/server.dart';
|
||||
|
||||
main(List<String> args) {
|
||||
new Server().main(args);
|
||||
void main(List<String> args) {
|
||||
Server().main(args);
|
||||
}
|
||||
|
|
|
@ -20,13 +20,16 @@ import 'package:grpc/grpc.dart';
|
|||
import 'generated/metadata.pbgrpc.dart';
|
||||
|
||||
class Client {
|
||||
ClientChannel channel;
|
||||
MetadataClient stub;
|
||||
late ClientChannel channel;
|
||||
late MetadataClient stub;
|
||||
|
||||
Future<Null> main(List<String> args) async {
|
||||
channel = new ClientChannel('127.0.0.1',
|
||||
port: 8080, options: const ChannelOptions.insecure());
|
||||
stub = new MetadataClient(channel);
|
||||
Future<void> main(List<String> args) async {
|
||||
channel = ClientChannel(
|
||||
'127.0.0.1',
|
||||
port: 8080,
|
||||
options: const ChannelOptions(credentials: ChannelCredentials.insecure()),
|
||||
);
|
||||
stub = MetadataClient(channel);
|
||||
// Run all of the demos in order.
|
||||
await runEcho();
|
||||
await runEchoDelayCancel();
|
||||
|
@ -40,10 +43,12 @@ class Client {
|
|||
///
|
||||
/// Send custom metadata with a RPC, and print out the received response and
|
||||
/// metadata.
|
||||
Future<Null> runEcho() async {
|
||||
final request = new Record()..value = 'Kaj';
|
||||
final call = stub.echo(request,
|
||||
options: new CallOptions(metadata: {'peer': 'Verner'}));
|
||||
Future<void> runEcho() async {
|
||||
final request = Record()..value = 'Kaj';
|
||||
final call = stub.echo(
|
||||
request,
|
||||
options: CallOptions(metadata: {'peer': 'Verner'}),
|
||||
);
|
||||
call.headers.then((headers) {
|
||||
print('Received header metadata: $headers');
|
||||
});
|
||||
|
@ -59,19 +64,23 @@ class Client {
|
|||
/// Same as the echo demo, but demonstrating per-client custom metadata, as
|
||||
/// well as a per-call metadata. The server will delay the response for the
|
||||
/// requested duration, during which the client will cancel the RPC.
|
||||
Future<Null> runEchoDelayCancel() async {
|
||||
final stubWithCustomOptions = new MetadataClient(channel,
|
||||
options: new CallOptions(metadata: {'peer': 'Verner'}));
|
||||
final request = new Record()..value = 'Kaj';
|
||||
final call = stubWithCustomOptions.echo(request,
|
||||
options: new CallOptions(metadata: {'delay': '1'}));
|
||||
Future<void> runEchoDelayCancel() async {
|
||||
final stubWithCustomOptions = MetadataClient(
|
||||
channel,
|
||||
options: CallOptions(metadata: {'peer': 'Verner'}),
|
||||
);
|
||||
final request = Record()..value = 'Kaj';
|
||||
final call = stubWithCustomOptions.echo(
|
||||
request,
|
||||
options: CallOptions(metadata: {'delay': '1'}),
|
||||
);
|
||||
call.headers.then((headers) {
|
||||
print('Received header metadata: $headers');
|
||||
});
|
||||
call.trailers.then((trailers) {
|
||||
print('Received trailer metadata: $trailers');
|
||||
});
|
||||
await new Future.delayed(new Duration(milliseconds: 10));
|
||||
await Future.delayed(Duration(milliseconds: 10));
|
||||
call.cancel();
|
||||
try {
|
||||
final response = await call;
|
||||
|
@ -85,11 +94,12 @@ class Client {
|
|||
///
|
||||
/// Makes a bi-directional RPC, sends 4 requests, and cancels the RPC after
|
||||
/// receiving 3 responses.
|
||||
Future<Null> runAddOneCancel() async {
|
||||
final numbers = new StreamController<int>();
|
||||
final call =
|
||||
stub.addOne(numbers.stream.map((value) => new Number()..value = value));
|
||||
final receivedThree = new Completer<bool>();
|
||||
Future<void> runAddOneCancel() async {
|
||||
final numbers = StreamController<int>();
|
||||
final call = stub.addOne(
|
||||
numbers.stream.map((value) => Number()..value = value),
|
||||
);
|
||||
final receivedThree = Completer<bool>();
|
||||
final sub = call.listen((number) {
|
||||
print('AddOneCancel: Received ${number.value}');
|
||||
if (number.value == 3) {
|
||||
|
@ -109,9 +119,9 @@ class Client {
|
|||
///
|
||||
/// Call an RPC that returns a stream of Fibonacci numbers. Cancel the call
|
||||
/// after receiving more than 5 responses.
|
||||
Future<Null> runFibonacciCancel() async {
|
||||
final call = stub.fibonacci(new Empty());
|
||||
int count = 0;
|
||||
Future<void> runFibonacciCancel() async {
|
||||
final call = stub.fibonacci(Empty());
|
||||
var count = 0;
|
||||
try {
|
||||
await for (var number in call) {
|
||||
count++;
|
||||
|
@ -130,10 +140,12 @@ class Client {
|
|||
///
|
||||
/// Call an RPC that returns a stream of Fibonacci numbers, and specify an RPC
|
||||
/// timeout of 2 seconds.
|
||||
Future<Null> runFibonacciTimeout() async {
|
||||
final call = stub.fibonacci(new Empty(),
|
||||
options: new CallOptions(timeout: new Duration(seconds: 2)));
|
||||
int count = 0;
|
||||
Future<void> runFibonacciTimeout() async {
|
||||
final call = stub.fibonacci(
|
||||
Empty(),
|
||||
options: CallOptions(timeout: Duration(seconds: 2)),
|
||||
);
|
||||
var count = 0;
|
||||
try {
|
||||
await for (var number in call) {
|
||||
count++;
|
||||
|
|
|
@ -1,108 +1,177 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library grpc_metadata;
|
||||
// source: metadata.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
// ignore: UNUSED_SHOWN_NAME
|
||||
import 'dart:core' show int, bool, double, String, List, override;
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'package:protobuf/protobuf.dart';
|
||||
import 'dart:core' as $core;
|
||||
|
||||
class Record extends GeneratedMessage {
|
||||
static final BuilderInfo _i = new BuilderInfo('Record')
|
||||
..aOS(1, 'value')
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
/// A message containing a single string value.
|
||||
class Record extends $pb.GeneratedMessage {
|
||||
factory Record({
|
||||
$core.String? value,
|
||||
}) {
|
||||
final result = create();
|
||||
if (value != null) {
|
||||
result.value = value;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
Record._() : super();
|
||||
factory Record.fromBuffer($core.List<$core.int> i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(i, r);
|
||||
factory Record.fromJson($core.String i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(i, r);
|
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
_omitMessageNames ? '' : 'Record',
|
||||
package: const $pb.PackageName(_omitMessageNames ? '' : 'grpc'),
|
||||
createEmptyInstance: create)
|
||||
..aOS(1, _omitFieldNames ? '' : 'value')
|
||||
..hasRequiredFields = false;
|
||||
|
||||
Record() : super();
|
||||
Record.fromBuffer(List<int> i,
|
||||
[ExtensionRegistry r = ExtensionRegistry.EMPTY])
|
||||
: super.fromBuffer(i, r);
|
||||
Record.fromJson(String i, [ExtensionRegistry r = ExtensionRegistry.EMPTY])
|
||||
: super.fromJson(i, r);
|
||||
Record clone() => new Record()..mergeFromMessage(this);
|
||||
BuilderInfo get info_ => _i;
|
||||
static Record create() => new Record();
|
||||
static PbList<Record> createRepeated() => new PbList<Record>();
|
||||
static Record getDefault() {
|
||||
if (_defaultInstance == null) _defaultInstance = new _ReadonlyRecord();
|
||||
return _defaultInstance;
|
||||
}
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
Record clone() => Record()..mergeFromMessage(this);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
Record copyWith(void Function(Record) updates) =>
|
||||
super.copyWith((message) => updates(message as Record)) as Record;
|
||||
|
||||
static Record _defaultInstance;
|
||||
static void $checkItem(Record v) {
|
||||
if (v is! Record) checkItemFailed(v, 'Record');
|
||||
}
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
String get value => $_getS(0, '');
|
||||
set value(String v) {
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Record create() => Record._();
|
||||
Record createEmptyInstance() => create();
|
||||
static $pb.PbList<Record> createRepeated() => $pb.PbList<Record>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Record getDefault() =>
|
||||
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Record>(create);
|
||||
static Record? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get value => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set value($core.String v) {
|
||||
$_setString(0, v);
|
||||
}
|
||||
|
||||
bool hasValue() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasValue() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearValue() => clearField(1);
|
||||
}
|
||||
|
||||
class _ReadonlyRecord extends Record with ReadonlyMessageMixin {}
|
||||
/// A message containing a single number.
|
||||
class Number extends $pb.GeneratedMessage {
|
||||
factory Number({
|
||||
$core.int? value,
|
||||
}) {
|
||||
final result = create();
|
||||
if (value != null) {
|
||||
result.value = value;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
Number._() : super();
|
||||
factory Number.fromBuffer($core.List<$core.int> i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(i, r);
|
||||
factory Number.fromJson($core.String i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(i, r);
|
||||
|
||||
class Number extends GeneratedMessage {
|
||||
static final BuilderInfo _i = new BuilderInfo('Number')
|
||||
..a<int>(1, 'value', PbFieldType.O3)
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
_omitMessageNames ? '' : 'Number',
|
||||
package: const $pb.PackageName(_omitMessageNames ? '' : 'grpc'),
|
||||
createEmptyInstance: create)
|
||||
..a<$core.int>(1, _omitFieldNames ? '' : 'value', $pb.PbFieldType.O3)
|
||||
..hasRequiredFields = false;
|
||||
|
||||
Number() : super();
|
||||
Number.fromBuffer(List<int> i,
|
||||
[ExtensionRegistry r = ExtensionRegistry.EMPTY])
|
||||
: super.fromBuffer(i, r);
|
||||
Number.fromJson(String i, [ExtensionRegistry r = ExtensionRegistry.EMPTY])
|
||||
: super.fromJson(i, r);
|
||||
Number clone() => new Number()..mergeFromMessage(this);
|
||||
BuilderInfo get info_ => _i;
|
||||
static Number create() => new Number();
|
||||
static PbList<Number> createRepeated() => new PbList<Number>();
|
||||
static Number getDefault() {
|
||||
if (_defaultInstance == null) _defaultInstance = new _ReadonlyNumber();
|
||||
return _defaultInstance;
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
Number clone() => Number()..mergeFromMessage(this);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
Number copyWith(void Function(Number) updates) =>
|
||||
super.copyWith((message) => updates(message as Number)) as Number;
|
||||
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Number create() => Number._();
|
||||
Number createEmptyInstance() => create();
|
||||
static $pb.PbList<Number> createRepeated() => $pb.PbList<Number>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Number getDefault() =>
|
||||
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Number>(create);
|
||||
static Number? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.int get value => $_getIZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set value($core.int v) {
|
||||
$_setSignedInt32(0, v);
|
||||
}
|
||||
|
||||
static Number _defaultInstance;
|
||||
static void $checkItem(Number v) {
|
||||
if (v is! Number) checkItemFailed(v, 'Number');
|
||||
}
|
||||
|
||||
int get value => $_get(0, 0);
|
||||
set value(int v) {
|
||||
$_setUnsignedInt32(0, v);
|
||||
}
|
||||
|
||||
bool hasValue() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasValue() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearValue() => clearField(1);
|
||||
}
|
||||
|
||||
class _ReadonlyNumber extends Number with ReadonlyMessageMixin {}
|
||||
/// A message containing nothing.
|
||||
class Empty extends $pb.GeneratedMessage {
|
||||
factory Empty() => create();
|
||||
Empty._() : super();
|
||||
factory Empty.fromBuffer($core.List<$core.int> i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(i, r);
|
||||
factory Empty.fromJson($core.String i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(i, r);
|
||||
|
||||
class Empty extends GeneratedMessage {
|
||||
static final BuilderInfo _i = new BuilderInfo('Empty')
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
_omitMessageNames ? '' : 'Empty',
|
||||
package: const $pb.PackageName(_omitMessageNames ? '' : 'grpc'),
|
||||
createEmptyInstance: create)
|
||||
..hasRequiredFields = false;
|
||||
|
||||
Empty() : super();
|
||||
Empty.fromBuffer(List<int> i, [ExtensionRegistry r = ExtensionRegistry.EMPTY])
|
||||
: super.fromBuffer(i, r);
|
||||
Empty.fromJson(String i, [ExtensionRegistry r = ExtensionRegistry.EMPTY])
|
||||
: super.fromJson(i, r);
|
||||
Empty clone() => new Empty()..mergeFromMessage(this);
|
||||
BuilderInfo get info_ => _i;
|
||||
static Empty create() => new Empty();
|
||||
static PbList<Empty> createRepeated() => new PbList<Empty>();
|
||||
static Empty getDefault() {
|
||||
if (_defaultInstance == null) _defaultInstance = new _ReadonlyEmpty();
|
||||
return _defaultInstance;
|
||||
}
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
Empty clone() => Empty()..mergeFromMessage(this);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
Empty copyWith(void Function(Empty) updates) =>
|
||||
super.copyWith((message) => updates(message as Empty)) as Empty;
|
||||
|
||||
static Empty _defaultInstance;
|
||||
static void $checkItem(Empty v) {
|
||||
if (v is! Empty) checkItemFailed(v, 'Empty');
|
||||
}
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Empty create() => Empty._();
|
||||
Empty createEmptyInstance() => create();
|
||||
static $pb.PbList<Empty> createRepeated() => $pb.PbList<Empty>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static Empty getDefault() =>
|
||||
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Empty>(create);
|
||||
static Empty? _defaultInstance;
|
||||
}
|
||||
|
||||
class _ReadonlyEmpty extends Empty with ReadonlyMessageMixin {}
|
||||
const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names');
|
||||
const _omitMessageNames =
|
||||
$core.bool.fromEnvironment('protobuf.omit_message_names');
|
||||
|
|
|
@ -1,87 +1,102 @@
|
|||
///
|
||||
//
|
||||
// Generated code. Do not modify.
|
||||
///
|
||||
// ignore_for_file: non_constant_identifier_names,library_prefixes
|
||||
library grpc_metadata_pbgrpc;
|
||||
// source: metadata.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
|
||||
import 'dart:async';
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
|
||||
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import
|
||||
|
||||
import 'package:grpc/grpc.dart';
|
||||
import 'dart:async' as $async;
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:grpc/service_api.dart' as $grpc;
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
import 'metadata.pb.dart' as $0;
|
||||
|
||||
import 'metadata.pb.dart';
|
||||
export 'metadata.pb.dart';
|
||||
|
||||
class MetadataClient extends Client {
|
||||
static final _$echo = new ClientMethod<Record, Record>(
|
||||
@$pb.GrpcServiceName('grpc.Metadata')
|
||||
class MetadataClient extends $grpc.Client {
|
||||
static final _$echo = $grpc.ClientMethod<$0.Record, $0.Record>(
|
||||
'/grpc.Metadata/Echo',
|
||||
(Record value) => value.writeToBuffer(),
|
||||
(List<int> value) => new Record.fromBuffer(value));
|
||||
static final _$addOne = new ClientMethod<Number, Number>(
|
||||
($0.Record value) => value.writeToBuffer(),
|
||||
($core.List<$core.int> value) => $0.Record.fromBuffer(value));
|
||||
static final _$addOne = $grpc.ClientMethod<$0.Number, $0.Number>(
|
||||
'/grpc.Metadata/AddOne',
|
||||
(Number value) => value.writeToBuffer(),
|
||||
(List<int> value) => new Number.fromBuffer(value));
|
||||
static final _$fibonacci = new ClientMethod<Empty, Number>(
|
||||
($0.Number value) => value.writeToBuffer(),
|
||||
($core.List<$core.int> value) => $0.Number.fromBuffer(value));
|
||||
static final _$fibonacci = $grpc.ClientMethod<$0.Empty, $0.Number>(
|
||||
'/grpc.Metadata/Fibonacci',
|
||||
(Empty value) => value.writeToBuffer(),
|
||||
(List<int> value) => new Number.fromBuffer(value));
|
||||
($0.Empty value) => value.writeToBuffer(),
|
||||
($core.List<$core.int> value) => $0.Number.fromBuffer(value));
|
||||
|
||||
MetadataClient(ClientChannel channel, {CallOptions options})
|
||||
: super(channel, options: options);
|
||||
MetadataClient($grpc.ClientChannel channel,
|
||||
{$grpc.CallOptions? options,
|
||||
$core.Iterable<$grpc.ClientInterceptor>? interceptors})
|
||||
: super(channel, options: options, interceptors: interceptors);
|
||||
|
||||
ResponseFuture<Record> echo(Record request, {CallOptions options}) {
|
||||
final call = $createCall(_$echo, new Stream.fromIterable([request]),
|
||||
options: options);
|
||||
return new ResponseFuture(call);
|
||||
$grpc.ResponseFuture<$0.Record> echo($0.Record request,
|
||||
{$grpc.CallOptions? options}) {
|
||||
return $createUnaryCall(_$echo, request, options: options);
|
||||
}
|
||||
|
||||
ResponseStream<Number> addOne(Stream<Number> request, {CallOptions options}) {
|
||||
final call = $createCall(_$addOne, request, options: options);
|
||||
return new ResponseStream(call);
|
||||
$grpc.ResponseStream<$0.Number> addOne($async.Stream<$0.Number> request,
|
||||
{$grpc.CallOptions? options}) {
|
||||
return $createStreamingCall(_$addOne, request, options: options);
|
||||
}
|
||||
|
||||
ResponseStream<Number> fibonacci(Empty request, {CallOptions options}) {
|
||||
final call = $createCall(_$fibonacci, new Stream.fromIterable([request]),
|
||||
$grpc.ResponseStream<$0.Number> fibonacci($0.Empty request,
|
||||
{$grpc.CallOptions? options}) {
|
||||
return $createStreamingCall(
|
||||
_$fibonacci, $async.Stream.fromIterable([request]),
|
||||
options: options);
|
||||
return new ResponseStream(call);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class MetadataServiceBase extends Service {
|
||||
String get $name => 'grpc.Metadata';
|
||||
@$pb.GrpcServiceName('grpc.Metadata')
|
||||
abstract class MetadataServiceBase extends $grpc.Service {
|
||||
$core.String get $name => 'grpc.Metadata';
|
||||
|
||||
MetadataServiceBase() {
|
||||
$addMethod(new ServiceMethod<Record, Record>(
|
||||
$addMethod($grpc.ServiceMethod<$0.Record, $0.Record>(
|
||||
'Echo',
|
||||
echo_Pre,
|
||||
false,
|
||||
false,
|
||||
(List<int> value) => new Record.fromBuffer(value),
|
||||
(Record value) => value.writeToBuffer()));
|
||||
$addMethod(new ServiceMethod<Number, Number>(
|
||||
($core.List<$core.int> value) => $0.Record.fromBuffer(value),
|
||||
($0.Record value) => value.writeToBuffer()));
|
||||
$addMethod($grpc.ServiceMethod<$0.Number, $0.Number>(
|
||||
'AddOne',
|
||||
addOne,
|
||||
true,
|
||||
true,
|
||||
(List<int> value) => new Number.fromBuffer(value),
|
||||
(Number value) => value.writeToBuffer()));
|
||||
$addMethod(new ServiceMethod<Empty, Number>(
|
||||
($core.List<$core.int> value) => $0.Number.fromBuffer(value),
|
||||
($0.Number value) => value.writeToBuffer()));
|
||||
$addMethod($grpc.ServiceMethod<$0.Empty, $0.Number>(
|
||||
'Fibonacci',
|
||||
fibonacci_Pre,
|
||||
false,
|
||||
true,
|
||||
(List<int> value) => new Empty.fromBuffer(value),
|
||||
(Number value) => value.writeToBuffer()));
|
||||
($core.List<$core.int> value) => $0.Empty.fromBuffer(value),
|
||||
($0.Number value) => value.writeToBuffer()));
|
||||
}
|
||||
|
||||
Future<Record> echo_Pre(ServiceCall call, Future<Record> request) async {
|
||||
$async.Future<$0.Record> echo_Pre(
|
||||
$grpc.ServiceCall call, $async.Future<$0.Record> request) async {
|
||||
return echo(call, await request);
|
||||
}
|
||||
|
||||
Stream<Number> fibonacci_Pre(ServiceCall call, Future<Empty> request) async* {
|
||||
$async.Stream<$0.Number> fibonacci_Pre(
|
||||
$grpc.ServiceCall call, $async.Future<$0.Empty> request) async* {
|
||||
yield* fibonacci(call, await request);
|
||||
}
|
||||
|
||||
Future<Record> echo(ServiceCall call, Record request);
|
||||
Stream<Number> addOne(ServiceCall call, Stream<Number> request);
|
||||
Stream<Number> fibonacci(ServiceCall call, Empty request);
|
||||
$async.Future<$0.Record> echo($grpc.ServiceCall call, $0.Record request);
|
||||
$async.Stream<$0.Number> addOne(
|
||||
$grpc.ServiceCall call, $async.Stream<$0.Number> request);
|
||||
$async.Stream<$0.Number> fibonacci($grpc.ServiceCall call, $0.Empty request);
|
||||
}
|
||||
|
|
|
@ -24,27 +24,27 @@ class MetadataService extends MetadataServiceBase {
|
|||
|
||||
@override
|
||||
Future<Record> echo(grpc.ServiceCall call, Record request) async {
|
||||
final peer = call.clientMetadata['peer'];
|
||||
final peer = call.clientMetadata!['peer']!;
|
||||
final count = callCount++;
|
||||
print('Echo: Call #$count: Peer: $peer, request: ${request.value}');
|
||||
call.headers['count'] = '${count}';
|
||||
call.trailers['hello'] = request.value;
|
||||
call.headers!['count'] = '$count';
|
||||
call.trailers!['hello'] = request.value;
|
||||
|
||||
final delay = call.clientMetadata['delay'];
|
||||
final delay = call.clientMetadata!['delay'];
|
||||
if (delay != null) {
|
||||
await new Future.delayed(new Duration(seconds: int.parse(delay)));
|
||||
await Future.delayed(Duration(seconds: int.parse(delay)));
|
||||
}
|
||||
|
||||
return new Record()..value = peer;
|
||||
return Record()..value = peer;
|
||||
}
|
||||
|
||||
@override
|
||||
Stream<Number> addOne(grpc.ServiceCall call, Stream<Number> request) async* {
|
||||
int lastNumber = -1;
|
||||
var lastNumber = -1;
|
||||
try {
|
||||
await for (var number in request) {
|
||||
lastNumber = number.value;
|
||||
yield new Number()..value = number.value + 1;
|
||||
yield Number()..value = number.value + 1;
|
||||
}
|
||||
} catch (error) {
|
||||
print('Caught: $error, last number = $lastNumber');
|
||||
|
@ -56,13 +56,14 @@ class MetadataService extends MetadataServiceBase {
|
|||
}
|
||||
|
||||
/// Streams a Fibonacci number every 500ms until the call is canceled.
|
||||
@override
|
||||
Stream<Number> fibonacci(grpc.ServiceCall call, Empty request) async* {
|
||||
int previous = 0;
|
||||
int current = 1;
|
||||
var previous = 0;
|
||||
var current = 1;
|
||||
try {
|
||||
while (true) {
|
||||
await new Future.delayed(new Duration(milliseconds: 500));
|
||||
yield new Number()..value = current;
|
||||
await Future.delayed(Duration(milliseconds: 500));
|
||||
yield Number()..value = current;
|
||||
final next = current + previous;
|
||||
previous = current;
|
||||
current = next;
|
||||
|
@ -76,10 +77,9 @@ class MetadataService extends MetadataServiceBase {
|
|||
}
|
||||
|
||||
class Server {
|
||||
Future<Null> main(List<String> args) async {
|
||||
final server =
|
||||
new grpc.Server.insecure([new MetadataService()], port: 8080);
|
||||
await server.serve();
|
||||
print('Server listening...');
|
||||
Future<void> main(List<String> args) async {
|
||||
final server = grpc.Server.create(services: [MetadataService()]);
|
||||
await server.serve(port: 8080);
|
||||
print('Server listening on port ${server.port}...');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
name: metadata
|
||||
description: Dart gRPC sample client and server.
|
||||
version: 0.0.1
|
||||
homepage: https://github.com/dart-lang/grpc-dart
|
||||
publish_to: none
|
||||
|
||||
environment:
|
||||
sdk: '>=1.24.3 <2.0.0'
|
||||
sdk: ^3.8.0
|
||||
|
||||
dependencies:
|
||||
async: ^1.13.3
|
||||
async: ^2.13.0
|
||||
grpc:
|
||||
path: ../../
|
||||
protobuf: ^0.7.0
|
||||
protobuf: ^4.1.0
|
||||
|
||||
dev_dependencies:
|
||||
test: ^0.12.0
|
||||
lints: ^6.0.0
|
||||
test: ^1.26.2
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
protoc --dart_out=grpc:lib/src/generated -Iprotos protos/metadata.proto
|
||||
rm lib/src/generated/metadata.pb{enum,json}.dart
|
||||
dartfmt -w lib/src/generated
|
||||
dart format -o write lib/src/generated
|
||||
|
|
|
@ -31,16 +31,19 @@ If you have made changes to the message or service definition in
|
|||
you will need to have protoc version 3.0.0 or higher and the Dart protoc plugin
|
||||
version 0.7.9 or higher on your PATH.
|
||||
|
||||
To install protoc, see the instructions on
|
||||
[the Protocol Buffers website](https://developers.google.com/protocol-buffers/).
|
||||
To install protoc with Dart support, take these steps:
|
||||
|
||||
The easiest way to get the Dart protoc plugin is by running
|
||||
1. Install the `protoc` matching your development operating system from
|
||||
[the Protocol Buffers releases page](https://github.com/google/protobuf/releases)
|
||||
(e.g. `protoc-3.5.1-osx-x86_64.zip` for macOS).
|
||||
|
||||
```sh
|
||||
$ pub global activate protoc_plugin
|
||||
```
|
||||
1. Get the Dart protoc plugin by running
|
||||
|
||||
and follow the directions to add `~/.pub-cache/bin` to your PATH, if you haven't
|
||||
```sh
|
||||
$ pub global activate protoc_plugin
|
||||
```
|
||||
|
||||
1. Add `~/.pub-cache/bin` to your PATH, if you haven't
|
||||
already done so.
|
||||
|
||||
You can now regenerate the Dart files by running
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
include: package:lints/recommended.yaml
|
|
@ -15,6 +15,6 @@
|
|||
|
||||
import 'package:route_guide/src/client.dart';
|
||||
|
||||
main(List<String> args) async {
|
||||
await new Client().main(args);
|
||||
Future<void> main(List<String> args) async {
|
||||
await Client().main(args);
|
||||
}
|
||||
|
|
|
@ -15,6 +15,6 @@
|
|||
|
||||
import 'package:route_guide/src/server.dart';
|
||||
|
||||
main(List<String> args) async {
|
||||
await new Server().main(args);
|
||||
Future<void> main(List<String> args) async {
|
||||
await Server().main(args);
|
||||
}
|
||||
|
|
|
@ -13,24 +13,26 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:math' show Random;
|
||||
|
||||
import 'package:grpc/grpc.dart';
|
||||
|
||||
import 'common.dart';
|
||||
import 'generated/route_guide.pb.dart';
|
||||
import 'generated/route_guide.pbgrpc.dart';
|
||||
|
||||
class Client {
|
||||
ClientChannel channel;
|
||||
RouteGuideClient stub;
|
||||
late RouteGuideClient stub;
|
||||
|
||||
Future<Null> main(List<String> args) async {
|
||||
channel = new ClientChannel('127.0.0.1',
|
||||
port: 8080, options: const ChannelOptions.insecure());
|
||||
stub = new RouteGuideClient(channel,
|
||||
options: new CallOptions(timeout: new Duration(seconds: 30)));
|
||||
Future<void> main(List<String> args) async {
|
||||
final channel = ClientChannel(
|
||||
'127.0.0.1',
|
||||
port: 8080,
|
||||
options: const ChannelOptions(credentials: ChannelCredentials.insecure()),
|
||||
);
|
||||
stub = RouteGuideClient(
|
||||
channel,
|
||||
options: CallOptions(timeout: Duration(seconds: 30)),
|
||||
);
|
||||
// Run all of the demos in order.
|
||||
try {
|
||||
await runGetFeature();
|
||||
|
@ -50,16 +52,17 @@ class Client {
|
|||
? 'no feature'
|
||||
: 'feature called "${feature.name}"';
|
||||
print(
|
||||
'Found $name at ${latitude / coordFactor}, ${longitude / coordFactor}');
|
||||
'Found $name at ${latitude / coordFactor}, ${longitude / coordFactor}',
|
||||
);
|
||||
}
|
||||
|
||||
/// Run the getFeature demo. Calls getFeature with a point known to have a
|
||||
/// feature and a point known not to have a feature.
|
||||
Future<Null> runGetFeature() async {
|
||||
final point1 = new Point()
|
||||
Future<void> runGetFeature() async {
|
||||
final point1 = Point()
|
||||
..latitude = 409146138
|
||||
..longitude = -746188906;
|
||||
final point2 = new Point()
|
||||
final point2 = Point()
|
||||
..latitude = 0
|
||||
..longitude = 0;
|
||||
|
||||
|
@ -70,14 +73,14 @@ class Client {
|
|||
/// Run the listFeatures demo. Calls listFeatures with a rectangle containing
|
||||
/// all of the features in the pre-generated database. Prints each response as
|
||||
/// it comes in.
|
||||
Future<Null> runListFeatures() async {
|
||||
final lo = new Point()
|
||||
Future<void> runListFeatures() async {
|
||||
final lo = Point()
|
||||
..latitude = 400000000
|
||||
..longitude = -750000000;
|
||||
final hi = new Point()
|
||||
final hi = Point()
|
||||
..latitude = 420000000
|
||||
..longitude = -730000000;
|
||||
final rect = new Rectangle()
|
||||
final rect = Rectangle()
|
||||
..lo = lo
|
||||
..hi = hi;
|
||||
|
||||
|
@ -90,18 +93,17 @@ class Client {
|
|||
/// Run the recordRoute demo. Sends several randomly chosen points from the
|
||||
/// pre-generated feature database with a variable delay in between. Prints
|
||||
/// the statistics when they are sent from the server.
|
||||
Future<Null> runRecordRoute() async {
|
||||
Future<void> runRecordRoute() async {
|
||||
Stream<Point> generateRoute(int count) async* {
|
||||
final random = new Random();
|
||||
final random = Random();
|
||||
|
||||
for (int i = 0; i < count; i++) {
|
||||
for (var i = 0; i < count; i++) {
|
||||
final point = featuresDb[random.nextInt(featuresDb.length)].location;
|
||||
print(
|
||||
'Visiting point ${point.latitude / coordFactor}, ${point.longitude /
|
||||
coordFactor}');
|
||||
'Visiting point ${point.latitude / coordFactor}, ${point.longitude / coordFactor}',
|
||||
);
|
||||
yield point;
|
||||
await new Future.delayed(
|
||||
new Duration(milliseconds: 200 + random.nextInt(100)));
|
||||
await Future.delayed(Duration(milliseconds: 200 + random.nextInt(100)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -114,12 +116,12 @@ class Client {
|
|||
|
||||
/// Run the routeChat demo. Send some chat messages, and print any chat
|
||||
/// messages that are sent from the server.
|
||||
Future<Null> runRouteChat() async {
|
||||
Future<void> runRouteChat() async {
|
||||
RouteNote createNote(String message, int latitude, int longitude) {
|
||||
final location = new Point()
|
||||
final location = Point()
|
||||
..latitude = latitude
|
||||
..longitude = longitude;
|
||||
return new RouteNote()
|
||||
return RouteNote()
|
||||
..message = message
|
||||
..location = location;
|
||||
}
|
||||
|
@ -134,17 +136,20 @@ class Client {
|
|||
Stream<RouteNote> outgoingNotes() async* {
|
||||
for (final note in notes) {
|
||||
// Short delay to simulate some other interaction.
|
||||
await new Future.delayed(new Duration(milliseconds: 10));
|
||||
print('Sending message ${note.message} at ${note.location.latitude}, '
|
||||
'${note.location.longitude}');
|
||||
await Future.delayed(Duration(milliseconds: 10));
|
||||
print(
|
||||
'Sending message ${note.message} at ${note.location.latitude}, '
|
||||
'${note.location.longitude}',
|
||||
);
|
||||
yield note;
|
||||
}
|
||||
}
|
||||
|
||||
final call = stub.routeChat(outgoingNotes());
|
||||
await for (var note in call) {
|
||||
print('Got message ${note.message} at ${note.location.latitude}, ${note
|
||||
.location.longitude}');
|
||||
print(
|
||||
'Got message ${note.message} at ${note.location.latitude}, ${note.location.longitude}',
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue