diff --git a/.gitignore b/.gitignore index 3a9c3f9bec..45ed23a68f 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,5 @@ logs/ /cover.out vendor/ demo/state/redis/client +node_modules/ +sdk/js-sdk/dist diff --git a/.licenserc.yaml b/.licenserc.yaml index 79e581581c..77f1ee451d 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -23,13 +23,21 @@ header: - 'sdk/' paths-ignore: + # js related + - 'sdk/js-sdk/node_modules/' + - 'sdk/js-sdk/demo/' + - '**/*.config.js' + - '**/*pb.d.ts' + - '**/*pb.js' + # java related + - 'sdk/java-sdk/sdk/target/' + - '**/*Grpc.java' + - '**/*Proto.java' - '**/*.json' - '**/*.log' - '**/*.log.*' - '**/*.lst' - '**/*.pb.go' - - '**/*Grpc.java' - - '**/*Proto.java' - '**/*.proto' - '**/*.yaml' - '**/*.xml' diff --git a/Makefile b/Makefile index b7ed07141b..e2487c2761 100644 --- a/Makefile +++ b/Makefile @@ -49,4 +49,7 @@ build-linux-wasm-layotto: docker build --rm -t ${BUILD_IMAGE} build/contrib/builder/image/faas docker run --rm -v $(shell pwd):/go/src/${PROJECT_NAME} -w /go/src/${PROJECT_NAME} ${BUILD_IMAGE} go build -tags wasmer -o layotto /go/src/${PROJECT_NAME}/cmd/layotto +license-checker: + docker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes header fix + .PHONY: build diff --git a/configs/config_integration_redis_etcd.json b/configs/config_integration_redis_etcd.json new file mode 100644 index 0000000000..75bf6f8211 --- /dev/null +++ b/configs/config_integration_redis_etcd.json @@ -0,0 +1,211 @@ +{ + "servers": [ + { + "default_log_path": "stdout", + "default_log_level": "DEBUG", + "routers": [ + { + "router_config_name": "http_router", + "virtual_hosts": [ + { + "name": "http_host", + "domains": [ + "*" + ], + "routers": [ + { + "match": { + "headers": [ + { + "name": "id", + "value": "HelloService:1.0" + } + ] + }, + "route": { + "cluster_name": "http_server" + } + } + ] + } + ] + }, + { + "router_config_name": "actuator_dont_need_router" + } + ], + "listeners": [ + { + "name": "grpc", + "address": "127.0.0.1:34904", + "bind_port": true, + "filter_chains": [ + { + "filters": [ + { + "type": "grpc", + "config": { + "server_name": "runtime", + "grpc_config": { + "rpcs": { + "mosn": { + "config": { + "channel": [ + { + "size": 16, + "protocol": "http", + "listener": "egress_runtime_http" + } + ] + } + } + }, + "hellos": { + "helloworld": { + "hello": "greeting" + } + }, + "bindings": { + "http": { + "metadata": { + "url": "https://registry.npmmirror.com/layotto/0.0.0" + } + } + }, + "config_stores": { + "etcd": { + "address": [ + "127.0.0.1:2379" + ], + "timeout": "10" + } + }, + "state": { + "redis": { + "metadata": { + "redisHost": "localhost:6380", + "redisPassword": "" + } + } + }, + "sequencer": { + "etcd": { + "metadata": { + "endpoints": "localhost:2379", + "segmentCacheEnable": "false", + "segmentStep": "1", + "username": "", + "password": "", + "dialTimeout": "5" + } + }, + "redis": { + "metadata": { + "redisHost": "127.0.0.1:6380", + "redisPassword": "" + } + } + }, + "lock": { + "etcd": { + "metadata": { + "endpoints": "localhost:2379", + "username": "", + "password": "", + "keyPrefixPath": "/lock", + "dialTimeout": "5" + } + }, + "redis": { + "metadata": { + "redisHost": "localhost:6380", + "redisPassword": "" + } + } + }, + "pub_subs": { + "redis": { + "metadata": { + "redisHost": "localhost:6380", + "redisPassword": "" + } + } + }, + "app": { + "app_id": "app1", + "grpc_callback_port": 9999 + } + } + } + } + ] + } + ] + }, + { + "name": "actuator", + "address": "127.0.0.1:34999", + "bind_port": true, + "filter_chains": [ + { + "filters": [ + { + "type": "proxy", + "config": { + "downstream_protocol": "Http1", + "upstream_protocol": "Http1", + "router_config_name": "actuator_dont_need_router" + } + } + ] + } + ], + "stream_filters": [ + { + "type": "actuator_filter" + } + ] + }, + { + "name": "egress_runtime_http", + "type": "egress", + "address": "0.0.0.0:12221", + "bind_port": true, + "network": "tcp", + "filter_chains": [ + { + "filters": [ + { + "type": "proxy", + "config": { + "downstream_protocol": "Http1", + "name": "proxy_config", + "router_config_name": "http_router", + "upstream_protocol": "Http1" + } + } + ] + } + ] + } + ] + } + ], + "cluster_manager": { + "tls_context": {}, + "clusters": [ + { + "name": "http_server", + "type": "SIMPLE", + "lb_type": "LB_RANDOM", + "hosts": [ + { + "address": "127.0.0.1:8889", + "hostname": "downstream_machine1", + "weight": 1 + } + ] + } + ] + } +} diff --git a/demo/configuration/etcd/etcd.go b/demo/configuration/etcd/etcd.go index 5a0c88ef4d..791278c04a 100644 --- a/demo/configuration/etcd/etcd.go +++ b/demo/configuration/etcd/etcd.go @@ -19,8 +19,9 @@ package main import ( "context" "fmt" - client "mosn.io/layotto/sdk/go-sdk/client" "time" + + client "mosn.io/layotto/sdk/go-sdk/client" ) func main() { diff --git a/sdk/js-sdk/.github/workflows/nodejs.yml b/sdk/js-sdk/.github/workflows/nodejs.yml new file mode 100644 index 0000000000..4590023e77 --- /dev/null +++ b/sdk/js-sdk/.github/workflows/nodejs.yml @@ -0,0 +1,59 @@ +# +# Copyright 2021 Layotto 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. +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Node.js CI + +on: + push: + branches: + - main + - master + pull_request: + branches: + - main + - master + schedule: + - cron: '0 2 * * *' + +jobs: + build: + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + node-version: [14, 16] + os: [ubuntu-latest, macos-latest] + + steps: + - name: Checkout Git Source + uses: actions/checkout@v2 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - name: Install Dependencies + run: npm i -g npminstall && npminstall + + - name: Continuous Integration + run: npm run ci + + - name: Code Coverage + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/sdk/js-sdk/README.md b/sdk/js-sdk/README.md new file mode 100644 index 0000000000..ad12dc78ba --- /dev/null +++ b/sdk/js-sdk/README.md @@ -0,0 +1,96 @@ +# Layotto Node.js SDK + +The Layotto Node.js SDK to build your application. + +## Usage + +### State + +`demo/state.ts` + +```ts +import { Client } from 'layotto'; + +const storeName = 'redis'; +const key = 'foo-js-sdk'; +const value = `bar, from js-sdk, ${Date()}`; + +await client.state.save({ + storeName, + states: { key, value }, +}); +console.log('saveState success, key: %j, value: %j', key, value); + +const resValue = await client.state.get({ storeName, key }); +console.log('getState success, key: %j, value: %j, toString: %j', + key, resValue, Buffer.from(resValue).toString('utf8')); +``` + +## Development + +### Install dependencies + +```bash +npm install +``` + +### Generate gRPC files + +```bash +npm run build:grpc +``` + +### Run Tests +### step 1. Set up the environment + +- Running redis under Docker + +```bash +docker pull redis:latest +docker run -itd --name redis-test -p 6380:6379 redis +``` + +- Running etcd under Docker + +```bash +docker pull quay.io/coreos/etcd +docker run -itd -p 2379:2379 --name etcd quay.io/coreos/etcd /usr/local/bin/etcd -advertise-client-urls http://0.0.0.0:2379 -listen-client-urls http://0.0.0.0:2379 +``` + +- Start a echoserver for testing the rpc api +```shell +go run demo/rpc/http/echoserver/echoserver.go +``` + +If you want to know more about this,check https://mosn.io/layotto/#/zh/start/rpc/helloworld + +- Start Layotto, see [How to run layotto](https://mosn.io/layotto/#/zh/start/state/start?id=%e7%ac%ac%e4%ba%8c%e6%ad%a5%ef%bc%9a%e8%bf%90%e8%a1%8clayotto) + +```bash +cd ${projectpath}/cmd/layotto +go build + +./layotto start -c ../../configs/config_integration_redis_etcd.json +``` + +### step 2: Run the tests +- Then, run the test script by npm + +```bash +npm run test:unit +``` + +Enable trace debug log for grpc-js: + +```bash +GRPC_TRACE=compression GRPC_VERBOSITY=debug GRPC_TRACE=all npm run test test/unit/client/Invoker.test.ts +``` + +## Reference + +- [Core concepts, architecture and lifecycle](https://grpc.io/docs/what-is-grpc/core-concepts/) +- [Get Start with gRPC on Node.js](https://grpc.io/docs/languages/node/quickstart/) +- [Node.js gRPC Library](https://grpc.github.io/grpc/node/) +- [Understanding Streams in Node.js](https://nodesource.com/blog/understanding-streams-in-nodejs/) +- [Go Proxy in China](https://learnku.com/go/wikis/38122) +- [How to build a bi-directional streaming gRPC service with Node.js and Java](https://medium.com/@Mark.io/bi-directional-streaming-grpc-with-node-js-and-java-7cbe0f1e0693) diff --git a/sdk/js-sdk/demo/configuration/subscribe.ts b/sdk/js-sdk/demo/configuration/subscribe.ts new file mode 100644 index 0000000000..b27a1a7b7d --- /dev/null +++ b/sdk/js-sdk/demo/configuration/subscribe.ts @@ -0,0 +1,91 @@ +/* + * Copyright 2021 Layotto 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. + */ +import { strict as assert } from 'assert'; +import { Client, utils } from 'layotto'; + +const client = new Client(); +assert(client); + +async function main() { + const hello = await client.hello.sayHello({ + name: 'js-sdk', + }); + console.log('%s', hello); + + await client.configuration.save({ + storeName: 'etcd', + appId: 'js-sdk-demo', + items: [ + { + key: 'hello', + content: 'world', + }, + ], + }); + + const call = client.configuration.subscribe({ + storeName: 'etcd', + appId: 'js-sdk-demo', + keys: ['hello'], + onData(items) { + console.log('get items: %j', items); + }, + onClose(err) { + console.error('close with error: %s', err); + } + }); + await utils.sleep(100); + + await client.configuration.save({ + storeName: 'etcd', + appId: 'js-sdk-demo', + items: [ + { + key: 'hello', + content: 'world first', + }, + ], + }); + + await utils.sleep(500); + await client.configuration.save({ + storeName: 'etcd', + appId: 'js-sdk-demo', + items: [ + { + key: 'hello', + content: 'world second after 500ms', + }, + ], + }); + + await utils.sleep(500); + await client.configuration.save({ + storeName: 'etcd', + appId: 'js-sdk-demo', + items: [ + { + key: 'hello', + content: 'world third after 1000ms', + }, + ], + }); + + await utils.sleep(500); + call.end(); + call.destroy(); +} + +main(); diff --git a/sdk/js-sdk/demo/helloworld.ts b/sdk/js-sdk/demo/helloworld.ts new file mode 100644 index 0000000000..d11f6eb204 --- /dev/null +++ b/sdk/js-sdk/demo/helloworld.ts @@ -0,0 +1,29 @@ +/* + * Copyright 2021 Layotto 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. + */ +import { strict as assert } from 'assert'; +import { Client } from 'layotto'; + +const client = new Client(); +assert(client); + +async function main() { + const hello = await client.hello.sayHello({ + serviceName: 'helloworld', + name: 'js-sdk', + }); + console.log('%s', hello); +} + +main(); diff --git a/sdk/js-sdk/demo/package.json b/sdk/js-sdk/demo/package.json new file mode 100644 index 0000000000..92ac9cc075 --- /dev/null +++ b/sdk/js-sdk/demo/package.json @@ -0,0 +1,16 @@ +{ + "name": "layotto-demo", + "version": "0.0.0", + "description": "Layotto Node.js SDK Demo", + "private": true, + "scripts": { + "test:all": "npm run test:cjs && npm run test:esm && npm run test:ts", + "test:cjs": "node ./state.js", + "test:esm": "node ./state.mjs", + "test:ts": "ts-node ./state.ts && ts-node ./configuration/subscribe.ts" + }, + "dependencies": { + "koa": "^2.13.4", + "layotto": "^0.0.1" + } +} diff --git a/sdk/js-sdk/demo/pubsub/client.mjs b/sdk/js-sdk/demo/pubsub/client.mjs new file mode 100644 index 0000000000..c25a942381 --- /dev/null +++ b/sdk/js-sdk/demo/pubsub/client.mjs @@ -0,0 +1,17 @@ +import { strict as assert } from 'assert'; +import { Client } from 'layotto'; + +const client = new Client(); +assert(client); + +async function main() { + const pubsubName = 'redis'; + const topic = 'topic1'; + const value = `bar, from js-sdk, ${Date()}`; + + await client.pubsub.publish({ + pubsubName, topic, data: { value }, + }); +} + +main(); diff --git a/sdk/js-sdk/demo/pubsub/client.ts b/sdk/js-sdk/demo/pubsub/client.ts new file mode 100644 index 0000000000..40904272a1 --- /dev/null +++ b/sdk/js-sdk/demo/pubsub/client.ts @@ -0,0 +1,31 @@ +/* + * Copyright 2021 Layotto 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. + */ +import { strict as assert } from 'assert' +import { Client } from 'layotto'; + +const client = new Client(); +assert(client); + +async function main() { + const pubsubName = 'redis'; + const topic = 'topic1'; + const value = `bar, from js-sdk, ${Date()}`; + + await client.pubsub.publish({ + pubsubName, topic, data: { value }, + }); +} + +main(); diff --git a/sdk/js-sdk/demo/pubsub/server.ts b/sdk/js-sdk/demo/pubsub/server.ts new file mode 100644 index 0000000000..6a95b4e1e3 --- /dev/null +++ b/sdk/js-sdk/demo/pubsub/server.ts @@ -0,0 +1,12 @@ +import { Server } from 'layotto'; + +async function main() { + const server = new Server(); + server.pubsub.subscribe('redis', 'topic1', async (data) => { + console.log('topic1 event data: %j', data); + }); + + await server.start(); +} + +main(); diff --git a/sdk/js-sdk/demo/rpc/http/server.js b/sdk/js-sdk/demo/rpc/http/server.js new file mode 100644 index 0000000000..20b9a6a2e0 --- /dev/null +++ b/sdk/js-sdk/demo/rpc/http/server.js @@ -0,0 +1,24 @@ +/* + * Copyright 2021 Layotto 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. + */ +const Koa = require('koa'); +const app = new Koa(); + +// response +app.use(ctx => { + console.log('%s %s, headers: %j', ctx.method, ctx.url, ctx.headers); + ctx.body = 'Hello Koa'; +}); + +app.listen(8889); diff --git a/sdk/js-sdk/demo/state.js b/sdk/js-sdk/demo/state.js new file mode 100644 index 0000000000..c2ff2a0158 --- /dev/null +++ b/sdk/js-sdk/demo/state.js @@ -0,0 +1,25 @@ +const { strict: assert } = require('assert'); +const { Client } = require('layotto'); + +const client = new Client(); +assert(client); + +async function main() { + const storeName = 'redis'; + const key = 'foo-js-sdk'; + const value = `bar, from js-sdk, ${Date()}`; + + await client.state.save({ + storeName, + states: [ + { key, value }, + ], + }); + console.log('saveState success, key: %j, value: %j', key, value); + + const state = await client.state.get({ storeName, key }); + console.log('getState success, key: %j, value: %j, toString: %j', + key, state.value, Buffer.from(state.value).toString('utf8')); +} + +main(); diff --git a/sdk/js-sdk/demo/state.mjs b/sdk/js-sdk/demo/state.mjs new file mode 100644 index 0000000000..ce5a11b9a4 --- /dev/null +++ b/sdk/js-sdk/demo/state.mjs @@ -0,0 +1,25 @@ +import { strict as assert } from 'assert'; +import { Client } from 'layotto'; + +const client = new Client(); +assert(client); + +async function main() { + const storeName = 'redis'; + const key = 'foo-js-sdk'; + const value = `bar, from js-sdk, ${Date()}`; + + await client.state.save({ + storeName, + states: [ + { key, value }, + ], + }); + console.log('saveState success, key: %j, value: %j', key, value); + + const state = await client.state.get({ storeName, key }); + console.log('getState success, key: %j, value: %j, toString: %j', + key, state.value, Buffer.from(state.value).toString('utf8')); +} + +main(); diff --git a/sdk/js-sdk/demo/state.ts b/sdk/js-sdk/demo/state.ts new file mode 100644 index 0000000000..cdb73dee0b --- /dev/null +++ b/sdk/js-sdk/demo/state.ts @@ -0,0 +1,44 @@ +/* + * Copyright 2021 Layotto 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. + */ +import { strict as assert } from 'assert' +import { Client } from 'layotto'; + +const client = new Client(); +assert(client); + +async function main() { + const storeName = 'redis'; + const key = 'foo-js-sdk'; + const value = `bar, from js-sdk, ${Date()}`; + + await client.state.save({ + storeName, + states: [ + { key, value }, + ], + requestMeta: { traceid: 'mock-tracerid-123123' }, + }); + console.log('saveState success, key: %j, value: %j', key, value); + + // await client.state.save(storeName, { key, value }); + // console.log('saveState success, key: %j, value: %j', key, value); + + const state = await client.state.get({ storeName, key }); + assert(state); + console.log('getState success, key: %j, value: %j, toString: %j', + key, state.value, Buffer.from(state.value).toString('utf8')); +} + +main(); diff --git a/sdk/js-sdk/jest.config.js b/sdk/js-sdk/jest.config.js new file mode 100644 index 0000000000..e86e13bab9 --- /dev/null +++ b/sdk/js-sdk/jest.config.js @@ -0,0 +1,5 @@ +/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ +module.exports = { + preset: 'ts-jest', + testEnvironment: 'node', +}; diff --git a/sdk/js-sdk/package.json b/sdk/js-sdk/package.json new file mode 100644 index 0000000000..a1cefeed8b --- /dev/null +++ b/sdk/js-sdk/package.json @@ -0,0 +1,68 @@ +{ + "name": "layotto", + "version": "0.0.1", + "description": "Layotto Node.js SDK", + "main": "dist/index.js", + "files": [ + "dist", + "proto", + "package.json", + "README.md" + ], + "scripts": { + "ci": "npm run lint && npm run build && npm run test:unit && npm run test:demo", + "test": "jest --runInBand --detectOpenHandles", + "test:unit": "NODE_ENV=test npm run test 'test/unit/.*\\.test\\.ts'", + "test:demo": "cd demo && npm run test:all", + "lint": "tslint -p tsconfig.json", + "build:grpc": "scripts/build-grpc.sh", + "tsc:clean": "rm -rf dist", + "tsc:cjs": "tsc -p tsconfig.json", + "build": "npm run tsc:clean && npm run tsc:cjs", + "rename:cjs": "for f in cjs/*.js; do mv -- \"$f\" \"${f/.js/.cjs}\"; done", + "prepublishOnly": "npm run build" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/mosn/layotto.git" + }, + "keywords": [ + "layotto", + "mosn" + ], + "author": "fengmk2", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/mosn/layotto/issues" + }, + "homepage": "https://github.com/mosn/layotto#readme", + "devDependencies": { + "@eggjs/tsconfig": "^1.0.0", + "@types/google-protobuf": "^3.15.5", + "@types/jest": "^27.0.2", + "egg-ci": "^1.19.0", + "grpc-tools": "^1.11.2", + "grpc_tools_node_protoc_ts": "^5.3.2", + "jest": "^27.2.5", + "ts-jest": "^27.0.7", + "ts-node": "^10.3.0", + "tslint": "^6.1.3", + "tslint-config-prettier": "^1.18.0", + "type-fest": "^2.5.2", + "typescript": "^4.4.4" + }, + "dependencies": { + "@grpc/grpc-js": "^1.4.1", + "google-protobuf": "^3.19.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "ci": { + "version": "14, 16", + "type": "github", + "os": { + "github": "linux, macos" + } + } +} diff --git a/sdk/js-sdk/proto/appcallback_grpc_pb.d.ts b/sdk/js-sdk/proto/appcallback_grpc_pb.d.ts new file mode 100644 index 0000000000..5cb6357b5b --- /dev/null +++ b/sdk/js-sdk/proto/appcallback_grpc_pb.d.ts @@ -0,0 +1,59 @@ +// package: spec.proto.runtime.v1 +// file: appcallback.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as grpc from "@grpc/grpc-js"; +import * as appcallback_pb from "./appcallback_pb"; +import * as google_protobuf_empty_pb from "google-protobuf/google/protobuf/empty_pb"; + +interface IAppCallbackService extends grpc.ServiceDefinition { + listTopicSubscriptions: IAppCallbackService_IListTopicSubscriptions; + onTopicEvent: IAppCallbackService_IOnTopicEvent; +} + +interface IAppCallbackService_IListTopicSubscriptions extends grpc.MethodDefinition { + path: "/spec.proto.runtime.v1.AppCallback/ListTopicSubscriptions"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IAppCallbackService_IOnTopicEvent extends grpc.MethodDefinition { + path: "/spec.proto.runtime.v1.AppCallback/OnTopicEvent"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} + +export const AppCallbackService: IAppCallbackService; + +export interface IAppCallbackServer extends grpc.UntypedServiceImplementation { + listTopicSubscriptions: grpc.handleUnaryCall; + onTopicEvent: grpc.handleUnaryCall; +} + +export interface IAppCallbackClient { + listTopicSubscriptions(request: google_protobuf_empty_pb.Empty, callback: (error: grpc.ServiceError | null, response: appcallback_pb.ListTopicSubscriptionsResponse) => void): grpc.ClientUnaryCall; + listTopicSubscriptions(request: google_protobuf_empty_pb.Empty, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: appcallback_pb.ListTopicSubscriptionsResponse) => void): grpc.ClientUnaryCall; + listTopicSubscriptions(request: google_protobuf_empty_pb.Empty, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: appcallback_pb.ListTopicSubscriptionsResponse) => void): grpc.ClientUnaryCall; + onTopicEvent(request: appcallback_pb.TopicEventRequest, callback: (error: grpc.ServiceError | null, response: appcallback_pb.TopicEventResponse) => void): grpc.ClientUnaryCall; + onTopicEvent(request: appcallback_pb.TopicEventRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: appcallback_pb.TopicEventResponse) => void): grpc.ClientUnaryCall; + onTopicEvent(request: appcallback_pb.TopicEventRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: appcallback_pb.TopicEventResponse) => void): grpc.ClientUnaryCall; +} + +export class AppCallbackClient extends grpc.Client implements IAppCallbackClient { + constructor(address: string, credentials: grpc.ChannelCredentials, options?: Partial); + public listTopicSubscriptions(request: google_protobuf_empty_pb.Empty, callback: (error: grpc.ServiceError | null, response: appcallback_pb.ListTopicSubscriptionsResponse) => void): grpc.ClientUnaryCall; + public listTopicSubscriptions(request: google_protobuf_empty_pb.Empty, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: appcallback_pb.ListTopicSubscriptionsResponse) => void): grpc.ClientUnaryCall; + public listTopicSubscriptions(request: google_protobuf_empty_pb.Empty, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: appcallback_pb.ListTopicSubscriptionsResponse) => void): grpc.ClientUnaryCall; + public onTopicEvent(request: appcallback_pb.TopicEventRequest, callback: (error: grpc.ServiceError | null, response: appcallback_pb.TopicEventResponse) => void): grpc.ClientUnaryCall; + public onTopicEvent(request: appcallback_pb.TopicEventRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: appcallback_pb.TopicEventResponse) => void): grpc.ClientUnaryCall; + public onTopicEvent(request: appcallback_pb.TopicEventRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: appcallback_pb.TopicEventResponse) => void): grpc.ClientUnaryCall; +} diff --git a/sdk/js-sdk/proto/appcallback_grpc_pb.js b/sdk/js-sdk/proto/appcallback_grpc_pb.js new file mode 100644 index 0000000000..044a4b54fb --- /dev/null +++ b/sdk/js-sdk/proto/appcallback_grpc_pb.js @@ -0,0 +1,85 @@ +// GENERATED CODE -- DO NOT EDIT! + +'use strict'; +var grpc = require('@grpc/grpc-js'); +var appcallback_pb = require('./appcallback_pb.js'); +var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js'); + +function serialize_google_protobuf_Empty(arg) { + if (!(arg instanceof google_protobuf_empty_pb.Empty)) { + throw new Error('Expected argument of type google.protobuf.Empty'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_google_protobuf_Empty(buffer_arg) { + return google_protobuf_empty_pb.Empty.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_ListTopicSubscriptionsResponse(arg) { + if (!(arg instanceof appcallback_pb.ListTopicSubscriptionsResponse)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.ListTopicSubscriptionsResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_ListTopicSubscriptionsResponse(buffer_arg) { + return appcallback_pb.ListTopicSubscriptionsResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_TopicEventRequest(arg) { + if (!(arg instanceof appcallback_pb.TopicEventRequest)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.TopicEventRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_TopicEventRequest(buffer_arg) { + return appcallback_pb.TopicEventRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_TopicEventResponse(arg) { + if (!(arg instanceof appcallback_pb.TopicEventResponse)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.TopicEventResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_TopicEventResponse(buffer_arg) { + return appcallback_pb.TopicEventResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + + +// AppCallback V1 allows user application to interact with runtime. +// User application needs to implement AppCallback service if it needs to +// receive message from runtime. +var AppCallbackService = exports.AppCallbackService = { + // Lists all topics subscribed by this app. +listTopicSubscriptions: { + path: '/spec.proto.runtime.v1.AppCallback/ListTopicSubscriptions', + requestStream: false, + responseStream: false, + requestType: google_protobuf_empty_pb.Empty, + responseType: appcallback_pb.ListTopicSubscriptionsResponse, + requestSerialize: serialize_google_protobuf_Empty, + requestDeserialize: deserialize_google_protobuf_Empty, + responseSerialize: serialize_spec_proto_runtime_v1_ListTopicSubscriptionsResponse, + responseDeserialize: deserialize_spec_proto_runtime_v1_ListTopicSubscriptionsResponse, + }, + // Subscribes events from Pubsub +onTopicEvent: { + path: '/spec.proto.runtime.v1.AppCallback/OnTopicEvent', + requestStream: false, + responseStream: false, + requestType: appcallback_pb.TopicEventRequest, + responseType: appcallback_pb.TopicEventResponse, + requestSerialize: serialize_spec_proto_runtime_v1_TopicEventRequest, + requestDeserialize: deserialize_spec_proto_runtime_v1_TopicEventRequest, + responseSerialize: serialize_spec_proto_runtime_v1_TopicEventResponse, + responseDeserialize: deserialize_spec_proto_runtime_v1_TopicEventResponse, + }, +}; + +exports.AppCallbackClient = grpc.makeGenericClientConstructor(AppCallbackService); +// // Invokes service method with InvokeRequest. +// rpc OnInvoke (InvokeRequest) returns (InvokeResponse) {} diff --git a/sdk/js-sdk/proto/appcallback_pb.d.ts b/sdk/js-sdk/proto/appcallback_pb.d.ts new file mode 100644 index 0000000000..5807b6e124 --- /dev/null +++ b/sdk/js-sdk/proto/appcallback_pb.d.ts @@ -0,0 +1,128 @@ +// package: spec.proto.runtime.v1 +// file: appcallback.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; +import * as google_protobuf_empty_pb from "google-protobuf/google/protobuf/empty_pb"; + +export class TopicEventRequest extends jspb.Message { + getId(): string; + setId(value: string): TopicEventRequest; + getSource(): string; + setSource(value: string): TopicEventRequest; + getType(): string; + setType(value: string): TopicEventRequest; + getSpecVersion(): string; + setSpecVersion(value: string): TopicEventRequest; + getDataContentType(): string; + setDataContentType(value: string): TopicEventRequest; + getData(): Uint8Array | string; + getData_asU8(): Uint8Array; + getData_asB64(): string; + setData(value: Uint8Array | string): TopicEventRequest; + getTopic(): string; + setTopic(value: string): TopicEventRequest; + getPubsubName(): string; + setPubsubName(value: string): TopicEventRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): TopicEventRequest.AsObject; + static toObject(includeInstance: boolean, msg: TopicEventRequest): TopicEventRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: TopicEventRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): TopicEventRequest; + static deserializeBinaryFromReader(message: TopicEventRequest, reader: jspb.BinaryReader): TopicEventRequest; +} + +export namespace TopicEventRequest { + export type AsObject = { + id: string, + source: string, + type: string, + specVersion: string, + dataContentType: string, + data: Uint8Array | string, + topic: string, + pubsubName: string, + } +} + +export class TopicEventResponse extends jspb.Message { + getStatus(): TopicEventResponse.TopicEventResponseStatus; + setStatus(value: TopicEventResponse.TopicEventResponseStatus): TopicEventResponse; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): TopicEventResponse.AsObject; + static toObject(includeInstance: boolean, msg: TopicEventResponse): TopicEventResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: TopicEventResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): TopicEventResponse; + static deserializeBinaryFromReader(message: TopicEventResponse, reader: jspb.BinaryReader): TopicEventResponse; +} + +export namespace TopicEventResponse { + export type AsObject = { + status: TopicEventResponse.TopicEventResponseStatus, + } + + export enum TopicEventResponseStatus { + SUCCESS = 0, + RETRY = 1, + DROP = 2, + } + +} + +export class ListTopicSubscriptionsResponse extends jspb.Message { + clearSubscriptionsList(): void; + getSubscriptionsList(): Array; + setSubscriptionsList(value: Array): ListTopicSubscriptionsResponse; + addSubscriptions(value?: TopicSubscription, index?: number): TopicSubscription; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ListTopicSubscriptionsResponse.AsObject; + static toObject(includeInstance: boolean, msg: ListTopicSubscriptionsResponse): ListTopicSubscriptionsResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ListTopicSubscriptionsResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ListTopicSubscriptionsResponse; + static deserializeBinaryFromReader(message: ListTopicSubscriptionsResponse, reader: jspb.BinaryReader): ListTopicSubscriptionsResponse; +} + +export namespace ListTopicSubscriptionsResponse { + export type AsObject = { + subscriptionsList: Array, + } +} + +export class TopicSubscription extends jspb.Message { + getPubsubName(): string; + setPubsubName(value: string): TopicSubscription; + getTopic(): string; + setTopic(value: string): TopicSubscription; + + getMetadataMap(): jspb.Map; + clearMetadataMap(): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): TopicSubscription.AsObject; + static toObject(includeInstance: boolean, msg: TopicSubscription): TopicSubscription.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: TopicSubscription, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): TopicSubscription; + static deserializeBinaryFromReader(message: TopicSubscription, reader: jspb.BinaryReader): TopicSubscription; +} + +export namespace TopicSubscription { + export type AsObject = { + pubsubName: string, + topic: string, + + metadataMap: Array<[string, string]>, + } +} diff --git a/sdk/js-sdk/proto/appcallback_pb.js b/sdk/js-sdk/proto/appcallback_pb.js new file mode 100644 index 0000000000..021406fecc --- /dev/null +++ b/sdk/js-sdk/proto/appcallback_pb.js @@ -0,0 +1,965 @@ +// source: appcallback.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js'); +goog.object.extend(proto, google_protobuf_empty_pb); +goog.exportSymbol('proto.spec.proto.runtime.v1.ListTopicSubscriptionsResponse', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.TopicEventRequest', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.TopicEventResponse', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.TopicEventResponse.TopicEventResponseStatus', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.TopicSubscription', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.TopicEventRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.TopicEventRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.TopicEventRequest.displayName = 'proto.spec.proto.runtime.v1.TopicEventRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.TopicEventResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.TopicEventResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.TopicEventResponse.displayName = 'proto.spec.proto.runtime.v1.TopicEventResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.ListTopicSubscriptionsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.spec.proto.runtime.v1.ListTopicSubscriptionsResponse.repeatedFields_, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.ListTopicSubscriptionsResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.ListTopicSubscriptionsResponse.displayName = 'proto.spec.proto.runtime.v1.ListTopicSubscriptionsResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.TopicSubscription = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.TopicSubscription, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.TopicSubscription.displayName = 'proto.spec.proto.runtime.v1.TopicSubscription'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.TopicEventRequest.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.TopicEventRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.TopicEventRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.TopicEventRequest.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, ""), + source: jspb.Message.getFieldWithDefault(msg, 2, ""), + type: jspb.Message.getFieldWithDefault(msg, 3, ""), + specVersion: jspb.Message.getFieldWithDefault(msg, 4, ""), + dataContentType: jspb.Message.getFieldWithDefault(msg, 5, ""), + data: msg.getData_asB64(), + topic: jspb.Message.getFieldWithDefault(msg, 6, ""), + pubsubName: jspb.Message.getFieldWithDefault(msg, 8, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.TopicEventRequest} + */ +proto.spec.proto.runtime.v1.TopicEventRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.TopicEventRequest; + return proto.spec.proto.runtime.v1.TopicEventRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.TopicEventRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.TopicEventRequest} + */ +proto.spec.proto.runtime.v1.TopicEventRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setId(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setSource(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setType(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setSpecVersion(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setDataContentType(value); + break; + case 7: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setData(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setTopic(value); + break; + case 8: + var value = /** @type {string} */ (reader.readString()); + msg.setPubsubName(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.TopicEventRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.TopicEventRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.TopicEventRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.TopicEventRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getSource(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getType(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getSpecVersion(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getDataContentType(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } + f = message.getData_asU8(); + if (f.length > 0) { + writer.writeBytes( + 7, + f + ); + } + f = message.getTopic(); + if (f.length > 0) { + writer.writeString( + 6, + f + ); + } + f = message.getPubsubName(); + if (f.length > 0) { + writer.writeString( + 8, + f + ); + } +}; + + +/** + * optional string id = 1; + * @return {string} + */ +proto.spec.proto.runtime.v1.TopicEventRequest.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.TopicEventRequest} returns this + */ +proto.spec.proto.runtime.v1.TopicEventRequest.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string source = 2; + * @return {string} + */ +proto.spec.proto.runtime.v1.TopicEventRequest.prototype.getSource = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.TopicEventRequest} returns this + */ +proto.spec.proto.runtime.v1.TopicEventRequest.prototype.setSource = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string type = 3; + * @return {string} + */ +proto.spec.proto.runtime.v1.TopicEventRequest.prototype.getType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.TopicEventRequest} returns this + */ +proto.spec.proto.runtime.v1.TopicEventRequest.prototype.setType = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string spec_version = 4; + * @return {string} + */ +proto.spec.proto.runtime.v1.TopicEventRequest.prototype.getSpecVersion = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.TopicEventRequest} returns this + */ +proto.spec.proto.runtime.v1.TopicEventRequest.prototype.setSpecVersion = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional string data_content_type = 5; + * @return {string} + */ +proto.spec.proto.runtime.v1.TopicEventRequest.prototype.getDataContentType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.TopicEventRequest} returns this + */ +proto.spec.proto.runtime.v1.TopicEventRequest.prototype.setDataContentType = function(value) { + return jspb.Message.setProto3StringField(this, 5, value); +}; + + +/** + * optional bytes data = 7; + * @return {!(string|Uint8Array)} + */ +proto.spec.proto.runtime.v1.TopicEventRequest.prototype.getData = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 7, "")); +}; + + +/** + * optional bytes data = 7; + * This is a type-conversion wrapper around `getData()` + * @return {string} + */ +proto.spec.proto.runtime.v1.TopicEventRequest.prototype.getData_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getData())); +}; + + +/** + * optional bytes data = 7; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getData()` + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.TopicEventRequest.prototype.getData_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getData())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.spec.proto.runtime.v1.TopicEventRequest} returns this + */ +proto.spec.proto.runtime.v1.TopicEventRequest.prototype.setData = function(value) { + return jspb.Message.setProto3BytesField(this, 7, value); +}; + + +/** + * optional string topic = 6; + * @return {string} + */ +proto.spec.proto.runtime.v1.TopicEventRequest.prototype.getTopic = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.TopicEventRequest} returns this + */ +proto.spec.proto.runtime.v1.TopicEventRequest.prototype.setTopic = function(value) { + return jspb.Message.setProto3StringField(this, 6, value); +}; + + +/** + * optional string pubsub_name = 8; + * @return {string} + */ +proto.spec.proto.runtime.v1.TopicEventRequest.prototype.getPubsubName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.TopicEventRequest} returns this + */ +proto.spec.proto.runtime.v1.TopicEventRequest.prototype.setPubsubName = function(value) { + return jspb.Message.setProto3StringField(this, 8, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.TopicEventResponse.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.TopicEventResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.TopicEventResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.TopicEventResponse.toObject = function(includeInstance, msg) { + var f, obj = { + status: jspb.Message.getFieldWithDefault(msg, 1, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.TopicEventResponse} + */ +proto.spec.proto.runtime.v1.TopicEventResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.TopicEventResponse; + return proto.spec.proto.runtime.v1.TopicEventResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.TopicEventResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.TopicEventResponse} + */ +proto.spec.proto.runtime.v1.TopicEventResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.spec.proto.runtime.v1.TopicEventResponse.TopicEventResponseStatus} */ (reader.readEnum()); + msg.setStatus(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.TopicEventResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.TopicEventResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.TopicEventResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.TopicEventResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStatus(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.spec.proto.runtime.v1.TopicEventResponse.TopicEventResponseStatus = { + SUCCESS: 0, + RETRY: 1, + DROP: 2 +}; + +/** + * optional TopicEventResponseStatus status = 1; + * @return {!proto.spec.proto.runtime.v1.TopicEventResponse.TopicEventResponseStatus} + */ +proto.spec.proto.runtime.v1.TopicEventResponse.prototype.getStatus = function() { + return /** @type {!proto.spec.proto.runtime.v1.TopicEventResponse.TopicEventResponseStatus} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {!proto.spec.proto.runtime.v1.TopicEventResponse.TopicEventResponseStatus} value + * @return {!proto.spec.proto.runtime.v1.TopicEventResponse} returns this + */ +proto.spec.proto.runtime.v1.TopicEventResponse.prototype.setStatus = function(value) { + return jspb.Message.setProto3EnumField(this, 1, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.spec.proto.runtime.v1.ListTopicSubscriptionsResponse.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.ListTopicSubscriptionsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.ListTopicSubscriptionsResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.ListTopicSubscriptionsResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.ListTopicSubscriptionsResponse.toObject = function(includeInstance, msg) { + var f, obj = { + subscriptionsList: jspb.Message.toObjectList(msg.getSubscriptionsList(), + proto.spec.proto.runtime.v1.TopicSubscription.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.ListTopicSubscriptionsResponse} + */ +proto.spec.proto.runtime.v1.ListTopicSubscriptionsResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.ListTopicSubscriptionsResponse; + return proto.spec.proto.runtime.v1.ListTopicSubscriptionsResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.ListTopicSubscriptionsResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.ListTopicSubscriptionsResponse} + */ +proto.spec.proto.runtime.v1.ListTopicSubscriptionsResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.spec.proto.runtime.v1.TopicSubscription; + reader.readMessage(value,proto.spec.proto.runtime.v1.TopicSubscription.deserializeBinaryFromReader); + msg.addSubscriptions(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.ListTopicSubscriptionsResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.ListTopicSubscriptionsResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.ListTopicSubscriptionsResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.ListTopicSubscriptionsResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSubscriptionsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.spec.proto.runtime.v1.TopicSubscription.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated TopicSubscription subscriptions = 1; + * @return {!Array} + */ +proto.spec.proto.runtime.v1.ListTopicSubscriptionsResponse.prototype.getSubscriptionsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.spec.proto.runtime.v1.TopicSubscription, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.spec.proto.runtime.v1.ListTopicSubscriptionsResponse} returns this +*/ +proto.spec.proto.runtime.v1.ListTopicSubscriptionsResponse.prototype.setSubscriptionsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.spec.proto.runtime.v1.TopicSubscription=} opt_value + * @param {number=} opt_index + * @return {!proto.spec.proto.runtime.v1.TopicSubscription} + */ +proto.spec.proto.runtime.v1.ListTopicSubscriptionsResponse.prototype.addSubscriptions = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.spec.proto.runtime.v1.TopicSubscription, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.spec.proto.runtime.v1.ListTopicSubscriptionsResponse} returns this + */ +proto.spec.proto.runtime.v1.ListTopicSubscriptionsResponse.prototype.clearSubscriptionsList = function() { + return this.setSubscriptionsList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.TopicSubscription.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.TopicSubscription.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.TopicSubscription} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.TopicSubscription.toObject = function(includeInstance, msg) { + var f, obj = { + pubsubName: jspb.Message.getFieldWithDefault(msg, 1, ""), + topic: jspb.Message.getFieldWithDefault(msg, 2, ""), + metadataMap: (f = msg.getMetadataMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.TopicSubscription} + */ +proto.spec.proto.runtime.v1.TopicSubscription.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.TopicSubscription; + return proto.spec.proto.runtime.v1.TopicSubscription.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.TopicSubscription} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.TopicSubscription} + */ +proto.spec.proto.runtime.v1.TopicSubscription.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setPubsubName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setTopic(value); + break; + case 3: + var value = msg.getMetadataMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.TopicSubscription.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.TopicSubscription.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.TopicSubscription} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.TopicSubscription.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPubsubName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getTopic(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getMetadataMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(3, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } +}; + + +/** + * optional string pubsub_name = 1; + * @return {string} + */ +proto.spec.proto.runtime.v1.TopicSubscription.prototype.getPubsubName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.TopicSubscription} returns this + */ +proto.spec.proto.runtime.v1.TopicSubscription.prototype.setPubsubName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string topic = 2; + * @return {string} + */ +proto.spec.proto.runtime.v1.TopicSubscription.prototype.getTopic = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.TopicSubscription} returns this + */ +proto.spec.proto.runtime.v1.TopicSubscription.prototype.setTopic = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * map metadata = 3; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.spec.proto.runtime.v1.TopicSubscription.prototype.getMetadataMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 3, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.spec.proto.runtime.v1.TopicSubscription} returns this + */ +proto.spec.proto.runtime.v1.TopicSubscription.prototype.clearMetadataMap = function() { + this.getMetadataMap().clear(); + return this;}; + + +goog.object.extend(exports, proto.spec.proto.runtime.v1); diff --git a/sdk/js-sdk/proto/runtime_grpc_pb.d.ts b/sdk/js-sdk/proto/runtime_grpc_pb.d.ts new file mode 100644 index 0000000000..52ea7d87db --- /dev/null +++ b/sdk/js-sdk/proto/runtime_grpc_pb.d.ts @@ -0,0 +1,382 @@ +// package: spec.proto.runtime.v1 +// file: runtime.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as grpc from "@grpc/grpc-js"; +import * as runtime_pb from "./runtime_pb"; +import * as google_protobuf_empty_pb from "google-protobuf/google/protobuf/empty_pb"; +import * as google_protobuf_any_pb from "google-protobuf/google/protobuf/any_pb"; + +interface IRuntimeService extends grpc.ServiceDefinition { + sayHello: IRuntimeService_ISayHello; + invokeService: IRuntimeService_IInvokeService; + getConfiguration: IRuntimeService_IGetConfiguration; + saveConfiguration: IRuntimeService_ISaveConfiguration; + deleteConfiguration: IRuntimeService_IDeleteConfiguration; + subscribeConfiguration: IRuntimeService_ISubscribeConfiguration; + tryLock: IRuntimeService_ITryLock; + unlock: IRuntimeService_IUnlock; + getNextId: IRuntimeService_IGetNextId; + getState: IRuntimeService_IGetState; + getBulkState: IRuntimeService_IGetBulkState; + saveState: IRuntimeService_ISaveState; + deleteState: IRuntimeService_IDeleteState; + deleteBulkState: IRuntimeService_IDeleteBulkState; + executeStateTransaction: IRuntimeService_IExecuteStateTransaction; + publishEvent: IRuntimeService_IPublishEvent; + getFile: IRuntimeService_IGetFile; + putFile: IRuntimeService_IPutFile; + listFile: IRuntimeService_IListFile; + delFile: IRuntimeService_IDelFile; + invokeBinding: IRuntimeService_IInvokeBinding; +} + +interface IRuntimeService_ISayHello extends grpc.MethodDefinition { + path: "/spec.proto.runtime.v1.Runtime/SayHello"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IRuntimeService_IInvokeService extends grpc.MethodDefinition { + path: "/spec.proto.runtime.v1.Runtime/InvokeService"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IRuntimeService_IGetConfiguration extends grpc.MethodDefinition { + path: "/spec.proto.runtime.v1.Runtime/GetConfiguration"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IRuntimeService_ISaveConfiguration extends grpc.MethodDefinition { + path: "/spec.proto.runtime.v1.Runtime/SaveConfiguration"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IRuntimeService_IDeleteConfiguration extends grpc.MethodDefinition { + path: "/spec.proto.runtime.v1.Runtime/DeleteConfiguration"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IRuntimeService_ISubscribeConfiguration extends grpc.MethodDefinition { + path: "/spec.proto.runtime.v1.Runtime/SubscribeConfiguration"; + requestStream: true; + responseStream: true; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IRuntimeService_ITryLock extends grpc.MethodDefinition { + path: "/spec.proto.runtime.v1.Runtime/TryLock"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IRuntimeService_IUnlock extends grpc.MethodDefinition { + path: "/spec.proto.runtime.v1.Runtime/Unlock"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IRuntimeService_IGetNextId extends grpc.MethodDefinition { + path: "/spec.proto.runtime.v1.Runtime/GetNextId"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IRuntimeService_IGetState extends grpc.MethodDefinition { + path: "/spec.proto.runtime.v1.Runtime/GetState"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IRuntimeService_IGetBulkState extends grpc.MethodDefinition { + path: "/spec.proto.runtime.v1.Runtime/GetBulkState"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IRuntimeService_ISaveState extends grpc.MethodDefinition { + path: "/spec.proto.runtime.v1.Runtime/SaveState"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IRuntimeService_IDeleteState extends grpc.MethodDefinition { + path: "/spec.proto.runtime.v1.Runtime/DeleteState"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IRuntimeService_IDeleteBulkState extends grpc.MethodDefinition { + path: "/spec.proto.runtime.v1.Runtime/DeleteBulkState"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IRuntimeService_IExecuteStateTransaction extends grpc.MethodDefinition { + path: "/spec.proto.runtime.v1.Runtime/ExecuteStateTransaction"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IRuntimeService_IPublishEvent extends grpc.MethodDefinition { + path: "/spec.proto.runtime.v1.Runtime/PublishEvent"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IRuntimeService_IGetFile extends grpc.MethodDefinition { + path: "/spec.proto.runtime.v1.Runtime/GetFile"; + requestStream: false; + responseStream: true; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IRuntimeService_IPutFile extends grpc.MethodDefinition { + path: "/spec.proto.runtime.v1.Runtime/PutFile"; + requestStream: true; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IRuntimeService_IListFile extends grpc.MethodDefinition { + path: "/spec.proto.runtime.v1.Runtime/ListFile"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IRuntimeService_IDelFile extends grpc.MethodDefinition { + path: "/spec.proto.runtime.v1.Runtime/DelFile"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface IRuntimeService_IInvokeBinding extends grpc.MethodDefinition { + path: "/spec.proto.runtime.v1.Runtime/InvokeBinding"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} + +export const RuntimeService: IRuntimeService; + +export interface IRuntimeServer extends grpc.UntypedServiceImplementation { + sayHello: grpc.handleUnaryCall; + invokeService: grpc.handleUnaryCall; + getConfiguration: grpc.handleUnaryCall; + saveConfiguration: grpc.handleUnaryCall; + deleteConfiguration: grpc.handleUnaryCall; + subscribeConfiguration: grpc.handleBidiStreamingCall; + tryLock: grpc.handleUnaryCall; + unlock: grpc.handleUnaryCall; + getNextId: grpc.handleUnaryCall; + getState: grpc.handleUnaryCall; + getBulkState: grpc.handleUnaryCall; + saveState: grpc.handleUnaryCall; + deleteState: grpc.handleUnaryCall; + deleteBulkState: grpc.handleUnaryCall; + executeStateTransaction: grpc.handleUnaryCall; + publishEvent: grpc.handleUnaryCall; + getFile: grpc.handleServerStreamingCall; + putFile: grpc.handleClientStreamingCall; + listFile: grpc.handleUnaryCall; + delFile: grpc.handleUnaryCall; + invokeBinding: grpc.handleUnaryCall; +} + +export interface IRuntimeClient { + sayHello(request: runtime_pb.SayHelloRequest, callback: (error: grpc.ServiceError | null, response: runtime_pb.SayHelloResponse) => void): grpc.ClientUnaryCall; + sayHello(request: runtime_pb.SayHelloRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: runtime_pb.SayHelloResponse) => void): grpc.ClientUnaryCall; + sayHello(request: runtime_pb.SayHelloRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: runtime_pb.SayHelloResponse) => void): grpc.ClientUnaryCall; + invokeService(request: runtime_pb.InvokeServiceRequest, callback: (error: grpc.ServiceError | null, response: runtime_pb.InvokeResponse) => void): grpc.ClientUnaryCall; + invokeService(request: runtime_pb.InvokeServiceRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: runtime_pb.InvokeResponse) => void): grpc.ClientUnaryCall; + invokeService(request: runtime_pb.InvokeServiceRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: runtime_pb.InvokeResponse) => void): grpc.ClientUnaryCall; + getConfiguration(request: runtime_pb.GetConfigurationRequest, callback: (error: grpc.ServiceError | null, response: runtime_pb.GetConfigurationResponse) => void): grpc.ClientUnaryCall; + getConfiguration(request: runtime_pb.GetConfigurationRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: runtime_pb.GetConfigurationResponse) => void): grpc.ClientUnaryCall; + getConfiguration(request: runtime_pb.GetConfigurationRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: runtime_pb.GetConfigurationResponse) => void): grpc.ClientUnaryCall; + saveConfiguration(request: runtime_pb.SaveConfigurationRequest, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + saveConfiguration(request: runtime_pb.SaveConfigurationRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + saveConfiguration(request: runtime_pb.SaveConfigurationRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + deleteConfiguration(request: runtime_pb.DeleteConfigurationRequest, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + deleteConfiguration(request: runtime_pb.DeleteConfigurationRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + deleteConfiguration(request: runtime_pb.DeleteConfigurationRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + subscribeConfiguration(): grpc.ClientDuplexStream; + subscribeConfiguration(options: Partial): grpc.ClientDuplexStream; + subscribeConfiguration(metadata: grpc.Metadata, options?: Partial): grpc.ClientDuplexStream; + tryLock(request: runtime_pb.TryLockRequest, callback: (error: grpc.ServiceError | null, response: runtime_pb.TryLockResponse) => void): grpc.ClientUnaryCall; + tryLock(request: runtime_pb.TryLockRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: runtime_pb.TryLockResponse) => void): grpc.ClientUnaryCall; + tryLock(request: runtime_pb.TryLockRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: runtime_pb.TryLockResponse) => void): grpc.ClientUnaryCall; + unlock(request: runtime_pb.UnlockRequest, callback: (error: grpc.ServiceError | null, response: runtime_pb.UnlockResponse) => void): grpc.ClientUnaryCall; + unlock(request: runtime_pb.UnlockRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: runtime_pb.UnlockResponse) => void): grpc.ClientUnaryCall; + unlock(request: runtime_pb.UnlockRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: runtime_pb.UnlockResponse) => void): grpc.ClientUnaryCall; + getNextId(request: runtime_pb.GetNextIdRequest, callback: (error: grpc.ServiceError | null, response: runtime_pb.GetNextIdResponse) => void): grpc.ClientUnaryCall; + getNextId(request: runtime_pb.GetNextIdRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: runtime_pb.GetNextIdResponse) => void): grpc.ClientUnaryCall; + getNextId(request: runtime_pb.GetNextIdRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: runtime_pb.GetNextIdResponse) => void): grpc.ClientUnaryCall; + getState(request: runtime_pb.GetStateRequest, callback: (error: grpc.ServiceError | null, response: runtime_pb.GetStateResponse) => void): grpc.ClientUnaryCall; + getState(request: runtime_pb.GetStateRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: runtime_pb.GetStateResponse) => void): grpc.ClientUnaryCall; + getState(request: runtime_pb.GetStateRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: runtime_pb.GetStateResponse) => void): grpc.ClientUnaryCall; + getBulkState(request: runtime_pb.GetBulkStateRequest, callback: (error: grpc.ServiceError | null, response: runtime_pb.GetBulkStateResponse) => void): grpc.ClientUnaryCall; + getBulkState(request: runtime_pb.GetBulkStateRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: runtime_pb.GetBulkStateResponse) => void): grpc.ClientUnaryCall; + getBulkState(request: runtime_pb.GetBulkStateRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: runtime_pb.GetBulkStateResponse) => void): grpc.ClientUnaryCall; + saveState(request: runtime_pb.SaveStateRequest, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + saveState(request: runtime_pb.SaveStateRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + saveState(request: runtime_pb.SaveStateRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + deleteState(request: runtime_pb.DeleteStateRequest, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + deleteState(request: runtime_pb.DeleteStateRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + deleteState(request: runtime_pb.DeleteStateRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + deleteBulkState(request: runtime_pb.DeleteBulkStateRequest, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + deleteBulkState(request: runtime_pb.DeleteBulkStateRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + deleteBulkState(request: runtime_pb.DeleteBulkStateRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + executeStateTransaction(request: runtime_pb.ExecuteStateTransactionRequest, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + executeStateTransaction(request: runtime_pb.ExecuteStateTransactionRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + executeStateTransaction(request: runtime_pb.ExecuteStateTransactionRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + publishEvent(request: runtime_pb.PublishEventRequest, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + publishEvent(request: runtime_pb.PublishEventRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + publishEvent(request: runtime_pb.PublishEventRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + getFile(request: runtime_pb.GetFileRequest, options?: Partial): grpc.ClientReadableStream; + getFile(request: runtime_pb.GetFileRequest, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; + putFile(callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientWritableStream; + putFile(metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientWritableStream; + putFile(options: Partial, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientWritableStream; + putFile(metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientWritableStream; + listFile(request: runtime_pb.ListFileRequest, callback: (error: grpc.ServiceError | null, response: runtime_pb.ListFileResp) => void): grpc.ClientUnaryCall; + listFile(request: runtime_pb.ListFileRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: runtime_pb.ListFileResp) => void): grpc.ClientUnaryCall; + listFile(request: runtime_pb.ListFileRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: runtime_pb.ListFileResp) => void): grpc.ClientUnaryCall; + delFile(request: runtime_pb.DelFileRequest, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + delFile(request: runtime_pb.DelFileRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + delFile(request: runtime_pb.DelFileRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + invokeBinding(request: runtime_pb.InvokeBindingRequest, callback: (error: grpc.ServiceError | null, response: runtime_pb.InvokeBindingResponse) => void): grpc.ClientUnaryCall; + invokeBinding(request: runtime_pb.InvokeBindingRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: runtime_pb.InvokeBindingResponse) => void): grpc.ClientUnaryCall; + invokeBinding(request: runtime_pb.InvokeBindingRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: runtime_pb.InvokeBindingResponse) => void): grpc.ClientUnaryCall; +} + +export class RuntimeClient extends grpc.Client implements IRuntimeClient { + constructor(address: string, credentials: grpc.ChannelCredentials, options?: Partial); + public sayHello(request: runtime_pb.SayHelloRequest, callback: (error: grpc.ServiceError | null, response: runtime_pb.SayHelloResponse) => void): grpc.ClientUnaryCall; + public sayHello(request: runtime_pb.SayHelloRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: runtime_pb.SayHelloResponse) => void): grpc.ClientUnaryCall; + public sayHello(request: runtime_pb.SayHelloRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: runtime_pb.SayHelloResponse) => void): grpc.ClientUnaryCall; + public invokeService(request: runtime_pb.InvokeServiceRequest, callback: (error: grpc.ServiceError | null, response: runtime_pb.InvokeResponse) => void): grpc.ClientUnaryCall; + public invokeService(request: runtime_pb.InvokeServiceRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: runtime_pb.InvokeResponse) => void): grpc.ClientUnaryCall; + public invokeService(request: runtime_pb.InvokeServiceRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: runtime_pb.InvokeResponse) => void): grpc.ClientUnaryCall; + public getConfiguration(request: runtime_pb.GetConfigurationRequest, callback: (error: grpc.ServiceError | null, response: runtime_pb.GetConfigurationResponse) => void): grpc.ClientUnaryCall; + public getConfiguration(request: runtime_pb.GetConfigurationRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: runtime_pb.GetConfigurationResponse) => void): grpc.ClientUnaryCall; + public getConfiguration(request: runtime_pb.GetConfigurationRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: runtime_pb.GetConfigurationResponse) => void): grpc.ClientUnaryCall; + public saveConfiguration(request: runtime_pb.SaveConfigurationRequest, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + public saveConfiguration(request: runtime_pb.SaveConfigurationRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + public saveConfiguration(request: runtime_pb.SaveConfigurationRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + public deleteConfiguration(request: runtime_pb.DeleteConfigurationRequest, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + public deleteConfiguration(request: runtime_pb.DeleteConfigurationRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + public deleteConfiguration(request: runtime_pb.DeleteConfigurationRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + public subscribeConfiguration(options?: Partial): grpc.ClientDuplexStream; + public subscribeConfiguration(metadata?: grpc.Metadata, options?: Partial): grpc.ClientDuplexStream; + public tryLock(request: runtime_pb.TryLockRequest, callback: (error: grpc.ServiceError | null, response: runtime_pb.TryLockResponse) => void): grpc.ClientUnaryCall; + public tryLock(request: runtime_pb.TryLockRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: runtime_pb.TryLockResponse) => void): grpc.ClientUnaryCall; + public tryLock(request: runtime_pb.TryLockRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: runtime_pb.TryLockResponse) => void): grpc.ClientUnaryCall; + public unlock(request: runtime_pb.UnlockRequest, callback: (error: grpc.ServiceError | null, response: runtime_pb.UnlockResponse) => void): grpc.ClientUnaryCall; + public unlock(request: runtime_pb.UnlockRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: runtime_pb.UnlockResponse) => void): grpc.ClientUnaryCall; + public unlock(request: runtime_pb.UnlockRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: runtime_pb.UnlockResponse) => void): grpc.ClientUnaryCall; + public getNextId(request: runtime_pb.GetNextIdRequest, callback: (error: grpc.ServiceError | null, response: runtime_pb.GetNextIdResponse) => void): grpc.ClientUnaryCall; + public getNextId(request: runtime_pb.GetNextIdRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: runtime_pb.GetNextIdResponse) => void): grpc.ClientUnaryCall; + public getNextId(request: runtime_pb.GetNextIdRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: runtime_pb.GetNextIdResponse) => void): grpc.ClientUnaryCall; + public getState(request: runtime_pb.GetStateRequest, callback: (error: grpc.ServiceError | null, response: runtime_pb.GetStateResponse) => void): grpc.ClientUnaryCall; + public getState(request: runtime_pb.GetStateRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: runtime_pb.GetStateResponse) => void): grpc.ClientUnaryCall; + public getState(request: runtime_pb.GetStateRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: runtime_pb.GetStateResponse) => void): grpc.ClientUnaryCall; + public getBulkState(request: runtime_pb.GetBulkStateRequest, callback: (error: grpc.ServiceError | null, response: runtime_pb.GetBulkStateResponse) => void): grpc.ClientUnaryCall; + public getBulkState(request: runtime_pb.GetBulkStateRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: runtime_pb.GetBulkStateResponse) => void): grpc.ClientUnaryCall; + public getBulkState(request: runtime_pb.GetBulkStateRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: runtime_pb.GetBulkStateResponse) => void): grpc.ClientUnaryCall; + public saveState(request: runtime_pb.SaveStateRequest, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + public saveState(request: runtime_pb.SaveStateRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + public saveState(request: runtime_pb.SaveStateRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + public deleteState(request: runtime_pb.DeleteStateRequest, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + public deleteState(request: runtime_pb.DeleteStateRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + public deleteState(request: runtime_pb.DeleteStateRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + public deleteBulkState(request: runtime_pb.DeleteBulkStateRequest, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + public deleteBulkState(request: runtime_pb.DeleteBulkStateRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + public deleteBulkState(request: runtime_pb.DeleteBulkStateRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + public executeStateTransaction(request: runtime_pb.ExecuteStateTransactionRequest, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + public executeStateTransaction(request: runtime_pb.ExecuteStateTransactionRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + public executeStateTransaction(request: runtime_pb.ExecuteStateTransactionRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + public publishEvent(request: runtime_pb.PublishEventRequest, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + public publishEvent(request: runtime_pb.PublishEventRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + public publishEvent(request: runtime_pb.PublishEventRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + public getFile(request: runtime_pb.GetFileRequest, options?: Partial): grpc.ClientReadableStream; + public getFile(request: runtime_pb.GetFileRequest, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; + public putFile(callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientWritableStream; + public putFile(metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientWritableStream; + public putFile(options: Partial, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientWritableStream; + public putFile(metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientWritableStream; + public listFile(request: runtime_pb.ListFileRequest, callback: (error: grpc.ServiceError | null, response: runtime_pb.ListFileResp) => void): grpc.ClientUnaryCall; + public listFile(request: runtime_pb.ListFileRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: runtime_pb.ListFileResp) => void): grpc.ClientUnaryCall; + public listFile(request: runtime_pb.ListFileRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: runtime_pb.ListFileResp) => void): grpc.ClientUnaryCall; + public delFile(request: runtime_pb.DelFileRequest, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + public delFile(request: runtime_pb.DelFileRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + public delFile(request: runtime_pb.DelFileRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall; + public invokeBinding(request: runtime_pb.InvokeBindingRequest, callback: (error: grpc.ServiceError | null, response: runtime_pb.InvokeBindingResponse) => void): grpc.ClientUnaryCall; + public invokeBinding(request: runtime_pb.InvokeBindingRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: runtime_pb.InvokeBindingResponse) => void): grpc.ClientUnaryCall; + public invokeBinding(request: runtime_pb.InvokeBindingRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: runtime_pb.InvokeBindingResponse) => void): grpc.ClientUnaryCall; +} diff --git a/sdk/js-sdk/proto/runtime_grpc_pb.js b/sdk/js-sdk/proto/runtime_grpc_pb.js new file mode 100644 index 0000000000..157074bac8 --- /dev/null +++ b/sdk/js-sdk/proto/runtime_grpc_pb.js @@ -0,0 +1,644 @@ +// GENERATED CODE -- DO NOT EDIT! + +'use strict'; +var grpc = require('@grpc/grpc-js'); +var runtime_pb = require('./runtime_pb.js'); +var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js'); +var google_protobuf_any_pb = require('google-protobuf/google/protobuf/any_pb.js'); + +function serialize_google_protobuf_Empty(arg) { + if (!(arg instanceof google_protobuf_empty_pb.Empty)) { + throw new Error('Expected argument of type google.protobuf.Empty'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_google_protobuf_Empty(buffer_arg) { + return google_protobuf_empty_pb.Empty.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_DelFileRequest(arg) { + if (!(arg instanceof runtime_pb.DelFileRequest)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.DelFileRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_DelFileRequest(buffer_arg) { + return runtime_pb.DelFileRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_DeleteBulkStateRequest(arg) { + if (!(arg instanceof runtime_pb.DeleteBulkStateRequest)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.DeleteBulkStateRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_DeleteBulkStateRequest(buffer_arg) { + return runtime_pb.DeleteBulkStateRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_DeleteConfigurationRequest(arg) { + if (!(arg instanceof runtime_pb.DeleteConfigurationRequest)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.DeleteConfigurationRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_DeleteConfigurationRequest(buffer_arg) { + return runtime_pb.DeleteConfigurationRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_DeleteStateRequest(arg) { + if (!(arg instanceof runtime_pb.DeleteStateRequest)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.DeleteStateRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_DeleteStateRequest(buffer_arg) { + return runtime_pb.DeleteStateRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_ExecuteStateTransactionRequest(arg) { + if (!(arg instanceof runtime_pb.ExecuteStateTransactionRequest)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.ExecuteStateTransactionRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_ExecuteStateTransactionRequest(buffer_arg) { + return runtime_pb.ExecuteStateTransactionRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_GetBulkStateRequest(arg) { + if (!(arg instanceof runtime_pb.GetBulkStateRequest)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.GetBulkStateRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_GetBulkStateRequest(buffer_arg) { + return runtime_pb.GetBulkStateRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_GetBulkStateResponse(arg) { + if (!(arg instanceof runtime_pb.GetBulkStateResponse)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.GetBulkStateResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_GetBulkStateResponse(buffer_arg) { + return runtime_pb.GetBulkStateResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_GetConfigurationRequest(arg) { + if (!(arg instanceof runtime_pb.GetConfigurationRequest)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.GetConfigurationRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_GetConfigurationRequest(buffer_arg) { + return runtime_pb.GetConfigurationRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_GetConfigurationResponse(arg) { + if (!(arg instanceof runtime_pb.GetConfigurationResponse)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.GetConfigurationResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_GetConfigurationResponse(buffer_arg) { + return runtime_pb.GetConfigurationResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_GetFileRequest(arg) { + if (!(arg instanceof runtime_pb.GetFileRequest)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.GetFileRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_GetFileRequest(buffer_arg) { + return runtime_pb.GetFileRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_GetFileResponse(arg) { + if (!(arg instanceof runtime_pb.GetFileResponse)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.GetFileResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_GetFileResponse(buffer_arg) { + return runtime_pb.GetFileResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_GetNextIdRequest(arg) { + if (!(arg instanceof runtime_pb.GetNextIdRequest)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.GetNextIdRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_GetNextIdRequest(buffer_arg) { + return runtime_pb.GetNextIdRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_GetNextIdResponse(arg) { + if (!(arg instanceof runtime_pb.GetNextIdResponse)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.GetNextIdResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_GetNextIdResponse(buffer_arg) { + return runtime_pb.GetNextIdResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_GetStateRequest(arg) { + if (!(arg instanceof runtime_pb.GetStateRequest)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.GetStateRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_GetStateRequest(buffer_arg) { + return runtime_pb.GetStateRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_GetStateResponse(arg) { + if (!(arg instanceof runtime_pb.GetStateResponse)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.GetStateResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_GetStateResponse(buffer_arg) { + return runtime_pb.GetStateResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_InvokeBindingRequest(arg) { + if (!(arg instanceof runtime_pb.InvokeBindingRequest)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.InvokeBindingRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_InvokeBindingRequest(buffer_arg) { + return runtime_pb.InvokeBindingRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_InvokeBindingResponse(arg) { + if (!(arg instanceof runtime_pb.InvokeBindingResponse)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.InvokeBindingResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_InvokeBindingResponse(buffer_arg) { + return runtime_pb.InvokeBindingResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_InvokeResponse(arg) { + if (!(arg instanceof runtime_pb.InvokeResponse)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.InvokeResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_InvokeResponse(buffer_arg) { + return runtime_pb.InvokeResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_InvokeServiceRequest(arg) { + if (!(arg instanceof runtime_pb.InvokeServiceRequest)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.InvokeServiceRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_InvokeServiceRequest(buffer_arg) { + return runtime_pb.InvokeServiceRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_ListFileRequest(arg) { + if (!(arg instanceof runtime_pb.ListFileRequest)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.ListFileRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_ListFileRequest(buffer_arg) { + return runtime_pb.ListFileRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_ListFileResp(arg) { + if (!(arg instanceof runtime_pb.ListFileResp)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.ListFileResp'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_ListFileResp(buffer_arg) { + return runtime_pb.ListFileResp.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_PublishEventRequest(arg) { + if (!(arg instanceof runtime_pb.PublishEventRequest)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.PublishEventRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_PublishEventRequest(buffer_arg) { + return runtime_pb.PublishEventRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_PutFileRequest(arg) { + if (!(arg instanceof runtime_pb.PutFileRequest)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.PutFileRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_PutFileRequest(buffer_arg) { + return runtime_pb.PutFileRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_SaveConfigurationRequest(arg) { + if (!(arg instanceof runtime_pb.SaveConfigurationRequest)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.SaveConfigurationRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_SaveConfigurationRequest(buffer_arg) { + return runtime_pb.SaveConfigurationRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_SaveStateRequest(arg) { + if (!(arg instanceof runtime_pb.SaveStateRequest)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.SaveStateRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_SaveStateRequest(buffer_arg) { + return runtime_pb.SaveStateRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_SayHelloRequest(arg) { + if (!(arg instanceof runtime_pb.SayHelloRequest)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.SayHelloRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_SayHelloRequest(buffer_arg) { + return runtime_pb.SayHelloRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_SayHelloResponse(arg) { + if (!(arg instanceof runtime_pb.SayHelloResponse)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.SayHelloResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_SayHelloResponse(buffer_arg) { + return runtime_pb.SayHelloResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_SubscribeConfigurationRequest(arg) { + if (!(arg instanceof runtime_pb.SubscribeConfigurationRequest)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.SubscribeConfigurationRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_SubscribeConfigurationRequest(buffer_arg) { + return runtime_pb.SubscribeConfigurationRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_SubscribeConfigurationResponse(arg) { + if (!(arg instanceof runtime_pb.SubscribeConfigurationResponse)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.SubscribeConfigurationResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_SubscribeConfigurationResponse(buffer_arg) { + return runtime_pb.SubscribeConfigurationResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_TryLockRequest(arg) { + if (!(arg instanceof runtime_pb.TryLockRequest)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.TryLockRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_TryLockRequest(buffer_arg) { + return runtime_pb.TryLockRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_TryLockResponse(arg) { + if (!(arg instanceof runtime_pb.TryLockResponse)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.TryLockResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_TryLockResponse(buffer_arg) { + return runtime_pb.TryLockResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_UnlockRequest(arg) { + if (!(arg instanceof runtime_pb.UnlockRequest)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.UnlockRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_UnlockRequest(buffer_arg) { + return runtime_pb.UnlockRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_spec_proto_runtime_v1_UnlockResponse(arg) { + if (!(arg instanceof runtime_pb.UnlockResponse)) { + throw new Error('Expected argument of type spec.proto.runtime.v1.UnlockResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_spec_proto_runtime_v1_UnlockResponse(buffer_arg) { + return runtime_pb.UnlockResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + + +var RuntimeService = exports.RuntimeService = { + // SayHello used for test +sayHello: { + path: '/spec.proto.runtime.v1.Runtime/SayHello', + requestStream: false, + responseStream: false, + requestType: runtime_pb.SayHelloRequest, + responseType: runtime_pb.SayHelloResponse, + requestSerialize: serialize_spec_proto_runtime_v1_SayHelloRequest, + requestDeserialize: deserialize_spec_proto_runtime_v1_SayHelloRequest, + responseSerialize: serialize_spec_proto_runtime_v1_SayHelloResponse, + responseDeserialize: deserialize_spec_proto_runtime_v1_SayHelloResponse, + }, + // InvokeService do rpc calls +invokeService: { + path: '/spec.proto.runtime.v1.Runtime/InvokeService', + requestStream: false, + responseStream: false, + requestType: runtime_pb.InvokeServiceRequest, + responseType: runtime_pb.InvokeResponse, + requestSerialize: serialize_spec_proto_runtime_v1_InvokeServiceRequest, + requestDeserialize: deserialize_spec_proto_runtime_v1_InvokeServiceRequest, + responseSerialize: serialize_spec_proto_runtime_v1_InvokeResponse, + responseDeserialize: deserialize_spec_proto_runtime_v1_InvokeResponse, + }, + // GetConfiguration gets configuration from configuration store. +getConfiguration: { + path: '/spec.proto.runtime.v1.Runtime/GetConfiguration', + requestStream: false, + responseStream: false, + requestType: runtime_pb.GetConfigurationRequest, + responseType: runtime_pb.GetConfigurationResponse, + requestSerialize: serialize_spec_proto_runtime_v1_GetConfigurationRequest, + requestDeserialize: deserialize_spec_proto_runtime_v1_GetConfigurationRequest, + responseSerialize: serialize_spec_proto_runtime_v1_GetConfigurationResponse, + responseDeserialize: deserialize_spec_proto_runtime_v1_GetConfigurationResponse, + }, + // SaveConfiguration saves configuration into configuration store. +saveConfiguration: { + path: '/spec.proto.runtime.v1.Runtime/SaveConfiguration', + requestStream: false, + responseStream: false, + requestType: runtime_pb.SaveConfigurationRequest, + responseType: google_protobuf_empty_pb.Empty, + requestSerialize: serialize_spec_proto_runtime_v1_SaveConfigurationRequest, + requestDeserialize: deserialize_spec_proto_runtime_v1_SaveConfigurationRequest, + responseSerialize: serialize_google_protobuf_Empty, + responseDeserialize: deserialize_google_protobuf_Empty, + }, + // DeleteConfiguration deletes configuration from configuration store. +deleteConfiguration: { + path: '/spec.proto.runtime.v1.Runtime/DeleteConfiguration', + requestStream: false, + responseStream: false, + requestType: runtime_pb.DeleteConfigurationRequest, + responseType: google_protobuf_empty_pb.Empty, + requestSerialize: serialize_spec_proto_runtime_v1_DeleteConfigurationRequest, + requestDeserialize: deserialize_spec_proto_runtime_v1_DeleteConfigurationRequest, + responseSerialize: serialize_google_protobuf_Empty, + responseDeserialize: deserialize_google_protobuf_Empty, + }, + // SubscribeConfiguration gets configuration from configuration store and subscribe the updates. +subscribeConfiguration: { + path: '/spec.proto.runtime.v1.Runtime/SubscribeConfiguration', + requestStream: true, + responseStream: true, + requestType: runtime_pb.SubscribeConfigurationRequest, + responseType: runtime_pb.SubscribeConfigurationResponse, + requestSerialize: serialize_spec_proto_runtime_v1_SubscribeConfigurationRequest, + requestDeserialize: deserialize_spec_proto_runtime_v1_SubscribeConfigurationRequest, + responseSerialize: serialize_spec_proto_runtime_v1_SubscribeConfigurationResponse, + responseDeserialize: deserialize_spec_proto_runtime_v1_SubscribeConfigurationResponse, + }, + // Distributed Lock API +// A non-blocking method trying to get a lock with ttl. +tryLock: { + path: '/spec.proto.runtime.v1.Runtime/TryLock', + requestStream: false, + responseStream: false, + requestType: runtime_pb.TryLockRequest, + responseType: runtime_pb.TryLockResponse, + requestSerialize: serialize_spec_proto_runtime_v1_TryLockRequest, + requestDeserialize: deserialize_spec_proto_runtime_v1_TryLockRequest, + responseSerialize: serialize_spec_proto_runtime_v1_TryLockResponse, + responseDeserialize: deserialize_spec_proto_runtime_v1_TryLockResponse, + }, + unlock: { + path: '/spec.proto.runtime.v1.Runtime/Unlock', + requestStream: false, + responseStream: false, + requestType: runtime_pb.UnlockRequest, + responseType: runtime_pb.UnlockResponse, + requestSerialize: serialize_spec_proto_runtime_v1_UnlockRequest, + requestDeserialize: deserialize_spec_proto_runtime_v1_UnlockRequest, + responseSerialize: serialize_spec_proto_runtime_v1_UnlockResponse, + responseDeserialize: deserialize_spec_proto_runtime_v1_UnlockResponse, + }, + // Sequencer API +// Get next unique id with some auto-increment guarantee +getNextId: { + path: '/spec.proto.runtime.v1.Runtime/GetNextId', + requestStream: false, + responseStream: false, + requestType: runtime_pb.GetNextIdRequest, + responseType: runtime_pb.GetNextIdResponse, + requestSerialize: serialize_spec_proto_runtime_v1_GetNextIdRequest, + requestDeserialize: deserialize_spec_proto_runtime_v1_GetNextIdRequest, + responseSerialize: serialize_spec_proto_runtime_v1_GetNextIdResponse, + responseDeserialize: deserialize_spec_proto_runtime_v1_GetNextIdResponse, + }, + // Below are the APIs compatible with Dapr. +// We try to keep them same as Dapr's because we want to work with Dapr to build an API spec for cloud native runtime +// ,like CloudEvent for event data. +// +// Gets the state for a specific key. +getState: { + path: '/spec.proto.runtime.v1.Runtime/GetState', + requestStream: false, + responseStream: false, + requestType: runtime_pb.GetStateRequest, + responseType: runtime_pb.GetStateResponse, + requestSerialize: serialize_spec_proto_runtime_v1_GetStateRequest, + requestDeserialize: deserialize_spec_proto_runtime_v1_GetStateRequest, + responseSerialize: serialize_spec_proto_runtime_v1_GetStateResponse, + responseDeserialize: deserialize_spec_proto_runtime_v1_GetStateResponse, + }, + // Gets a bulk of state items for a list of keys +getBulkState: { + path: '/spec.proto.runtime.v1.Runtime/GetBulkState', + requestStream: false, + responseStream: false, + requestType: runtime_pb.GetBulkStateRequest, + responseType: runtime_pb.GetBulkStateResponse, + requestSerialize: serialize_spec_proto_runtime_v1_GetBulkStateRequest, + requestDeserialize: deserialize_spec_proto_runtime_v1_GetBulkStateRequest, + responseSerialize: serialize_spec_proto_runtime_v1_GetBulkStateResponse, + responseDeserialize: deserialize_spec_proto_runtime_v1_GetBulkStateResponse, + }, + // Saves an array of state objects +saveState: { + path: '/spec.proto.runtime.v1.Runtime/SaveState', + requestStream: false, + responseStream: false, + requestType: runtime_pb.SaveStateRequest, + responseType: google_protobuf_empty_pb.Empty, + requestSerialize: serialize_spec_proto_runtime_v1_SaveStateRequest, + requestDeserialize: deserialize_spec_proto_runtime_v1_SaveStateRequest, + responseSerialize: serialize_google_protobuf_Empty, + responseDeserialize: deserialize_google_protobuf_Empty, + }, + // Deletes the state for a specific key. +deleteState: { + path: '/spec.proto.runtime.v1.Runtime/DeleteState', + requestStream: false, + responseStream: false, + requestType: runtime_pb.DeleteStateRequest, + responseType: google_protobuf_empty_pb.Empty, + requestSerialize: serialize_spec_proto_runtime_v1_DeleteStateRequest, + requestDeserialize: deserialize_spec_proto_runtime_v1_DeleteStateRequest, + responseSerialize: serialize_google_protobuf_Empty, + responseDeserialize: deserialize_google_protobuf_Empty, + }, + // Deletes a bulk of state items for a list of keys +deleteBulkState: { + path: '/spec.proto.runtime.v1.Runtime/DeleteBulkState', + requestStream: false, + responseStream: false, + requestType: runtime_pb.DeleteBulkStateRequest, + responseType: google_protobuf_empty_pb.Empty, + requestSerialize: serialize_spec_proto_runtime_v1_DeleteBulkStateRequest, + requestDeserialize: deserialize_spec_proto_runtime_v1_DeleteBulkStateRequest, + responseSerialize: serialize_google_protobuf_Empty, + responseDeserialize: deserialize_google_protobuf_Empty, + }, + // Executes transactions for a specified store +executeStateTransaction: { + path: '/spec.proto.runtime.v1.Runtime/ExecuteStateTransaction', + requestStream: false, + responseStream: false, + requestType: runtime_pb.ExecuteStateTransactionRequest, + responseType: google_protobuf_empty_pb.Empty, + requestSerialize: serialize_spec_proto_runtime_v1_ExecuteStateTransactionRequest, + requestDeserialize: deserialize_spec_proto_runtime_v1_ExecuteStateTransactionRequest, + responseSerialize: serialize_google_protobuf_Empty, + responseDeserialize: deserialize_google_protobuf_Empty, + }, + // Publishes events to the specific topic +publishEvent: { + path: '/spec.proto.runtime.v1.Runtime/PublishEvent', + requestStream: false, + responseStream: false, + requestType: runtime_pb.PublishEventRequest, + responseType: google_protobuf_empty_pb.Empty, + requestSerialize: serialize_spec_proto_runtime_v1_PublishEventRequest, + requestDeserialize: deserialize_spec_proto_runtime_v1_PublishEventRequest, + responseSerialize: serialize_google_protobuf_Empty, + responseDeserialize: deserialize_google_protobuf_Empty, + }, + // Get file with stream +getFile: { + path: '/spec.proto.runtime.v1.Runtime/GetFile', + requestStream: false, + responseStream: true, + requestType: runtime_pb.GetFileRequest, + responseType: runtime_pb.GetFileResponse, + requestSerialize: serialize_spec_proto_runtime_v1_GetFileRequest, + requestDeserialize: deserialize_spec_proto_runtime_v1_GetFileRequest, + responseSerialize: serialize_spec_proto_runtime_v1_GetFileResponse, + responseDeserialize: deserialize_spec_proto_runtime_v1_GetFileResponse, + }, + // Put file with stream +putFile: { + path: '/spec.proto.runtime.v1.Runtime/PutFile', + requestStream: true, + responseStream: false, + requestType: runtime_pb.PutFileRequest, + responseType: google_protobuf_empty_pb.Empty, + requestSerialize: serialize_spec_proto_runtime_v1_PutFileRequest, + requestDeserialize: deserialize_spec_proto_runtime_v1_PutFileRequest, + responseSerialize: serialize_google_protobuf_Empty, + responseDeserialize: deserialize_google_protobuf_Empty, + }, + // List all files +listFile: { + path: '/spec.proto.runtime.v1.Runtime/ListFile', + requestStream: false, + responseStream: false, + requestType: runtime_pb.ListFileRequest, + responseType: runtime_pb.ListFileResp, + requestSerialize: serialize_spec_proto_runtime_v1_ListFileRequest, + requestDeserialize: deserialize_spec_proto_runtime_v1_ListFileRequest, + responseSerialize: serialize_spec_proto_runtime_v1_ListFileResp, + responseDeserialize: deserialize_spec_proto_runtime_v1_ListFileResp, + }, + // Delete specific file +delFile: { + path: '/spec.proto.runtime.v1.Runtime/DelFile', + requestStream: false, + responseStream: false, + requestType: runtime_pb.DelFileRequest, + responseType: google_protobuf_empty_pb.Empty, + requestSerialize: serialize_spec_proto_runtime_v1_DelFileRequest, + requestDeserialize: deserialize_spec_proto_runtime_v1_DelFileRequest, + responseSerialize: serialize_google_protobuf_Empty, + responseDeserialize: deserialize_google_protobuf_Empty, + }, + // Invokes binding data to specific output bindings +invokeBinding: { + path: '/spec.proto.runtime.v1.Runtime/InvokeBinding', + requestStream: false, + responseStream: false, + requestType: runtime_pb.InvokeBindingRequest, + responseType: runtime_pb.InvokeBindingResponse, + requestSerialize: serialize_spec_proto_runtime_v1_InvokeBindingRequest, + requestDeserialize: deserialize_spec_proto_runtime_v1_InvokeBindingRequest, + responseSerialize: serialize_spec_proto_runtime_v1_InvokeBindingResponse, + responseDeserialize: deserialize_spec_proto_runtime_v1_InvokeBindingResponse, + }, +}; + +exports.RuntimeClient = grpc.makeGenericClientConstructor(RuntimeService); diff --git a/sdk/js-sdk/proto/runtime_pb.d.ts b/sdk/js-sdk/proto/runtime_pb.d.ts new file mode 100644 index 0000000000..109213219f --- /dev/null +++ b/sdk/js-sdk/proto/runtime_pb.d.ts @@ -0,0 +1,1283 @@ +// package: spec.proto.runtime.v1 +// file: runtime.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; +import * as google_protobuf_empty_pb from "google-protobuf/google/protobuf/empty_pb"; +import * as google_protobuf_any_pb from "google-protobuf/google/protobuf/any_pb"; + +export class GetFileRequest extends jspb.Message { + getStoreName(): string; + setStoreName(value: string): GetFileRequest; + getName(): string; + setName(value: string): GetFileRequest; + + getMetadataMap(): jspb.Map; + clearMetadataMap(): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetFileRequest.AsObject; + static toObject(includeInstance: boolean, msg: GetFileRequest): GetFileRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetFileRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetFileRequest; + static deserializeBinaryFromReader(message: GetFileRequest, reader: jspb.BinaryReader): GetFileRequest; +} + +export namespace GetFileRequest { + export type AsObject = { + storeName: string, + name: string, + + metadataMap: Array<[string, string]>, + } +} + +export class GetFileResponse extends jspb.Message { + getData(): Uint8Array | string; + getData_asU8(): Uint8Array; + getData_asB64(): string; + setData(value: Uint8Array | string): GetFileResponse; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetFileResponse.AsObject; + static toObject(includeInstance: boolean, msg: GetFileResponse): GetFileResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetFileResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetFileResponse; + static deserializeBinaryFromReader(message: GetFileResponse, reader: jspb.BinaryReader): GetFileResponse; +} + +export namespace GetFileResponse { + export type AsObject = { + data: Uint8Array | string, + } +} + +export class PutFileRequest extends jspb.Message { + getStoreName(): string; + setStoreName(value: string): PutFileRequest; + getName(): string; + setName(value: string): PutFileRequest; + getData(): Uint8Array | string; + getData_asU8(): Uint8Array; + getData_asB64(): string; + setData(value: Uint8Array | string): PutFileRequest; + + getMetadataMap(): jspb.Map; + clearMetadataMap(): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): PutFileRequest.AsObject; + static toObject(includeInstance: boolean, msg: PutFileRequest): PutFileRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: PutFileRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): PutFileRequest; + static deserializeBinaryFromReader(message: PutFileRequest, reader: jspb.BinaryReader): PutFileRequest; +} + +export namespace PutFileRequest { + export type AsObject = { + storeName: string, + name: string, + data: Uint8Array | string, + + metadataMap: Array<[string, string]>, + } +} + +export class FileRequest extends jspb.Message { + getStoreName(): string; + setStoreName(value: string): FileRequest; + getName(): string; + setName(value: string): FileRequest; + + getMetadataMap(): jspb.Map; + clearMetadataMap(): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): FileRequest.AsObject; + static toObject(includeInstance: boolean, msg: FileRequest): FileRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: FileRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): FileRequest; + static deserializeBinaryFromReader(message: FileRequest, reader: jspb.BinaryReader): FileRequest; +} + +export namespace FileRequest { + export type AsObject = { + storeName: string, + name: string, + + metadataMap: Array<[string, string]>, + } +} + +export class ListFileRequest extends jspb.Message { + + hasRequest(): boolean; + clearRequest(): void; + getRequest(): FileRequest | undefined; + setRequest(value?: FileRequest): ListFileRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ListFileRequest.AsObject; + static toObject(includeInstance: boolean, msg: ListFileRequest): ListFileRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ListFileRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ListFileRequest; + static deserializeBinaryFromReader(message: ListFileRequest, reader: jspb.BinaryReader): ListFileRequest; +} + +export namespace ListFileRequest { + export type AsObject = { + request?: FileRequest.AsObject, + } +} + +export class ListFileResp extends jspb.Message { + clearFileNameList(): void; + getFileNameList(): Array; + setFileNameList(value: Array): ListFileResp; + addFileName(value: string, index?: number): string; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ListFileResp.AsObject; + static toObject(includeInstance: boolean, msg: ListFileResp): ListFileResp.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ListFileResp, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ListFileResp; + static deserializeBinaryFromReader(message: ListFileResp, reader: jspb.BinaryReader): ListFileResp; +} + +export namespace ListFileResp { + export type AsObject = { + fileNameList: Array, + } +} + +export class DelFileRequest extends jspb.Message { + + hasRequest(): boolean; + clearRequest(): void; + getRequest(): FileRequest | undefined; + setRequest(value?: FileRequest): DelFileRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): DelFileRequest.AsObject; + static toObject(includeInstance: boolean, msg: DelFileRequest): DelFileRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: DelFileRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): DelFileRequest; + static deserializeBinaryFromReader(message: DelFileRequest, reader: jspb.BinaryReader): DelFileRequest; +} + +export namespace DelFileRequest { + export type AsObject = { + request?: FileRequest.AsObject, + } +} + +export class GetNextIdRequest extends jspb.Message { + getStoreName(): string; + setStoreName(value: string): GetNextIdRequest; + getKey(): string; + setKey(value: string): GetNextIdRequest; + + hasOptions(): boolean; + clearOptions(): void; + getOptions(): SequencerOptions | undefined; + setOptions(value?: SequencerOptions): GetNextIdRequest; + + getMetadataMap(): jspb.Map; + clearMetadataMap(): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetNextIdRequest.AsObject; + static toObject(includeInstance: boolean, msg: GetNextIdRequest): GetNextIdRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetNextIdRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetNextIdRequest; + static deserializeBinaryFromReader(message: GetNextIdRequest, reader: jspb.BinaryReader): GetNextIdRequest; +} + +export namespace GetNextIdRequest { + export type AsObject = { + storeName: string, + key: string, + options?: SequencerOptions.AsObject, + + metadataMap: Array<[string, string]>, + } +} + +export class SequencerOptions extends jspb.Message { + getIncrement(): SequencerOptions.AutoIncrement; + setIncrement(value: SequencerOptions.AutoIncrement): SequencerOptions; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SequencerOptions.AsObject; + static toObject(includeInstance: boolean, msg: SequencerOptions): SequencerOptions.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SequencerOptions, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SequencerOptions; + static deserializeBinaryFromReader(message: SequencerOptions, reader: jspb.BinaryReader): SequencerOptions; +} + +export namespace SequencerOptions { + export type AsObject = { + increment: SequencerOptions.AutoIncrement, + } + + export enum AutoIncrement { + WEAK = 0, + STRONG = 1, + } + +} + +export class GetNextIdResponse extends jspb.Message { + getNextId(): string; + setNextId(value: string): GetNextIdResponse; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetNextIdResponse.AsObject; + static toObject(includeInstance: boolean, msg: GetNextIdResponse): GetNextIdResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetNextIdResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetNextIdResponse; + static deserializeBinaryFromReader(message: GetNextIdResponse, reader: jspb.BinaryReader): GetNextIdResponse; +} + +export namespace GetNextIdResponse { + export type AsObject = { + nextId: string, + } +} + +export class TryLockRequest extends jspb.Message { + getStoreName(): string; + setStoreName(value: string): TryLockRequest; + getResourceId(): string; + setResourceId(value: string): TryLockRequest; + getLockOwner(): string; + setLockOwner(value: string): TryLockRequest; + getExpire(): number; + setExpire(value: number): TryLockRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): TryLockRequest.AsObject; + static toObject(includeInstance: boolean, msg: TryLockRequest): TryLockRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: TryLockRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): TryLockRequest; + static deserializeBinaryFromReader(message: TryLockRequest, reader: jspb.BinaryReader): TryLockRequest; +} + +export namespace TryLockRequest { + export type AsObject = { + storeName: string, + resourceId: string, + lockOwner: string, + expire: number, + } +} + +export class TryLockResponse extends jspb.Message { + getSuccess(): boolean; + setSuccess(value: boolean): TryLockResponse; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): TryLockResponse.AsObject; + static toObject(includeInstance: boolean, msg: TryLockResponse): TryLockResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: TryLockResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): TryLockResponse; + static deserializeBinaryFromReader(message: TryLockResponse, reader: jspb.BinaryReader): TryLockResponse; +} + +export namespace TryLockResponse { + export type AsObject = { + success: boolean, + } +} + +export class UnlockRequest extends jspb.Message { + getStoreName(): string; + setStoreName(value: string): UnlockRequest; + getResourceId(): string; + setResourceId(value: string): UnlockRequest; + getLockOwner(): string; + setLockOwner(value: string): UnlockRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): UnlockRequest.AsObject; + static toObject(includeInstance: boolean, msg: UnlockRequest): UnlockRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: UnlockRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): UnlockRequest; + static deserializeBinaryFromReader(message: UnlockRequest, reader: jspb.BinaryReader): UnlockRequest; +} + +export namespace UnlockRequest { + export type AsObject = { + storeName: string, + resourceId: string, + lockOwner: string, + } +} + +export class UnlockResponse extends jspb.Message { + getStatus(): UnlockResponse.Status; + setStatus(value: UnlockResponse.Status): UnlockResponse; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): UnlockResponse.AsObject; + static toObject(includeInstance: boolean, msg: UnlockResponse): UnlockResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: UnlockResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): UnlockResponse; + static deserializeBinaryFromReader(message: UnlockResponse, reader: jspb.BinaryReader): UnlockResponse; +} + +export namespace UnlockResponse { + export type AsObject = { + status: UnlockResponse.Status, + } + + export enum Status { + SUCCESS = 0, + LOCK_UNEXIST = 1, + LOCK_BELONG_TO_OTHERS = 2, + INTERNAL_ERROR = 3, + } + +} + +export class SayHelloRequest extends jspb.Message { + getServiceName(): string; + setServiceName(value: string): SayHelloRequest; + getName(): string; + setName(value: string): SayHelloRequest; + + hasData(): boolean; + clearData(): void; + getData(): google_protobuf_any_pb.Any | undefined; + setData(value?: google_protobuf_any_pb.Any): SayHelloRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SayHelloRequest.AsObject; + static toObject(includeInstance: boolean, msg: SayHelloRequest): SayHelloRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SayHelloRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SayHelloRequest; + static deserializeBinaryFromReader(message: SayHelloRequest, reader: jspb.BinaryReader): SayHelloRequest; +} + +export namespace SayHelloRequest { + export type AsObject = { + serviceName: string, + name: string, + data?: google_protobuf_any_pb.Any.AsObject, + } +} + +export class SayHelloResponse extends jspb.Message { + getHello(): string; + setHello(value: string): SayHelloResponse; + + hasData(): boolean; + clearData(): void; + getData(): google_protobuf_any_pb.Any | undefined; + setData(value?: google_protobuf_any_pb.Any): SayHelloResponse; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SayHelloResponse.AsObject; + static toObject(includeInstance: boolean, msg: SayHelloResponse): SayHelloResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SayHelloResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SayHelloResponse; + static deserializeBinaryFromReader(message: SayHelloResponse, reader: jspb.BinaryReader): SayHelloResponse; +} + +export namespace SayHelloResponse { + export type AsObject = { + hello: string, + data?: google_protobuf_any_pb.Any.AsObject, + } +} + +export class InvokeServiceRequest extends jspb.Message { + getId(): string; + setId(value: string): InvokeServiceRequest; + + hasMessage(): boolean; + clearMessage(): void; + getMessage(): CommonInvokeRequest | undefined; + setMessage(value?: CommonInvokeRequest): InvokeServiceRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): InvokeServiceRequest.AsObject; + static toObject(includeInstance: boolean, msg: InvokeServiceRequest): InvokeServiceRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: InvokeServiceRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): InvokeServiceRequest; + static deserializeBinaryFromReader(message: InvokeServiceRequest, reader: jspb.BinaryReader): InvokeServiceRequest; +} + +export namespace InvokeServiceRequest { + export type AsObject = { + id: string, + message?: CommonInvokeRequest.AsObject, + } +} + +export class CommonInvokeRequest extends jspb.Message { + getMethod(): string; + setMethod(value: string): CommonInvokeRequest; + + hasData(): boolean; + clearData(): void; + getData(): google_protobuf_any_pb.Any | undefined; + setData(value?: google_protobuf_any_pb.Any): CommonInvokeRequest; + getContentType(): string; + setContentType(value: string): CommonInvokeRequest; + + hasHttpExtension(): boolean; + clearHttpExtension(): void; + getHttpExtension(): HTTPExtension | undefined; + setHttpExtension(value?: HTTPExtension): CommonInvokeRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): CommonInvokeRequest.AsObject; + static toObject(includeInstance: boolean, msg: CommonInvokeRequest): CommonInvokeRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: CommonInvokeRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): CommonInvokeRequest; + static deserializeBinaryFromReader(message: CommonInvokeRequest, reader: jspb.BinaryReader): CommonInvokeRequest; +} + +export namespace CommonInvokeRequest { + export type AsObject = { + method: string, + data?: google_protobuf_any_pb.Any.AsObject, + contentType: string, + httpExtension?: HTTPExtension.AsObject, + } +} + +export class HTTPExtension extends jspb.Message { + getVerb(): HTTPExtension.Verb; + setVerb(value: HTTPExtension.Verb): HTTPExtension; + getQuerystring(): string; + setQuerystring(value: string): HTTPExtension; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): HTTPExtension.AsObject; + static toObject(includeInstance: boolean, msg: HTTPExtension): HTTPExtension.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: HTTPExtension, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): HTTPExtension; + static deserializeBinaryFromReader(message: HTTPExtension, reader: jspb.BinaryReader): HTTPExtension; +} + +export namespace HTTPExtension { + export type AsObject = { + verb: HTTPExtension.Verb, + querystring: string, + } + + export enum Verb { + NONE = 0, + GET = 1, + HEAD = 2, + POST = 3, + PUT = 4, + DELETE = 5, + CONNECT = 6, + OPTIONS = 7, + TRACE = 8, + } + +} + +export class InvokeResponse extends jspb.Message { + + hasData(): boolean; + clearData(): void; + getData(): google_protobuf_any_pb.Any | undefined; + setData(value?: google_protobuf_any_pb.Any): InvokeResponse; + getContentType(): string; + setContentType(value: string): InvokeResponse; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): InvokeResponse.AsObject; + static toObject(includeInstance: boolean, msg: InvokeResponse): InvokeResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: InvokeResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): InvokeResponse; + static deserializeBinaryFromReader(message: InvokeResponse, reader: jspb.BinaryReader): InvokeResponse; +} + +export namespace InvokeResponse { + export type AsObject = { + data?: google_protobuf_any_pb.Any.AsObject, + contentType: string, + } +} + +export class ConfigurationItem extends jspb.Message { + getKey(): string; + setKey(value: string): ConfigurationItem; + getContent(): string; + setContent(value: string): ConfigurationItem; + getGroup(): string; + setGroup(value: string): ConfigurationItem; + getLabel(): string; + setLabel(value: string): ConfigurationItem; + + getTagsMap(): jspb.Map; + clearTagsMap(): void; + + getMetadataMap(): jspb.Map; + clearMetadataMap(): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ConfigurationItem.AsObject; + static toObject(includeInstance: boolean, msg: ConfigurationItem): ConfigurationItem.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ConfigurationItem, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ConfigurationItem; + static deserializeBinaryFromReader(message: ConfigurationItem, reader: jspb.BinaryReader): ConfigurationItem; +} + +export namespace ConfigurationItem { + export type AsObject = { + key: string, + content: string, + group: string, + label: string, + + tagsMap: Array<[string, string]>, + + metadataMap: Array<[string, string]>, + } +} + +export class GetConfigurationRequest extends jspb.Message { + getStoreName(): string; + setStoreName(value: string): GetConfigurationRequest; + getAppId(): string; + setAppId(value: string): GetConfigurationRequest; + getGroup(): string; + setGroup(value: string): GetConfigurationRequest; + getLabel(): string; + setLabel(value: string): GetConfigurationRequest; + clearKeysList(): void; + getKeysList(): Array; + setKeysList(value: Array): GetConfigurationRequest; + addKeys(value: string, index?: number): string; + + getMetadataMap(): jspb.Map; + clearMetadataMap(): void; + getSubscribeUpdate(): boolean; + setSubscribeUpdate(value: boolean): GetConfigurationRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetConfigurationRequest.AsObject; + static toObject(includeInstance: boolean, msg: GetConfigurationRequest): GetConfigurationRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetConfigurationRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetConfigurationRequest; + static deserializeBinaryFromReader(message: GetConfigurationRequest, reader: jspb.BinaryReader): GetConfigurationRequest; +} + +export namespace GetConfigurationRequest { + export type AsObject = { + storeName: string, + appId: string, + group: string, + label: string, + keysList: Array, + + metadataMap: Array<[string, string]>, + subscribeUpdate: boolean, + } +} + +export class GetConfigurationResponse extends jspb.Message { + clearItemsList(): void; + getItemsList(): Array; + setItemsList(value: Array): GetConfigurationResponse; + addItems(value?: ConfigurationItem, index?: number): ConfigurationItem; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetConfigurationResponse.AsObject; + static toObject(includeInstance: boolean, msg: GetConfigurationResponse): GetConfigurationResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetConfigurationResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetConfigurationResponse; + static deserializeBinaryFromReader(message: GetConfigurationResponse, reader: jspb.BinaryReader): GetConfigurationResponse; +} + +export namespace GetConfigurationResponse { + export type AsObject = { + itemsList: Array, + } +} + +export class SubscribeConfigurationRequest extends jspb.Message { + getStoreName(): string; + setStoreName(value: string): SubscribeConfigurationRequest; + getAppId(): string; + setAppId(value: string): SubscribeConfigurationRequest; + getGroup(): string; + setGroup(value: string): SubscribeConfigurationRequest; + getLabel(): string; + setLabel(value: string): SubscribeConfigurationRequest; + clearKeysList(): void; + getKeysList(): Array; + setKeysList(value: Array): SubscribeConfigurationRequest; + addKeys(value: string, index?: number): string; + + getMetadataMap(): jspb.Map; + clearMetadataMap(): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SubscribeConfigurationRequest.AsObject; + static toObject(includeInstance: boolean, msg: SubscribeConfigurationRequest): SubscribeConfigurationRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SubscribeConfigurationRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SubscribeConfigurationRequest; + static deserializeBinaryFromReader(message: SubscribeConfigurationRequest, reader: jspb.BinaryReader): SubscribeConfigurationRequest; +} + +export namespace SubscribeConfigurationRequest { + export type AsObject = { + storeName: string, + appId: string, + group: string, + label: string, + keysList: Array, + + metadataMap: Array<[string, string]>, + } +} + +export class SubscribeConfigurationResponse extends jspb.Message { + getStoreName(): string; + setStoreName(value: string): SubscribeConfigurationResponse; + getAppId(): string; + setAppId(value: string): SubscribeConfigurationResponse; + clearItemsList(): void; + getItemsList(): Array; + setItemsList(value: Array): SubscribeConfigurationResponse; + addItems(value?: ConfigurationItem, index?: number): ConfigurationItem; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SubscribeConfigurationResponse.AsObject; + static toObject(includeInstance: boolean, msg: SubscribeConfigurationResponse): SubscribeConfigurationResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SubscribeConfigurationResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SubscribeConfigurationResponse; + static deserializeBinaryFromReader(message: SubscribeConfigurationResponse, reader: jspb.BinaryReader): SubscribeConfigurationResponse; +} + +export namespace SubscribeConfigurationResponse { + export type AsObject = { + storeName: string, + appId: string, + itemsList: Array, + } +} + +export class SaveConfigurationRequest extends jspb.Message { + getStoreName(): string; + setStoreName(value: string): SaveConfigurationRequest; + getAppId(): string; + setAppId(value: string): SaveConfigurationRequest; + clearItemsList(): void; + getItemsList(): Array; + setItemsList(value: Array): SaveConfigurationRequest; + addItems(value?: ConfigurationItem, index?: number): ConfigurationItem; + + getMetadataMap(): jspb.Map; + clearMetadataMap(): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SaveConfigurationRequest.AsObject; + static toObject(includeInstance: boolean, msg: SaveConfigurationRequest): SaveConfigurationRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SaveConfigurationRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SaveConfigurationRequest; + static deserializeBinaryFromReader(message: SaveConfigurationRequest, reader: jspb.BinaryReader): SaveConfigurationRequest; +} + +export namespace SaveConfigurationRequest { + export type AsObject = { + storeName: string, + appId: string, + itemsList: Array, + + metadataMap: Array<[string, string]>, + } +} + +export class DeleteConfigurationRequest extends jspb.Message { + getStoreName(): string; + setStoreName(value: string): DeleteConfigurationRequest; + getAppId(): string; + setAppId(value: string): DeleteConfigurationRequest; + getGroup(): string; + setGroup(value: string): DeleteConfigurationRequest; + getLabel(): string; + setLabel(value: string): DeleteConfigurationRequest; + clearKeysList(): void; + getKeysList(): Array; + setKeysList(value: Array): DeleteConfigurationRequest; + addKeys(value: string, index?: number): string; + + getMetadataMap(): jspb.Map; + clearMetadataMap(): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): DeleteConfigurationRequest.AsObject; + static toObject(includeInstance: boolean, msg: DeleteConfigurationRequest): DeleteConfigurationRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: DeleteConfigurationRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): DeleteConfigurationRequest; + static deserializeBinaryFromReader(message: DeleteConfigurationRequest, reader: jspb.BinaryReader): DeleteConfigurationRequest; +} + +export namespace DeleteConfigurationRequest { + export type AsObject = { + storeName: string, + appId: string, + group: string, + label: string, + keysList: Array, + + metadataMap: Array<[string, string]>, + } +} + +export class GetStateRequest extends jspb.Message { + getStoreName(): string; + setStoreName(value: string): GetStateRequest; + getKey(): string; + setKey(value: string): GetStateRequest; + getConsistency(): StateOptions.StateConsistency; + setConsistency(value: StateOptions.StateConsistency): GetStateRequest; + + getMetadataMap(): jspb.Map; + clearMetadataMap(): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetStateRequest.AsObject; + static toObject(includeInstance: boolean, msg: GetStateRequest): GetStateRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetStateRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetStateRequest; + static deserializeBinaryFromReader(message: GetStateRequest, reader: jspb.BinaryReader): GetStateRequest; +} + +export namespace GetStateRequest { + export type AsObject = { + storeName: string, + key: string, + consistency: StateOptions.StateConsistency, + + metadataMap: Array<[string, string]>, + } +} + +export class GetBulkStateRequest extends jspb.Message { + getStoreName(): string; + setStoreName(value: string): GetBulkStateRequest; + clearKeysList(): void; + getKeysList(): Array; + setKeysList(value: Array): GetBulkStateRequest; + addKeys(value: string, index?: number): string; + getParallelism(): number; + setParallelism(value: number): GetBulkStateRequest; + + getMetadataMap(): jspb.Map; + clearMetadataMap(): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetBulkStateRequest.AsObject; + static toObject(includeInstance: boolean, msg: GetBulkStateRequest): GetBulkStateRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetBulkStateRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetBulkStateRequest; + static deserializeBinaryFromReader(message: GetBulkStateRequest, reader: jspb.BinaryReader): GetBulkStateRequest; +} + +export namespace GetBulkStateRequest { + export type AsObject = { + storeName: string, + keysList: Array, + parallelism: number, + + metadataMap: Array<[string, string]>, + } +} + +export class GetBulkStateResponse extends jspb.Message { + clearItemsList(): void; + getItemsList(): Array; + setItemsList(value: Array): GetBulkStateResponse; + addItems(value?: BulkStateItem, index?: number): BulkStateItem; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetBulkStateResponse.AsObject; + static toObject(includeInstance: boolean, msg: GetBulkStateResponse): GetBulkStateResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetBulkStateResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetBulkStateResponse; + static deserializeBinaryFromReader(message: GetBulkStateResponse, reader: jspb.BinaryReader): GetBulkStateResponse; +} + +export namespace GetBulkStateResponse { + export type AsObject = { + itemsList: Array, + } +} + +export class BulkStateItem extends jspb.Message { + getKey(): string; + setKey(value: string): BulkStateItem; + getData(): Uint8Array | string; + getData_asU8(): Uint8Array; + getData_asB64(): string; + setData(value: Uint8Array | string): BulkStateItem; + getEtag(): string; + setEtag(value: string): BulkStateItem; + getError(): string; + setError(value: string): BulkStateItem; + + getMetadataMap(): jspb.Map; + clearMetadataMap(): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): BulkStateItem.AsObject; + static toObject(includeInstance: boolean, msg: BulkStateItem): BulkStateItem.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: BulkStateItem, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): BulkStateItem; + static deserializeBinaryFromReader(message: BulkStateItem, reader: jspb.BinaryReader): BulkStateItem; +} + +export namespace BulkStateItem { + export type AsObject = { + key: string, + data: Uint8Array | string, + etag: string, + error: string, + + metadataMap: Array<[string, string]>, + } +} + +export class GetStateResponse extends jspb.Message { + getData(): Uint8Array | string; + getData_asU8(): Uint8Array; + getData_asB64(): string; + setData(value: Uint8Array | string): GetStateResponse; + getEtag(): string; + setEtag(value: string): GetStateResponse; + + getMetadataMap(): jspb.Map; + clearMetadataMap(): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetStateResponse.AsObject; + static toObject(includeInstance: boolean, msg: GetStateResponse): GetStateResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetStateResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetStateResponse; + static deserializeBinaryFromReader(message: GetStateResponse, reader: jspb.BinaryReader): GetStateResponse; +} + +export namespace GetStateResponse { + export type AsObject = { + data: Uint8Array | string, + etag: string, + + metadataMap: Array<[string, string]>, + } +} + +export class DeleteStateRequest extends jspb.Message { + getStoreName(): string; + setStoreName(value: string): DeleteStateRequest; + getKey(): string; + setKey(value: string): DeleteStateRequest; + + hasEtag(): boolean; + clearEtag(): void; + getEtag(): Etag | undefined; + setEtag(value?: Etag): DeleteStateRequest; + + hasOptions(): boolean; + clearOptions(): void; + getOptions(): StateOptions | undefined; + setOptions(value?: StateOptions): DeleteStateRequest; + + getMetadataMap(): jspb.Map; + clearMetadataMap(): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): DeleteStateRequest.AsObject; + static toObject(includeInstance: boolean, msg: DeleteStateRequest): DeleteStateRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: DeleteStateRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): DeleteStateRequest; + static deserializeBinaryFromReader(message: DeleteStateRequest, reader: jspb.BinaryReader): DeleteStateRequest; +} + +export namespace DeleteStateRequest { + export type AsObject = { + storeName: string, + key: string, + etag?: Etag.AsObject, + options?: StateOptions.AsObject, + + metadataMap: Array<[string, string]>, + } +} + +export class DeleteBulkStateRequest extends jspb.Message { + getStoreName(): string; + setStoreName(value: string): DeleteBulkStateRequest; + clearStatesList(): void; + getStatesList(): Array; + setStatesList(value: Array): DeleteBulkStateRequest; + addStates(value?: StateItem, index?: number): StateItem; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): DeleteBulkStateRequest.AsObject; + static toObject(includeInstance: boolean, msg: DeleteBulkStateRequest): DeleteBulkStateRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: DeleteBulkStateRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): DeleteBulkStateRequest; + static deserializeBinaryFromReader(message: DeleteBulkStateRequest, reader: jspb.BinaryReader): DeleteBulkStateRequest; +} + +export namespace DeleteBulkStateRequest { + export type AsObject = { + storeName: string, + statesList: Array, + } +} + +export class SaveStateRequest extends jspb.Message { + getStoreName(): string; + setStoreName(value: string): SaveStateRequest; + clearStatesList(): void; + getStatesList(): Array; + setStatesList(value: Array): SaveStateRequest; + addStates(value?: StateItem, index?: number): StateItem; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SaveStateRequest.AsObject; + static toObject(includeInstance: boolean, msg: SaveStateRequest): SaveStateRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SaveStateRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SaveStateRequest; + static deserializeBinaryFromReader(message: SaveStateRequest, reader: jspb.BinaryReader): SaveStateRequest; +} + +export namespace SaveStateRequest { + export type AsObject = { + storeName: string, + statesList: Array, + } +} + +export class StateItem extends jspb.Message { + getKey(): string; + setKey(value: string): StateItem; + getValue(): Uint8Array | string; + getValue_asU8(): Uint8Array; + getValue_asB64(): string; + setValue(value: Uint8Array | string): StateItem; + + hasEtag(): boolean; + clearEtag(): void; + getEtag(): Etag | undefined; + setEtag(value?: Etag): StateItem; + + getMetadataMap(): jspb.Map; + clearMetadataMap(): void; + + hasOptions(): boolean; + clearOptions(): void; + getOptions(): StateOptions | undefined; + setOptions(value?: StateOptions): StateItem; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): StateItem.AsObject; + static toObject(includeInstance: boolean, msg: StateItem): StateItem.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: StateItem, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): StateItem; + static deserializeBinaryFromReader(message: StateItem, reader: jspb.BinaryReader): StateItem; +} + +export namespace StateItem { + export type AsObject = { + key: string, + value: Uint8Array | string, + etag?: Etag.AsObject, + + metadataMap: Array<[string, string]>, + options?: StateOptions.AsObject, + } +} + +export class Etag extends jspb.Message { + getValue(): string; + setValue(value: string): Etag; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Etag.AsObject; + static toObject(includeInstance: boolean, msg: Etag): Etag.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Etag, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Etag; + static deserializeBinaryFromReader(message: Etag, reader: jspb.BinaryReader): Etag; +} + +export namespace Etag { + export type AsObject = { + value: string, + } +} + +export class StateOptions extends jspb.Message { + getConcurrency(): StateOptions.StateConcurrency; + setConcurrency(value: StateOptions.StateConcurrency): StateOptions; + getConsistency(): StateOptions.StateConsistency; + setConsistency(value: StateOptions.StateConsistency): StateOptions; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): StateOptions.AsObject; + static toObject(includeInstance: boolean, msg: StateOptions): StateOptions.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: StateOptions, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): StateOptions; + static deserializeBinaryFromReader(message: StateOptions, reader: jspb.BinaryReader): StateOptions; +} + +export namespace StateOptions { + export type AsObject = { + concurrency: StateOptions.StateConcurrency, + consistency: StateOptions.StateConsistency, + } + + export enum StateConcurrency { + CONCURRENCY_UNSPECIFIED = 0, + CONCURRENCY_FIRST_WRITE = 1, + CONCURRENCY_LAST_WRITE = 2, + } + + export enum StateConsistency { + CONSISTENCY_UNSPECIFIED = 0, + CONSISTENCY_EVENTUAL = 1, + CONSISTENCY_STRONG = 2, + } + +} + +export class TransactionalStateOperation extends jspb.Message { + getOperationtype(): string; + setOperationtype(value: string): TransactionalStateOperation; + + hasRequest(): boolean; + clearRequest(): void; + getRequest(): StateItem | undefined; + setRequest(value?: StateItem): TransactionalStateOperation; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): TransactionalStateOperation.AsObject; + static toObject(includeInstance: boolean, msg: TransactionalStateOperation): TransactionalStateOperation.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: TransactionalStateOperation, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): TransactionalStateOperation; + static deserializeBinaryFromReader(message: TransactionalStateOperation, reader: jspb.BinaryReader): TransactionalStateOperation; +} + +export namespace TransactionalStateOperation { + export type AsObject = { + operationtype: string, + request?: StateItem.AsObject, + } +} + +export class ExecuteStateTransactionRequest extends jspb.Message { + getStorename(): string; + setStorename(value: string): ExecuteStateTransactionRequest; + clearOperationsList(): void; + getOperationsList(): Array; + setOperationsList(value: Array): ExecuteStateTransactionRequest; + addOperations(value?: TransactionalStateOperation, index?: number): TransactionalStateOperation; + + getMetadataMap(): jspb.Map; + clearMetadataMap(): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ExecuteStateTransactionRequest.AsObject; + static toObject(includeInstance: boolean, msg: ExecuteStateTransactionRequest): ExecuteStateTransactionRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ExecuteStateTransactionRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ExecuteStateTransactionRequest; + static deserializeBinaryFromReader(message: ExecuteStateTransactionRequest, reader: jspb.BinaryReader): ExecuteStateTransactionRequest; +} + +export namespace ExecuteStateTransactionRequest { + export type AsObject = { + storename: string, + operationsList: Array, + + metadataMap: Array<[string, string]>, + } +} + +export class PublishEventRequest extends jspb.Message { + getPubsubName(): string; + setPubsubName(value: string): PublishEventRequest; + getTopic(): string; + setTopic(value: string): PublishEventRequest; + getData(): Uint8Array | string; + getData_asU8(): Uint8Array; + getData_asB64(): string; + setData(value: Uint8Array | string): PublishEventRequest; + getDataContentType(): string; + setDataContentType(value: string): PublishEventRequest; + + getMetadataMap(): jspb.Map; + clearMetadataMap(): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): PublishEventRequest.AsObject; + static toObject(includeInstance: boolean, msg: PublishEventRequest): PublishEventRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: PublishEventRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): PublishEventRequest; + static deserializeBinaryFromReader(message: PublishEventRequest, reader: jspb.BinaryReader): PublishEventRequest; +} + +export namespace PublishEventRequest { + export type AsObject = { + pubsubName: string, + topic: string, + data: Uint8Array | string, + dataContentType: string, + + metadataMap: Array<[string, string]>, + } +} + +export class InvokeBindingRequest extends jspb.Message { + getName(): string; + setName(value: string): InvokeBindingRequest; + getData(): Uint8Array | string; + getData_asU8(): Uint8Array; + getData_asB64(): string; + setData(value: Uint8Array | string): InvokeBindingRequest; + + getMetadataMap(): jspb.Map; + clearMetadataMap(): void; + getOperation(): string; + setOperation(value: string): InvokeBindingRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): InvokeBindingRequest.AsObject; + static toObject(includeInstance: boolean, msg: InvokeBindingRequest): InvokeBindingRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: InvokeBindingRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): InvokeBindingRequest; + static deserializeBinaryFromReader(message: InvokeBindingRequest, reader: jspb.BinaryReader): InvokeBindingRequest; +} + +export namespace InvokeBindingRequest { + export type AsObject = { + name: string, + data: Uint8Array | string, + + metadataMap: Array<[string, string]>, + operation: string, + } +} + +export class InvokeBindingResponse extends jspb.Message { + getData(): Uint8Array | string; + getData_asU8(): Uint8Array; + getData_asB64(): string; + setData(value: Uint8Array | string): InvokeBindingResponse; + + getMetadataMap(): jspb.Map; + clearMetadataMap(): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): InvokeBindingResponse.AsObject; + static toObject(includeInstance: boolean, msg: InvokeBindingResponse): InvokeBindingResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: InvokeBindingResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): InvokeBindingResponse; + static deserializeBinaryFromReader(message: InvokeBindingResponse, reader: jspb.BinaryReader): InvokeBindingResponse; +} + +export namespace InvokeBindingResponse { + export type AsObject = { + data: Uint8Array | string, + + metadataMap: Array<[string, string]>, + } +} diff --git a/sdk/js-sdk/proto/runtime_pb.js b/sdk/js-sdk/proto/runtime_pb.js new file mode 100644 index 0000000000..d6ed9050e1 --- /dev/null +++ b/sdk/js-sdk/proto/runtime_pb.js @@ -0,0 +1,10020 @@ +// source: runtime.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js'); +goog.object.extend(proto, google_protobuf_empty_pb); +var google_protobuf_any_pb = require('google-protobuf/google/protobuf/any_pb.js'); +goog.object.extend(proto, google_protobuf_any_pb); +goog.exportSymbol('proto.spec.proto.runtime.v1.BulkStateItem', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.CommonInvokeRequest', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.ConfigurationItem', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.DelFileRequest', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.DeleteBulkStateRequest', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.DeleteConfigurationRequest', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.DeleteStateRequest', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.Etag', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.ExecuteStateTransactionRequest', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.FileRequest', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.GetBulkStateRequest', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.GetBulkStateResponse', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.GetConfigurationRequest', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.GetConfigurationResponse', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.GetFileRequest', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.GetFileResponse', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.GetNextIdRequest', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.GetNextIdResponse', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.GetStateRequest', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.GetStateResponse', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.HTTPExtension', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.HTTPExtension.Verb', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.InvokeBindingRequest', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.InvokeBindingResponse', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.InvokeResponse', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.InvokeServiceRequest', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.ListFileRequest', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.ListFileResp', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.PublishEventRequest', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.PutFileRequest', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.SaveConfigurationRequest', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.SaveStateRequest', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.SayHelloRequest', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.SayHelloResponse', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.SequencerOptions', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.SequencerOptions.AutoIncrement', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.StateItem', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.StateOptions', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.StateOptions.StateConcurrency', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.StateOptions.StateConsistency', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.SubscribeConfigurationRequest', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.SubscribeConfigurationResponse', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.TransactionalStateOperation', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.TryLockRequest', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.TryLockResponse', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.UnlockRequest', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.UnlockResponse', null, global); +goog.exportSymbol('proto.spec.proto.runtime.v1.UnlockResponse.Status', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.GetFileRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.GetFileRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.GetFileRequest.displayName = 'proto.spec.proto.runtime.v1.GetFileRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.GetFileResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.GetFileResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.GetFileResponse.displayName = 'proto.spec.proto.runtime.v1.GetFileResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.PutFileRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.PutFileRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.PutFileRequest.displayName = 'proto.spec.proto.runtime.v1.PutFileRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.FileRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.FileRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.FileRequest.displayName = 'proto.spec.proto.runtime.v1.FileRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.ListFileRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.ListFileRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.ListFileRequest.displayName = 'proto.spec.proto.runtime.v1.ListFileRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.ListFileResp = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.spec.proto.runtime.v1.ListFileResp.repeatedFields_, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.ListFileResp, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.ListFileResp.displayName = 'proto.spec.proto.runtime.v1.ListFileResp'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.DelFileRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.DelFileRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.DelFileRequest.displayName = 'proto.spec.proto.runtime.v1.DelFileRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.GetNextIdRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.GetNextIdRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.GetNextIdRequest.displayName = 'proto.spec.proto.runtime.v1.GetNextIdRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.SequencerOptions = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.SequencerOptions, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.SequencerOptions.displayName = 'proto.spec.proto.runtime.v1.SequencerOptions'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.GetNextIdResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.GetNextIdResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.GetNextIdResponse.displayName = 'proto.spec.proto.runtime.v1.GetNextIdResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.TryLockRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.TryLockRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.TryLockRequest.displayName = 'proto.spec.proto.runtime.v1.TryLockRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.TryLockResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.TryLockResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.TryLockResponse.displayName = 'proto.spec.proto.runtime.v1.TryLockResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.UnlockRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.UnlockRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.UnlockRequest.displayName = 'proto.spec.proto.runtime.v1.UnlockRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.UnlockResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.UnlockResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.UnlockResponse.displayName = 'proto.spec.proto.runtime.v1.UnlockResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.SayHelloRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.SayHelloRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.SayHelloRequest.displayName = 'proto.spec.proto.runtime.v1.SayHelloRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.SayHelloResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.SayHelloResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.SayHelloResponse.displayName = 'proto.spec.proto.runtime.v1.SayHelloResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.InvokeServiceRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.InvokeServiceRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.InvokeServiceRequest.displayName = 'proto.spec.proto.runtime.v1.InvokeServiceRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.CommonInvokeRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.CommonInvokeRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.CommonInvokeRequest.displayName = 'proto.spec.proto.runtime.v1.CommonInvokeRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.HTTPExtension = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.HTTPExtension, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.HTTPExtension.displayName = 'proto.spec.proto.runtime.v1.HTTPExtension'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.InvokeResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.InvokeResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.InvokeResponse.displayName = 'proto.spec.proto.runtime.v1.InvokeResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.ConfigurationItem = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.ConfigurationItem, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.ConfigurationItem.displayName = 'proto.spec.proto.runtime.v1.ConfigurationItem'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.GetConfigurationRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.spec.proto.runtime.v1.GetConfigurationRequest.repeatedFields_, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.GetConfigurationRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.GetConfigurationRequest.displayName = 'proto.spec.proto.runtime.v1.GetConfigurationRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.GetConfigurationResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.spec.proto.runtime.v1.GetConfigurationResponse.repeatedFields_, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.GetConfigurationResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.GetConfigurationResponse.displayName = 'proto.spec.proto.runtime.v1.GetConfigurationResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.spec.proto.runtime.v1.SubscribeConfigurationRequest.repeatedFields_, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.SubscribeConfigurationRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.SubscribeConfigurationRequest.displayName = 'proto.spec.proto.runtime.v1.SubscribeConfigurationRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.spec.proto.runtime.v1.SubscribeConfigurationResponse.repeatedFields_, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.SubscribeConfigurationResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.SubscribeConfigurationResponse.displayName = 'proto.spec.proto.runtime.v1.SubscribeConfigurationResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.SaveConfigurationRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.spec.proto.runtime.v1.SaveConfigurationRequest.repeatedFields_, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.SaveConfigurationRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.SaveConfigurationRequest.displayName = 'proto.spec.proto.runtime.v1.SaveConfigurationRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.DeleteConfigurationRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.spec.proto.runtime.v1.DeleteConfigurationRequest.repeatedFields_, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.DeleteConfigurationRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.DeleteConfigurationRequest.displayName = 'proto.spec.proto.runtime.v1.DeleteConfigurationRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.GetStateRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.GetStateRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.GetStateRequest.displayName = 'proto.spec.proto.runtime.v1.GetStateRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.GetBulkStateRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.spec.proto.runtime.v1.GetBulkStateRequest.repeatedFields_, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.GetBulkStateRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.GetBulkStateRequest.displayName = 'proto.spec.proto.runtime.v1.GetBulkStateRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.GetBulkStateResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.spec.proto.runtime.v1.GetBulkStateResponse.repeatedFields_, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.GetBulkStateResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.GetBulkStateResponse.displayName = 'proto.spec.proto.runtime.v1.GetBulkStateResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.BulkStateItem = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.BulkStateItem, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.BulkStateItem.displayName = 'proto.spec.proto.runtime.v1.BulkStateItem'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.GetStateResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.GetStateResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.GetStateResponse.displayName = 'proto.spec.proto.runtime.v1.GetStateResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.DeleteStateRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.DeleteStateRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.DeleteStateRequest.displayName = 'proto.spec.proto.runtime.v1.DeleteStateRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.DeleteBulkStateRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.spec.proto.runtime.v1.DeleteBulkStateRequest.repeatedFields_, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.DeleteBulkStateRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.DeleteBulkStateRequest.displayName = 'proto.spec.proto.runtime.v1.DeleteBulkStateRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.SaveStateRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.spec.proto.runtime.v1.SaveStateRequest.repeatedFields_, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.SaveStateRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.SaveStateRequest.displayName = 'proto.spec.proto.runtime.v1.SaveStateRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.StateItem = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.StateItem, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.StateItem.displayName = 'proto.spec.proto.runtime.v1.StateItem'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.Etag = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.Etag, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.Etag.displayName = 'proto.spec.proto.runtime.v1.Etag'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.StateOptions = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.StateOptions, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.StateOptions.displayName = 'proto.spec.proto.runtime.v1.StateOptions'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.TransactionalStateOperation = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.TransactionalStateOperation, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.TransactionalStateOperation.displayName = 'proto.spec.proto.runtime.v1.TransactionalStateOperation'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.ExecuteStateTransactionRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.spec.proto.runtime.v1.ExecuteStateTransactionRequest.repeatedFields_, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.ExecuteStateTransactionRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.ExecuteStateTransactionRequest.displayName = 'proto.spec.proto.runtime.v1.ExecuteStateTransactionRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.PublishEventRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.PublishEventRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.PublishEventRequest.displayName = 'proto.spec.proto.runtime.v1.PublishEventRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.InvokeBindingRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.InvokeBindingRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.InvokeBindingRequest.displayName = 'proto.spec.proto.runtime.v1.InvokeBindingRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.spec.proto.runtime.v1.InvokeBindingResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.spec.proto.runtime.v1.InvokeBindingResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.spec.proto.runtime.v1.InvokeBindingResponse.displayName = 'proto.spec.proto.runtime.v1.InvokeBindingResponse'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.GetFileRequest.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.GetFileRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.GetFileRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.GetFileRequest.toObject = function(includeInstance, msg) { + var f, obj = { + storeName: jspb.Message.getFieldWithDefault(msg, 1, ""), + name: jspb.Message.getFieldWithDefault(msg, 2, ""), + metadataMap: (f = msg.getMetadataMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.GetFileRequest} + */ +proto.spec.proto.runtime.v1.GetFileRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.GetFileRequest; + return proto.spec.proto.runtime.v1.GetFileRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.GetFileRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.GetFileRequest} + */ +proto.spec.proto.runtime.v1.GetFileRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setStoreName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 3: + var value = msg.getMetadataMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.GetFileRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.GetFileRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.GetFileRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.GetFileRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStoreName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getMetadataMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(3, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } +}; + + +/** + * optional string store_name = 1; + * @return {string} + */ +proto.spec.proto.runtime.v1.GetFileRequest.prototype.getStoreName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.GetFileRequest} returns this + */ +proto.spec.proto.runtime.v1.GetFileRequest.prototype.setStoreName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string name = 2; + * @return {string} + */ +proto.spec.proto.runtime.v1.GetFileRequest.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.GetFileRequest} returns this + */ +proto.spec.proto.runtime.v1.GetFileRequest.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * map metadata = 3; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.spec.proto.runtime.v1.GetFileRequest.prototype.getMetadataMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 3, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.spec.proto.runtime.v1.GetFileRequest} returns this + */ +proto.spec.proto.runtime.v1.GetFileRequest.prototype.clearMetadataMap = function() { + this.getMetadataMap().clear(); + return this;}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.GetFileResponse.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.GetFileResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.GetFileResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.GetFileResponse.toObject = function(includeInstance, msg) { + var f, obj = { + data: msg.getData_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.GetFileResponse} + */ +proto.spec.proto.runtime.v1.GetFileResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.GetFileResponse; + return proto.spec.proto.runtime.v1.GetFileResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.GetFileResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.GetFileResponse} + */ +proto.spec.proto.runtime.v1.GetFileResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setData(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.GetFileResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.GetFileResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.GetFileResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.GetFileResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getData_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } +}; + + +/** + * optional bytes data = 1; + * @return {!(string|Uint8Array)} + */ +proto.spec.proto.runtime.v1.GetFileResponse.prototype.getData = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes data = 1; + * This is a type-conversion wrapper around `getData()` + * @return {string} + */ +proto.spec.proto.runtime.v1.GetFileResponse.prototype.getData_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getData())); +}; + + +/** + * optional bytes data = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getData()` + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.GetFileResponse.prototype.getData_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getData())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.spec.proto.runtime.v1.GetFileResponse} returns this + */ +proto.spec.proto.runtime.v1.GetFileResponse.prototype.setData = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.PutFileRequest.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.PutFileRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.PutFileRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.PutFileRequest.toObject = function(includeInstance, msg) { + var f, obj = { + storeName: jspb.Message.getFieldWithDefault(msg, 1, ""), + name: jspb.Message.getFieldWithDefault(msg, 2, ""), + data: msg.getData_asB64(), + metadataMap: (f = msg.getMetadataMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.PutFileRequest} + */ +proto.spec.proto.runtime.v1.PutFileRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.PutFileRequest; + return proto.spec.proto.runtime.v1.PutFileRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.PutFileRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.PutFileRequest} + */ +proto.spec.proto.runtime.v1.PutFileRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setStoreName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setData(value); + break; + case 4: + var value = msg.getMetadataMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.PutFileRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.PutFileRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.PutFileRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.PutFileRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStoreName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getData_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } + f = message.getMetadataMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(4, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } +}; + + +/** + * optional string store_name = 1; + * @return {string} + */ +proto.spec.proto.runtime.v1.PutFileRequest.prototype.getStoreName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.PutFileRequest} returns this + */ +proto.spec.proto.runtime.v1.PutFileRequest.prototype.setStoreName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string name = 2; + * @return {string} + */ +proto.spec.proto.runtime.v1.PutFileRequest.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.PutFileRequest} returns this + */ +proto.spec.proto.runtime.v1.PutFileRequest.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional bytes data = 3; + * @return {!(string|Uint8Array)} + */ +proto.spec.proto.runtime.v1.PutFileRequest.prototype.getData = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes data = 3; + * This is a type-conversion wrapper around `getData()` + * @return {string} + */ +proto.spec.proto.runtime.v1.PutFileRequest.prototype.getData_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getData())); +}; + + +/** + * optional bytes data = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getData()` + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.PutFileRequest.prototype.getData_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getData())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.spec.proto.runtime.v1.PutFileRequest} returns this + */ +proto.spec.proto.runtime.v1.PutFileRequest.prototype.setData = function(value) { + return jspb.Message.setProto3BytesField(this, 3, value); +}; + + +/** + * map metadata = 4; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.spec.proto.runtime.v1.PutFileRequest.prototype.getMetadataMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 4, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.spec.proto.runtime.v1.PutFileRequest} returns this + */ +proto.spec.proto.runtime.v1.PutFileRequest.prototype.clearMetadataMap = function() { + this.getMetadataMap().clear(); + return this;}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.FileRequest.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.FileRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.FileRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.FileRequest.toObject = function(includeInstance, msg) { + var f, obj = { + storeName: jspb.Message.getFieldWithDefault(msg, 1, ""), + name: jspb.Message.getFieldWithDefault(msg, 2, ""), + metadataMap: (f = msg.getMetadataMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.FileRequest} + */ +proto.spec.proto.runtime.v1.FileRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.FileRequest; + return proto.spec.proto.runtime.v1.FileRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.FileRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.FileRequest} + */ +proto.spec.proto.runtime.v1.FileRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setStoreName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 3: + var value = msg.getMetadataMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.FileRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.FileRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.FileRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.FileRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStoreName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getMetadataMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(3, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } +}; + + +/** + * optional string store_name = 1; + * @return {string} + */ +proto.spec.proto.runtime.v1.FileRequest.prototype.getStoreName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.FileRequest} returns this + */ +proto.spec.proto.runtime.v1.FileRequest.prototype.setStoreName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string name = 2; + * @return {string} + */ +proto.spec.proto.runtime.v1.FileRequest.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.FileRequest} returns this + */ +proto.spec.proto.runtime.v1.FileRequest.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * map metadata = 3; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.spec.proto.runtime.v1.FileRequest.prototype.getMetadataMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 3, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.spec.proto.runtime.v1.FileRequest} returns this + */ +proto.spec.proto.runtime.v1.FileRequest.prototype.clearMetadataMap = function() { + this.getMetadataMap().clear(); + return this;}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.ListFileRequest.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.ListFileRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.ListFileRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.ListFileRequest.toObject = function(includeInstance, msg) { + var f, obj = { + request: (f = msg.getRequest()) && proto.spec.proto.runtime.v1.FileRequest.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.ListFileRequest} + */ +proto.spec.proto.runtime.v1.ListFileRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.ListFileRequest; + return proto.spec.proto.runtime.v1.ListFileRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.ListFileRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.ListFileRequest} + */ +proto.spec.proto.runtime.v1.ListFileRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.spec.proto.runtime.v1.FileRequest; + reader.readMessage(value,proto.spec.proto.runtime.v1.FileRequest.deserializeBinaryFromReader); + msg.setRequest(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.ListFileRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.ListFileRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.ListFileRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.ListFileRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRequest(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.spec.proto.runtime.v1.FileRequest.serializeBinaryToWriter + ); + } +}; + + +/** + * optional FileRequest request = 1; + * @return {?proto.spec.proto.runtime.v1.FileRequest} + */ +proto.spec.proto.runtime.v1.ListFileRequest.prototype.getRequest = function() { + return /** @type{?proto.spec.proto.runtime.v1.FileRequest} */ ( + jspb.Message.getWrapperField(this, proto.spec.proto.runtime.v1.FileRequest, 1)); +}; + + +/** + * @param {?proto.spec.proto.runtime.v1.FileRequest|undefined} value + * @return {!proto.spec.proto.runtime.v1.ListFileRequest} returns this +*/ +proto.spec.proto.runtime.v1.ListFileRequest.prototype.setRequest = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.spec.proto.runtime.v1.ListFileRequest} returns this + */ +proto.spec.proto.runtime.v1.ListFileRequest.prototype.clearRequest = function() { + return this.setRequest(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.spec.proto.runtime.v1.ListFileRequest.prototype.hasRequest = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.spec.proto.runtime.v1.ListFileResp.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.ListFileResp.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.ListFileResp.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.ListFileResp} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.ListFileResp.toObject = function(includeInstance, msg) { + var f, obj = { + fileNameList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.ListFileResp} + */ +proto.spec.proto.runtime.v1.ListFileResp.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.ListFileResp; + return proto.spec.proto.runtime.v1.ListFileResp.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.ListFileResp} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.ListFileResp} + */ +proto.spec.proto.runtime.v1.ListFileResp.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.addFileName(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.ListFileResp.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.ListFileResp.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.ListFileResp} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.ListFileResp.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getFileNameList(); + if (f.length > 0) { + writer.writeRepeatedString( + 1, + f + ); + } +}; + + +/** + * repeated string file_name = 1; + * @return {!Array} + */ +proto.spec.proto.runtime.v1.ListFileResp.prototype.getFileNameList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.spec.proto.runtime.v1.ListFileResp} returns this + */ +proto.spec.proto.runtime.v1.ListFileResp.prototype.setFileNameList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.spec.proto.runtime.v1.ListFileResp} returns this + */ +proto.spec.proto.runtime.v1.ListFileResp.prototype.addFileName = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.spec.proto.runtime.v1.ListFileResp} returns this + */ +proto.spec.proto.runtime.v1.ListFileResp.prototype.clearFileNameList = function() { + return this.setFileNameList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.DelFileRequest.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.DelFileRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.DelFileRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.DelFileRequest.toObject = function(includeInstance, msg) { + var f, obj = { + request: (f = msg.getRequest()) && proto.spec.proto.runtime.v1.FileRequest.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.DelFileRequest} + */ +proto.spec.proto.runtime.v1.DelFileRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.DelFileRequest; + return proto.spec.proto.runtime.v1.DelFileRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.DelFileRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.DelFileRequest} + */ +proto.spec.proto.runtime.v1.DelFileRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.spec.proto.runtime.v1.FileRequest; + reader.readMessage(value,proto.spec.proto.runtime.v1.FileRequest.deserializeBinaryFromReader); + msg.setRequest(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.DelFileRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.DelFileRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.DelFileRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.DelFileRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRequest(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.spec.proto.runtime.v1.FileRequest.serializeBinaryToWriter + ); + } +}; + + +/** + * optional FileRequest request = 1; + * @return {?proto.spec.proto.runtime.v1.FileRequest} + */ +proto.spec.proto.runtime.v1.DelFileRequest.prototype.getRequest = function() { + return /** @type{?proto.spec.proto.runtime.v1.FileRequest} */ ( + jspb.Message.getWrapperField(this, proto.spec.proto.runtime.v1.FileRequest, 1)); +}; + + +/** + * @param {?proto.spec.proto.runtime.v1.FileRequest|undefined} value + * @return {!proto.spec.proto.runtime.v1.DelFileRequest} returns this +*/ +proto.spec.proto.runtime.v1.DelFileRequest.prototype.setRequest = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.spec.proto.runtime.v1.DelFileRequest} returns this + */ +proto.spec.proto.runtime.v1.DelFileRequest.prototype.clearRequest = function() { + return this.setRequest(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.spec.proto.runtime.v1.DelFileRequest.prototype.hasRequest = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.GetNextIdRequest.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.GetNextIdRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.GetNextIdRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.GetNextIdRequest.toObject = function(includeInstance, msg) { + var f, obj = { + storeName: jspb.Message.getFieldWithDefault(msg, 1, ""), + key: jspb.Message.getFieldWithDefault(msg, 2, ""), + options: (f = msg.getOptions()) && proto.spec.proto.runtime.v1.SequencerOptions.toObject(includeInstance, f), + metadataMap: (f = msg.getMetadataMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.GetNextIdRequest} + */ +proto.spec.proto.runtime.v1.GetNextIdRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.GetNextIdRequest; + return proto.spec.proto.runtime.v1.GetNextIdRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.GetNextIdRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.GetNextIdRequest} + */ +proto.spec.proto.runtime.v1.GetNextIdRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setStoreName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setKey(value); + break; + case 3: + var value = new proto.spec.proto.runtime.v1.SequencerOptions; + reader.readMessage(value,proto.spec.proto.runtime.v1.SequencerOptions.deserializeBinaryFromReader); + msg.setOptions(value); + break; + case 4: + var value = msg.getMetadataMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.GetNextIdRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.GetNextIdRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.GetNextIdRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.GetNextIdRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStoreName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getKey(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getOptions(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.spec.proto.runtime.v1.SequencerOptions.serializeBinaryToWriter + ); + } + f = message.getMetadataMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(4, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } +}; + + +/** + * optional string store_name = 1; + * @return {string} + */ +proto.spec.proto.runtime.v1.GetNextIdRequest.prototype.getStoreName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.GetNextIdRequest} returns this + */ +proto.spec.proto.runtime.v1.GetNextIdRequest.prototype.setStoreName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string key = 2; + * @return {string} + */ +proto.spec.proto.runtime.v1.GetNextIdRequest.prototype.getKey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.GetNextIdRequest} returns this + */ +proto.spec.proto.runtime.v1.GetNextIdRequest.prototype.setKey = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional SequencerOptions options = 3; + * @return {?proto.spec.proto.runtime.v1.SequencerOptions} + */ +proto.spec.proto.runtime.v1.GetNextIdRequest.prototype.getOptions = function() { + return /** @type{?proto.spec.proto.runtime.v1.SequencerOptions} */ ( + jspb.Message.getWrapperField(this, proto.spec.proto.runtime.v1.SequencerOptions, 3)); +}; + + +/** + * @param {?proto.spec.proto.runtime.v1.SequencerOptions|undefined} value + * @return {!proto.spec.proto.runtime.v1.GetNextIdRequest} returns this +*/ +proto.spec.proto.runtime.v1.GetNextIdRequest.prototype.setOptions = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.spec.proto.runtime.v1.GetNextIdRequest} returns this + */ +proto.spec.proto.runtime.v1.GetNextIdRequest.prototype.clearOptions = function() { + return this.setOptions(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.spec.proto.runtime.v1.GetNextIdRequest.prototype.hasOptions = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * map metadata = 4; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.spec.proto.runtime.v1.GetNextIdRequest.prototype.getMetadataMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 4, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.spec.proto.runtime.v1.GetNextIdRequest} returns this + */ +proto.spec.proto.runtime.v1.GetNextIdRequest.prototype.clearMetadataMap = function() { + this.getMetadataMap().clear(); + return this;}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.SequencerOptions.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.SequencerOptions.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.SequencerOptions} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.SequencerOptions.toObject = function(includeInstance, msg) { + var f, obj = { + increment: jspb.Message.getFieldWithDefault(msg, 1, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.SequencerOptions} + */ +proto.spec.proto.runtime.v1.SequencerOptions.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.SequencerOptions; + return proto.spec.proto.runtime.v1.SequencerOptions.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.SequencerOptions} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.SequencerOptions} + */ +proto.spec.proto.runtime.v1.SequencerOptions.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.spec.proto.runtime.v1.SequencerOptions.AutoIncrement} */ (reader.readEnum()); + msg.setIncrement(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.SequencerOptions.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.SequencerOptions.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.SequencerOptions} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.SequencerOptions.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getIncrement(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.spec.proto.runtime.v1.SequencerOptions.AutoIncrement = { + WEAK: 0, + STRONG: 1 +}; + +/** + * optional AutoIncrement increment = 1; + * @return {!proto.spec.proto.runtime.v1.SequencerOptions.AutoIncrement} + */ +proto.spec.proto.runtime.v1.SequencerOptions.prototype.getIncrement = function() { + return /** @type {!proto.spec.proto.runtime.v1.SequencerOptions.AutoIncrement} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {!proto.spec.proto.runtime.v1.SequencerOptions.AutoIncrement} value + * @return {!proto.spec.proto.runtime.v1.SequencerOptions} returns this + */ +proto.spec.proto.runtime.v1.SequencerOptions.prototype.setIncrement = function(value) { + return jspb.Message.setProto3EnumField(this, 1, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.GetNextIdResponse.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.GetNextIdResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.GetNextIdResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.GetNextIdResponse.toObject = function(includeInstance, msg) { + var f, obj = { + nextId: jspb.Message.getFieldWithDefault(msg, 1, "0") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.GetNextIdResponse} + */ +proto.spec.proto.runtime.v1.GetNextIdResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.GetNextIdResponse; + return proto.spec.proto.runtime.v1.GetNextIdResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.GetNextIdResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.GetNextIdResponse} + */ +proto.spec.proto.runtime.v1.GetNextIdResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readInt64String()); + msg.setNextId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.GetNextIdResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.GetNextIdResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.GetNextIdResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.GetNextIdResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getNextId(); + if (parseInt(f, 10) !== 0) { + writer.writeInt64String( + 1, + f + ); + } +}; + + +/** + * optional int64 next_id = 1; + * @return {string} + */ +proto.spec.proto.runtime.v1.GetNextIdResponse.prototype.getNextId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "0")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.GetNextIdResponse} returns this + */ +proto.spec.proto.runtime.v1.GetNextIdResponse.prototype.setNextId = function(value) { + return jspb.Message.setProto3StringIntField(this, 1, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.TryLockRequest.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.TryLockRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.TryLockRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.TryLockRequest.toObject = function(includeInstance, msg) { + var f, obj = { + storeName: jspb.Message.getFieldWithDefault(msg, 1, ""), + resourceId: jspb.Message.getFieldWithDefault(msg, 2, ""), + lockOwner: jspb.Message.getFieldWithDefault(msg, 3, ""), + expire: jspb.Message.getFieldWithDefault(msg, 4, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.TryLockRequest} + */ +proto.spec.proto.runtime.v1.TryLockRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.TryLockRequest; + return proto.spec.proto.runtime.v1.TryLockRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.TryLockRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.TryLockRequest} + */ +proto.spec.proto.runtime.v1.TryLockRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setStoreName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setResourceId(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setLockOwner(value); + break; + case 4: + var value = /** @type {number} */ (reader.readInt32()); + msg.setExpire(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.TryLockRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.TryLockRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.TryLockRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.TryLockRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStoreName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getResourceId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getLockOwner(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getExpire(); + if (f !== 0) { + writer.writeInt32( + 4, + f + ); + } +}; + + +/** + * optional string store_name = 1; + * @return {string} + */ +proto.spec.proto.runtime.v1.TryLockRequest.prototype.getStoreName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.TryLockRequest} returns this + */ +proto.spec.proto.runtime.v1.TryLockRequest.prototype.setStoreName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string resource_id = 2; + * @return {string} + */ +proto.spec.proto.runtime.v1.TryLockRequest.prototype.getResourceId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.TryLockRequest} returns this + */ +proto.spec.proto.runtime.v1.TryLockRequest.prototype.setResourceId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string lock_owner = 3; + * @return {string} + */ +proto.spec.proto.runtime.v1.TryLockRequest.prototype.getLockOwner = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.TryLockRequest} returns this + */ +proto.spec.proto.runtime.v1.TryLockRequest.prototype.setLockOwner = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional int32 expire = 4; + * @return {number} + */ +proto.spec.proto.runtime.v1.TryLockRequest.prototype.getExpire = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.spec.proto.runtime.v1.TryLockRequest} returns this + */ +proto.spec.proto.runtime.v1.TryLockRequest.prototype.setExpire = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.TryLockResponse.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.TryLockResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.TryLockResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.TryLockResponse.toObject = function(includeInstance, msg) { + var f, obj = { + success: jspb.Message.getBooleanFieldWithDefault(msg, 1, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.TryLockResponse} + */ +proto.spec.proto.runtime.v1.TryLockResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.TryLockResponse; + return proto.spec.proto.runtime.v1.TryLockResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.TryLockResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.TryLockResponse} + */ +proto.spec.proto.runtime.v1.TryLockResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setSuccess(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.TryLockResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.TryLockResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.TryLockResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.TryLockResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSuccess(); + if (f) { + writer.writeBool( + 1, + f + ); + } +}; + + +/** + * optional bool success = 1; + * @return {boolean} + */ +proto.spec.proto.runtime.v1.TryLockResponse.prototype.getSuccess = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.spec.proto.runtime.v1.TryLockResponse} returns this + */ +proto.spec.proto.runtime.v1.TryLockResponse.prototype.setSuccess = function(value) { + return jspb.Message.setProto3BooleanField(this, 1, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.UnlockRequest.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.UnlockRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.UnlockRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.UnlockRequest.toObject = function(includeInstance, msg) { + var f, obj = { + storeName: jspb.Message.getFieldWithDefault(msg, 1, ""), + resourceId: jspb.Message.getFieldWithDefault(msg, 2, ""), + lockOwner: jspb.Message.getFieldWithDefault(msg, 3, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.UnlockRequest} + */ +proto.spec.proto.runtime.v1.UnlockRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.UnlockRequest; + return proto.spec.proto.runtime.v1.UnlockRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.UnlockRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.UnlockRequest} + */ +proto.spec.proto.runtime.v1.UnlockRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setStoreName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setResourceId(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setLockOwner(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.UnlockRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.UnlockRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.UnlockRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.UnlockRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStoreName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getResourceId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getLockOwner(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } +}; + + +/** + * optional string store_name = 1; + * @return {string} + */ +proto.spec.proto.runtime.v1.UnlockRequest.prototype.getStoreName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.UnlockRequest} returns this + */ +proto.spec.proto.runtime.v1.UnlockRequest.prototype.setStoreName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string resource_id = 2; + * @return {string} + */ +proto.spec.proto.runtime.v1.UnlockRequest.prototype.getResourceId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.UnlockRequest} returns this + */ +proto.spec.proto.runtime.v1.UnlockRequest.prototype.setResourceId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string lock_owner = 3; + * @return {string} + */ +proto.spec.proto.runtime.v1.UnlockRequest.prototype.getLockOwner = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.UnlockRequest} returns this + */ +proto.spec.proto.runtime.v1.UnlockRequest.prototype.setLockOwner = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.UnlockResponse.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.UnlockResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.UnlockResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.UnlockResponse.toObject = function(includeInstance, msg) { + var f, obj = { + status: jspb.Message.getFieldWithDefault(msg, 1, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.UnlockResponse} + */ +proto.spec.proto.runtime.v1.UnlockResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.UnlockResponse; + return proto.spec.proto.runtime.v1.UnlockResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.UnlockResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.UnlockResponse} + */ +proto.spec.proto.runtime.v1.UnlockResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.spec.proto.runtime.v1.UnlockResponse.Status} */ (reader.readEnum()); + msg.setStatus(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.UnlockResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.UnlockResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.UnlockResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.UnlockResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStatus(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.spec.proto.runtime.v1.UnlockResponse.Status = { + SUCCESS: 0, + LOCK_UNEXIST: 1, + LOCK_BELONG_TO_OTHERS: 2, + INTERNAL_ERROR: 3 +}; + +/** + * optional Status status = 1; + * @return {!proto.spec.proto.runtime.v1.UnlockResponse.Status} + */ +proto.spec.proto.runtime.v1.UnlockResponse.prototype.getStatus = function() { + return /** @type {!proto.spec.proto.runtime.v1.UnlockResponse.Status} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {!proto.spec.proto.runtime.v1.UnlockResponse.Status} value + * @return {!proto.spec.proto.runtime.v1.UnlockResponse} returns this + */ +proto.spec.proto.runtime.v1.UnlockResponse.prototype.setStatus = function(value) { + return jspb.Message.setProto3EnumField(this, 1, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.SayHelloRequest.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.SayHelloRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.SayHelloRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.SayHelloRequest.toObject = function(includeInstance, msg) { + var f, obj = { + serviceName: jspb.Message.getFieldWithDefault(msg, 1, ""), + name: jspb.Message.getFieldWithDefault(msg, 2, ""), + data: (f = msg.getData()) && google_protobuf_any_pb.Any.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.SayHelloRequest} + */ +proto.spec.proto.runtime.v1.SayHelloRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.SayHelloRequest; + return proto.spec.proto.runtime.v1.SayHelloRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.SayHelloRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.SayHelloRequest} + */ +proto.spec.proto.runtime.v1.SayHelloRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setServiceName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 3: + var value = new google_protobuf_any_pb.Any; + reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader); + msg.setData(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.SayHelloRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.SayHelloRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.SayHelloRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.SayHelloRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getServiceName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getData(); + if (f != null) { + writer.writeMessage( + 3, + f, + google_protobuf_any_pb.Any.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string service_name = 1; + * @return {string} + */ +proto.spec.proto.runtime.v1.SayHelloRequest.prototype.getServiceName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.SayHelloRequest} returns this + */ +proto.spec.proto.runtime.v1.SayHelloRequest.prototype.setServiceName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string name = 2; + * @return {string} + */ +proto.spec.proto.runtime.v1.SayHelloRequest.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.SayHelloRequest} returns this + */ +proto.spec.proto.runtime.v1.SayHelloRequest.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional google.protobuf.Any data = 3; + * @return {?proto.google.protobuf.Any} + */ +proto.spec.proto.runtime.v1.SayHelloRequest.prototype.getData = function() { + return /** @type{?proto.google.protobuf.Any} */ ( + jspb.Message.getWrapperField(this, google_protobuf_any_pb.Any, 3)); +}; + + +/** + * @param {?proto.google.protobuf.Any|undefined} value + * @return {!proto.spec.proto.runtime.v1.SayHelloRequest} returns this +*/ +proto.spec.proto.runtime.v1.SayHelloRequest.prototype.setData = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.spec.proto.runtime.v1.SayHelloRequest} returns this + */ +proto.spec.proto.runtime.v1.SayHelloRequest.prototype.clearData = function() { + return this.setData(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.spec.proto.runtime.v1.SayHelloRequest.prototype.hasData = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.SayHelloResponse.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.SayHelloResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.SayHelloResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.SayHelloResponse.toObject = function(includeInstance, msg) { + var f, obj = { + hello: jspb.Message.getFieldWithDefault(msg, 1, ""), + data: (f = msg.getData()) && google_protobuf_any_pb.Any.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.SayHelloResponse} + */ +proto.spec.proto.runtime.v1.SayHelloResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.SayHelloResponse; + return proto.spec.proto.runtime.v1.SayHelloResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.SayHelloResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.SayHelloResponse} + */ +proto.spec.proto.runtime.v1.SayHelloResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setHello(value); + break; + case 2: + var value = new google_protobuf_any_pb.Any; + reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader); + msg.setData(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.SayHelloResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.SayHelloResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.SayHelloResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.SayHelloResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getHello(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getData(); + if (f != null) { + writer.writeMessage( + 2, + f, + google_protobuf_any_pb.Any.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string hello = 1; + * @return {string} + */ +proto.spec.proto.runtime.v1.SayHelloResponse.prototype.getHello = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.SayHelloResponse} returns this + */ +proto.spec.proto.runtime.v1.SayHelloResponse.prototype.setHello = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional google.protobuf.Any data = 2; + * @return {?proto.google.protobuf.Any} + */ +proto.spec.proto.runtime.v1.SayHelloResponse.prototype.getData = function() { + return /** @type{?proto.google.protobuf.Any} */ ( + jspb.Message.getWrapperField(this, google_protobuf_any_pb.Any, 2)); +}; + + +/** + * @param {?proto.google.protobuf.Any|undefined} value + * @return {!proto.spec.proto.runtime.v1.SayHelloResponse} returns this +*/ +proto.spec.proto.runtime.v1.SayHelloResponse.prototype.setData = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.spec.proto.runtime.v1.SayHelloResponse} returns this + */ +proto.spec.proto.runtime.v1.SayHelloResponse.prototype.clearData = function() { + return this.setData(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.spec.proto.runtime.v1.SayHelloResponse.prototype.hasData = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.InvokeServiceRequest.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.InvokeServiceRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.InvokeServiceRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.InvokeServiceRequest.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, ""), + message: (f = msg.getMessage()) && proto.spec.proto.runtime.v1.CommonInvokeRequest.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.InvokeServiceRequest} + */ +proto.spec.proto.runtime.v1.InvokeServiceRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.InvokeServiceRequest; + return proto.spec.proto.runtime.v1.InvokeServiceRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.InvokeServiceRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.InvokeServiceRequest} + */ +proto.spec.proto.runtime.v1.InvokeServiceRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setId(value); + break; + case 3: + var value = new proto.spec.proto.runtime.v1.CommonInvokeRequest; + reader.readMessage(value,proto.spec.proto.runtime.v1.CommonInvokeRequest.deserializeBinaryFromReader); + msg.setMessage(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.InvokeServiceRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.InvokeServiceRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.InvokeServiceRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.InvokeServiceRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getMessage(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.spec.proto.runtime.v1.CommonInvokeRequest.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string id = 1; + * @return {string} + */ +proto.spec.proto.runtime.v1.InvokeServiceRequest.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.InvokeServiceRequest} returns this + */ +proto.spec.proto.runtime.v1.InvokeServiceRequest.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional CommonInvokeRequest message = 3; + * @return {?proto.spec.proto.runtime.v1.CommonInvokeRequest} + */ +proto.spec.proto.runtime.v1.InvokeServiceRequest.prototype.getMessage = function() { + return /** @type{?proto.spec.proto.runtime.v1.CommonInvokeRequest} */ ( + jspb.Message.getWrapperField(this, proto.spec.proto.runtime.v1.CommonInvokeRequest, 3)); +}; + + +/** + * @param {?proto.spec.proto.runtime.v1.CommonInvokeRequest|undefined} value + * @return {!proto.spec.proto.runtime.v1.InvokeServiceRequest} returns this +*/ +proto.spec.proto.runtime.v1.InvokeServiceRequest.prototype.setMessage = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.spec.proto.runtime.v1.InvokeServiceRequest} returns this + */ +proto.spec.proto.runtime.v1.InvokeServiceRequest.prototype.clearMessage = function() { + return this.setMessage(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.spec.proto.runtime.v1.InvokeServiceRequest.prototype.hasMessage = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.CommonInvokeRequest.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.CommonInvokeRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.CommonInvokeRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.CommonInvokeRequest.toObject = function(includeInstance, msg) { + var f, obj = { + method: jspb.Message.getFieldWithDefault(msg, 1, ""), + data: (f = msg.getData()) && google_protobuf_any_pb.Any.toObject(includeInstance, f), + contentType: jspb.Message.getFieldWithDefault(msg, 3, ""), + httpExtension: (f = msg.getHttpExtension()) && proto.spec.proto.runtime.v1.HTTPExtension.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.CommonInvokeRequest} + */ +proto.spec.proto.runtime.v1.CommonInvokeRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.CommonInvokeRequest; + return proto.spec.proto.runtime.v1.CommonInvokeRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.CommonInvokeRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.CommonInvokeRequest} + */ +proto.spec.proto.runtime.v1.CommonInvokeRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setMethod(value); + break; + case 2: + var value = new google_protobuf_any_pb.Any; + reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader); + msg.setData(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setContentType(value); + break; + case 4: + var value = new proto.spec.proto.runtime.v1.HTTPExtension; + reader.readMessage(value,proto.spec.proto.runtime.v1.HTTPExtension.deserializeBinaryFromReader); + msg.setHttpExtension(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.CommonInvokeRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.CommonInvokeRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.CommonInvokeRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.CommonInvokeRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMethod(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getData(); + if (f != null) { + writer.writeMessage( + 2, + f, + google_protobuf_any_pb.Any.serializeBinaryToWriter + ); + } + f = message.getContentType(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getHttpExtension(); + if (f != null) { + writer.writeMessage( + 4, + f, + proto.spec.proto.runtime.v1.HTTPExtension.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string method = 1; + * @return {string} + */ +proto.spec.proto.runtime.v1.CommonInvokeRequest.prototype.getMethod = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.CommonInvokeRequest} returns this + */ +proto.spec.proto.runtime.v1.CommonInvokeRequest.prototype.setMethod = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional google.protobuf.Any data = 2; + * @return {?proto.google.protobuf.Any} + */ +proto.spec.proto.runtime.v1.CommonInvokeRequest.prototype.getData = function() { + return /** @type{?proto.google.protobuf.Any} */ ( + jspb.Message.getWrapperField(this, google_protobuf_any_pb.Any, 2)); +}; + + +/** + * @param {?proto.google.protobuf.Any|undefined} value + * @return {!proto.spec.proto.runtime.v1.CommonInvokeRequest} returns this +*/ +proto.spec.proto.runtime.v1.CommonInvokeRequest.prototype.setData = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.spec.proto.runtime.v1.CommonInvokeRequest} returns this + */ +proto.spec.proto.runtime.v1.CommonInvokeRequest.prototype.clearData = function() { + return this.setData(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.spec.proto.runtime.v1.CommonInvokeRequest.prototype.hasData = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional string content_type = 3; + * @return {string} + */ +proto.spec.proto.runtime.v1.CommonInvokeRequest.prototype.getContentType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.CommonInvokeRequest} returns this + */ +proto.spec.proto.runtime.v1.CommonInvokeRequest.prototype.setContentType = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional HTTPExtension http_extension = 4; + * @return {?proto.spec.proto.runtime.v1.HTTPExtension} + */ +proto.spec.proto.runtime.v1.CommonInvokeRequest.prototype.getHttpExtension = function() { + return /** @type{?proto.spec.proto.runtime.v1.HTTPExtension} */ ( + jspb.Message.getWrapperField(this, proto.spec.proto.runtime.v1.HTTPExtension, 4)); +}; + + +/** + * @param {?proto.spec.proto.runtime.v1.HTTPExtension|undefined} value + * @return {!proto.spec.proto.runtime.v1.CommonInvokeRequest} returns this +*/ +proto.spec.proto.runtime.v1.CommonInvokeRequest.prototype.setHttpExtension = function(value) { + return jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.spec.proto.runtime.v1.CommonInvokeRequest} returns this + */ +proto.spec.proto.runtime.v1.CommonInvokeRequest.prototype.clearHttpExtension = function() { + return this.setHttpExtension(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.spec.proto.runtime.v1.CommonInvokeRequest.prototype.hasHttpExtension = function() { + return jspb.Message.getField(this, 4) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.HTTPExtension.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.HTTPExtension.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.HTTPExtension} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.HTTPExtension.toObject = function(includeInstance, msg) { + var f, obj = { + verb: jspb.Message.getFieldWithDefault(msg, 1, 0), + querystring: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.HTTPExtension} + */ +proto.spec.proto.runtime.v1.HTTPExtension.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.HTTPExtension; + return proto.spec.proto.runtime.v1.HTTPExtension.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.HTTPExtension} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.HTTPExtension} + */ +proto.spec.proto.runtime.v1.HTTPExtension.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.spec.proto.runtime.v1.HTTPExtension.Verb} */ (reader.readEnum()); + msg.setVerb(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setQuerystring(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.HTTPExtension.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.HTTPExtension.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.HTTPExtension} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.HTTPExtension.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getVerb(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } + f = message.getQuerystring(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.spec.proto.runtime.v1.HTTPExtension.Verb = { + NONE: 0, + GET: 1, + HEAD: 2, + POST: 3, + PUT: 4, + DELETE: 5, + CONNECT: 6, + OPTIONS: 7, + TRACE: 8 +}; + +/** + * optional Verb verb = 1; + * @return {!proto.spec.proto.runtime.v1.HTTPExtension.Verb} + */ +proto.spec.proto.runtime.v1.HTTPExtension.prototype.getVerb = function() { + return /** @type {!proto.spec.proto.runtime.v1.HTTPExtension.Verb} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {!proto.spec.proto.runtime.v1.HTTPExtension.Verb} value + * @return {!proto.spec.proto.runtime.v1.HTTPExtension} returns this + */ +proto.spec.proto.runtime.v1.HTTPExtension.prototype.setVerb = function(value) { + return jspb.Message.setProto3EnumField(this, 1, value); +}; + + +/** + * optional string querystring = 2; + * @return {string} + */ +proto.spec.proto.runtime.v1.HTTPExtension.prototype.getQuerystring = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.HTTPExtension} returns this + */ +proto.spec.proto.runtime.v1.HTTPExtension.prototype.setQuerystring = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.InvokeResponse.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.InvokeResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.InvokeResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.InvokeResponse.toObject = function(includeInstance, msg) { + var f, obj = { + data: (f = msg.getData()) && google_protobuf_any_pb.Any.toObject(includeInstance, f), + contentType: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.InvokeResponse} + */ +proto.spec.proto.runtime.v1.InvokeResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.InvokeResponse; + return proto.spec.proto.runtime.v1.InvokeResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.InvokeResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.InvokeResponse} + */ +proto.spec.proto.runtime.v1.InvokeResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new google_protobuf_any_pb.Any; + reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader); + msg.setData(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setContentType(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.InvokeResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.InvokeResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.InvokeResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.InvokeResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getData(); + if (f != null) { + writer.writeMessage( + 1, + f, + google_protobuf_any_pb.Any.serializeBinaryToWriter + ); + } + f = message.getContentType(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional google.protobuf.Any data = 1; + * @return {?proto.google.protobuf.Any} + */ +proto.spec.proto.runtime.v1.InvokeResponse.prototype.getData = function() { + return /** @type{?proto.google.protobuf.Any} */ ( + jspb.Message.getWrapperField(this, google_protobuf_any_pb.Any, 1)); +}; + + +/** + * @param {?proto.google.protobuf.Any|undefined} value + * @return {!proto.spec.proto.runtime.v1.InvokeResponse} returns this +*/ +proto.spec.proto.runtime.v1.InvokeResponse.prototype.setData = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.spec.proto.runtime.v1.InvokeResponse} returns this + */ +proto.spec.proto.runtime.v1.InvokeResponse.prototype.clearData = function() { + return this.setData(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.spec.proto.runtime.v1.InvokeResponse.prototype.hasData = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional string content_type = 2; + * @return {string} + */ +proto.spec.proto.runtime.v1.InvokeResponse.prototype.getContentType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.InvokeResponse} returns this + */ +proto.spec.proto.runtime.v1.InvokeResponse.prototype.setContentType = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.ConfigurationItem.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.ConfigurationItem.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.ConfigurationItem} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.ConfigurationItem.toObject = function(includeInstance, msg) { + var f, obj = { + key: jspb.Message.getFieldWithDefault(msg, 1, ""), + content: jspb.Message.getFieldWithDefault(msg, 2, ""), + group: jspb.Message.getFieldWithDefault(msg, 3, ""), + label: jspb.Message.getFieldWithDefault(msg, 4, ""), + tagsMap: (f = msg.getTagsMap()) ? f.toObject(includeInstance, undefined) : [], + metadataMap: (f = msg.getMetadataMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.ConfigurationItem} + */ +proto.spec.proto.runtime.v1.ConfigurationItem.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.ConfigurationItem; + return proto.spec.proto.runtime.v1.ConfigurationItem.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.ConfigurationItem} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.ConfigurationItem} + */ +proto.spec.proto.runtime.v1.ConfigurationItem.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setKey(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setContent(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setGroup(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setLabel(value); + break; + case 5: + var value = msg.getTagsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + case 6: + var value = msg.getMetadataMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.ConfigurationItem.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.ConfigurationItem.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.ConfigurationItem} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.ConfigurationItem.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getKey(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getContent(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getGroup(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getLabel(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getTagsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } + f = message.getMetadataMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(6, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } +}; + + +/** + * optional string key = 1; + * @return {string} + */ +proto.spec.proto.runtime.v1.ConfigurationItem.prototype.getKey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.ConfigurationItem} returns this + */ +proto.spec.proto.runtime.v1.ConfigurationItem.prototype.setKey = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string content = 2; + * @return {string} + */ +proto.spec.proto.runtime.v1.ConfigurationItem.prototype.getContent = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.ConfigurationItem} returns this + */ +proto.spec.proto.runtime.v1.ConfigurationItem.prototype.setContent = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string group = 3; + * @return {string} + */ +proto.spec.proto.runtime.v1.ConfigurationItem.prototype.getGroup = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.ConfigurationItem} returns this + */ +proto.spec.proto.runtime.v1.ConfigurationItem.prototype.setGroup = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string label = 4; + * @return {string} + */ +proto.spec.proto.runtime.v1.ConfigurationItem.prototype.getLabel = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.ConfigurationItem} returns this + */ +proto.spec.proto.runtime.v1.ConfigurationItem.prototype.setLabel = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * map tags = 5; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.spec.proto.runtime.v1.ConfigurationItem.prototype.getTagsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 5, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.spec.proto.runtime.v1.ConfigurationItem} returns this + */ +proto.spec.proto.runtime.v1.ConfigurationItem.prototype.clearTagsMap = function() { + this.getTagsMap().clear(); + return this;}; + + +/** + * map metadata = 6; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.spec.proto.runtime.v1.ConfigurationItem.prototype.getMetadataMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 6, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.spec.proto.runtime.v1.ConfigurationItem} returns this + */ +proto.spec.proto.runtime.v1.ConfigurationItem.prototype.clearMetadataMap = function() { + this.getMetadataMap().clear(); + return this;}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.spec.proto.runtime.v1.GetConfigurationRequest.repeatedFields_ = [5]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.GetConfigurationRequest.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.GetConfigurationRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.GetConfigurationRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.GetConfigurationRequest.toObject = function(includeInstance, msg) { + var f, obj = { + storeName: jspb.Message.getFieldWithDefault(msg, 1, ""), + appId: jspb.Message.getFieldWithDefault(msg, 2, ""), + group: jspb.Message.getFieldWithDefault(msg, 3, ""), + label: jspb.Message.getFieldWithDefault(msg, 4, ""), + keysList: (f = jspb.Message.getRepeatedField(msg, 5)) == null ? undefined : f, + metadataMap: (f = msg.getMetadataMap()) ? f.toObject(includeInstance, undefined) : [], + subscribeUpdate: jspb.Message.getBooleanFieldWithDefault(msg, 7, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.GetConfigurationRequest} + */ +proto.spec.proto.runtime.v1.GetConfigurationRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.GetConfigurationRequest; + return proto.spec.proto.runtime.v1.GetConfigurationRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.GetConfigurationRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.GetConfigurationRequest} + */ +proto.spec.proto.runtime.v1.GetConfigurationRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setStoreName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setAppId(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setGroup(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setLabel(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.addKeys(value); + break; + case 6: + var value = msg.getMetadataMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + case 7: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setSubscribeUpdate(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.GetConfigurationRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.GetConfigurationRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.GetConfigurationRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.GetConfigurationRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStoreName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getAppId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getGroup(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getLabel(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getKeysList(); + if (f.length > 0) { + writer.writeRepeatedString( + 5, + f + ); + } + f = message.getMetadataMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(6, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } + f = message.getSubscribeUpdate(); + if (f) { + writer.writeBool( + 7, + f + ); + } +}; + + +/** + * optional string store_name = 1; + * @return {string} + */ +proto.spec.proto.runtime.v1.GetConfigurationRequest.prototype.getStoreName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.GetConfigurationRequest} returns this + */ +proto.spec.proto.runtime.v1.GetConfigurationRequest.prototype.setStoreName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string app_id = 2; + * @return {string} + */ +proto.spec.proto.runtime.v1.GetConfigurationRequest.prototype.getAppId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.GetConfigurationRequest} returns this + */ +proto.spec.proto.runtime.v1.GetConfigurationRequest.prototype.setAppId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string group = 3; + * @return {string} + */ +proto.spec.proto.runtime.v1.GetConfigurationRequest.prototype.getGroup = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.GetConfigurationRequest} returns this + */ +proto.spec.proto.runtime.v1.GetConfigurationRequest.prototype.setGroup = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string label = 4; + * @return {string} + */ +proto.spec.proto.runtime.v1.GetConfigurationRequest.prototype.getLabel = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.GetConfigurationRequest} returns this + */ +proto.spec.proto.runtime.v1.GetConfigurationRequest.prototype.setLabel = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * repeated string keys = 5; + * @return {!Array} + */ +proto.spec.proto.runtime.v1.GetConfigurationRequest.prototype.getKeysList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 5)); +}; + + +/** + * @param {!Array} value + * @return {!proto.spec.proto.runtime.v1.GetConfigurationRequest} returns this + */ +proto.spec.proto.runtime.v1.GetConfigurationRequest.prototype.setKeysList = function(value) { + return jspb.Message.setField(this, 5, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.spec.proto.runtime.v1.GetConfigurationRequest} returns this + */ +proto.spec.proto.runtime.v1.GetConfigurationRequest.prototype.addKeys = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 5, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.spec.proto.runtime.v1.GetConfigurationRequest} returns this + */ +proto.spec.proto.runtime.v1.GetConfigurationRequest.prototype.clearKeysList = function() { + return this.setKeysList([]); +}; + + +/** + * map metadata = 6; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.spec.proto.runtime.v1.GetConfigurationRequest.prototype.getMetadataMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 6, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.spec.proto.runtime.v1.GetConfigurationRequest} returns this + */ +proto.spec.proto.runtime.v1.GetConfigurationRequest.prototype.clearMetadataMap = function() { + this.getMetadataMap().clear(); + return this;}; + + +/** + * optional bool subscribe_update = 7; + * @return {boolean} + */ +proto.spec.proto.runtime.v1.GetConfigurationRequest.prototype.getSubscribeUpdate = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 7, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.spec.proto.runtime.v1.GetConfigurationRequest} returns this + */ +proto.spec.proto.runtime.v1.GetConfigurationRequest.prototype.setSubscribeUpdate = function(value) { + return jspb.Message.setProto3BooleanField(this, 7, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.spec.proto.runtime.v1.GetConfigurationResponse.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.GetConfigurationResponse.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.GetConfigurationResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.GetConfigurationResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.GetConfigurationResponse.toObject = function(includeInstance, msg) { + var f, obj = { + itemsList: jspb.Message.toObjectList(msg.getItemsList(), + proto.spec.proto.runtime.v1.ConfigurationItem.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.GetConfigurationResponse} + */ +proto.spec.proto.runtime.v1.GetConfigurationResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.GetConfigurationResponse; + return proto.spec.proto.runtime.v1.GetConfigurationResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.GetConfigurationResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.GetConfigurationResponse} + */ +proto.spec.proto.runtime.v1.GetConfigurationResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.spec.proto.runtime.v1.ConfigurationItem; + reader.readMessage(value,proto.spec.proto.runtime.v1.ConfigurationItem.deserializeBinaryFromReader); + msg.addItems(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.GetConfigurationResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.GetConfigurationResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.GetConfigurationResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.GetConfigurationResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getItemsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.spec.proto.runtime.v1.ConfigurationItem.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated ConfigurationItem items = 1; + * @return {!Array} + */ +proto.spec.proto.runtime.v1.GetConfigurationResponse.prototype.getItemsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.spec.proto.runtime.v1.ConfigurationItem, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.spec.proto.runtime.v1.GetConfigurationResponse} returns this +*/ +proto.spec.proto.runtime.v1.GetConfigurationResponse.prototype.setItemsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.spec.proto.runtime.v1.ConfigurationItem=} opt_value + * @param {number=} opt_index + * @return {!proto.spec.proto.runtime.v1.ConfigurationItem} + */ +proto.spec.proto.runtime.v1.GetConfigurationResponse.prototype.addItems = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.spec.proto.runtime.v1.ConfigurationItem, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.spec.proto.runtime.v1.GetConfigurationResponse} returns this + */ +proto.spec.proto.runtime.v1.GetConfigurationResponse.prototype.clearItemsList = function() { + return this.setItemsList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationRequest.repeatedFields_ = [5]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationRequest.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.SubscribeConfigurationRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.SubscribeConfigurationRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationRequest.toObject = function(includeInstance, msg) { + var f, obj = { + storeName: jspb.Message.getFieldWithDefault(msg, 1, ""), + appId: jspb.Message.getFieldWithDefault(msg, 2, ""), + group: jspb.Message.getFieldWithDefault(msg, 3, ""), + label: jspb.Message.getFieldWithDefault(msg, 4, ""), + keysList: (f = jspb.Message.getRepeatedField(msg, 5)) == null ? undefined : f, + metadataMap: (f = msg.getMetadataMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.SubscribeConfigurationRequest} + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.SubscribeConfigurationRequest; + return proto.spec.proto.runtime.v1.SubscribeConfigurationRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.SubscribeConfigurationRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.SubscribeConfigurationRequest} + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setStoreName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setAppId(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setGroup(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setLabel(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.addKeys(value); + break; + case 6: + var value = msg.getMetadataMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.SubscribeConfigurationRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.SubscribeConfigurationRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStoreName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getAppId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getGroup(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getLabel(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getKeysList(); + if (f.length > 0) { + writer.writeRepeatedString( + 5, + f + ); + } + f = message.getMetadataMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(6, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } +}; + + +/** + * optional string store_name = 1; + * @return {string} + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationRequest.prototype.getStoreName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.SubscribeConfigurationRequest} returns this + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationRequest.prototype.setStoreName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string app_id = 2; + * @return {string} + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationRequest.prototype.getAppId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.SubscribeConfigurationRequest} returns this + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationRequest.prototype.setAppId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string group = 3; + * @return {string} + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationRequest.prototype.getGroup = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.SubscribeConfigurationRequest} returns this + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationRequest.prototype.setGroup = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string label = 4; + * @return {string} + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationRequest.prototype.getLabel = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.SubscribeConfigurationRequest} returns this + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationRequest.prototype.setLabel = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * repeated string keys = 5; + * @return {!Array} + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationRequest.prototype.getKeysList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 5)); +}; + + +/** + * @param {!Array} value + * @return {!proto.spec.proto.runtime.v1.SubscribeConfigurationRequest} returns this + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationRequest.prototype.setKeysList = function(value) { + return jspb.Message.setField(this, 5, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.spec.proto.runtime.v1.SubscribeConfigurationRequest} returns this + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationRequest.prototype.addKeys = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 5, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.spec.proto.runtime.v1.SubscribeConfigurationRequest} returns this + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationRequest.prototype.clearKeysList = function() { + return this.setKeysList([]); +}; + + +/** + * map metadata = 6; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationRequest.prototype.getMetadataMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 6, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.spec.proto.runtime.v1.SubscribeConfigurationRequest} returns this + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationRequest.prototype.clearMetadataMap = function() { + this.getMetadataMap().clear(); + return this;}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationResponse.repeatedFields_ = [3]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationResponse.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.SubscribeConfigurationResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.SubscribeConfigurationResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationResponse.toObject = function(includeInstance, msg) { + var f, obj = { + storeName: jspb.Message.getFieldWithDefault(msg, 1, ""), + appId: jspb.Message.getFieldWithDefault(msg, 2, ""), + itemsList: jspb.Message.toObjectList(msg.getItemsList(), + proto.spec.proto.runtime.v1.ConfigurationItem.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.SubscribeConfigurationResponse} + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.SubscribeConfigurationResponse; + return proto.spec.proto.runtime.v1.SubscribeConfigurationResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.SubscribeConfigurationResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.SubscribeConfigurationResponse} + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setStoreName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setAppId(value); + break; + case 3: + var value = new proto.spec.proto.runtime.v1.ConfigurationItem; + reader.readMessage(value,proto.spec.proto.runtime.v1.ConfigurationItem.deserializeBinaryFromReader); + msg.addItems(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.SubscribeConfigurationResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.SubscribeConfigurationResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStoreName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getAppId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getItemsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 3, + f, + proto.spec.proto.runtime.v1.ConfigurationItem.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string store_name = 1; + * @return {string} + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationResponse.prototype.getStoreName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.SubscribeConfigurationResponse} returns this + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationResponse.prototype.setStoreName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string app_id = 2; + * @return {string} + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationResponse.prototype.getAppId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.SubscribeConfigurationResponse} returns this + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationResponse.prototype.setAppId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * repeated ConfigurationItem items = 3; + * @return {!Array} + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationResponse.prototype.getItemsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.spec.proto.runtime.v1.ConfigurationItem, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.spec.proto.runtime.v1.SubscribeConfigurationResponse} returns this +*/ +proto.spec.proto.runtime.v1.SubscribeConfigurationResponse.prototype.setItemsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 3, value); +}; + + +/** + * @param {!proto.spec.proto.runtime.v1.ConfigurationItem=} opt_value + * @param {number=} opt_index + * @return {!proto.spec.proto.runtime.v1.ConfigurationItem} + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationResponse.prototype.addItems = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.spec.proto.runtime.v1.ConfigurationItem, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.spec.proto.runtime.v1.SubscribeConfigurationResponse} returns this + */ +proto.spec.proto.runtime.v1.SubscribeConfigurationResponse.prototype.clearItemsList = function() { + return this.setItemsList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.spec.proto.runtime.v1.SaveConfigurationRequest.repeatedFields_ = [3]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.SaveConfigurationRequest.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.SaveConfigurationRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.SaveConfigurationRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.SaveConfigurationRequest.toObject = function(includeInstance, msg) { + var f, obj = { + storeName: jspb.Message.getFieldWithDefault(msg, 1, ""), + appId: jspb.Message.getFieldWithDefault(msg, 2, ""), + itemsList: jspb.Message.toObjectList(msg.getItemsList(), + proto.spec.proto.runtime.v1.ConfigurationItem.toObject, includeInstance), + metadataMap: (f = msg.getMetadataMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.SaveConfigurationRequest} + */ +proto.spec.proto.runtime.v1.SaveConfigurationRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.SaveConfigurationRequest; + return proto.spec.proto.runtime.v1.SaveConfigurationRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.SaveConfigurationRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.SaveConfigurationRequest} + */ +proto.spec.proto.runtime.v1.SaveConfigurationRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setStoreName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setAppId(value); + break; + case 3: + var value = new proto.spec.proto.runtime.v1.ConfigurationItem; + reader.readMessage(value,proto.spec.proto.runtime.v1.ConfigurationItem.deserializeBinaryFromReader); + msg.addItems(value); + break; + case 4: + var value = msg.getMetadataMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.SaveConfigurationRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.SaveConfigurationRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.SaveConfigurationRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.SaveConfigurationRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStoreName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getAppId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getItemsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 3, + f, + proto.spec.proto.runtime.v1.ConfigurationItem.serializeBinaryToWriter + ); + } + f = message.getMetadataMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(4, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } +}; + + +/** + * optional string store_name = 1; + * @return {string} + */ +proto.spec.proto.runtime.v1.SaveConfigurationRequest.prototype.getStoreName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.SaveConfigurationRequest} returns this + */ +proto.spec.proto.runtime.v1.SaveConfigurationRequest.prototype.setStoreName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string app_id = 2; + * @return {string} + */ +proto.spec.proto.runtime.v1.SaveConfigurationRequest.prototype.getAppId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.SaveConfigurationRequest} returns this + */ +proto.spec.proto.runtime.v1.SaveConfigurationRequest.prototype.setAppId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * repeated ConfigurationItem items = 3; + * @return {!Array} + */ +proto.spec.proto.runtime.v1.SaveConfigurationRequest.prototype.getItemsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.spec.proto.runtime.v1.ConfigurationItem, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.spec.proto.runtime.v1.SaveConfigurationRequest} returns this +*/ +proto.spec.proto.runtime.v1.SaveConfigurationRequest.prototype.setItemsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 3, value); +}; + + +/** + * @param {!proto.spec.proto.runtime.v1.ConfigurationItem=} opt_value + * @param {number=} opt_index + * @return {!proto.spec.proto.runtime.v1.ConfigurationItem} + */ +proto.spec.proto.runtime.v1.SaveConfigurationRequest.prototype.addItems = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.spec.proto.runtime.v1.ConfigurationItem, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.spec.proto.runtime.v1.SaveConfigurationRequest} returns this + */ +proto.spec.proto.runtime.v1.SaveConfigurationRequest.prototype.clearItemsList = function() { + return this.setItemsList([]); +}; + + +/** + * map metadata = 4; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.spec.proto.runtime.v1.SaveConfigurationRequest.prototype.getMetadataMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 4, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.spec.proto.runtime.v1.SaveConfigurationRequest} returns this + */ +proto.spec.proto.runtime.v1.SaveConfigurationRequest.prototype.clearMetadataMap = function() { + this.getMetadataMap().clear(); + return this;}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.spec.proto.runtime.v1.DeleteConfigurationRequest.repeatedFields_ = [5]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.DeleteConfigurationRequest.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.DeleteConfigurationRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.DeleteConfigurationRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.DeleteConfigurationRequest.toObject = function(includeInstance, msg) { + var f, obj = { + storeName: jspb.Message.getFieldWithDefault(msg, 1, ""), + appId: jspb.Message.getFieldWithDefault(msg, 2, ""), + group: jspb.Message.getFieldWithDefault(msg, 3, ""), + label: jspb.Message.getFieldWithDefault(msg, 4, ""), + keysList: (f = jspb.Message.getRepeatedField(msg, 5)) == null ? undefined : f, + metadataMap: (f = msg.getMetadataMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.DeleteConfigurationRequest} + */ +proto.spec.proto.runtime.v1.DeleteConfigurationRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.DeleteConfigurationRequest; + return proto.spec.proto.runtime.v1.DeleteConfigurationRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.DeleteConfigurationRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.DeleteConfigurationRequest} + */ +proto.spec.proto.runtime.v1.DeleteConfigurationRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setStoreName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setAppId(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setGroup(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setLabel(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.addKeys(value); + break; + case 6: + var value = msg.getMetadataMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.DeleteConfigurationRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.DeleteConfigurationRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.DeleteConfigurationRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.DeleteConfigurationRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStoreName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getAppId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getGroup(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getLabel(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getKeysList(); + if (f.length > 0) { + writer.writeRepeatedString( + 5, + f + ); + } + f = message.getMetadataMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(6, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } +}; + + +/** + * optional string store_name = 1; + * @return {string} + */ +proto.spec.proto.runtime.v1.DeleteConfigurationRequest.prototype.getStoreName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.DeleteConfigurationRequest} returns this + */ +proto.spec.proto.runtime.v1.DeleteConfigurationRequest.prototype.setStoreName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string app_id = 2; + * @return {string} + */ +proto.spec.proto.runtime.v1.DeleteConfigurationRequest.prototype.getAppId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.DeleteConfigurationRequest} returns this + */ +proto.spec.proto.runtime.v1.DeleteConfigurationRequest.prototype.setAppId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string group = 3; + * @return {string} + */ +proto.spec.proto.runtime.v1.DeleteConfigurationRequest.prototype.getGroup = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.DeleteConfigurationRequest} returns this + */ +proto.spec.proto.runtime.v1.DeleteConfigurationRequest.prototype.setGroup = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string label = 4; + * @return {string} + */ +proto.spec.proto.runtime.v1.DeleteConfigurationRequest.prototype.getLabel = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.DeleteConfigurationRequest} returns this + */ +proto.spec.proto.runtime.v1.DeleteConfigurationRequest.prototype.setLabel = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * repeated string keys = 5; + * @return {!Array} + */ +proto.spec.proto.runtime.v1.DeleteConfigurationRequest.prototype.getKeysList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 5)); +}; + + +/** + * @param {!Array} value + * @return {!proto.spec.proto.runtime.v1.DeleteConfigurationRequest} returns this + */ +proto.spec.proto.runtime.v1.DeleteConfigurationRequest.prototype.setKeysList = function(value) { + return jspb.Message.setField(this, 5, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.spec.proto.runtime.v1.DeleteConfigurationRequest} returns this + */ +proto.spec.proto.runtime.v1.DeleteConfigurationRequest.prototype.addKeys = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 5, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.spec.proto.runtime.v1.DeleteConfigurationRequest} returns this + */ +proto.spec.proto.runtime.v1.DeleteConfigurationRequest.prototype.clearKeysList = function() { + return this.setKeysList([]); +}; + + +/** + * map metadata = 6; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.spec.proto.runtime.v1.DeleteConfigurationRequest.prototype.getMetadataMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 6, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.spec.proto.runtime.v1.DeleteConfigurationRequest} returns this + */ +proto.spec.proto.runtime.v1.DeleteConfigurationRequest.prototype.clearMetadataMap = function() { + this.getMetadataMap().clear(); + return this;}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.GetStateRequest.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.GetStateRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.GetStateRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.GetStateRequest.toObject = function(includeInstance, msg) { + var f, obj = { + storeName: jspb.Message.getFieldWithDefault(msg, 1, ""), + key: jspb.Message.getFieldWithDefault(msg, 2, ""), + consistency: jspb.Message.getFieldWithDefault(msg, 3, 0), + metadataMap: (f = msg.getMetadataMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.GetStateRequest} + */ +proto.spec.proto.runtime.v1.GetStateRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.GetStateRequest; + return proto.spec.proto.runtime.v1.GetStateRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.GetStateRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.GetStateRequest} + */ +proto.spec.proto.runtime.v1.GetStateRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setStoreName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setKey(value); + break; + case 3: + var value = /** @type {!proto.spec.proto.runtime.v1.StateOptions.StateConsistency} */ (reader.readEnum()); + msg.setConsistency(value); + break; + case 4: + var value = msg.getMetadataMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.GetStateRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.GetStateRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.GetStateRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.GetStateRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStoreName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getKey(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getConsistency(); + if (f !== 0.0) { + writer.writeEnum( + 3, + f + ); + } + f = message.getMetadataMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(4, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } +}; + + +/** + * optional string store_name = 1; + * @return {string} + */ +proto.spec.proto.runtime.v1.GetStateRequest.prototype.getStoreName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.GetStateRequest} returns this + */ +proto.spec.proto.runtime.v1.GetStateRequest.prototype.setStoreName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string key = 2; + * @return {string} + */ +proto.spec.proto.runtime.v1.GetStateRequest.prototype.getKey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.GetStateRequest} returns this + */ +proto.spec.proto.runtime.v1.GetStateRequest.prototype.setKey = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional StateOptions.StateConsistency consistency = 3; + * @return {!proto.spec.proto.runtime.v1.StateOptions.StateConsistency} + */ +proto.spec.proto.runtime.v1.GetStateRequest.prototype.getConsistency = function() { + return /** @type {!proto.spec.proto.runtime.v1.StateOptions.StateConsistency} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {!proto.spec.proto.runtime.v1.StateOptions.StateConsistency} value + * @return {!proto.spec.proto.runtime.v1.GetStateRequest} returns this + */ +proto.spec.proto.runtime.v1.GetStateRequest.prototype.setConsistency = function(value) { + return jspb.Message.setProto3EnumField(this, 3, value); +}; + + +/** + * map metadata = 4; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.spec.proto.runtime.v1.GetStateRequest.prototype.getMetadataMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 4, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.spec.proto.runtime.v1.GetStateRequest} returns this + */ +proto.spec.proto.runtime.v1.GetStateRequest.prototype.clearMetadataMap = function() { + this.getMetadataMap().clear(); + return this;}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.spec.proto.runtime.v1.GetBulkStateRequest.repeatedFields_ = [2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.GetBulkStateRequest.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.GetBulkStateRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.GetBulkStateRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.GetBulkStateRequest.toObject = function(includeInstance, msg) { + var f, obj = { + storeName: jspb.Message.getFieldWithDefault(msg, 1, ""), + keysList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f, + parallelism: jspb.Message.getFieldWithDefault(msg, 3, 0), + metadataMap: (f = msg.getMetadataMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.GetBulkStateRequest} + */ +proto.spec.proto.runtime.v1.GetBulkStateRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.GetBulkStateRequest; + return proto.spec.proto.runtime.v1.GetBulkStateRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.GetBulkStateRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.GetBulkStateRequest} + */ +proto.spec.proto.runtime.v1.GetBulkStateRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setStoreName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.addKeys(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt32()); + msg.setParallelism(value); + break; + case 4: + var value = msg.getMetadataMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.GetBulkStateRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.GetBulkStateRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.GetBulkStateRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.GetBulkStateRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStoreName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getKeysList(); + if (f.length > 0) { + writer.writeRepeatedString( + 2, + f + ); + } + f = message.getParallelism(); + if (f !== 0) { + writer.writeInt32( + 3, + f + ); + } + f = message.getMetadataMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(4, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } +}; + + +/** + * optional string store_name = 1; + * @return {string} + */ +proto.spec.proto.runtime.v1.GetBulkStateRequest.prototype.getStoreName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.GetBulkStateRequest} returns this + */ +proto.spec.proto.runtime.v1.GetBulkStateRequest.prototype.setStoreName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * repeated string keys = 2; + * @return {!Array} + */ +proto.spec.proto.runtime.v1.GetBulkStateRequest.prototype.getKeysList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.spec.proto.runtime.v1.GetBulkStateRequest} returns this + */ +proto.spec.proto.runtime.v1.GetBulkStateRequest.prototype.setKeysList = function(value) { + return jspb.Message.setField(this, 2, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.spec.proto.runtime.v1.GetBulkStateRequest} returns this + */ +proto.spec.proto.runtime.v1.GetBulkStateRequest.prototype.addKeys = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 2, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.spec.proto.runtime.v1.GetBulkStateRequest} returns this + */ +proto.spec.proto.runtime.v1.GetBulkStateRequest.prototype.clearKeysList = function() { + return this.setKeysList([]); +}; + + +/** + * optional int32 parallelism = 3; + * @return {number} + */ +proto.spec.proto.runtime.v1.GetBulkStateRequest.prototype.getParallelism = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.spec.proto.runtime.v1.GetBulkStateRequest} returns this + */ +proto.spec.proto.runtime.v1.GetBulkStateRequest.prototype.setParallelism = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * map metadata = 4; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.spec.proto.runtime.v1.GetBulkStateRequest.prototype.getMetadataMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 4, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.spec.proto.runtime.v1.GetBulkStateRequest} returns this + */ +proto.spec.proto.runtime.v1.GetBulkStateRequest.prototype.clearMetadataMap = function() { + this.getMetadataMap().clear(); + return this;}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.spec.proto.runtime.v1.GetBulkStateResponse.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.GetBulkStateResponse.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.GetBulkStateResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.GetBulkStateResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.GetBulkStateResponse.toObject = function(includeInstance, msg) { + var f, obj = { + itemsList: jspb.Message.toObjectList(msg.getItemsList(), + proto.spec.proto.runtime.v1.BulkStateItem.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.GetBulkStateResponse} + */ +proto.spec.proto.runtime.v1.GetBulkStateResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.GetBulkStateResponse; + return proto.spec.proto.runtime.v1.GetBulkStateResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.GetBulkStateResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.GetBulkStateResponse} + */ +proto.spec.proto.runtime.v1.GetBulkStateResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.spec.proto.runtime.v1.BulkStateItem; + reader.readMessage(value,proto.spec.proto.runtime.v1.BulkStateItem.deserializeBinaryFromReader); + msg.addItems(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.GetBulkStateResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.GetBulkStateResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.GetBulkStateResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.GetBulkStateResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getItemsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.spec.proto.runtime.v1.BulkStateItem.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated BulkStateItem items = 1; + * @return {!Array} + */ +proto.spec.proto.runtime.v1.GetBulkStateResponse.prototype.getItemsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.spec.proto.runtime.v1.BulkStateItem, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.spec.proto.runtime.v1.GetBulkStateResponse} returns this +*/ +proto.spec.proto.runtime.v1.GetBulkStateResponse.prototype.setItemsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.spec.proto.runtime.v1.BulkStateItem=} opt_value + * @param {number=} opt_index + * @return {!proto.spec.proto.runtime.v1.BulkStateItem} + */ +proto.spec.proto.runtime.v1.GetBulkStateResponse.prototype.addItems = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.spec.proto.runtime.v1.BulkStateItem, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.spec.proto.runtime.v1.GetBulkStateResponse} returns this + */ +proto.spec.proto.runtime.v1.GetBulkStateResponse.prototype.clearItemsList = function() { + return this.setItemsList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.BulkStateItem.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.BulkStateItem.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.BulkStateItem} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.BulkStateItem.toObject = function(includeInstance, msg) { + var f, obj = { + key: jspb.Message.getFieldWithDefault(msg, 1, ""), + data: msg.getData_asB64(), + etag: jspb.Message.getFieldWithDefault(msg, 3, ""), + error: jspb.Message.getFieldWithDefault(msg, 4, ""), + metadataMap: (f = msg.getMetadataMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.BulkStateItem} + */ +proto.spec.proto.runtime.v1.BulkStateItem.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.BulkStateItem; + return proto.spec.proto.runtime.v1.BulkStateItem.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.BulkStateItem} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.BulkStateItem} + */ +proto.spec.proto.runtime.v1.BulkStateItem.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setKey(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setData(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setEtag(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setError(value); + break; + case 5: + var value = msg.getMetadataMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.BulkStateItem.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.BulkStateItem.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.BulkStateItem} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.BulkStateItem.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getKey(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getData_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getEtag(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getError(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getMetadataMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } +}; + + +/** + * optional string key = 1; + * @return {string} + */ +proto.spec.proto.runtime.v1.BulkStateItem.prototype.getKey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.BulkStateItem} returns this + */ +proto.spec.proto.runtime.v1.BulkStateItem.prototype.setKey = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional bytes data = 2; + * @return {!(string|Uint8Array)} + */ +proto.spec.proto.runtime.v1.BulkStateItem.prototype.getData = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes data = 2; + * This is a type-conversion wrapper around `getData()` + * @return {string} + */ +proto.spec.proto.runtime.v1.BulkStateItem.prototype.getData_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getData())); +}; + + +/** + * optional bytes data = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getData()` + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.BulkStateItem.prototype.getData_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getData())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.spec.proto.runtime.v1.BulkStateItem} returns this + */ +proto.spec.proto.runtime.v1.BulkStateItem.prototype.setData = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); +}; + + +/** + * optional string etag = 3; + * @return {string} + */ +proto.spec.proto.runtime.v1.BulkStateItem.prototype.getEtag = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.BulkStateItem} returns this + */ +proto.spec.proto.runtime.v1.BulkStateItem.prototype.setEtag = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string error = 4; + * @return {string} + */ +proto.spec.proto.runtime.v1.BulkStateItem.prototype.getError = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.BulkStateItem} returns this + */ +proto.spec.proto.runtime.v1.BulkStateItem.prototype.setError = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * map metadata = 5; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.spec.proto.runtime.v1.BulkStateItem.prototype.getMetadataMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 5, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.spec.proto.runtime.v1.BulkStateItem} returns this + */ +proto.spec.proto.runtime.v1.BulkStateItem.prototype.clearMetadataMap = function() { + this.getMetadataMap().clear(); + return this;}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.GetStateResponse.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.GetStateResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.GetStateResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.GetStateResponse.toObject = function(includeInstance, msg) { + var f, obj = { + data: msg.getData_asB64(), + etag: jspb.Message.getFieldWithDefault(msg, 2, ""), + metadataMap: (f = msg.getMetadataMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.GetStateResponse} + */ +proto.spec.proto.runtime.v1.GetStateResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.GetStateResponse; + return proto.spec.proto.runtime.v1.GetStateResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.GetStateResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.GetStateResponse} + */ +proto.spec.proto.runtime.v1.GetStateResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setData(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setEtag(value); + break; + case 3: + var value = msg.getMetadataMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.GetStateResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.GetStateResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.GetStateResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.GetStateResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getData_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getEtag(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getMetadataMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(3, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } +}; + + +/** + * optional bytes data = 1; + * @return {!(string|Uint8Array)} + */ +proto.spec.proto.runtime.v1.GetStateResponse.prototype.getData = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes data = 1; + * This is a type-conversion wrapper around `getData()` + * @return {string} + */ +proto.spec.proto.runtime.v1.GetStateResponse.prototype.getData_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getData())); +}; + + +/** + * optional bytes data = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getData()` + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.GetStateResponse.prototype.getData_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getData())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.spec.proto.runtime.v1.GetStateResponse} returns this + */ +proto.spec.proto.runtime.v1.GetStateResponse.prototype.setData = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional string etag = 2; + * @return {string} + */ +proto.spec.proto.runtime.v1.GetStateResponse.prototype.getEtag = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.GetStateResponse} returns this + */ +proto.spec.proto.runtime.v1.GetStateResponse.prototype.setEtag = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * map metadata = 3; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.spec.proto.runtime.v1.GetStateResponse.prototype.getMetadataMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 3, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.spec.proto.runtime.v1.GetStateResponse} returns this + */ +proto.spec.proto.runtime.v1.GetStateResponse.prototype.clearMetadataMap = function() { + this.getMetadataMap().clear(); + return this;}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.DeleteStateRequest.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.DeleteStateRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.DeleteStateRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.DeleteStateRequest.toObject = function(includeInstance, msg) { + var f, obj = { + storeName: jspb.Message.getFieldWithDefault(msg, 1, ""), + key: jspb.Message.getFieldWithDefault(msg, 2, ""), + etag: (f = msg.getEtag()) && proto.spec.proto.runtime.v1.Etag.toObject(includeInstance, f), + options: (f = msg.getOptions()) && proto.spec.proto.runtime.v1.StateOptions.toObject(includeInstance, f), + metadataMap: (f = msg.getMetadataMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.DeleteStateRequest} + */ +proto.spec.proto.runtime.v1.DeleteStateRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.DeleteStateRequest; + return proto.spec.proto.runtime.v1.DeleteStateRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.DeleteStateRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.DeleteStateRequest} + */ +proto.spec.proto.runtime.v1.DeleteStateRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setStoreName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setKey(value); + break; + case 3: + var value = new proto.spec.proto.runtime.v1.Etag; + reader.readMessage(value,proto.spec.proto.runtime.v1.Etag.deserializeBinaryFromReader); + msg.setEtag(value); + break; + case 4: + var value = new proto.spec.proto.runtime.v1.StateOptions; + reader.readMessage(value,proto.spec.proto.runtime.v1.StateOptions.deserializeBinaryFromReader); + msg.setOptions(value); + break; + case 5: + var value = msg.getMetadataMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.DeleteStateRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.DeleteStateRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.DeleteStateRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.DeleteStateRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStoreName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getKey(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getEtag(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.spec.proto.runtime.v1.Etag.serializeBinaryToWriter + ); + } + f = message.getOptions(); + if (f != null) { + writer.writeMessage( + 4, + f, + proto.spec.proto.runtime.v1.StateOptions.serializeBinaryToWriter + ); + } + f = message.getMetadataMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } +}; + + +/** + * optional string store_name = 1; + * @return {string} + */ +proto.spec.proto.runtime.v1.DeleteStateRequest.prototype.getStoreName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.DeleteStateRequest} returns this + */ +proto.spec.proto.runtime.v1.DeleteStateRequest.prototype.setStoreName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string key = 2; + * @return {string} + */ +proto.spec.proto.runtime.v1.DeleteStateRequest.prototype.getKey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.DeleteStateRequest} returns this + */ +proto.spec.proto.runtime.v1.DeleteStateRequest.prototype.setKey = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional Etag etag = 3; + * @return {?proto.spec.proto.runtime.v1.Etag} + */ +proto.spec.proto.runtime.v1.DeleteStateRequest.prototype.getEtag = function() { + return /** @type{?proto.spec.proto.runtime.v1.Etag} */ ( + jspb.Message.getWrapperField(this, proto.spec.proto.runtime.v1.Etag, 3)); +}; + + +/** + * @param {?proto.spec.proto.runtime.v1.Etag|undefined} value + * @return {!proto.spec.proto.runtime.v1.DeleteStateRequest} returns this +*/ +proto.spec.proto.runtime.v1.DeleteStateRequest.prototype.setEtag = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.spec.proto.runtime.v1.DeleteStateRequest} returns this + */ +proto.spec.proto.runtime.v1.DeleteStateRequest.prototype.clearEtag = function() { + return this.setEtag(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.spec.proto.runtime.v1.DeleteStateRequest.prototype.hasEtag = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional StateOptions options = 4; + * @return {?proto.spec.proto.runtime.v1.StateOptions} + */ +proto.spec.proto.runtime.v1.DeleteStateRequest.prototype.getOptions = function() { + return /** @type{?proto.spec.proto.runtime.v1.StateOptions} */ ( + jspb.Message.getWrapperField(this, proto.spec.proto.runtime.v1.StateOptions, 4)); +}; + + +/** + * @param {?proto.spec.proto.runtime.v1.StateOptions|undefined} value + * @return {!proto.spec.proto.runtime.v1.DeleteStateRequest} returns this +*/ +proto.spec.proto.runtime.v1.DeleteStateRequest.prototype.setOptions = function(value) { + return jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.spec.proto.runtime.v1.DeleteStateRequest} returns this + */ +proto.spec.proto.runtime.v1.DeleteStateRequest.prototype.clearOptions = function() { + return this.setOptions(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.spec.proto.runtime.v1.DeleteStateRequest.prototype.hasOptions = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * map metadata = 5; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.spec.proto.runtime.v1.DeleteStateRequest.prototype.getMetadataMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 5, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.spec.proto.runtime.v1.DeleteStateRequest} returns this + */ +proto.spec.proto.runtime.v1.DeleteStateRequest.prototype.clearMetadataMap = function() { + this.getMetadataMap().clear(); + return this;}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.spec.proto.runtime.v1.DeleteBulkStateRequest.repeatedFields_ = [2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.DeleteBulkStateRequest.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.DeleteBulkStateRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.DeleteBulkStateRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.DeleteBulkStateRequest.toObject = function(includeInstance, msg) { + var f, obj = { + storeName: jspb.Message.getFieldWithDefault(msg, 1, ""), + statesList: jspb.Message.toObjectList(msg.getStatesList(), + proto.spec.proto.runtime.v1.StateItem.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.DeleteBulkStateRequest} + */ +proto.spec.proto.runtime.v1.DeleteBulkStateRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.DeleteBulkStateRequest; + return proto.spec.proto.runtime.v1.DeleteBulkStateRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.DeleteBulkStateRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.DeleteBulkStateRequest} + */ +proto.spec.proto.runtime.v1.DeleteBulkStateRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setStoreName(value); + break; + case 2: + var value = new proto.spec.proto.runtime.v1.StateItem; + reader.readMessage(value,proto.spec.proto.runtime.v1.StateItem.deserializeBinaryFromReader); + msg.addStates(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.DeleteBulkStateRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.DeleteBulkStateRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.DeleteBulkStateRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.DeleteBulkStateRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStoreName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getStatesList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.spec.proto.runtime.v1.StateItem.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string store_name = 1; + * @return {string} + */ +proto.spec.proto.runtime.v1.DeleteBulkStateRequest.prototype.getStoreName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.DeleteBulkStateRequest} returns this + */ +proto.spec.proto.runtime.v1.DeleteBulkStateRequest.prototype.setStoreName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * repeated StateItem states = 2; + * @return {!Array} + */ +proto.spec.proto.runtime.v1.DeleteBulkStateRequest.prototype.getStatesList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.spec.proto.runtime.v1.StateItem, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.spec.proto.runtime.v1.DeleteBulkStateRequest} returns this +*/ +proto.spec.proto.runtime.v1.DeleteBulkStateRequest.prototype.setStatesList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.spec.proto.runtime.v1.StateItem=} opt_value + * @param {number=} opt_index + * @return {!proto.spec.proto.runtime.v1.StateItem} + */ +proto.spec.proto.runtime.v1.DeleteBulkStateRequest.prototype.addStates = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.spec.proto.runtime.v1.StateItem, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.spec.proto.runtime.v1.DeleteBulkStateRequest} returns this + */ +proto.spec.proto.runtime.v1.DeleteBulkStateRequest.prototype.clearStatesList = function() { + return this.setStatesList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.spec.proto.runtime.v1.SaveStateRequest.repeatedFields_ = [2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.SaveStateRequest.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.SaveStateRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.SaveStateRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.SaveStateRequest.toObject = function(includeInstance, msg) { + var f, obj = { + storeName: jspb.Message.getFieldWithDefault(msg, 1, ""), + statesList: jspb.Message.toObjectList(msg.getStatesList(), + proto.spec.proto.runtime.v1.StateItem.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.SaveStateRequest} + */ +proto.spec.proto.runtime.v1.SaveStateRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.SaveStateRequest; + return proto.spec.proto.runtime.v1.SaveStateRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.SaveStateRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.SaveStateRequest} + */ +proto.spec.proto.runtime.v1.SaveStateRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setStoreName(value); + break; + case 2: + var value = new proto.spec.proto.runtime.v1.StateItem; + reader.readMessage(value,proto.spec.proto.runtime.v1.StateItem.deserializeBinaryFromReader); + msg.addStates(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.SaveStateRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.SaveStateRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.SaveStateRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.SaveStateRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStoreName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getStatesList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.spec.proto.runtime.v1.StateItem.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string store_name = 1; + * @return {string} + */ +proto.spec.proto.runtime.v1.SaveStateRequest.prototype.getStoreName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.SaveStateRequest} returns this + */ +proto.spec.proto.runtime.v1.SaveStateRequest.prototype.setStoreName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * repeated StateItem states = 2; + * @return {!Array} + */ +proto.spec.proto.runtime.v1.SaveStateRequest.prototype.getStatesList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.spec.proto.runtime.v1.StateItem, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.spec.proto.runtime.v1.SaveStateRequest} returns this +*/ +proto.spec.proto.runtime.v1.SaveStateRequest.prototype.setStatesList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.spec.proto.runtime.v1.StateItem=} opt_value + * @param {number=} opt_index + * @return {!proto.spec.proto.runtime.v1.StateItem} + */ +proto.spec.proto.runtime.v1.SaveStateRequest.prototype.addStates = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.spec.proto.runtime.v1.StateItem, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.spec.proto.runtime.v1.SaveStateRequest} returns this + */ +proto.spec.proto.runtime.v1.SaveStateRequest.prototype.clearStatesList = function() { + return this.setStatesList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.StateItem.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.StateItem.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.StateItem} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.StateItem.toObject = function(includeInstance, msg) { + var f, obj = { + key: jspb.Message.getFieldWithDefault(msg, 1, ""), + value: msg.getValue_asB64(), + etag: (f = msg.getEtag()) && proto.spec.proto.runtime.v1.Etag.toObject(includeInstance, f), + metadataMap: (f = msg.getMetadataMap()) ? f.toObject(includeInstance, undefined) : [], + options: (f = msg.getOptions()) && proto.spec.proto.runtime.v1.StateOptions.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.StateItem} + */ +proto.spec.proto.runtime.v1.StateItem.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.StateItem; + return proto.spec.proto.runtime.v1.StateItem.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.StateItem} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.StateItem} + */ +proto.spec.proto.runtime.v1.StateItem.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setKey(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setValue(value); + break; + case 3: + var value = new proto.spec.proto.runtime.v1.Etag; + reader.readMessage(value,proto.spec.proto.runtime.v1.Etag.deserializeBinaryFromReader); + msg.setEtag(value); + break; + case 4: + var value = msg.getMetadataMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + case 5: + var value = new proto.spec.proto.runtime.v1.StateOptions; + reader.readMessage(value,proto.spec.proto.runtime.v1.StateOptions.deserializeBinaryFromReader); + msg.setOptions(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.StateItem.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.StateItem.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.StateItem} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.StateItem.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getKey(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getValue_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getEtag(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.spec.proto.runtime.v1.Etag.serializeBinaryToWriter + ); + } + f = message.getMetadataMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(4, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } + f = message.getOptions(); + if (f != null) { + writer.writeMessage( + 5, + f, + proto.spec.proto.runtime.v1.StateOptions.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string key = 1; + * @return {string} + */ +proto.spec.proto.runtime.v1.StateItem.prototype.getKey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.StateItem} returns this + */ +proto.spec.proto.runtime.v1.StateItem.prototype.setKey = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional bytes value = 2; + * @return {!(string|Uint8Array)} + */ +proto.spec.proto.runtime.v1.StateItem.prototype.getValue = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes value = 2; + * This is a type-conversion wrapper around `getValue()` + * @return {string} + */ +proto.spec.proto.runtime.v1.StateItem.prototype.getValue_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getValue())); +}; + + +/** + * optional bytes value = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getValue()` + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.StateItem.prototype.getValue_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getValue())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.spec.proto.runtime.v1.StateItem} returns this + */ +proto.spec.proto.runtime.v1.StateItem.prototype.setValue = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); +}; + + +/** + * optional Etag etag = 3; + * @return {?proto.spec.proto.runtime.v1.Etag} + */ +proto.spec.proto.runtime.v1.StateItem.prototype.getEtag = function() { + return /** @type{?proto.spec.proto.runtime.v1.Etag} */ ( + jspb.Message.getWrapperField(this, proto.spec.proto.runtime.v1.Etag, 3)); +}; + + +/** + * @param {?proto.spec.proto.runtime.v1.Etag|undefined} value + * @return {!proto.spec.proto.runtime.v1.StateItem} returns this +*/ +proto.spec.proto.runtime.v1.StateItem.prototype.setEtag = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.spec.proto.runtime.v1.StateItem} returns this + */ +proto.spec.proto.runtime.v1.StateItem.prototype.clearEtag = function() { + return this.setEtag(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.spec.proto.runtime.v1.StateItem.prototype.hasEtag = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * map metadata = 4; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.spec.proto.runtime.v1.StateItem.prototype.getMetadataMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 4, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.spec.proto.runtime.v1.StateItem} returns this + */ +proto.spec.proto.runtime.v1.StateItem.prototype.clearMetadataMap = function() { + this.getMetadataMap().clear(); + return this;}; + + +/** + * optional StateOptions options = 5; + * @return {?proto.spec.proto.runtime.v1.StateOptions} + */ +proto.spec.proto.runtime.v1.StateItem.prototype.getOptions = function() { + return /** @type{?proto.spec.proto.runtime.v1.StateOptions} */ ( + jspb.Message.getWrapperField(this, proto.spec.proto.runtime.v1.StateOptions, 5)); +}; + + +/** + * @param {?proto.spec.proto.runtime.v1.StateOptions|undefined} value + * @return {!proto.spec.proto.runtime.v1.StateItem} returns this +*/ +proto.spec.proto.runtime.v1.StateItem.prototype.setOptions = function(value) { + return jspb.Message.setWrapperField(this, 5, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.spec.proto.runtime.v1.StateItem} returns this + */ +proto.spec.proto.runtime.v1.StateItem.prototype.clearOptions = function() { + return this.setOptions(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.spec.proto.runtime.v1.StateItem.prototype.hasOptions = function() { + return jspb.Message.getField(this, 5) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.Etag.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.Etag.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.Etag} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.Etag.toObject = function(includeInstance, msg) { + var f, obj = { + value: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.Etag} + */ +proto.spec.proto.runtime.v1.Etag.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.Etag; + return proto.spec.proto.runtime.v1.Etag.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.Etag} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.Etag} + */ +proto.spec.proto.runtime.v1.Etag.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setValue(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.Etag.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.Etag.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.Etag} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.Etag.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getValue(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string value = 1; + * @return {string} + */ +proto.spec.proto.runtime.v1.Etag.prototype.getValue = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.Etag} returns this + */ +proto.spec.proto.runtime.v1.Etag.prototype.setValue = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.StateOptions.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.StateOptions.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.StateOptions} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.StateOptions.toObject = function(includeInstance, msg) { + var f, obj = { + concurrency: jspb.Message.getFieldWithDefault(msg, 1, 0), + consistency: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.StateOptions} + */ +proto.spec.proto.runtime.v1.StateOptions.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.StateOptions; + return proto.spec.proto.runtime.v1.StateOptions.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.StateOptions} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.StateOptions} + */ +proto.spec.proto.runtime.v1.StateOptions.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.spec.proto.runtime.v1.StateOptions.StateConcurrency} */ (reader.readEnum()); + msg.setConcurrency(value); + break; + case 2: + var value = /** @type {!proto.spec.proto.runtime.v1.StateOptions.StateConsistency} */ (reader.readEnum()); + msg.setConsistency(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.StateOptions.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.StateOptions.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.StateOptions} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.StateOptions.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getConcurrency(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } + f = message.getConsistency(); + if (f !== 0.0) { + writer.writeEnum( + 2, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.spec.proto.runtime.v1.StateOptions.StateConcurrency = { + CONCURRENCY_UNSPECIFIED: 0, + CONCURRENCY_FIRST_WRITE: 1, + CONCURRENCY_LAST_WRITE: 2 +}; + +/** + * @enum {number} + */ +proto.spec.proto.runtime.v1.StateOptions.StateConsistency = { + CONSISTENCY_UNSPECIFIED: 0, + CONSISTENCY_EVENTUAL: 1, + CONSISTENCY_STRONG: 2 +}; + +/** + * optional StateConcurrency concurrency = 1; + * @return {!proto.spec.proto.runtime.v1.StateOptions.StateConcurrency} + */ +proto.spec.proto.runtime.v1.StateOptions.prototype.getConcurrency = function() { + return /** @type {!proto.spec.proto.runtime.v1.StateOptions.StateConcurrency} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {!proto.spec.proto.runtime.v1.StateOptions.StateConcurrency} value + * @return {!proto.spec.proto.runtime.v1.StateOptions} returns this + */ +proto.spec.proto.runtime.v1.StateOptions.prototype.setConcurrency = function(value) { + return jspb.Message.setProto3EnumField(this, 1, value); +}; + + +/** + * optional StateConsistency consistency = 2; + * @return {!proto.spec.proto.runtime.v1.StateOptions.StateConsistency} + */ +proto.spec.proto.runtime.v1.StateOptions.prototype.getConsistency = function() { + return /** @type {!proto.spec.proto.runtime.v1.StateOptions.StateConsistency} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {!proto.spec.proto.runtime.v1.StateOptions.StateConsistency} value + * @return {!proto.spec.proto.runtime.v1.StateOptions} returns this + */ +proto.spec.proto.runtime.v1.StateOptions.prototype.setConsistency = function(value) { + return jspb.Message.setProto3EnumField(this, 2, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.TransactionalStateOperation.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.TransactionalStateOperation.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.TransactionalStateOperation} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.TransactionalStateOperation.toObject = function(includeInstance, msg) { + var f, obj = { + operationtype: jspb.Message.getFieldWithDefault(msg, 1, ""), + request: (f = msg.getRequest()) && proto.spec.proto.runtime.v1.StateItem.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.TransactionalStateOperation} + */ +proto.spec.proto.runtime.v1.TransactionalStateOperation.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.TransactionalStateOperation; + return proto.spec.proto.runtime.v1.TransactionalStateOperation.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.TransactionalStateOperation} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.TransactionalStateOperation} + */ +proto.spec.proto.runtime.v1.TransactionalStateOperation.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setOperationtype(value); + break; + case 2: + var value = new proto.spec.proto.runtime.v1.StateItem; + reader.readMessage(value,proto.spec.proto.runtime.v1.StateItem.deserializeBinaryFromReader); + msg.setRequest(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.TransactionalStateOperation.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.TransactionalStateOperation.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.TransactionalStateOperation} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.TransactionalStateOperation.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOperationtype(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getRequest(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.spec.proto.runtime.v1.StateItem.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string operationType = 1; + * @return {string} + */ +proto.spec.proto.runtime.v1.TransactionalStateOperation.prototype.getOperationtype = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.TransactionalStateOperation} returns this + */ +proto.spec.proto.runtime.v1.TransactionalStateOperation.prototype.setOperationtype = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional StateItem request = 2; + * @return {?proto.spec.proto.runtime.v1.StateItem} + */ +proto.spec.proto.runtime.v1.TransactionalStateOperation.prototype.getRequest = function() { + return /** @type{?proto.spec.proto.runtime.v1.StateItem} */ ( + jspb.Message.getWrapperField(this, proto.spec.proto.runtime.v1.StateItem, 2)); +}; + + +/** + * @param {?proto.spec.proto.runtime.v1.StateItem|undefined} value + * @return {!proto.spec.proto.runtime.v1.TransactionalStateOperation} returns this +*/ +proto.spec.proto.runtime.v1.TransactionalStateOperation.prototype.setRequest = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.spec.proto.runtime.v1.TransactionalStateOperation} returns this + */ +proto.spec.proto.runtime.v1.TransactionalStateOperation.prototype.clearRequest = function() { + return this.setRequest(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.spec.proto.runtime.v1.TransactionalStateOperation.prototype.hasRequest = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.spec.proto.runtime.v1.ExecuteStateTransactionRequest.repeatedFields_ = [2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.ExecuteStateTransactionRequest.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.ExecuteStateTransactionRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.ExecuteStateTransactionRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.ExecuteStateTransactionRequest.toObject = function(includeInstance, msg) { + var f, obj = { + storename: jspb.Message.getFieldWithDefault(msg, 1, ""), + operationsList: jspb.Message.toObjectList(msg.getOperationsList(), + proto.spec.proto.runtime.v1.TransactionalStateOperation.toObject, includeInstance), + metadataMap: (f = msg.getMetadataMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.ExecuteStateTransactionRequest} + */ +proto.spec.proto.runtime.v1.ExecuteStateTransactionRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.ExecuteStateTransactionRequest; + return proto.spec.proto.runtime.v1.ExecuteStateTransactionRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.ExecuteStateTransactionRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.ExecuteStateTransactionRequest} + */ +proto.spec.proto.runtime.v1.ExecuteStateTransactionRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setStorename(value); + break; + case 2: + var value = new proto.spec.proto.runtime.v1.TransactionalStateOperation; + reader.readMessage(value,proto.spec.proto.runtime.v1.TransactionalStateOperation.deserializeBinaryFromReader); + msg.addOperations(value); + break; + case 3: + var value = msg.getMetadataMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.ExecuteStateTransactionRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.ExecuteStateTransactionRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.ExecuteStateTransactionRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.ExecuteStateTransactionRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStorename(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getOperationsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.spec.proto.runtime.v1.TransactionalStateOperation.serializeBinaryToWriter + ); + } + f = message.getMetadataMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(3, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } +}; + + +/** + * optional string storeName = 1; + * @return {string} + */ +proto.spec.proto.runtime.v1.ExecuteStateTransactionRequest.prototype.getStorename = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.ExecuteStateTransactionRequest} returns this + */ +proto.spec.proto.runtime.v1.ExecuteStateTransactionRequest.prototype.setStorename = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * repeated TransactionalStateOperation operations = 2; + * @return {!Array} + */ +proto.spec.proto.runtime.v1.ExecuteStateTransactionRequest.prototype.getOperationsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.spec.proto.runtime.v1.TransactionalStateOperation, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.spec.proto.runtime.v1.ExecuteStateTransactionRequest} returns this +*/ +proto.spec.proto.runtime.v1.ExecuteStateTransactionRequest.prototype.setOperationsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.spec.proto.runtime.v1.TransactionalStateOperation=} opt_value + * @param {number=} opt_index + * @return {!proto.spec.proto.runtime.v1.TransactionalStateOperation} + */ +proto.spec.proto.runtime.v1.ExecuteStateTransactionRequest.prototype.addOperations = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.spec.proto.runtime.v1.TransactionalStateOperation, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.spec.proto.runtime.v1.ExecuteStateTransactionRequest} returns this + */ +proto.spec.proto.runtime.v1.ExecuteStateTransactionRequest.prototype.clearOperationsList = function() { + return this.setOperationsList([]); +}; + + +/** + * map metadata = 3; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.spec.proto.runtime.v1.ExecuteStateTransactionRequest.prototype.getMetadataMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 3, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.spec.proto.runtime.v1.ExecuteStateTransactionRequest} returns this + */ +proto.spec.proto.runtime.v1.ExecuteStateTransactionRequest.prototype.clearMetadataMap = function() { + this.getMetadataMap().clear(); + return this;}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.PublishEventRequest.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.PublishEventRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.PublishEventRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.PublishEventRequest.toObject = function(includeInstance, msg) { + var f, obj = { + pubsubName: jspb.Message.getFieldWithDefault(msg, 1, ""), + topic: jspb.Message.getFieldWithDefault(msg, 2, ""), + data: msg.getData_asB64(), + dataContentType: jspb.Message.getFieldWithDefault(msg, 4, ""), + metadataMap: (f = msg.getMetadataMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.PublishEventRequest} + */ +proto.spec.proto.runtime.v1.PublishEventRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.PublishEventRequest; + return proto.spec.proto.runtime.v1.PublishEventRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.PublishEventRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.PublishEventRequest} + */ +proto.spec.proto.runtime.v1.PublishEventRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setPubsubName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setTopic(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setData(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setDataContentType(value); + break; + case 5: + var value = msg.getMetadataMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.PublishEventRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.PublishEventRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.PublishEventRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.PublishEventRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPubsubName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getTopic(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getData_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } + f = message.getDataContentType(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getMetadataMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } +}; + + +/** + * optional string pubsub_name = 1; + * @return {string} + */ +proto.spec.proto.runtime.v1.PublishEventRequest.prototype.getPubsubName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.PublishEventRequest} returns this + */ +proto.spec.proto.runtime.v1.PublishEventRequest.prototype.setPubsubName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string topic = 2; + * @return {string} + */ +proto.spec.proto.runtime.v1.PublishEventRequest.prototype.getTopic = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.PublishEventRequest} returns this + */ +proto.spec.proto.runtime.v1.PublishEventRequest.prototype.setTopic = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional bytes data = 3; + * @return {!(string|Uint8Array)} + */ +proto.spec.proto.runtime.v1.PublishEventRequest.prototype.getData = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes data = 3; + * This is a type-conversion wrapper around `getData()` + * @return {string} + */ +proto.spec.proto.runtime.v1.PublishEventRequest.prototype.getData_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getData())); +}; + + +/** + * optional bytes data = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getData()` + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.PublishEventRequest.prototype.getData_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getData())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.spec.proto.runtime.v1.PublishEventRequest} returns this + */ +proto.spec.proto.runtime.v1.PublishEventRequest.prototype.setData = function(value) { + return jspb.Message.setProto3BytesField(this, 3, value); +}; + + +/** + * optional string data_content_type = 4; + * @return {string} + */ +proto.spec.proto.runtime.v1.PublishEventRequest.prototype.getDataContentType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.PublishEventRequest} returns this + */ +proto.spec.proto.runtime.v1.PublishEventRequest.prototype.setDataContentType = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * map metadata = 5; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.spec.proto.runtime.v1.PublishEventRequest.prototype.getMetadataMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 5, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.spec.proto.runtime.v1.PublishEventRequest} returns this + */ +proto.spec.proto.runtime.v1.PublishEventRequest.prototype.clearMetadataMap = function() { + this.getMetadataMap().clear(); + return this;}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.InvokeBindingRequest.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.InvokeBindingRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.InvokeBindingRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.InvokeBindingRequest.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + data: msg.getData_asB64(), + metadataMap: (f = msg.getMetadataMap()) ? f.toObject(includeInstance, undefined) : [], + operation: jspb.Message.getFieldWithDefault(msg, 4, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.InvokeBindingRequest} + */ +proto.spec.proto.runtime.v1.InvokeBindingRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.InvokeBindingRequest; + return proto.spec.proto.runtime.v1.InvokeBindingRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.InvokeBindingRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.InvokeBindingRequest} + */ +proto.spec.proto.runtime.v1.InvokeBindingRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setData(value); + break; + case 3: + var value = msg.getMetadataMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setOperation(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.InvokeBindingRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.InvokeBindingRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.InvokeBindingRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.InvokeBindingRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getData_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getMetadataMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(3, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } + f = message.getOperation(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.spec.proto.runtime.v1.InvokeBindingRequest.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.InvokeBindingRequest} returns this + */ +proto.spec.proto.runtime.v1.InvokeBindingRequest.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional bytes data = 2; + * @return {!(string|Uint8Array)} + */ +proto.spec.proto.runtime.v1.InvokeBindingRequest.prototype.getData = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes data = 2; + * This is a type-conversion wrapper around `getData()` + * @return {string} + */ +proto.spec.proto.runtime.v1.InvokeBindingRequest.prototype.getData_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getData())); +}; + + +/** + * optional bytes data = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getData()` + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.InvokeBindingRequest.prototype.getData_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getData())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.spec.proto.runtime.v1.InvokeBindingRequest} returns this + */ +proto.spec.proto.runtime.v1.InvokeBindingRequest.prototype.setData = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); +}; + + +/** + * map metadata = 3; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.spec.proto.runtime.v1.InvokeBindingRequest.prototype.getMetadataMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 3, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.spec.proto.runtime.v1.InvokeBindingRequest} returns this + */ +proto.spec.proto.runtime.v1.InvokeBindingRequest.prototype.clearMetadataMap = function() { + this.getMetadataMap().clear(); + return this;}; + + +/** + * optional string operation = 4; + * @return {string} + */ +proto.spec.proto.runtime.v1.InvokeBindingRequest.prototype.getOperation = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.spec.proto.runtime.v1.InvokeBindingRequest} returns this + */ +proto.spec.proto.runtime.v1.InvokeBindingRequest.prototype.setOperation = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.spec.proto.runtime.v1.InvokeBindingResponse.prototype.toObject = function(opt_includeInstance) { + return proto.spec.proto.runtime.v1.InvokeBindingResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.spec.proto.runtime.v1.InvokeBindingResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.InvokeBindingResponse.toObject = function(includeInstance, msg) { + var f, obj = { + data: msg.getData_asB64(), + metadataMap: (f = msg.getMetadataMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.spec.proto.runtime.v1.InvokeBindingResponse} + */ +proto.spec.proto.runtime.v1.InvokeBindingResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.spec.proto.runtime.v1.InvokeBindingResponse; + return proto.spec.proto.runtime.v1.InvokeBindingResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.spec.proto.runtime.v1.InvokeBindingResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.spec.proto.runtime.v1.InvokeBindingResponse} + */ +proto.spec.proto.runtime.v1.InvokeBindingResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setData(value); + break; + case 2: + var value = msg.getMetadataMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.InvokeBindingResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.spec.proto.runtime.v1.InvokeBindingResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.spec.proto.runtime.v1.InvokeBindingResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.spec.proto.runtime.v1.InvokeBindingResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getData_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getMetadataMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } +}; + + +/** + * optional bytes data = 1; + * @return {!(string|Uint8Array)} + */ +proto.spec.proto.runtime.v1.InvokeBindingResponse.prototype.getData = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes data = 1; + * This is a type-conversion wrapper around `getData()` + * @return {string} + */ +proto.spec.proto.runtime.v1.InvokeBindingResponse.prototype.getData_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getData())); +}; + + +/** + * optional bytes data = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getData()` + * @return {!Uint8Array} + */ +proto.spec.proto.runtime.v1.InvokeBindingResponse.prototype.getData_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getData())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.spec.proto.runtime.v1.InvokeBindingResponse} returns this + */ +proto.spec.proto.runtime.v1.InvokeBindingResponse.prototype.setData = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * map metadata = 2; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.spec.proto.runtime.v1.InvokeBindingResponse.prototype.getMetadataMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 2, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.spec.proto.runtime.v1.InvokeBindingResponse} returns this + */ +proto.spec.proto.runtime.v1.InvokeBindingResponse.prototype.clearMetadataMap = function() { + this.getMetadataMap().clear(); + return this;}; + + +goog.object.extend(exports, proto.spec.proto.runtime.v1); diff --git a/sdk/js-sdk/scripts/build-grpc.sh b/sdk/js-sdk/scripts/build-grpc.sh new file mode 100755 index 0000000000..16a5f3f7a1 --- /dev/null +++ b/sdk/js-sdk/scripts/build-grpc.sh @@ -0,0 +1,74 @@ +#!/bin/bash +# +# Copyright 2021 Layotto 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. +OS=$(echo `uname`|tr '[:upper:]' '[:lower:]') +ARCH=$(uname -m) + +# Proto buf generation +# https://medium.com/blokur/how-to-implement-a-grpc-client-and-server-in-typescript-fa3ac807855e +PATH_ROOT=$(pwd) +PATH_PROTO_ROOT="${PATH_ROOT}/../../spec/proto/runtime/v1" +PATH_PROTO_OUTPUT="${PATH_ROOT}/proto" + +prerequisiteCheckProtobuf() { + if ! type "protoc" > /dev/null; then + echo "protoc is not installed, trying to install" + sudo apt update + sudo apt install -y protobuf-compiler + protoc --version + + prerequisiteCheckProtobuf + else + echo "protoc ($(protoc --version)) installed" + fi +} + +generateGrpc() { + PATH_PROTO=$1 + PATH_FILE=$2 + + echo "[protoc] Generating RPC for $PATH_PROTO/$PATH_FILE" + + # Tools to be installed by npm (see package.json) + # npm install grpc-tools --save-dev + # npm install grpc_tools_node_protoc_ts --save-dev + PROTOC_GEN_TS_PATH="${PATH_ROOT}/node_modules/.bin/protoc-gen-ts" + PROTOC_GEN_GRPC_PATH="${PATH_ROOT}/node_modules/.bin/grpc_tools_node_protoc_plugin" + + # commonjs + protoc \ + --proto_path="${PATH_PROTO}" \ + --plugin="protoc-gen-ts=${PROTOC_GEN_TS_PATH}" \ + --plugin=protoc-gen-grpc=${PROTOC_GEN_GRPC_PATH} \ + --js_out="import_style=commonjs,binary:$PATH_PROTO_OUTPUT" \ + --ts_out="grpc_js:$PATH_PROTO_OUTPUT" \ + --grpc_out="grpc_js:$PATH_PROTO_OUTPUT" \ + "$PATH_PROTO/$PATH_FILE" +} + +echo "Checking Dependencies" +prerequisiteCheckProtobuf + +echo "" +echo "Removing old Proto Files: ${PATH_PROTO_OUTPUT}" +rm -rf $PATH_PROTO_OUTPUT +mkdir -p $PATH_PROTO_OUTPUT + +echo "" +echo "Compiling gRPC files" +generateGrpc $PATH_PROTO_ROOT "runtime.proto" +generateGrpc $PATH_PROTO_ROOT "appcallback.proto" + +echo "" +echo "DONE" diff --git a/sdk/js-sdk/src/client/API.ts b/sdk/js-sdk/src/client/API.ts new file mode 100644 index 0000000000..a4c66723d9 --- /dev/null +++ b/sdk/js-sdk/src/client/API.ts @@ -0,0 +1,42 @@ +/* + * Copyright 2021 Layotto 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. + */ +import { Metadata } from '@grpc/grpc-js'; +import { RuntimeClient } from '../../proto/runtime_grpc_pb'; +import { KV, RequestWithMeta, Map } from '../types/common'; + +export class API { + readonly runtime: RuntimeClient; + constructor(runtime: RuntimeClient) { + this.runtime = runtime; + } + + createMetadata(request: RequestWithMeta<{}>): Metadata { + const metadata = new Metadata(); + if (!request.requestMeta) return metadata; + for (const key of Object.keys(request.requestMeta)) { + metadata.add(key, request.requestMeta[key]); + } + return metadata; + } + + mergeMetadataToMap(map: Map, ...metadatas: (KV | undefined)[]) { + for (const metadata of metadatas) { + if (!metadata) continue; + for (const key of Object.keys(metadata)) { + map.set(key, metadata[key]); + } + } + } +} diff --git a/sdk/js-sdk/src/client/Binding.ts b/sdk/js-sdk/src/client/Binding.ts new file mode 100644 index 0000000000..72f3054a91 --- /dev/null +++ b/sdk/js-sdk/src/client/Binding.ts @@ -0,0 +1,48 @@ +/* + * Copyright 2021 Layotto 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. + */ +import { + InvokeBindingRequest as InvokeBindingRequestPB, + InvokeBindingResponse as InvokeBindingResponsePB, +} from '../../proto/runtime_pb'; +import { API } from './API'; +import { + InvokeBindingRequest, + InvokeBindingResponse, +} from '../types/Binding'; +import { convertMapToKVString } from '../utils'; + +export default class Binding extends API { + async invoke(request: InvokeBindingRequest): Promise { + const req = new InvokeBindingRequestPB(); + req.setName(request.name); + req.setOperation(request.operation); + if (typeof request.data === 'string') { + req.setData(Buffer.from(request.data, 'utf8')); + } else { + req.setData(request.data); + } + this.mergeMetadataToMap(req.getMetadataMap(), request.metadata); + + return new Promise((resolve, reject) => { + this.runtime.invokeBinding(req, this.createMetadata(request), (err, res: InvokeBindingResponsePB) => { + if (err) return reject(err); + resolve({ + data: res.getData_asU8(), + metadata: convertMapToKVString(res.getMetadataMap()), + }); + }); + }); + } +} diff --git a/sdk/js-sdk/src/client/Client.ts b/sdk/js-sdk/src/client/Client.ts new file mode 100644 index 0000000000..6a9e9a67a5 --- /dev/null +++ b/sdk/js-sdk/src/client/Client.ts @@ -0,0 +1,97 @@ +/* + * Copyright 2021 Layotto 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. + */ +import { debuglog } from 'node:util'; +import { ChannelCredentials } from '@grpc/grpc-js'; +import { RuntimeClient } from '../../proto/runtime_grpc_pb'; +import State from './State'; +import Hello from './Hello'; +import Invoker from './Invoker'; +import Lock from './Lock'; +import Sequencer from './Sequencer'; +import Configuration from './Configuration'; +import PubSub from './PubSub'; +import File from './File'; +import Binding from './Binding'; + +const debug = debuglog('layotto:client:main'); + +export default class Client { + readonly host: string; + readonly port: string; + private _runtime: RuntimeClient; + private _hello: Hello; + private _state: State; + private _invoker: Invoker; + private _lock: Lock; + private _sequencer: Sequencer; + private _configuration: Configuration; + private _pubsub: PubSub; + private _file: File; + private _binding: Binding; + + constructor(port: string = process.env.runtime_GRPC_PORT ?? '34904', + host: string = process.env.runtime_GRPC_HOST ?? '127.0.0.1') { + this.host = host; + this.port = port; + const clientCredentials = ChannelCredentials.createInsecure(); + this._runtime = new RuntimeClient(`${this.host}:${this.port}`, clientCredentials); + debug('Start connection to %s:%s', this.host, this.port); + } + + get hello() { + if (!this._hello) this._hello = new Hello(this._runtime); + return this._hello; + } + + get state() { + if (!this._state) this._state = new State(this._runtime); + return this._state; + } + + get invoker() { + if (!this._invoker) this._invoker = new Invoker(this._runtime); + return this._invoker; + } + + get lock() { + if (!this._lock) this._lock = new Lock(this._runtime); + return this._lock; + } + + get sequencer() { + if (!this._sequencer) this._sequencer = new Sequencer(this._runtime); + return this._sequencer; + } + + get configuration() { + if (!this._configuration) this._configuration = new Configuration(this._runtime); + return this._configuration; + } + + get pubsub() { + if (!this._pubsub) this._pubsub = new PubSub(this._runtime); + return this._pubsub; + } + + get file() { + if (!this._file) this._file = new File(this._runtime); + return this._file; + } + + get binding() { + if (!this._binding) this._binding = new Binding(this._runtime); + return this._binding; + } +} diff --git a/sdk/js-sdk/src/client/Configuration.ts b/sdk/js-sdk/src/client/Configuration.ts new file mode 100644 index 0000000000..ba1373778b --- /dev/null +++ b/sdk/js-sdk/src/client/Configuration.ts @@ -0,0 +1,151 @@ +/* + * Copyright 2021 Layotto 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. + */ +import { debuglog } from 'node:util'; +import { + GetConfigurationRequest as GetConfigurationRequestPB, + GetConfigurationResponse as GetConfigurationResponsePB, + SaveConfigurationRequest as SaveConfigurationRequestPB, + ConfigurationItem as ConfigurationItemPB, + DeleteConfigurationRequest as DeleteConfigurationRequestPB, + SubscribeConfigurationRequest as SubscribeConfigurationRequestPB, + SubscribeConfigurationResponse as SubscribeConfigurationResponsePB, +} from '../../proto/runtime_pb'; +import { API } from './API'; +import { + GetConfigurationRequest, + GetConfigurationItem, + SaveConfigurationRequest, + DeleteConfigurationRequest, + SubscribeConfigurationRequest, +} from '../types/Configuration'; +import { convertArrayToKVString } from '../types/common'; + +const debug = debuglog('layotto:client:configuration'); + +export default class Configuration extends API { + // GetConfiguration gets configuration from configuration store. + async get(request: GetConfigurationRequest): Promise { + const req = new GetConfigurationRequestPB(); + req.setStoreName(request.storeName); + req.setAppId(request.appId); + req.setKeysList(request.keys); + if (request.group) req.setGroup(request.group); + if (request.label) req.setLabel(request.label); + if (request.subscribeUpdate !== undefined) { + req.setSubscribeUpdate(request.subscribeUpdate); + } + this.mergeMetadataToMap(req.getMetadataMap(), request.metadata); + + return new Promise((resolve, reject) => { + this.runtime.getConfiguration(req, this.createMetadata(request), (err, res: GetConfigurationResponsePB) => { + if (err) return reject(err); + resolve(res.getItemsList().map(item => this.createGetConfigurationItem(item))); + }); + }); + } + + // SaveConfiguration saves configuration into configuration store. + async save(request: SaveConfigurationRequest): Promise { + const req = new SaveConfigurationRequestPB(); + req.setStoreName(request.storeName); + req.setAppId(request.appId); + req.setItemsList(request.items.map(item => { + const configurationItem = new ConfigurationItemPB(); + configurationItem.setKey(item.key); + configurationItem.setContent(item.content); + if (item.group) configurationItem.setGroup(item.group); + if (item.label) configurationItem.setLabel(item.label); + return configurationItem; + })); + this.mergeMetadataToMap(req.getMetadataMap(), request.metadata); + + return new Promise((resolve, reject) => { + this.runtime.saveConfiguration(req, this.createMetadata(request), (err) => { + if (err) return reject(err); + resolve(); + }); + }); + } + + // DeleteConfiguration deletes configuration from configuration store. + async delete(request: DeleteConfigurationRequest): Promise { + const req = new DeleteConfigurationRequestPB(); + req.setStoreName(request.storeName); + req.setAppId(request.appId); + req.setKeysList(request.keys); + if (request.group) req.setGroup(request.group); + if (request.label) req.setLabel(request.label); + this.mergeMetadataToMap(req.getMetadataMap(), request.metadata); + + return new Promise((resolve, reject) => { + this.runtime.deleteConfiguration(req, this.createMetadata(request), (err) => { + if (err) return reject(err); + resolve(); + }); + }); + } + + // SubscribeConfiguration gets configuration from configuration store and subscribe the updates. + subscribe(request: SubscribeConfigurationRequest) { + const req = new SubscribeConfigurationRequestPB(); + req.setStoreName(request.storeName); + req.setAppId(request.appId); + req.setKeysList(request.keys); + if (request.group) req.setGroup(request.group); + if (request.label) req.setLabel(request.label); + this.mergeMetadataToMap(req.getMetadataMap(), request.metadata); + + let lastError: Error; + let isCloseOrEnd = false; + const call = this.runtime.subscribeConfiguration(this.createMetadata(request)); + call.on('readable', () => { + const res: SubscribeConfigurationResponsePB = call.read(); + debug('readable emit, has res: %s', !!res); + if (!res) return; + const items: GetConfigurationItem[] = res.getItemsList().map(item => this.createGetConfigurationItem(item)); + request.onData(items); + }); + call.on('error', (err) => { + debug('error emit, isCloseOrEnd: %s, %s', isCloseOrEnd, err); + lastError = err; + }); + call.on('close', () => { + debug('close emit, isCloseOrEnd: %s', isCloseOrEnd); + if (isCloseOrEnd) return; + isCloseOrEnd = true; + request.onClose(lastError); + }); + call.on('end', () => { + debug('end emit, isCloseOrEnd: %s', isCloseOrEnd); + if (isCloseOrEnd) return; + isCloseOrEnd = true; + request.onClose(lastError); + }); + call.write(req); + return call; + } + + private createGetConfigurationItem(item: ConfigurationItemPB): GetConfigurationItem { + const obj = item.toObject(); + return { + key: obj.key, + content: obj.content, + group: obj.group, + label: obj.label, + tags: convertArrayToKVString(obj.tagsMap), + metadata: convertArrayToKVString(obj.metadataMap), + }; + } +} diff --git a/sdk/js-sdk/src/client/File.ts b/sdk/js-sdk/src/client/File.ts new file mode 100644 index 0000000000..61f4bc9335 --- /dev/null +++ b/sdk/js-sdk/src/client/File.ts @@ -0,0 +1,117 @@ +/* + * Copyright 2021 Layotto 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. + */ +import { debuglog } from 'node:util'; +import { Transform, Readable } from 'stream'; +import { pipeline as pipelinePromise } from 'stream/promises'; +import { + GetFileRequest as GetFileRequestPB, + GetFileResponse as GetFileResponsePB, + PutFileRequest as PutFileRequestPB, + ListFileRequest as ListFileRequestPB, + DelFileRequest as DelFileRequestPB, +} from '../../proto/runtime_pb'; +import { API } from './API'; +import { GetFileRequest, ListFileResponse, PutFileRequest } from '../types/File'; + +const debug = debuglog('layotto:client:file'); + +export default class File extends API { + // Get a file stream + async get(request: GetFileRequest): Promise { + const req = new GetFileRequestPB(); + req.setStoreName(request.storeName); + req.setName(request.name); + this.mergeMetadataToMap(req.getMetadataMap(), request.metadata); + + // convert GetFileResponsePB to Uint8Array + const converter = new Transform({ + objectMode: true, + transform(res: GetFileResponsePB, _, done) { + const data = res.getData_asU8(); + done(null, data); + } + }); + const callStream = this.runtime.getFile(req, this.createMetadata(request)); + // Make sure callStream error handle by converter + callStream.on('error', (err) => converter.emit('error', err)); + return callStream.pipe(converter); + } + + async put(request: PutFileRequest): Promise { + const stream = request.stream ?? Readable.from(request.data); + + const ac = new AbortController(); + const signal = ac.signal; + const writeStream = this.runtime.putFile(this.createMetadata(request), (err) => { + if (err) { + debug('putFile %j got server error: %s', request, err); + // abort request and throw error + // FIXME: should tell caller the real err reason, not only AbortError + ac.abort(); + } + }); + await pipelinePromise( + stream, + new Transform({ + objectMode: true, + transform: (chunk: Uint8Array, _, done) => { + const req = new PutFileRequestPB(); + req.setStoreName(request.storeName); + req.setName(request.name); + req.setData(chunk); + this.mergeMetadataToMap(req.getMetadataMap(), request.metadata); + done(null, req); + } + }), + // @ts-ignore + writeStream, + { signal }, + ); + } + + async list(request: GetFileRequest): Promise { + const req = new GetFileRequestPB(); + req.setStoreName(request.storeName); + req.setName(request.name); + this.mergeMetadataToMap(req.getMetadataMap(), { storageType: 'Standard' }, request.metadata); + const listReq = new ListFileRequestPB(); + listReq.setRequest(req); + + return new Promise((resolve, reject) => { + this.runtime.listFile(listReq, this.createMetadata(request), (err, res) => { + if (err) return reject(err); + debug('listFile: %j, res: %j', request, res); + resolve({ + names: res.getFileNameList(), + }); + }); + }); + } + + async delete(request: GetFileRequest): Promise { + const req = new GetFileRequestPB(); + req.setStoreName(request.storeName); + req.setName(request.name); + const delReq = new DelFileRequestPB(); + delReq.setRequest(req); + + return new Promise((resolve, reject) => { + this.runtime.delFile(delReq, this.createMetadata(request), (err) => { + if (err) return reject(err); + resolve(); + }); + }); + } +} diff --git a/sdk/js-sdk/src/client/Hello.ts b/sdk/js-sdk/src/client/Hello.ts new file mode 100644 index 0000000000..b73faf87c6 --- /dev/null +++ b/sdk/js-sdk/src/client/Hello.ts @@ -0,0 +1,36 @@ +/* + * Copyright 2021 Layotto 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. + */ +import { + SayHelloRequest as SayHelloRequestPB, + SayHelloResponse as SayHelloResponsePB, +} from '../../proto/runtime_pb'; +import { API } from './API'; +import { SayHelloRequest } from '../types/Hello'; + +export default class Hello extends API { + async sayHello(request?: SayHelloRequest): Promise { + const req = new SayHelloRequestPB(); + if (!request) request = {}; + req.setServiceName(request.serviceName ?? 'helloworld'); + if (request.name) req.setName(request.name); + + return new Promise((resolve, reject) => { + this.runtime.sayHello(req, this.createMetadata(request as SayHelloRequest), (err, res: SayHelloResponsePB) => { + if (err) return reject(err); + resolve(res.getHello()); + }); + }); + } +} diff --git a/sdk/js-sdk/src/client/Invoker.ts b/sdk/js-sdk/src/client/Invoker.ts new file mode 100644 index 0000000000..298e27884a --- /dev/null +++ b/sdk/js-sdk/src/client/Invoker.ts @@ -0,0 +1,79 @@ +/* + * Copyright 2021 Layotto 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. + */ +import { Any } from 'google-protobuf/google/protobuf/any_pb'; +import { + InvokeServiceRequest as InvokeServiceRequestPB, + CommonInvokeRequest as CommonInvokeRequestPB, + HTTPExtension, + InvokeResponse as InvokeResponsePB, +} from '../../proto/runtime_pb'; +import { API } from './API'; +import { InvokeServiceRequest, InvokeResponse } from '../types/Invoker'; + +export default class Invoker extends API { + async invoke(request: InvokeServiceRequest): Promise { + const message = new CommonInvokeRequestPB(); + message.setMethod(request.method); + + const httpVerb = request.httpVerb ?? HTTPExtension.Verb.GET; + const httpExtension = new HTTPExtension(); + httpExtension.setVerb(httpVerb); + message.setHttpExtension(httpExtension); + + if (request.data) { + const dataSerialized = new Any(); + if (typeof request.data === 'string') { + message.setContentType(request.contentType ?? 'text/plain; charset=UTF-8'); + dataSerialized.setValue(Buffer.from(request.data, 'utf8')); + } else { + message.setContentType(request.contentType ?? 'application/json'); + dataSerialized.setValue(Buffer.from(JSON.stringify(request.data), 'utf8')); + } + message.setData(dataSerialized); + } + + console.log(message); + + const req = new InvokeServiceRequestPB(); + req.setId(request.id); + req.setMessage(message); + + return new Promise((resolve, reject) => { + this.runtime.invokeService(req, this.createMetadata(request), (err, res: InvokeResponsePB) => { + if (err) return reject(err); + const contentType = res.getContentType().split(';', 1)[0].toLowerCase(); + const rawData = res.getData(); + let content; + if (contentType === 'application/json') { + if (rawData) { + content = JSON.parse(Buffer.from(rawData.getValue_asU8()).toString()); + } else { + content = {}; + } + } else if (contentType === 'text/plain') { + if (rawData) { + content = Buffer.from(rawData.getValue_asU8()).toString(); + } else { + content = ''; + } + } else { + content = rawData ? rawData.getValue_asU8() : []; + } + const response: InvokeResponse = { contentType, content }; + resolve(response); + }); + }); + } +} diff --git a/sdk/js-sdk/src/client/Lock.ts b/sdk/js-sdk/src/client/Lock.ts new file mode 100644 index 0000000000..ca74a55fd9 --- /dev/null +++ b/sdk/js-sdk/src/client/Lock.ts @@ -0,0 +1,60 @@ +/* + * Copyright 2021 Layotto 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. + */ +import * as crypto from 'crypto'; +import { + TryLockRequest as TryLockRequestPB, + TryLockResponse as TryLockResponsePB, + UnlockRequest as UnlockRequestPB, + UnlockResponse as UnlockResponsePB, +} from '../../proto/runtime_pb'; +import { API } from './API'; +import { TryLockRequest, UnlockRequest } from '../types/Lock'; + +export default class Lock extends API { + // A non-blocking method trying to get a lock with ttl + // expire is the time before expire. The time unit is second. + async tryLock(request: TryLockRequest): Promise { + const req = new TryLockRequestPB(); + req.setStoreName(request.storeName); + req.setResourceId(request.resourceId); + req.setLockOwner(request.lockOwner); + req.setExpire(request.expire); + + return new Promise((resolve, reject) => { + this.runtime.tryLock(req, this.createMetadata(request), (err, res: TryLockResponsePB) => { + if (err) return reject(err); + resolve(res.getSuccess()); + }); + }); + } + + async unLock(request: UnlockRequest): Promise { + const req = new UnlockRequestPB(); + req.setStoreName(request.storeName); + req.setResourceId(request.resourceId); + req.setLockOwner(request.lockOwner); + + return new Promise((resolve, reject) => { + this.runtime.unlock(req, this.createMetadata(request), (err, res: UnlockResponsePB) => { + if (err) return reject(err); + resolve(res.toObject()); + }); + }); + } + + uuid() { + return crypto.randomUUID(); + } +} diff --git a/sdk/js-sdk/src/client/PubSub.ts b/sdk/js-sdk/src/client/PubSub.ts new file mode 100644 index 0000000000..658cff0143 --- /dev/null +++ b/sdk/js-sdk/src/client/PubSub.ts @@ -0,0 +1,39 @@ +/* + * Copyright 2021 Layotto 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. + */ +import { + PublishEventRequest as PublishEventRequestPB, +} from '../../proto/runtime_pb'; +import { API } from './API'; +import { PublishEventRequest } from '../types/PubSub'; + +export default class PubSub extends API { + async publish(request: PublishEventRequest): Promise { + const req = new PublishEventRequestPB(); + req.setPubsubName(request.pubsubName); + req.setTopic(request.topic); + // https://mosn.io/layotto/#/zh/design/pubsub/pubsub-api-and-compability-with-dapr-component + // PublishRequest.Data 和 NewMessage.Data 里面放符合 CloudEvent 1.0 规范的 json 数据(能反序列化放进 map[string]interface{}) + req.setData(Buffer.from(JSON.stringify(request.data))); + req.setDataContentType('application/json'); + this.mergeMetadataToMap(req.getMetadataMap(), request.metadata); + + return new Promise((resolve, reject) => { + this.runtime.publishEvent(req, this.createMetadata(request), (err) => { + if (err) return reject(err); + resolve(); + }); + }); + } +} diff --git a/sdk/js-sdk/src/client/Sequencer.ts b/sdk/js-sdk/src/client/Sequencer.ts new file mode 100644 index 0000000000..ac94278852 --- /dev/null +++ b/sdk/js-sdk/src/client/Sequencer.ts @@ -0,0 +1,43 @@ +/* + * Copyright 2021 Layotto 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. + */ +import { + GetNextIdRequest as GetNextIdRequestPB, + GetNextIdResponse as GetNextIdResponsePB, + SequencerOptions as SequencerOptionsPB, +} from '../../proto/runtime_pb'; +import { API } from './API'; +import { GetNextIdRequest } from '../types/Sequencer'; + +export default class Sequencer extends API { + // Get next unique id with some auto-increment guarantee + async getNextId(request: GetNextIdRequest): Promise { + const req = new GetNextIdRequestPB(); + req.setStoreName(request.storeName); + req.setKey(request.key); + if (request.options) { + const sequencerOptions = new SequencerOptionsPB(); + sequencerOptions.setIncrement(request.options.increment); + req.setOptions(sequencerOptions); + } + this.mergeMetadataToMap(req.getMetadataMap(), request.metadata); + + return new Promise((resolve, reject) => { + this.runtime.getNextId(req, this.createMetadata(request), (err, res: GetNextIdResponsePB) => { + if (err) return reject(err); + resolve(res.getNextId()); + }); + }); + } +} diff --git a/sdk/js-sdk/src/client/State.ts b/sdk/js-sdk/src/client/State.ts new file mode 100644 index 0000000000..1f9a1065dc --- /dev/null +++ b/sdk/js-sdk/src/client/State.ts @@ -0,0 +1,210 @@ +/* + * Copyright 2021 Layotto 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. + */ +import { + SaveStateRequest as SaveStateRequestPB, + StateItem as StateItemPB, + Etag as EtagPB, + StateOptions as StateOptionsPB, + GetStateRequest as GetStateRequestPB, + GetStateResponse as GetStateResponsePB, + GetBulkStateRequest as GetBulkStateRequestPB, + DeleteStateRequest as DeleteStateRequestPB, + DeleteBulkStateRequest as DeleteBulkStateRequestPB, + ExecuteStateTransactionRequest as ExecuteStateTransactionRequestPB, + TransactionalStateOperation as TransactionalStateOperationPB, +} from '../../proto/runtime_pb'; +import { API } from './API'; +import { + DeleteBulkStateRequest, + DeleteStateItem, + DeleteStateRequest, + ExecuteStateTransactionRequest, + GetBulkStateRequest, + GetStateRequest, + ResponseStateItem, + SaveStateRequest, + StateItem, +} from '../types/State'; +import { isEmptyPBMessage, convertMapToKVString } from '../utils'; + +export default class State extends API { + // Saves an array of state objects + async save(request: SaveStateRequest): Promise { + let states = request.states; + if (!Array.isArray(states)) { + states = [states]; + } + const stateList = this.createStateItemPBList(states); + const req = new SaveStateRequestPB(); + req.setStoreName(request.storeName); + req.setStatesList(stateList); + + return new Promise((resolve, reject) => { + this.runtime.saveState(req, this.createMetadata(request), (err) => { + if (err) return reject(err); + resolve(); + }); + }); + } + + // Gets the state for a specific key + async get(request: GetStateRequest): Promise { + const req = new GetStateRequestPB(); + req.setStoreName(request.storeName); + req.setKey(request.key); + this.mergeMetadataToMap(req.getMetadataMap(), request.metadata); + + return new Promise((resolve, reject) => { + this.runtime.getState(req, this.createMetadata(request), (err, res: GetStateResponsePB) => { + if (err) return reject(err); + if (isEmptyPBMessage(res)) { + return resolve(null); + } + resolve({ + key: request.key, + value: res.getData_asU8(), + etag: res.getEtag(), + metadata: convertMapToKVString(res.getMetadataMap()), + }); + }); + }); + } + + // Gets a bulk of state items for a list of keys + async getBulk(request: GetBulkStateRequest): Promise { + const req = new GetBulkStateRequestPB(); + req.setStoreName(request.storeName); + req.setKeysList(request.keys); + if (request.parallelism) req.setParallelism(request.parallelism); + this.mergeMetadataToMap(req.getMetadataMap(), request.metadata); + + return new Promise((resolve, reject) => { + this.runtime.getBulkState(req, this.createMetadata(request), (err, res) => { + if (err) return reject(err); + const states: ResponseStateItem[] = []; + const itemsList = res.getItemsList(); + for (const item of itemsList) { + // pb.message.array[0] is key, pb.message.array[1] is value + if (isEmptyPBMessage(item, 1)) { + continue; + } + states.push({ + key: item.getKey(), + value: item.getData_asU8(), + etag: item.getEtag(), + metadata: convertMapToKVString(item.getMetadataMap()), + }); + } + resolve(states); + }); + }); + } + + // Deletes the state for a specific key + async delete(request: DeleteStateRequest): Promise { + const req = new DeleteStateRequestPB(); + req.setStoreName(request.storeName); + req.setKey(request.key); + if (request.etag) { + const etagInstance = new EtagPB(); + etagInstance.setValue(request.etag); + req.setEtag(etagInstance); + } + if (request.options) { + const optionsInstance = new StateOptionsPB(); + optionsInstance.setConcurrency(request.options.concurrency); + optionsInstance.setConsistency(request.options.consistency); + req.setOptions(optionsInstance); + } + this.mergeMetadataToMap(req.getMetadataMap(), request.metadata); + + return new Promise((resolve, reject) => { + this.runtime.deleteState(req, this.createMetadata(request), (err) => { + if (err) return reject(err); + resolve(); + }); + }); + } + + // Deletes a bulk of state items for a list of keys + async deleteBulk(request: DeleteBulkStateRequest): Promise { + const req = new DeleteBulkStateRequestPB(); + req.setStoreName(request.storeName); + const stateList = this.createStateItemPBList(request.states); + req.setStatesList(stateList); + + return new Promise((resolve, reject) => { + this.runtime.deleteBulkState(req, this.createMetadata(request), (err) => { + if (err) return reject(err); + resolve(); + }); + }); + } + + // Executes transactions for a specified store + async executeTransaction(request: ExecuteStateTransactionRequest): Promise { + const req = new ExecuteStateTransactionRequestPB(); + req.setStorename(request.storeName); + const operationsList: TransactionalStateOperationPB[] = []; + for (const operation of request.operations) { + const ops = new TransactionalStateOperationPB(); + ops.setOperationtype(operation.operationType); + const stateItem = this.createStateItemPB(operation.request); + ops.setRequest(stateItem); + operationsList.push(ops); + } + req.setOperationsList(operationsList); + this.mergeMetadataToMap(req.getMetadataMap(), request.metadata); + + return new Promise((resolve, reject) => { + this.runtime.executeStateTransaction(req, this.createMetadata(request), (err, _res) => { + if (err) return reject(err); + resolve(); + }); + }); + } + + private createStateItemPB(item: StateItem | DeleteStateItem): StateItemPB { + const stateItem = new StateItemPB(); + stateItem.setKey(item.key); + if ('value' in item) { + if (typeof item.value === 'string') { + stateItem.setValue(Buffer.from(item.value, 'utf8')); + } else { + stateItem.setValue(item.value); + } + } + if (item.etag !== undefined) { + const etag = new EtagPB(); + etag.setValue(item.etag); + stateItem.setEtag(etag); + } + if (item.options !== undefined) { + const options = new StateOptionsPB(); + options.setConcurrency(item.options.concurrency); + options.setConsistency(item.options.consistency); + stateItem.setOptions(options); + } + return stateItem; + } + + private createStateItemPBList(items: StateItem[] | DeleteStateItem[]): StateItemPB[] { + const list: StateItemPB[] = []; + for (const item of items) { + list.push(this.createStateItemPB(item)); + } + return list; + } +} diff --git a/sdk/js-sdk/src/index.ts b/sdk/js-sdk/src/index.ts new file mode 100644 index 0000000000..261769235d --- /dev/null +++ b/sdk/js-sdk/src/index.ts @@ -0,0 +1,25 @@ +/* + * Copyright 2021 Layotto 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. + */ +import Client from './client/Client'; +import Server from './server/Server'; +import * as utils from './utils'; +import * as RumtimeTypes from '../proto/runtime_pb'; + +export { + Client, + Server, + utils, + RumtimeTypes, +} diff --git a/sdk/js-sdk/src/server/GRPCServerImpl.ts b/sdk/js-sdk/src/server/GRPCServerImpl.ts new file mode 100644 index 0000000000..ed153f9b3b --- /dev/null +++ b/sdk/js-sdk/src/server/GRPCServerImpl.ts @@ -0,0 +1,101 @@ +/* + * Copyright 2021 Layotto 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. + * + */ +import { debuglog } from 'node:util'; +import * as grpc from '@grpc/grpc-js'; +import { Empty } from 'google-protobuf/google/protobuf/empty_pb'; +import { IAppCallbackServer } from '../../proto/appcallback_grpc_pb'; +import { + ListTopicSubscriptionsResponse, + TopicSubscription, + TopicEventRequest, + TopicEventResponse, +} from '../../proto/appcallback_pb'; +import { PubSubCallback } from '../types/PubSub'; + +const debug = debuglog('layotto:server:grpc'); + +// @ts-ignore +export default class GRPCServerImpl implements IAppCallbackServer { + private readonly _handlersTopics: { [key: string]: PubSubCallback }; + constructor() { + this._handlersTopics = {}; + } + + private createPubSubHandlerKey(pubsubName: string, topic: string): string { + return `${pubsubName}|${topic}`.toLowerCase(); + } + + registerPubSubSubscriptionHandler(pubsubName: string, topic: string, callback: PubSubCallback): void { + const handlerKey = this.createPubSubHandlerKey(pubsubName, topic); + if (this._handlersTopics[handlerKey]) { + throw new Error(`Topic: "${handlerKey}" handler was exists`); + } + this._handlersTopics[handlerKey] = callback; + debug('PubSub Event from topic: "%s" is registered', handlerKey); + } + + async onTopicEvent(call: grpc.ServerUnaryCall, + callback: grpc.sendUnaryData): Promise { + const req = call.request; + const res = new TopicEventResponse(); + const handlerKey = this.createPubSubHandlerKey(req.getPubsubName(), req.getTopic()); + + const handler = this._handlersTopics[handlerKey]; + if (!handler) { + debug('PubSub Event from topic: "%s" was not handled, drop now', handlerKey); + // FIXME: should retry? + res.setStatus(TopicEventResponse.TopicEventResponseStatus.DROP); + return callback(null, res); + } + + // https://mosn.io/layotto/#/zh/design/pubsub/pubsub-api-and-compability-with-dapr-component + // PublishRequest.Data 和 NewMessage.Data 里面放符合 CloudEvent 1.0 规范的 json 数据(能反序列化放进 map[string]interface{}) + const rawData = Buffer.from(req.getData_asU8()).toString(); + debug('PubSub Event from topic: "%s" raw data: %j, typeof %s', handlerKey, rawData, typeof rawData); + let data: string | object; + try { + data = JSON.parse(rawData); + } catch { + data = rawData; + } + + try { + await handler(data); + res.setStatus(TopicEventResponse.TopicEventResponseStatus.SUCCESS); + } catch (e) { + // FIXME: should retry? + debug('PubSub Event from topic: "%s" handler throw error: %s, drop now', handlerKey, e); + res.setStatus(TopicEventResponse.TopicEventResponseStatus.DROP); + } + + callback(null, res); + } + + async listTopicSubscriptions(_call: grpc.ServerUnaryCall, + callback: grpc.sendUnaryData): Promise { + const res = new ListTopicSubscriptionsResponse(); + const subscriptionsList = Object.keys(this._handlersTopics).map(key => { + const splits = key.split('|'); + const sub = new TopicSubscription(); + sub.setPubsubName(splits[0]); + sub.setTopic(splits[1]); + return sub; + }); + debug('listTopicSubscriptions call: %j', subscriptionsList); + res.setSubscriptionsList(subscriptionsList); + callback(null, res); + } +} diff --git a/sdk/js-sdk/src/server/PubSub.ts b/sdk/js-sdk/src/server/PubSub.ts new file mode 100644 index 0000000000..238dc8ad0b --- /dev/null +++ b/sdk/js-sdk/src/server/PubSub.ts @@ -0,0 +1,33 @@ +/* + * Copyright 2021 Layotto 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. + * + */ +import { debuglog } from 'node:util'; +import { PubSubCallback } from '../types/PubSub'; +import GRPCServerImpl from './GRPCServerImpl'; + +const debug = debuglog('layotto:server:pubsub'); + +export default class PubSub { + readonly server: GRPCServerImpl; + + constructor(server: GRPCServerImpl) { + this.server = server; + } + + async subscribe(pubsubName: string, topic: string, cb: PubSubCallback): Promise { + debug('Registering onTopicEvent Handler: PubSub = %s, Topic = %s', pubsubName, topic); + this.server.registerPubSubSubscriptionHandler(pubsubName, topic, cb); + } +} diff --git a/sdk/js-sdk/src/server/Server.ts b/sdk/js-sdk/src/server/Server.ts new file mode 100644 index 0000000000..cb9440385f --- /dev/null +++ b/sdk/js-sdk/src/server/Server.ts @@ -0,0 +1,68 @@ +/* + * Copyright 2021 Layotto 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. + */ +import { debuglog } from 'node:util'; +import { ServerCredentials, Server as GRPCServer } from '@grpc/grpc-js'; +import { AppCallbackService } from '../../proto/appcallback_grpc_pb'; +import GRPCServerImpl from './GRPCServerImpl'; +import PubSub from './PubSub'; +import { sleep } from '../utils'; + +const debug = debuglog('layotto:server:main'); + +export default class Server { + readonly port: string; + readonly pubsub: PubSub; + private readonly _serverImpl: GRPCServerImpl; + private readonly _server: GRPCServer; + + constructor(port: string = process.env.appcallback_GRPC_PORT ?? '9999') { + this.port = port; + this._serverImpl = new GRPCServerImpl(); + this.pubsub = new PubSub(this._serverImpl); + + this._server = new GRPCServer(); + // @ts-ignore + this._server.addService(AppCallbackService, this._serverImpl); + debug('AppCallbackService start and listen on port:%s', this.port); + } + + async start(): Promise { + await this._bind(); + this._server.start(); + await sleep(250); + } + + async close(): Promise { + return new Promise((resolve, reject) => { + this._server.tryShutdown((err) => { + if (err) return reject(err); + debug('Closed Server'); + resolve(); + }); + }); + } + + private async _bind(): Promise { + debug('Starting to listen on 127.0.0.1:%s', this.port); + return new Promise((resolve, reject) => { + const serverCredentials = ServerCredentials.createInsecure(); + this._server.bindAsync(`127.0.0.1:${this.port}`, serverCredentials, (err, port) => { + if (err) return reject(err); + debug('Listening on 127.0.0.1:%s', port); + resolve(); + }); + }) + } +} diff --git a/sdk/js-sdk/src/types/Binding.ts b/sdk/js-sdk/src/types/Binding.ts new file mode 100644 index 0000000000..06f2d193ef --- /dev/null +++ b/sdk/js-sdk/src/types/Binding.ts @@ -0,0 +1,13 @@ +import { KV, RequestWithMeta } from './common'; + +export type InvokeBindingRequest = RequestWithMeta<{ + name: string, + data: Uint8Array | string, + metadata: KV + operation: string, +}>; + +export type InvokeBindingResponse = { + data: Uint8Array, + metadata: KV +}; diff --git a/sdk/js-sdk/src/types/Configuration.ts b/sdk/js-sdk/src/types/Configuration.ts new file mode 100644 index 0000000000..3f18731281 --- /dev/null +++ b/sdk/js-sdk/src/types/Configuration.ts @@ -0,0 +1,70 @@ +/* + * Copyright 2021 Layotto 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. + */ +import { KV, RequestWithMeta } from './common'; + +export type GetConfigurationRequest = RequestWithMeta<{ + storeName: string; + appId: string; + keys: string[]; + group?: string; + label?: string; + subscribeUpdate?: boolean; + metadata?: KV; +}>; + +export type GetConfigurationItem = { + key: string; + content: string; + group: string; + label: string; + tags: KV; + metadata: KV; +}; + +export type SaveConfigurationItem = { + key: string, + content: string, + group?: string, + label?: string, + tags?: KV, + metadata?: KV, +}; + +export type SaveConfigurationRequest = RequestWithMeta<{ + storeName: string; + appId: string; + items: SaveConfigurationItem[]; + metadata?: KV; +}>; + +export type DeleteConfigurationRequest = RequestWithMeta<{ + storeName: string; + appId: string; + keys: string[]; + group?: string; + label?: string; + metadata?: KV; +}>; + +export type SubscribeConfigurationRequest = RequestWithMeta<{ + storeName: string; + appId: string; + keys: string[]; + group?: string; + label?: string; + metadata?: KV; + onData(items: GetConfigurationItem[]): void; + onClose(err?: Error): void; +}>; diff --git a/sdk/js-sdk/src/types/File.ts b/sdk/js-sdk/src/types/File.ts new file mode 100644 index 0000000000..06890b3a17 --- /dev/null +++ b/sdk/js-sdk/src/types/File.ts @@ -0,0 +1,21 @@ +import { Readable } from 'stream'; +import { RequireExactlyOne } from 'type-fest'; +import { KV, RequestWithMeta } from './common'; + +export type GetFileRequest = RequestWithMeta<{ + storeName: string; + name: string; + metadata?: KV; +}>; + +export type PutFileRequest = RequestWithMeta; +}, 'stream' | 'data'>>; + +export type ListFileResponse = { + names: string[]; +}; diff --git a/sdk/js-sdk/src/types/Hello.ts b/sdk/js-sdk/src/types/Hello.ts new file mode 100644 index 0000000000..89a9c0f77f --- /dev/null +++ b/sdk/js-sdk/src/types/Hello.ts @@ -0,0 +1,21 @@ +/* + * Copyright 2021 Layotto 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. + * + */ +import { RequestWithMeta } from './common'; + +export type SayHelloRequest = RequestWithMeta<{ + serviceName?: string; + name?: string; +}>; diff --git a/sdk/js-sdk/src/types/Invoker.ts b/sdk/js-sdk/src/types/Invoker.ts new file mode 100644 index 0000000000..32cd991dc3 --- /dev/null +++ b/sdk/js-sdk/src/types/Invoker.ts @@ -0,0 +1,29 @@ +/* + * Copyright 2021 Layotto 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. + */ +import { HTTPExtension } from '../../proto/runtime_pb'; +import { RequestWithMeta } from './common'; + +export type InvokeServiceRequest = RequestWithMeta<{ + id: string; + method: string; + httpVerb?: HTTPExtension.Verb; + data?: string | object; + contentType?: string, +}>; + +export type InvokeResponse = { + contentType: string; + content: string | Uint8Array | object; +}; diff --git a/sdk/js-sdk/src/types/Lock.ts b/sdk/js-sdk/src/types/Lock.ts new file mode 100644 index 0000000000..ccd2c63636 --- /dev/null +++ b/sdk/js-sdk/src/types/Lock.ts @@ -0,0 +1,28 @@ +/* + * Copyright 2021 Layotto 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. + */ +import { RequestWithMeta } from './common'; + +export type TryLockRequest = RequestWithMeta<{ + storeName: string; + resourceId: string; + lockOwner: string; + expire: number; +}>; + +export type UnlockRequest = RequestWithMeta<{ + storeName: string; + resourceId: string; + lockOwner: string; +}>; diff --git a/sdk/js-sdk/src/types/PubSub.ts b/sdk/js-sdk/src/types/PubSub.ts new file mode 100644 index 0000000000..6e61239a78 --- /dev/null +++ b/sdk/js-sdk/src/types/PubSub.ts @@ -0,0 +1,25 @@ +/* + * Copyright 2021 Layotto 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. + * + */ +import { RequestWithMeta, KV } from './common'; + +export type PubSubCallback = (data: any) => Promise; + +export type PublishEventRequest = RequestWithMeta<{ + pubsubName: string; + topic: string; + data: object; + metadata?: KV; +}>; diff --git a/sdk/js-sdk/src/types/Sequencer.ts b/sdk/js-sdk/src/types/Sequencer.ts new file mode 100644 index 0000000000..15f76ff246 --- /dev/null +++ b/sdk/js-sdk/src/types/Sequencer.ts @@ -0,0 +1,29 @@ +/* + * Copyright 2021 Layotto 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. + */ +import { + SequencerOptions as SequencerOptionsPB, +} from '../../proto/runtime_pb'; +import { KV, RequestWithMeta } from './common'; + +export type SequencerOptions = { + increment: SequencerOptionsPB.AutoIncrement; +}; + +export type GetNextIdRequest = RequestWithMeta<{ + storeName: string; + key: string; + options?: SequencerOptions; + metadata?: KV; +}>; diff --git a/sdk/js-sdk/src/types/State.ts b/sdk/js-sdk/src/types/State.ts new file mode 100644 index 0000000000..474ca4fb01 --- /dev/null +++ b/sdk/js-sdk/src/types/State.ts @@ -0,0 +1,92 @@ +/* + * Copyright 2021 Layotto 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. + */ +import { Except, SetOptional } from 'type-fest'; +import { + StateOptions as StateOptionsPB, +} from '../../proto/runtime_pb'; +import { KV, RequestWithMeta } from './common'; + +export type StateConcurrency = StateOptionsPB.StateConcurrency; +export type StateConsistency = StateOptionsPB.StateConsistency; + +export type StateOptions = { + concurrency: StateConcurrency; + consistency: StateConsistency; +}; + +export type StateItem = { + key: string; + value: Uint8Array | string; + etag: string; + options: StateOptions; +} + +// etag and options is optional on Save State Request +export type SaveStateItem = SetOptional; +export type DeleteStateItem = Except; + +export type ResponseStateItem = { + key: string; + value: Uint8Array; + etag: string; + metadata: KV; +} + +export enum StateOperationType { + Upsert = 'upsert', + Delete = 'delete', +} + +export type StateOperation = { + operationType: StateOperationType; + request: StateItem | DeleteStateItem; +}; + +export type SaveStateRequest = RequestWithMeta<{ + storeName: string; + states: SaveStateItem[] | SaveStateItem; +}>; + +export type GetStateRequest = RequestWithMeta<{ + storeName: string; + key: string; + metadata?: KV; +}>; + +export type GetBulkStateRequest = RequestWithMeta<{ + storeName: string; + keys: string[]; + parallelism?: number; + metadata?: KV; +}>; + +export type DeleteStateRequest = RequestWithMeta<{ + storeName: string; + key: string; + etag?: string; + options?: StateOptions + metadata?: KV; +}>; + +export type DeleteBulkStateRequest = RequestWithMeta<{ + storeName: string; + states: DeleteStateItem[]; +}>; + +export type ExecuteStateTransactionRequest = RequestWithMeta<{ + storeName: string; + operations: StateOperation[]; + metadata?: KV; +}>; diff --git a/sdk/js-sdk/src/types/common.ts b/sdk/js-sdk/src/types/common.ts new file mode 100644 index 0000000000..13b693c23e --- /dev/null +++ b/sdk/js-sdk/src/types/common.ts @@ -0,0 +1,36 @@ +/* + * Copyright 2021 Layotto 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. + */ + +import { Simplify } from 'type-fest'; + +export type KV = { + [key: string]: Type; +}; + +export type RequestWithMeta = Simplify; +}>; + +export type Map = { + set(k: Type, v: Type): unknown; +}; + +export function convertArrayToKVString(items: [string, string][]) { + const kv: KV = {}; + for (const item of items) { + kv[item[0]] = item[1]; + } + return kv; +}; diff --git a/sdk/js-sdk/src/utils.ts b/sdk/js-sdk/src/utils.ts new file mode 100644 index 0000000000..0b48fab5a9 --- /dev/null +++ b/sdk/js-sdk/src/utils.ts @@ -0,0 +1,57 @@ +/* + * Copyright 2021 Layotto 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. + */ +import { setTimeout } from 'timers/promises'; +import { Map as MapPB } from 'google-protobuf'; +import { KV } from './types/common'; + +export async function sleep(ms: number) { + await setTimeout(ms); +} + +// jspb.Message +// https://github.com/protocolbuffers/protobuf/blob/master/js/message.js#L233 +// +// use array to detect not exists or empty +// console.log(res) +// not exists +// { +// wrappers_: null, +// messageId_: undefined, +// arrayIndexOffset_: -1, +// array: [], +// pivot_: 1.7976931348623157e+308, +// convertedPrimitiveFields_: {} +// } +// empty data +// { +// wrappers_: null, +// messageId_: undefined, +// arrayIndexOffset_: -1, +// array: [ <1 empty item>, '1' ], +// pivot_: 1.7976931348623157e+308, +// convertedPrimitiveFields_: {} +// } +export function isEmptyPBMessage(item, emptyLength = 0) { + if (item.array.length === emptyLength) return true; + return false; +} + +export function convertMapToKVString(map: MapPB) { + const kv: KV = {}; + for (const [k, v] of map.entries()) { + kv[k] = v; + } + return kv; +}; diff --git a/sdk/js-sdk/test/unit/client/Binding.test.ts b/sdk/js-sdk/test/unit/client/Binding.test.ts new file mode 100644 index 0000000000..cb695bade9 --- /dev/null +++ b/sdk/js-sdk/test/unit/client/Binding.test.ts @@ -0,0 +1,34 @@ +/* + * Copyright 2021 Layotto 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. + */ +import { strict as assert } from 'assert'; +import { Client } from '../../../src'; + +describe('client/Binding.test.ts', () => { + let client: Client; + beforeAll(async () => { + client = new Client(); + }); + + it('should invoke success', async () => { + const res = await client.binding.invoke({ + name: 'http', + operation: 'get', + data: '😄ok,你好', + metadata: { token: '123' }, + }); + assert.match(Buffer.from(res.data).toString(), /{"name":"layotto",/) + assert.equal(res.metadata.statusCode, '200'); + }); +}); diff --git a/sdk/js-sdk/test/unit/client/Client.test.ts b/sdk/js-sdk/test/unit/client/Client.test.ts new file mode 100644 index 0000000000..e0de6baa46 --- /dev/null +++ b/sdk/js-sdk/test/unit/client/Client.test.ts @@ -0,0 +1,32 @@ +/* + * Copyright 2021 Layotto 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. + */ +import { strict as assert } from 'assert'; +import { Client } from '../../../src'; + +describe('client/Client.test.ts', () => { + let client: Client; + beforeAll(async () => { + client = new Client(); + const hello = await client.hello.sayHello(); + assert.equal(hello, 'greeting, '); + const hello2 = await client.hello.sayHello({ name: 'js-sdk' }); + assert.equal(hello2, 'greeting, js-sdk'); + }); + + it('should create a Client with default port', () => { + assert.equal(client.port, '34904'); + assert(client.state); + }); +}); diff --git a/sdk/js-sdk/test/unit/client/Configuration.test.ts b/sdk/js-sdk/test/unit/client/Configuration.test.ts new file mode 100644 index 0000000000..f4f31cc847 --- /dev/null +++ b/sdk/js-sdk/test/unit/client/Configuration.test.ts @@ -0,0 +1,155 @@ +/* + * Copyright 2021 Layotto 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. + */ +import { strict as assert } from 'assert'; +import { Client, utils } from '../../../src'; + +describe('client/Configuration.test.ts', () => { + let client: Client; + const storeName = 'etcd'; + const appId = 'js-sdk-unittest'; + const key1 = `hello1-${Date.now()}`; + const key2 = `hello2-${Date.now()}`; + + beforeAll(() => { + client = new Client(); + }); + + it('should save/get/delete configuration work', async () => { + let configs = await client.configuration.get({ + storeName, + appId, + keys: [key1, key2], + }); + assert.equal(configs.length, 0); + // save success + + await client.configuration.save({ + storeName, + appId, + items: [ + { + key: key1, + content: 'world1 哈哈,😄', + }, + { + key: key2, + content: 'world2 哈哈,😄', + }, + ], + }); + + configs = await client.configuration.get({ + storeName, + appId, + keys: [key1, key2], + }); + assert.equal(configs.length, 2); + assert.equal(configs[0].key, key1); + assert.equal(configs[0].content, 'world1 哈哈,😄'); + assert.equal(configs[1].key, key2); + assert.equal(configs[1].content, 'world2 哈哈,😄'); + + // delete them + await client.configuration.delete({ + storeName, + appId, + keys: [key1, key2], + }); + configs = await client.configuration.get({ + storeName, + appId, + keys: [key1, key2], + }); + assert.equal(configs.length, 0); + }); + + it('should subscribe work', async () => { + await client.configuration.save({ + storeName, + appId, + items: [ + { + key: key1, + content: 'world1 哈哈,😄', + }, + { + key: key2, + content: 'world2 哈哈,😄', + }, + ], + }); + const configs = await client.configuration.get({ + storeName, + appId, + keys: [key1, key2], + }); + assert.equal(configs.length, 2); + + let lastConfig = {}; + const call = client.configuration.subscribe({ + storeName, + appId, + keys: [key1, key2], + onData(items) { + // console.log('get items', items); + for (const item of items) { + lastConfig[item.key] = item.content; + } + }, + onClose(err) { + assert(!err); + // console.log('close, error: %s', err); + }, + }); + // console.log('call send', call.destroyed); + await utils.sleep(500); + await client.configuration.save({ + storeName, + appId, + items: [ + { + key: key1, + content: 'world1111 哈哈,😄', + }, + { + key: key2, + content: 'world2222 哈哈,😄', + }, + ], + }); + await utils.sleep(500); + assert.equal(lastConfig[key1], 'world1111 哈哈,😄'); + assert.equal(lastConfig[key2], 'world2222 哈哈,😄'); + + await client.configuration.save({ + storeName, + appId, + items: [ + { + key: key2, + content: 'world2222-update2 哈哈,😄', + }, + ], + }); + + await utils.sleep(500); + assert.equal(lastConfig[key1], 'world1111 哈哈,😄'); + assert.equal(lastConfig[key2], 'world2222-update2 哈哈,😄'); + + call.end(); + call.destroy(); + await utils.sleep(500); + }); +}); diff --git a/sdk/js-sdk/test/unit/client/File.test.ts b/sdk/js-sdk/test/unit/client/File.test.ts new file mode 100644 index 0000000000..472d6e6e65 --- /dev/null +++ b/sdk/js-sdk/test/unit/client/File.test.ts @@ -0,0 +1,200 @@ +/* + * Copyright 2021 Layotto 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. + */ +import { strict as assert } from 'assert'; +import { tmpdir } from 'os'; +import { existsSync, createWriteStream, createReadStream } from 'fs'; +import { mkdtemp, rm } from 'fs/promises'; +import { pipeline } from 'stream/promises'; +import { join } from 'path'; +import { Client, utils } from '../../../src'; + +describe.skip('client/File.test.ts', () => { + let client: Client; + let tmpfileDir: string; + const storeName = 'aliOSS'; + const bucket = 'layotto-js-sdk-local-test'; + + beforeAll(async () => { + client = new Client(); + tmpfileDir = await mkdtemp(join(tmpdir(), 'layotto-js-sdk-file-unittest-tmp-')); + }); + + afterAll(async () => { + // rm -rf + await rm(tmpfileDir, { recursive: true, force: true }); + }); + + describe('get()', () => { + it('should get a file stream success', async () => { + const filepath = join(tmpfileDir, 'getFileStream.jpg'); + console.log(filepath); + assert(!existsSync(filepath)); + + const stream = await client.file.get({ + storeName: 'aliOSS', + name: 'foo/tab3.jpg', + }); + assert(stream); + await pipeline( + stream, + createWriteStream(filepath), + ); + assert(existsSync(filepath)); + }, 30000); + + it('should get a file stream from minio', async () => { + const filepath = join(tmpfileDir, 'minio.jpg'); + console.log(filepath); + assert(!existsSync(filepath)); + + const stream = await client.file.get({ + storeName: 'minioOSS', + name: '1.jpg', + metadata: { + bucket, + endpoint: 'http://127.0.0.1:9000', + }, + }); + assert(stream); + await pipeline( + stream, + createWriteStream(filepath), + ); + assert(existsSync(filepath)); + }); + + it('should throw error when storeName not exists', async () => { + await assert.rejects( + async () => { + const filepath = join(tmpfileDir, 'storeName-not-exists.jpg'); + const stream = await client.file.get({ + storeName: 'notexists', + name: 'foo.jpg', + }); + await pipeline( + stream, + createWriteStream(filepath), + ); + }, + (err: any) => { + assert.equal(err.code, 3); + assert.equal(err.details, 'not supported store type: notexists'); + return true; + } + ) + }); + }); + + describe('put()', () => { + it('should put a file stream to server success', async () => { + const stream = createReadStream(__filename); + await client.file.put({ + storeName: 'aliOSS', + name: 'layotto_js_sdk_unittest.test.ts', + stream, + }); + }, 10000); + + it('should put bytes data to server success', async () => { + await client.file.put({ + storeName: 'aliOSS', + name: 'layotto_js_sdk_unittest.txt', + data: Buffer.from('哈哈😄,text still work', 'utf8'), + }); + }, 10000); + + it.skip('should work with minio', async () => { + await client.file.put({ + storeName: 'minio', + name: 'layotto_js_sdk_unittest.txt', + data: Buffer.from('哈哈😄,text still work', 'utf8'), + }); + }); + }); + + describe('list()', () => { + it('should list dir success', async () => { + const { names } = await client.file.list({ + storeName, + name: 'layotto-js-sdk-local-test', + metadata: { + Prefix: 'foo/', + }, + }); + console.log(names); + assert(names.length > 0); + }); + + it.skip('should work with minio', async () => { + const { names } = await client.file.list({ + storeName: 'minio', + name: 'layotto-js-sdk-local-test', + }); + console.log(names); + assert(names.length > 0); + }); + }); + + describe('delete()', () => { + it('should put bytes data to server and delete it success', async () => { + const name = `layotto_js_sdk_unittest_need_to_delete_${Date.now()}.txt`; + await client.file.put({ + storeName, + name, + data: Buffer.from('哈哈😄,text still work, delete it now!', 'utf8'), + }); + + await utils.sleep(500); + const filepath = join(tmpfileDir, name); + const stream = await client.file.get({ + storeName, + name, + }); + assert(stream); + await pipeline( + stream, + createWriteStream(filepath), + ); + + // delete it + await client.file.delete({ + storeName, + name, + }); + + // throw error + await assert.rejects( + async () => { + const filepath = join(tmpfileDir, name); + const stream = await client.file.get({ + storeName, + name, + }); + await pipeline( + stream, + createWriteStream(filepath), + ); + }, + (err: any) => { + // console.error(err); + assert.equal(err.code, 13); + assert.match(err.message, /StatusCode=404, ErrorCode=NoSuchKey/); + return true; + } + ); + }, 10000); + }); +}); + diff --git a/sdk/js-sdk/test/unit/client/Invoker.test.ts b/sdk/js-sdk/test/unit/client/Invoker.test.ts new file mode 100644 index 0000000000..79f9d893c0 --- /dev/null +++ b/sdk/js-sdk/test/unit/client/Invoker.test.ts @@ -0,0 +1,66 @@ +/* + * Copyright 2021 Layotto 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. + */ +import { strict as assert } from 'assert'; +import { Client } from '../../../src'; +import { RumtimeTypes } from '../../../src'; + +describe.skip('client/Invoker.test.ts', () => { + let client: Client; + + beforeAll(() => { + client = new Client(); + }); + + describe('invoke()', () => { + it('should invoke HelloService:1.0 with text success', async () => { + const state = await client.invoker.invoke({ + id: 'HelloService:1.0', + method: '/hello', + data: 'hello runtime with js-sdk', + }); + assert.equal(state, null); + }); + + it('should invoke HelloService:1.0 with json success', async () => { + const state = await client.invoker.invoke({ + id: 'HelloService:1.0', + method: '/hello', + httpVerb: RumtimeTypes.HTTPExtension.Verb.POST, + data: { + 'hello runtime': 'I am js-sdk client', + }, + }); + assert.equal(state, null); + }); + + it.skip('should invoke rpc success', async () => { + const res = await client.invoker.invoke({ + id: 'com.alipay.rpc.common.service.facade.SampleService:1.0', + method: 'echoStr', + // contentType: 'json', + data: { + signatures: ['java.lang.String'], + arguments: ['abc'], + }, + requestMeta: { + content_type: 'json', + upstream_content_type: 'hessian', + }, + }); + console.log(res); + }); + }); +}); + diff --git a/sdk/js-sdk/test/unit/client/Lock.test.ts b/sdk/js-sdk/test/unit/client/Lock.test.ts new file mode 100644 index 0000000000..396dcb3625 --- /dev/null +++ b/sdk/js-sdk/test/unit/client/Lock.test.ts @@ -0,0 +1,54 @@ +/* + * Copyright 2021 Layotto 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. + */ +import { strict as assert } from 'assert'; +import { Client, RumtimeTypes, utils } from '../../../src'; + +describe('Lock.test.ts', () => { + let client: Client; + const storeName = 'redis'; + + beforeAll(() => { + client = new Client(); + }); + + it('should unLock not exists resource', async () => { + const resourceId = 'js-sdk-lock-not-exists'; + const lockOwner = client.lock.uuid(); + const result = await client.lock.unLock({ storeName, resourceId, lockOwner }); + assert.equal(result.status, RumtimeTypes.UnlockResponse.Status.LOCK_UNEXIST); + }); + + it('should lock 2 seconds work', async () => { + const resourceId = 'js-sdk-lock-2-seconds'; + const lockOwner = client.lock.uuid(); + const success1 = await client.lock.tryLock({ storeName, resourceId, lockOwner, expire: 2 }); + assert.equal(success1, true); + const success2 = await client.lock.tryLock({ storeName, resourceId, lockOwner, expire: 2 }); + assert.equal(success2, false); + await utils.sleep(2500); + // wait for lock exipre after 2.5s + const success3 = await client.lock.tryLock({ storeName, resourceId, lockOwner, expire: 2 }); + assert.equal(success3, true); + + // unlock by other owner will fail + const lockOwner2 = client.lock.uuid(); + const status1 = await client.lock.unLock({ storeName, resourceId, lockOwner: lockOwner2 }); + assert.equal(status1.status, RumtimeTypes.UnlockResponse.Status.LOCK_BELONG_TO_OTHERS); + + // unlock success by owner + const status2 = await client.lock.unLock({ storeName, resourceId, lockOwner }); + assert.equal(status2.status, RumtimeTypes.UnlockResponse.Status.SUCCESS); + }); +}); diff --git a/sdk/js-sdk/test/unit/client/PubSub.test.ts b/sdk/js-sdk/test/unit/client/PubSub.test.ts new file mode 100644 index 0000000000..6047ab2c28 --- /dev/null +++ b/sdk/js-sdk/test/unit/client/PubSub.test.ts @@ -0,0 +1,33 @@ +/* + * Copyright 2021 Layotto 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. + */ +import { Client } from '../../../src'; + +describe('client/PubSub.test.ts', () => { + let client: Client; + beforeAll(async () => { + client = new Client(); + await client.hello.sayHello(); + }); + + it('should publish a topic work', async () => { + const pubsubName = 'redis'; + const topic = 'topic1-client-unit'; + const value = `bar, from js-sdk, ${Date()}`; + + await client.pubsub.publish({ + pubsubName, topic, data: { value }, + }); + }); +}); diff --git a/sdk/js-sdk/test/unit/client/Sequencer.test.ts b/sdk/js-sdk/test/unit/client/Sequencer.test.ts new file mode 100644 index 0000000000..273858f1b4 --- /dev/null +++ b/sdk/js-sdk/test/unit/client/Sequencer.test.ts @@ -0,0 +1,62 @@ +/* + * Copyright 2021 Layotto 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. + */ +import { strict as assert } from 'assert'; +import { Client, RumtimeTypes } from '../../../src'; + +describe('client/Sequencer.test.ts', () => { + let client: Client; + const storeName = 'etcd'; + + beforeAll(() => { + client = new Client(); + }); + + it('should get next id success', async () => { + let lastId = '0'; + let currentId = '0'; + const ids: string[] = []; + for (let i = 0; i < 20; i++) { + lastId = currentId; + currentId = await client.sequencer.getNextId({ + storeName, + key: 'user_info', + }); + assert(BigInt(currentId) > BigInt(lastId)); + ids.push(currentId); + } + assert.equal(ids.length, 20); + // console.log('ids: %j', ids); + }); + + it('should get next id with options increment:WEAK success', async () => { + let lastId = '0'; + let currentId = '0'; + const ids: string[] = []; + for (let i = 0; i < 20; i++) { + lastId = currentId; + currentId = await client.sequencer.getNextId({ + storeName, + key: 'user_info', + options: { + increment: RumtimeTypes.SequencerOptions.AutoIncrement.WEAK, + }, + }); + assert(BigInt(currentId) > BigInt(lastId)); + ids.push(currentId); + } + assert.equal(ids.length, 20); + // console.log('ids: %j', ids); + }); +}); diff --git a/sdk/js-sdk/test/unit/client/State.test.ts b/sdk/js-sdk/test/unit/client/State.test.ts new file mode 100644 index 0000000000..b5524db598 --- /dev/null +++ b/sdk/js-sdk/test/unit/client/State.test.ts @@ -0,0 +1,201 @@ +/* + * Copyright 2021 Layotto 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. + */ +import { strict as assert } from 'assert'; +import { Client } from '../../../src'; +import { StateOperation, StateOperationType } from '../../../src/types/State'; + +describe('client/State.test.ts', () => { + let client: Client; + const storeName = 'redis'; + + beforeAll(async () => { + client = new Client(); + }); + + describe('get(), getBulk()', () => { + it('should throw error when storeName not exists', async () => { + await assert.rejects( + async () => { + await client.state.get({ storeName: 'notexists-store', key: 'foo' }); + }, + (err: any) => { + // console.error(err); + assert.equal(err.code, 3); + assert.equal(err.details, 'state store notexists-store is not found'); + return true; + } + ); + }); + + it('should get not exists key', async () => { + const key = 'js-sdk-unit-notexists-' + Date.now(); + const state = await client.state.get({ storeName, key }); + assert.equal(state, null); + }); + + it('should get empty value', async () => { + const key = 'js-sdk-unit-empty-' + Date.now(); + await client.state.save({ + storeName, + states: { + key, + value: '', + }, + }); + const state = await client.state.get({ storeName, key }); + assert(state); + assert.equal(state.value.length, 0); + assert.equal(state.key, key); + assert.equal(state.etag, '1'); + }); + + it('should save one item and get key success', async () => { + const key = 'js-sdk-unit-' + Date.now(); + const value = `hello js-sdk, with 中文, 😄, at ${Date()}`; + await client.state.save({ + storeName, + states: { key, value }, + requestMeta: { traceid: `mock-traceid-unittest-${Date.now()}` }, + }); + const state = await client.state.get({ storeName, key }); + assert(state); + assert.equal(Buffer.from(state.value).toString(), value); + + await client.state.save({ + storeName, + states: { key, value }, + }); + const state2 = await client.state.get({ storeName, key }); + assert(state2); + assert.equal(Buffer.from(state2.value).toString(), value); + }); + + it('should save bulk items and get them success', async () => { + const items: { key: string, value: string }[] = []; + for (let i = 0; i < 20; i++) { + const key = `key${i}:js-sdk-unit-${Date.now()}`; + const value = `key${i}:hello js-sdk, with 中文, 😄, at ${Date()}`; + items.push({ key, value }); + } + await client.state.save({ + storeName, + states: items, + }); + + for (const { key, value } of items) { + const state = await client.state.get({ storeName, key }); + assert(state); + assert.equal(Buffer.from(state.value).toString(), value); + } + + const keys = items.map(i => i.key); + const states = await client.state.getBulk({ storeName, keys }); + assert.equal(states.length, items.length); + for (let i = 0; i < states.length; i++) { + const state = states[i]; + const item = items.find(i => i.key === state.key); + assert(item); + assert.equal(state.key, item.key); + assert.equal(Buffer.from(state.value).toString(), item.value); + } + + const states2 = await client.state.getBulk({ + storeName, keys, requestMeta: { foo: 'bar' }, + }); + assert.equal(states2.length, items.length); + }); + }); + + describe('delete(), deleteBulk()', () => { + it('should delete one key success', async () => { + const key = 'js-sdk-unit-delete-' + Date.now(); + // delete not exists + await client.state.delete({ storeName, key }); + + const value = `hello js-sdk, with 中文, 😄, at ${Date()}`; + await client.state.save({ storeName, states: { key, value } }); + + // delete exists + await client.state.delete({ storeName, key }); + + const state = await client.state.get({ storeName, key }); + assert.equal(state, null); + }); + + it('should delete bulk keys success', async () => { + const items: { key: string, value: string }[] = []; + const keys: { key: string }[] = []; + for (let i = 0; i < 20; i++) { + const key = `key${i}:js-sdk-unit-delete-bulk-${Date.now()}`; + const value = `key${i}:hello js-sdk, with 中文, 😄, at ${Date()}`; + items.push({ key, value }); + keys.push({ key }); + } + // delete not exists + await client.state.deleteBulk({ storeName, states: keys }); + let states = await client.state.getBulk({ + storeName, + keys: keys.map(i => i.key), + }); + assert.equal(states.length, 0); + + await client.state.save({ storeName, states: items }); + states = await client.state.getBulk({ + storeName, + keys: keys.map(i => i.key), + }); + assert.equal(states.length, 20); + + // delete 5 keys + await client.state.deleteBulk({ storeName, states: keys.slice(0, 5) }); + + states = await client.state.getBulk({ + storeName, + keys: keys.map(i => i.key), + }); + assert.equal(states.length, 15); + + // delete all exists + await client.state.deleteBulk({ storeName, states: keys }); + + states = await client.state.getBulk({ + storeName, + keys: keys.map(i => i.key), + }); + assert.equal(states.length, 0); + }); + }); + + describe('executeTransaction()', () => { + it('should upsert then delete success', async () => { + const operations: StateOperation[] = []; + const keys: { key: string }[] = []; + for (let i = 0; i < 20; i++) { + const key = `key${i}:js-sdk-unit-upsert-bulk-${Date.now()}`; + const value = `key${i}:hello js-sdk, with 中文, 😄, at ${Date()}`; + operations.push({ + operationType: StateOperationType.Upsert, + request: { key, value }, + }); + keys.push({ key }); + } + // not work now: mosn error + // 2021-10-24 14:06:52,590 [ERROR] [mosn.proxy.panic] [grpc] [unary] grpc unary handle panic: interface conversion: interface {} is *state.SetRequest, not state.SetRequest, method: /spec.proto.runtime.v1.Runtime/ExecuteStateTransaction, stack:goroutine 8213 [running]: + await client.state.executeTransaction({ storeName, operations }); + // const states = await client.state.getBulk(storeName, keys.map(i => i.key)); + // assert.equal(states.length, 20); + }); + }); +}); diff --git a/sdk/js-sdk/test/unit/server/PubSub.test.ts b/sdk/js-sdk/test/unit/server/PubSub.test.ts new file mode 100644 index 0000000000..1ef43c2ad3 --- /dev/null +++ b/sdk/js-sdk/test/unit/server/PubSub.test.ts @@ -0,0 +1,51 @@ +/* + * Copyright 2021 Layotto 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. + */ +import { strict as assert } from 'assert'; +import { execSync } from 'child_process'; +import { Server, Client, utils } from '../../../src'; + +describe.skip('server/PubSub.test.ts', () => { + let server: Server; + let client: Client; + const topic1 = 'topic1'; + beforeAll(async () => { + client = new Client(); + await client.hello.sayHello(); + server = new Server(); + await server.start(); + }); + + afterAll(async () => { + await server.close(); + }); + + it('should subscribe a topic work', async () => { + let lastData; + server.pubsub.subscribe('redis', topic1, async (data) => { + console.log('topic event data: %j', data); + lastData = data; + }); + + const cmd = `ts-node ${process.cwd()}/test/unit/server/publishClient.ts`; + const buf = execSync(cmd); + console.log(cmd, buf.toString()); + + for (let i = 0; i < 20; i++) { + await utils.sleep(1000); + if (lastData) break; + } + assert(lastData); + }, 20000); +}); diff --git a/sdk/js-sdk/test/unit/server/publishClient.ts b/sdk/js-sdk/test/unit/server/publishClient.ts new file mode 100644 index 0000000000..ca4f45a1d5 --- /dev/null +++ b/sdk/js-sdk/test/unit/server/publishClient.ts @@ -0,0 +1,32 @@ +/* + * Copyright 2021 Layotto 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. + */ +import { strict as assert } from 'assert' +import { Client } from '../../../src'; + +const client = new Client(); +assert(client); + +async function main() { + const pubsubName = 'redis'; + const topic = 'topic1'; + const value = `bar, from js-sdk, ${Date()}`; + + await client.pubsub.publish({ + pubsubName, topic, data: { value }, + }); + console.log('publish event sent: %j', value); +} + +main(); diff --git a/sdk/js-sdk/tsconfig.json b/sdk/js-sdk/tsconfig.json new file mode 100644 index 0000000000..75dee290f3 --- /dev/null +++ b/sdk/js-sdk/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "@eggjs/tsconfig", + "compilerOptions": { + "rootDir": "./src", + "outDir": "./dist", + "module": "CommonJS", + "moduleResolution": "Node" + }, + "include": [ "src" ], + "exclude": ["node_modules", "**/test/*"] +} diff --git a/sdk/js-sdk/tslint.json b/sdk/js-sdk/tslint.json new file mode 100644 index 0000000000..5f147fbc66 --- /dev/null +++ b/sdk/js-sdk/tslint.json @@ -0,0 +1,7 @@ +{ + "rules": { + "no-console": false, + "no-shadowed-variable": false + }, + "extends": ["tslint:recommended", "tslint-config-prettier"] +} diff --git a/spec/proto/runtime/v1/runtime.proto b/spec/proto/runtime/v1/runtime.proto index c68586838c..9249cd8562 100644 --- a/spec/proto/runtime/v1/runtime.proto +++ b/spec/proto/runtime/v1/runtime.proto @@ -163,7 +163,8 @@ message SequencerOptions { message GetNextIdResponse{ // The next unique id - int64 next_id = 1; + // Fixed int64 overflow problems on JavaScript https://github.com/improbable-eng/ts-protoc-gen#gotchas + int64 next_id = 1 [jstype = JS_STRING]; } message TryLockRequest {