From 72a64fde1b8ce2e86afc428cf211c5d7f1c90259 Mon Sep 17 00:00:00 2001 From: Tim Holm Date: Tue, 20 Feb 2024 19:36:42 +1100 Subject: [PATCH] feat!: v1 release (#219) Co-authored-by: Jye Cusch Co-authored-by: David Moore Co-authored-by: Ryan Cartwright --- .eslintrc.js | 20 +- .github/workflows/test.yaml | 2 + .gitignore | 4 +- jest.config.ts | 2 +- package.json | 26 +- .../documents/v0/collection-group-ref.test.ts | 82 - src/api/documents/v0/collection-group-ref.ts | 115 - src/api/documents/v0/collection-ref.ts | 85 - src/api/documents/v0/document-ref.test.ts | 183 - src/api/documents/v0/document-ref.ts | 153 - src/api/documents/v0/document-snapshot.ts | 28 - src/api/documents/v0/documents.test.ts | 67 - src/api/documents/v0/documents.ts | 73 - src/api/documents/v0/query.test.ts | 313 - src/api/documents/v0/query.ts | 274 - src/api/errors/aborted.ts | 26 - src/api/errors/already-exists.ts | 28 - src/api/errors/cancelled.ts | 31 - src/api/errors/data-loss.ts | 28 - src/api/errors/deadline-exceeded.ts | 28 - src/api/errors/failed-precondition.ts | 29 - src/api/errors/index.test.ts | 33 +- src/api/errors/index.ts | 57 +- src/api/errors/internal.ts | 28 - src/api/errors/invalid-argument.ts | 28 - src/api/errors/not-found.ts | 28 - src/api/errors/out-of-range.ts | 29 - src/api/errors/permission-denied.ts | 29 - src/api/errors/plugin-error.ts | 36 - src/api/errors/provider-error.ts | 172 + src/api/errors/resource-exhausted.ts | 29 - src/api/errors/unauthenticated.ts | 28 - src/api/errors/unavailable.ts | 28 - src/api/errors/unimplemented.ts | 28 - src/api/errors/unknown.ts | 28 - src/api/events/v0/events.test.ts | 170 - src/api/events/v0/events.ts | 246 - src/api/index.ts | 4 +- src/api/{documents => keyvalue}/index.ts | 2 +- .../{documents/v0 => keyvalue/v1}/index.ts | 3 +- .../v1/keyvalue.test.ts} | 12 +- src/api/keyvalue/v1/keyvalue.ts | 55 + src/api/keyvalue/v1/store.ts | 123 + src/api/queues/index.ts | 2 +- src/api/queues/{v0 => v1}/index.ts | 0 src/api/queues/{v0 => v1}/queues.test.ts | 154 +- src/api/queues/{v0 => v1}/queues.ts | 165 +- src/api/secrets/index.ts | 2 +- src/api/secrets/{v0 => v1}/index.ts | 0 src/api/secrets/{v0 => v1}/secret.test.ts | 48 +- src/api/secrets/{v0 => v1}/secrets.ts | 14 +- src/api/storage/index.ts | 2 +- src/api/storage/{v0 => v1}/index.ts | 0 src/api/storage/{v0 => v1}/storage.test.ts | 189 +- src/api/storage/{v0 => v1}/storage.ts | 64 +- src/api/{events => topics}/index.ts | 2 +- src/api/{events/v0 => topics/v1}/index.ts | 2 +- src/api/topics/v1/topics.test.ts | 79 + src/api/topics/v1/topics.ts | 175 + src/api/websocket/{v0 => v1}/index.ts | 0 src/api/websocket/{v0 => v1}/websocket.ts | 20 +- src/context/base.ts | 78 + src/context/bucket.ts | 129 + src/context/http.ts | 207 + src/context/index.ts | 19 + src/context/interval.ts | 62 + src/context/message.ts | 70 + src/context/websocket.ts | 126 + src/faas/index.ts | 14 - src/faas/v0/context.test.ts | 237 - src/faas/v0/context.ts | 703 - src/faas/v0/start.test.ts | 83 - src/faas/v0/start.ts | 439 - .../nitric/proto/apis/v1/apis_grpc_pb.d.ts | 28 + src/gen/nitric/proto/apis/v1/apis_grpc_pb.js | 80 + src/gen/nitric/proto/apis/v1/apis_pb.d.ts | 332 + src/gen/nitric/proto/apis/v1/apis_pb.js | 2595 ++++ .../deployments/v1/deployments_grpc_pb.d.ts | 27 + .../deployments/v1/deployments_grpc_pb.js | 87 + .../proto/deployments/v1/deployments_pb.d.ts} | 478 +- .../proto/deployments/v1/deployments_pb.js | 6681 ++++++++ .../nitric/proto/http/v1/http_grpc_pb.d.ts | 23 + src/gen/nitric/proto/http/v1/http_grpc_pb.js | 46 + src/gen/nitric/proto/http/v1/http_pb.d.ts | 63 + src/gen/nitric/proto/http/v1/http_pb.js | 472 + .../proto/keyvalue/v1/keyvalue_grpc_pb.d.ts | 34 + .../proto/keyvalue/v1/keyvalue_grpc_pb.js | 115 + .../nitric/proto/keyvalue/v1/keyvalue_pb.d.ts | 204 + .../nitric/proto/keyvalue/v1/keyvalue_pb.js | 1573 ++ .../proto/queues/v1/queues_grpc_pb.d.ts | 34 + .../nitric/proto/queues/v1/queues_grpc_pb.js | 115 + src/gen/nitric/proto/queues/v1/queues_pb.d.ts | 220 + .../proto/queues/v1/queues_pb.js} | 1113 +- .../proto/resources/v1/resources_grpc_pb.d.ts | 24 + .../proto/resources/v1/resources_grpc_pb.js | 49 + .../proto/resources/v1/resources_pb.d.ts} | 330 +- .../nitric/proto/resources/v1/resources_pb.js | 2655 ++++ .../proto/schedules/v1/schedules_grpc_pb.d.ts | 23 + .../proto/schedules/v1/schedules_grpc_pb.js | 45 + .../proto/schedules/v1/schedules_pb.d.ts | 214 + .../nitric/proto/schedules/v1/schedules_pb.js | 1569 ++ .../proto/secrets/v1/secrets_grpc_pb.d.ts | 29 + .../proto/secrets/v1/secrets_grpc_pb.js | 80 + .../proto/secrets/v1/secrets_pb.d.ts} | 5 +- .../proto/secrets/v1/secrets_pb.js} | 406 +- .../proto/storage/v1/storage_grpc_pb.d.ts | 65 + .../proto/storage/v1/storage_grpc_pb.js | 255 + .../proto/storage/v1/storage_pb.d.ts | 281 +- src/gen/nitric/proto/storage/v1/storage_pb.js | 3820 +++++ .../proto/topics/v1/topics_grpc_pb.d.ts | 40 + .../nitric/proto/topics/v1/topics_grpc_pb.js | 87 + src/gen/nitric/proto/topics/v1/topics_pb.d.ts | 243 + src/gen/nitric/proto/topics/v1/topics_pb.js | 1796 +++ .../websockets/v1/websockets_grpc_pb.d.ts | 50 + .../proto/websockets/v1/websockets_grpc_pb.js | 152 + .../proto/websockets/v1/websockets_pb.d.ts | 434 + .../proto/websockets/v1/websockets_pb.js | 3215 ++++ src/gen/proto/deploy/v1/deploy_grpc_pb.d.ts | 27 - src/gen/proto/deploy/v1/deploy_grpc_pb.js | 87 - src/gen/proto/deploy/v1/deploy_pb.js | 6138 -------- .../proto/document/v1/document_grpc_pb.d.ts | 43 - src/gen/proto/document/v1/document_grpc_pb.js | 184 - src/gen/proto/document/v1/document_pb.d.ts | 406 - src/gen/proto/document/v1/document_pb.js | 3170 ---- src/gen/proto/error/v1/error_grpc_pb.d.ts | 1 - src/gen/proto/error/v1/error_grpc_pb.js | 1 - src/gen/proto/error/v1/error_pb.d.ts | 62 - src/gen/proto/error/v1/error_pb.js | 472 - src/gen/proto/event/v1/event_grpc_pb.d.ts | 41 - src/gen/proto/event/v1/event_grpc_pb.js | 87 - src/gen/proto/event/v1/event_pb.d.ts | 145 - src/gen/proto/event/v1/event_pb.js | 1103 -- src/gen/proto/faas/v1/faas_grpc_pb.d.ts | 23 - src/gen/proto/faas/v1/faas_grpc_pb.js | 46 - src/gen/proto/faas/v1/faas_pb.d.ts | 867 -- src/gen/proto/faas/v1/faas_pb.js | 6535 -------- src/gen/proto/queue/v1/queue_grpc_pb.d.ts | 39 - src/gen/proto/queue/v1/queue_grpc_pb.js | 150 - src/gen/proto/queue/v1/queue_pb.d.ts | 243 - .../proto/resource/v1/resource_grpc_pb.d.ts | 29 - src/gen/proto/resource/v1/resource_grpc_pb.js | 83 - src/gen/proto/resource/v1/resource_pb.js | 3429 ---- src/gen/proto/secret/v1/secret_grpc_pb.d.ts | 29 - src/gen/proto/secret/v1/secret_grpc_pb.js | 81 - src/gen/proto/storage/v1/storage_grpc_pb.d.ts | 49 - src/gen/proto/storage/v1/storage_grpc_pb.js | 217 - src/gen/proto/storage/v1/storage_pb.js | 2301 --- .../proto/websocket/v1/websocket_grpc_pb.d.ts | 29 - .../proto/websocket/v1/websocket_grpc_pb.js | 81 - src/gen/proto/websocket/v1/websocket_pb.d.ts | 92 - src/gen/proto/websocket/v1/websocket_pb.js | 690 - src/gen/validate/validate_grpc_pb.d.ts | 1 - src/gen/validate/validate_grpc_pb.js | 1 - src/gen/validate/validate_pb.d.ts | 1629 -- src/gen/validate/validate_pb.js | 12932 ---------------- src/{faas/v0 => handlers}/handler.test.ts | 0 src/{faas/v0 => handlers}/handler.ts | 37 +- src/{faas/v0 => handlers}/index.ts | 2 - src/{faas/v0 => handlers}/json.ts | 6 +- src/index.ts | 5 +- src/resources/api.test.ts | 123 +- src/resources/api.ts | 321 +- src/resources/bucket.test.ts | 22 +- src/resources/bucket.ts | 188 +- src/resources/client.ts | 4 +- src/resources/collection.ts | 131 - src/resources/common.test.ts | 51 +- src/resources/common.ts | 73 +- src/resources/http.test.ts | 60 +- src/resources/http.ts | 62 +- src/resources/index.ts | 3 +- .../{collection.test.ts => keyvalue.test.ts} | 58 +- src/resources/keyvalue.ts | 123 + src/resources/oidc.ts | 134 + src/resources/queue.test.ts | 22 +- src/resources/queue.ts | 72 +- src/resources/schedule.test.ts | 114 +- src/resources/schedule.ts | 161 +- src/resources/secret.test.ts | 24 +- src/resources/secret.ts | 42 +- src/resources/topic.test.ts | 56 +- src/resources/topic.ts | 154 +- src/resources/websocket.test.ts | 24 +- src/resources/websocket.ts | 186 +- src/{faas/v0 => }/traceProvider.ts | 1 - src/types.ts | 33 - tsconfig.json | 2 +- yarn.lock | 1199 +- 188 files changed, 32527 insertions(+), 48574 deletions(-) delete mode 100644 src/api/documents/v0/collection-group-ref.test.ts delete mode 100644 src/api/documents/v0/collection-group-ref.ts delete mode 100644 src/api/documents/v0/collection-ref.ts delete mode 100644 src/api/documents/v0/document-ref.test.ts delete mode 100644 src/api/documents/v0/document-ref.ts delete mode 100644 src/api/documents/v0/document-snapshot.ts delete mode 100644 src/api/documents/v0/documents.test.ts delete mode 100644 src/api/documents/v0/documents.ts delete mode 100644 src/api/documents/v0/query.test.ts delete mode 100644 src/api/documents/v0/query.ts delete mode 100644 src/api/errors/aborted.ts delete mode 100644 src/api/errors/already-exists.ts delete mode 100644 src/api/errors/cancelled.ts delete mode 100644 src/api/errors/data-loss.ts delete mode 100644 src/api/errors/deadline-exceeded.ts delete mode 100644 src/api/errors/failed-precondition.ts delete mode 100644 src/api/errors/internal.ts delete mode 100644 src/api/errors/invalid-argument.ts delete mode 100644 src/api/errors/not-found.ts delete mode 100644 src/api/errors/out-of-range.ts delete mode 100644 src/api/errors/permission-denied.ts delete mode 100644 src/api/errors/plugin-error.ts create mode 100644 src/api/errors/provider-error.ts delete mode 100644 src/api/errors/resource-exhausted.ts delete mode 100644 src/api/errors/unauthenticated.ts delete mode 100644 src/api/errors/unavailable.ts delete mode 100644 src/api/errors/unimplemented.ts delete mode 100644 src/api/errors/unknown.ts delete mode 100644 src/api/events/v0/events.test.ts delete mode 100644 src/api/events/v0/events.ts rename src/api/{documents => keyvalue}/index.ts (96%) rename src/api/{documents/v0 => keyvalue/v1}/index.ts (89%) rename src/api/{documents/v0/constants.ts => keyvalue/v1/keyvalue.test.ts} (66%) create mode 100644 src/api/keyvalue/v1/keyvalue.ts create mode 100644 src/api/keyvalue/v1/store.ts rename src/api/queues/{v0 => v1}/index.ts (100%) rename src/api/queues/{v0 => v1}/queues.test.ts (58%) rename src/api/queues/{v0 => v1}/queues.ts (54%) rename src/api/secrets/{v0 => v1}/index.ts (100%) rename src/api/secrets/{v0 => v1}/secret.test.ts (82%) rename src/api/secrets/{v0 => v1}/secrets.ts (95%) rename src/api/storage/{v0 => v1}/index.ts (100%) rename src/api/storage/{v0 => v1}/storage.test.ts (79%) rename src/api/storage/{v0 => v1}/storage.ts (85%) rename src/api/{events => topics}/index.ts (96%) rename src/api/{events/v0 => topics/v1}/index.ts (95%) create mode 100644 src/api/topics/v1/topics.test.ts create mode 100644 src/api/topics/v1/topics.ts rename src/api/websocket/{v0 => v1}/index.ts (100%) rename src/api/websocket/{v0 => v1}/websocket.ts (81%) create mode 100644 src/context/base.ts create mode 100644 src/context/bucket.ts create mode 100644 src/context/http.ts create mode 100644 src/context/index.ts create mode 100644 src/context/interval.ts create mode 100644 src/context/message.ts create mode 100644 src/context/websocket.ts delete mode 100644 src/faas/index.ts delete mode 100644 src/faas/v0/context.test.ts delete mode 100644 src/faas/v0/context.ts delete mode 100644 src/faas/v0/start.test.ts delete mode 100644 src/faas/v0/start.ts create mode 100644 src/gen/nitric/proto/apis/v1/apis_grpc_pb.d.ts create mode 100644 src/gen/nitric/proto/apis/v1/apis_grpc_pb.js create mode 100644 src/gen/nitric/proto/apis/v1/apis_pb.d.ts create mode 100644 src/gen/nitric/proto/apis/v1/apis_pb.js create mode 100644 src/gen/nitric/proto/deployments/v1/deployments_grpc_pb.d.ts create mode 100644 src/gen/nitric/proto/deployments/v1/deployments_grpc_pb.js rename src/gen/{proto/deploy/v1/deploy_pb.d.ts => nitric/proto/deployments/v1/deployments_pb.d.ts} (65%) create mode 100644 src/gen/nitric/proto/deployments/v1/deployments_pb.js create mode 100644 src/gen/nitric/proto/http/v1/http_grpc_pb.d.ts create mode 100644 src/gen/nitric/proto/http/v1/http_grpc_pb.js create mode 100644 src/gen/nitric/proto/http/v1/http_pb.d.ts create mode 100644 src/gen/nitric/proto/http/v1/http_pb.js create mode 100644 src/gen/nitric/proto/keyvalue/v1/keyvalue_grpc_pb.d.ts create mode 100644 src/gen/nitric/proto/keyvalue/v1/keyvalue_grpc_pb.js create mode 100644 src/gen/nitric/proto/keyvalue/v1/keyvalue_pb.d.ts create mode 100644 src/gen/nitric/proto/keyvalue/v1/keyvalue_pb.js create mode 100644 src/gen/nitric/proto/queues/v1/queues_grpc_pb.d.ts create mode 100644 src/gen/nitric/proto/queues/v1/queues_grpc_pb.js create mode 100644 src/gen/nitric/proto/queues/v1/queues_pb.d.ts rename src/gen/{proto/queue/v1/queue_pb.js => nitric/proto/queues/v1/queues_pb.js} (51%) create mode 100644 src/gen/nitric/proto/resources/v1/resources_grpc_pb.d.ts create mode 100644 src/gen/nitric/proto/resources/v1/resources_grpc_pb.js rename src/gen/{proto/resource/v1/resource_pb.d.ts => nitric/proto/resources/v1/resources_pb.d.ts} (56%) create mode 100644 src/gen/nitric/proto/resources/v1/resources_pb.js create mode 100644 src/gen/nitric/proto/schedules/v1/schedules_grpc_pb.d.ts create mode 100644 src/gen/nitric/proto/schedules/v1/schedules_grpc_pb.js create mode 100644 src/gen/nitric/proto/schedules/v1/schedules_pb.d.ts create mode 100644 src/gen/nitric/proto/schedules/v1/schedules_pb.js create mode 100644 src/gen/nitric/proto/secrets/v1/secrets_grpc_pb.d.ts create mode 100644 src/gen/nitric/proto/secrets/v1/secrets_grpc_pb.js rename src/gen/{proto/secret/v1/secret_pb.d.ts => nitric/proto/secrets/v1/secrets_pb.d.ts} (97%) rename src/gen/{proto/secret/v1/secret_pb.js => nitric/proto/secrets/v1/secrets_pb.js} (58%) create mode 100644 src/gen/nitric/proto/storage/v1/storage_grpc_pb.d.ts create mode 100644 src/gen/nitric/proto/storage/v1/storage_grpc_pb.js rename src/gen/{ => nitric}/proto/storage/v1/storage_pb.d.ts (51%) create mode 100644 src/gen/nitric/proto/storage/v1/storage_pb.js create mode 100644 src/gen/nitric/proto/topics/v1/topics_grpc_pb.d.ts create mode 100644 src/gen/nitric/proto/topics/v1/topics_grpc_pb.js create mode 100644 src/gen/nitric/proto/topics/v1/topics_pb.d.ts create mode 100644 src/gen/nitric/proto/topics/v1/topics_pb.js create mode 100644 src/gen/nitric/proto/websockets/v1/websockets_grpc_pb.d.ts create mode 100644 src/gen/nitric/proto/websockets/v1/websockets_grpc_pb.js create mode 100644 src/gen/nitric/proto/websockets/v1/websockets_pb.d.ts create mode 100644 src/gen/nitric/proto/websockets/v1/websockets_pb.js delete mode 100644 src/gen/proto/deploy/v1/deploy_grpc_pb.d.ts delete mode 100644 src/gen/proto/deploy/v1/deploy_grpc_pb.js delete mode 100644 src/gen/proto/deploy/v1/deploy_pb.js delete mode 100644 src/gen/proto/document/v1/document_grpc_pb.d.ts delete mode 100644 src/gen/proto/document/v1/document_grpc_pb.js delete mode 100644 src/gen/proto/document/v1/document_pb.d.ts delete mode 100644 src/gen/proto/document/v1/document_pb.js delete mode 100644 src/gen/proto/error/v1/error_grpc_pb.d.ts delete mode 100644 src/gen/proto/error/v1/error_grpc_pb.js delete mode 100644 src/gen/proto/error/v1/error_pb.d.ts delete mode 100644 src/gen/proto/error/v1/error_pb.js delete mode 100644 src/gen/proto/event/v1/event_grpc_pb.d.ts delete mode 100644 src/gen/proto/event/v1/event_grpc_pb.js delete mode 100644 src/gen/proto/event/v1/event_pb.d.ts delete mode 100644 src/gen/proto/event/v1/event_pb.js delete mode 100644 src/gen/proto/faas/v1/faas_grpc_pb.d.ts delete mode 100644 src/gen/proto/faas/v1/faas_grpc_pb.js delete mode 100644 src/gen/proto/faas/v1/faas_pb.d.ts delete mode 100644 src/gen/proto/faas/v1/faas_pb.js delete mode 100644 src/gen/proto/queue/v1/queue_grpc_pb.d.ts delete mode 100644 src/gen/proto/queue/v1/queue_grpc_pb.js delete mode 100644 src/gen/proto/queue/v1/queue_pb.d.ts delete mode 100644 src/gen/proto/resource/v1/resource_grpc_pb.d.ts delete mode 100644 src/gen/proto/resource/v1/resource_grpc_pb.js delete mode 100644 src/gen/proto/resource/v1/resource_pb.js delete mode 100644 src/gen/proto/secret/v1/secret_grpc_pb.d.ts delete mode 100644 src/gen/proto/secret/v1/secret_grpc_pb.js delete mode 100644 src/gen/proto/storage/v1/storage_grpc_pb.d.ts delete mode 100644 src/gen/proto/storage/v1/storage_grpc_pb.js delete mode 100644 src/gen/proto/storage/v1/storage_pb.js delete mode 100644 src/gen/proto/websocket/v1/websocket_grpc_pb.d.ts delete mode 100644 src/gen/proto/websocket/v1/websocket_grpc_pb.js delete mode 100644 src/gen/proto/websocket/v1/websocket_pb.d.ts delete mode 100644 src/gen/proto/websocket/v1/websocket_pb.js delete mode 100644 src/gen/validate/validate_grpc_pb.d.ts delete mode 100644 src/gen/validate/validate_grpc_pb.js delete mode 100644 src/gen/validate/validate_pb.d.ts delete mode 100644 src/gen/validate/validate_pb.js rename src/{faas/v0 => handlers}/handler.test.ts (100%) rename src/{faas/v0 => handlers}/handler.ts (76%) rename src/{faas/v0 => handlers}/index.ts (92%) rename src/{faas/v0 => handlers}/json.ts (89%) delete mode 100644 src/resources/collection.ts rename src/resources/{collection.test.ts => keyvalue.test.ts} (65%) create mode 100644 src/resources/keyvalue.ts create mode 100644 src/resources/oidc.ts rename src/{faas/v0 => }/traceProvider.ts (99%) diff --git a/.eslintrc.js b/.eslintrc.js index aba61082..42c9062d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,15 +1,10 @@ module.exports = { parser: '@typescript-eslint/parser', - ignorePatterns: [ - 'src/gen/**/*.ts', - 'src/**/*.test.ts', - ], + ignorePatterns: ['src/gen/**/*.ts', 'src/**/*.test.ts'], env: { node: true, }, - plugins: [ - "jsdoc", - ], + plugins: ['jsdoc'], extends: [ 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended', @@ -20,5 +15,16 @@ module.exports = { '@typescript-eslint/ban-ts-ignore': 'off', '@typescript-eslint/no-explicit-any': 'off', 'jsdoc/tag-lines': 'off', // not documented on jsdoc plugin site, unsure how to correct. + '@typescript-eslint/no-unused-vars': [ + 'error', + { args: 'all', argsIgnorePattern: '^_' }, + ], + 'no-warning-comments': [ + 'error', + { + terms: ['todo', 'fixme'], + location: 'anywhere', + }, + ], }, }; diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 0f2715bd..d72557f4 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -30,6 +30,8 @@ jobs: git diff --cached --quiet - name: Check Formatting run: yarn prettier:check + - name: Linting + run: yarn lint - name: Build run: yarn build - name: Run tests diff --git a/.gitignore b/.gitignore index 7866e5c5..5bb05dea 100644 --- a/.gitignore +++ b/.gitignore @@ -92,4 +92,6 @@ typings/ lib/ -contracts/ \ No newline at end of file +contracts/ + +nitric/** \ No newline at end of file diff --git a/jest.config.ts b/jest.config.ts index 75571764..4a5cf51b 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -1,4 +1,4 @@ -import { pathsToModuleNameMapper } from 'ts-jest'; +import { pathsToModuleNameMapper } from 'ts-jest/utils'; import { compilerOptions } from './tsconfig.json'; module.exports = { diff --git a/package.json b/package.json index 158de002..d64b8dd3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@nitric/sdk", "description": "Nitric NodeJS client sdk", - "nitric": "v0.33.0", + "nitric": "v1.0.0", "author": "Nitric ", "repository": "https://github.com/nitrictech/node-sdk", "main": "lib/index.js", @@ -21,9 +21,10 @@ "license:header:add": "license-check-and-add add -f ./licenseconfig.json", "license:header:check": "license-check-and-add check -f ./licenseconfig.json", "license:check": "licensee --production", - "download:contracts": "curl -L https://github.com/nitrictech/nitric/releases/download/${npm_package_nitric}/contracts.tgz -o contracts.tgz && tar xvzf contracts.tgz && rm contracts.tgz", + "download:contracts": "curl -L https://github.com/nitrictech/nitric/releases/download/${npm_package_nitric}/proto.tgz -o nitric.tgz && tar xvzf nitric.tgz && rm nitric.tgz", + "download:contracts:local": "rm -r ./nitric && mkdir ./nitric && cp -r $NITRIC_CORE_HOME/nitric/proto ./nitric", "gen:proto": "yarn run download:contracts && yarn run gen:sources", - "gen:sources": "mkdir -p ./src/gen && grpc_tools_node_protoc --ts_out=service=grpc-node,mode=grpc-js:./src/gen --js_out=import_style=commonjs,binary:./src/gen --grpc_out=grpc_js:./src/gen -I ./contracts ./contracts/**/*.proto ./contracts/proto/**/*/*.proto" + "gen:sources": "mkdir -p ./src/gen && grpc_tools_node_protoc --ts_out=service=grpc-node,mode=grpc-js:./src/gen --js_out=import_style=commonjs,binary:./src/gen --grpc_out=grpc_js:./src/gen -I ./ ./nitric/proto/**/*/*.proto" }, "contributors": [ "Jye Cusch ", @@ -31,16 +32,16 @@ "David Moore " ], "dependencies": { - "@grpc/grpc-js": "1.8.1", + "@grpc/grpc-js": "1.10.0", "@nitric/grpc-error-status": "^0.0.2", "@opentelemetry/api": "^1.4.1", - "@opentelemetry/exporter-trace-otlp-http": "^0.36.1", - "@opentelemetry/instrumentation": "^0.36.1", - "@opentelemetry/instrumentation-grpc": "^0.36.1", - "@opentelemetry/instrumentation-http": "^0.36.1", - "@opentelemetry/resources": "^1.10.1", - "@opentelemetry/sdk-trace-node": "^1.10.1", - "@opentelemetry/semantic-conventions": "^1.10.1", + "@opentelemetry/exporter-trace-otlp-http": "^0.48.0", + "@opentelemetry/instrumentation": "^0.48.0", + "@opentelemetry/instrumentation-grpc": "^0.48.0", + "@opentelemetry/instrumentation-http": "^0.48.0", + "@opentelemetry/resources": "^1.21.0", + "@opentelemetry/sdk-trace-node": "^1.21.0", + "@opentelemetry/semantic-conventions": "^1.21.0", "google-protobuf": "3.14.0", "portfinder": "^1.0.32", "tslib": "^2.1.0" @@ -57,11 +58,12 @@ "devDependencies": { "@types/google-protobuf": "^3.15.6", "@types/jest": "^26.0.15", + "@types/node": "^20.11.17", "@typescript-eslint/eslint-plugin": "^4.22.0", "@typescript-eslint/parser": "^4.22.0", "codecov": "^3.8.3", "eslint": "^7.24.0", - "eslint-plugin-jsdoc": "^40.1.0", + "eslint-plugin-jsdoc": "^46.9.1", "glob-run": "^0.1.7", "grpc-tools": "^1.11.3", "husky": "^6.0.0", diff --git a/src/api/documents/v0/collection-group-ref.test.ts b/src/api/documents/v0/collection-group-ref.test.ts deleted file mode 100644 index bb186e01..00000000 --- a/src/api/documents/v0/collection-group-ref.test.ts +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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 { CollectionGroupRef } from './collection-group-ref'; -import { CollectionRef } from './collection-ref'; - -// limitations under the License. -describe('Collection Group Ref Tests', () => { - describe('constructor', () => { - const colGrpRef = new CollectionGroupRef(null, 'test', null); - - it('should have the provided document client', () => { - expect(colGrpRef['documentClient']).toBeNull(); - }); - - it('should have the provided collection name', () => { - expect(colGrpRef.name).toEqual('test'); - }); - - it('should have the provided parent', () => { - expect(colGrpRef.parent).toBeNull(); - }); - }); - - describe('collection', () => { - const colGrpRef = new CollectionGroupRef(null, 'test', null); - const subColGrpRef = colGrpRef.collection('sub-test'); - - it('should share its parents document service client', () => { - expect(subColGrpRef['documentClient']).toEqual( - colGrpRef['documentClient'] - ); - }); - - it('should have the provided name', () => { - expect(subColGrpRef.name).toEqual('sub-test'); - }); - - it("should have a reference to it's parent", () => { - expect(subColGrpRef.parent).toEqual(colGrpRef); - }); - }); - - describe('query', () => { - const colGrpRef = new CollectionGroupRef(null, 'test', null); - const subColGrpRef = colGrpRef.collection('sub-test'); - - const q = subColGrpRef.query(); - - it('should have a reference to the sub collection', () => { - expect(q.collection.name).toEqual('sub-test'); - }); - - it('should have a reference to the parent collection', () => { - expect(q.collection.parent.parent.name).toEqual('test'); - }); - - it('should have a blank document reference', () => { - expect(q.collection.parent.id).toEqual(''); - }); - }); - - describe('fromCollectionRef', () => { - describe('no children', () => { - const colref = new CollectionRef(null, 'test'); - - it('should have the collections name', () => { - expect(colref.name).toEqual('test'); - }); - }); - }); -}); diff --git a/src/api/documents/v0/collection-group-ref.ts b/src/api/documents/v0/collection-group-ref.ts deleted file mode 100644 index e1396f49..00000000 --- a/src/api/documents/v0/collection-group-ref.ts +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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 { DocumentServiceClient } from '@nitric/api/proto/document/v1/document_grpc_pb'; -import { InvalidArgumentError } from '../../errors'; -import { CollectionRef } from './collection-ref'; -import { MAX_COLLECTION_DEPTH } from './constants'; -import { DocumentRef, DocumentStructure } from './document-ref'; -import { Query } from './query'; - -const NIL_DOC_ID = ''; - -/** - * CollectionGroupRef - * - * Provides a Document API CollectionGroupRef class. - */ -export class CollectionGroupRef { - private documentClient: DocumentServiceClient; - public readonly parent: CollectionGroupRef; - public readonly name: string; - - constructor( - documentClient: DocumentServiceClient, - name: string, - parent?: CollectionGroupRef - ) { - this.documentClient = documentClient; - this.name = name; - this.parent = parent; - } - - /** - * Create a CollectionGroupRef referencing a sub-collection of this collection. - * - * @param name of the sub-collection - * @returns a reference to the sub-collection - */ - public collection( - name: string - ): CollectionGroupRef { - if (this.depth() >= MAX_COLLECTION_DEPTH) { - throw new Error( - `Maximum collection depth ${MAX_COLLECTION_DEPTH} exceeded` - ); - } - return new CollectionGroupRef(this.documentClient, name, this); - } - - /** - * Create a new collection query object. - * - * @returns a new collection query object - */ - public query(): Query { - return new Query(this.documentClient, this.toCollectionRef()); - } - - private depth(): number { - if (this.parent) { - return this.parent.depth() + 1; - } - - return 0; - } - - private toCollectionRef(): CollectionRef { - if (this.parent) { - return new CollectionRef( - this.documentClient, - this.name, - new DocumentRef( - this.documentClient, - this.parent.toCollectionRef(), - NIL_DOC_ID - ) - ); - } - - return new CollectionRef(this.documentClient, this.name); - } - - /** - * Creates a collection group reference from a collection reference. - * - * @internal - * @param ref a collection reference. - * @param dc a document service client. - * @returns a collection group reference. - */ - public static fromCollectionRef( - ref: CollectionRef, - dc: DocumentServiceClient - ): CollectionGroupRef { - if (ref.parent) { - return new CollectionGroupRef( - dc, - ref.name, - CollectionGroupRef.fromCollectionRef(ref.parent.parent, dc) - ); - } - - return new CollectionGroupRef(dc, ref.name); - } -} diff --git a/src/api/documents/v0/collection-ref.ts b/src/api/documents/v0/collection-ref.ts deleted file mode 100644 index ac65d819..00000000 --- a/src/api/documents/v0/collection-ref.ts +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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 { Collection } from '@nitric/api/proto/document/v1/document_pb'; -import { DocumentServiceClient } from '@nitric/api/proto/document/v1/document_grpc_pb'; -import { Query } from './query'; -import { DocumentRef, DocumentStructure } from './document-ref'; -import { CollectionGroupRef } from './collection-group-ref'; - -/** - * CollectionRef - * - * Provides a Document API CollectionRef class. - */ -export class CollectionRef { - private documentClient: DocumentServiceClient; - public readonly name: string; - public readonly parent?: DocumentRef; - - constructor( - documentClient: DocumentServiceClient, - name: string, - parent?: DocumentRef - ) { - this.documentClient = documentClient; - this.name = name; - this.parent = parent; - } - - /** - * Return a reference to a sub-collection within the documents of this collection. - * - * Useful when querying sub-collection documents across all/many parent documents. E.g. Querying landmarks from multiple cities. - * - * @param name the name of the collection - * @returns a reference to all sub-collections matching the name provided. - */ - public collection(name: string): CollectionGroupRef { - return CollectionGroupRef.fromCollectionRef( - this, - this.documentClient - ).collection(name); - } - - /** - * Return a reference to a document in the collection. - * - * @param id the unique id of the document - * @returns new collection document reference - */ - public doc(id: string): DocumentRef { - return new DocumentRef(this.documentClient, this, id); - } - - /** - * Create a new collection query object. - * - * @returns a new collection query object. - */ - public query(): Query { - return new Query(this.documentClient, this); - } - - private toWire(): Collection { - const col = new Collection(); - - col.setName(this.name); - - if (this.parent) { - col.setParent(this.parent['toWire']()); - } - - return col; - } -} diff --git a/src/api/documents/v0/document-ref.test.ts b/src/api/documents/v0/document-ref.test.ts deleted file mode 100644 index 42a0a945..00000000 --- a/src/api/documents/v0/document-ref.test.ts +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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 { Struct } from 'google-protobuf/google/protobuf/struct_pb'; -import { DocumentServiceClient as GrpcKeyDocumentsClient } from '@nitric/api/proto/document/v1/document_grpc_pb'; -import { - DocumentGetResponse, - Document, -} from '@nitric/api/proto/document/v1/document_pb'; -import { InvalidArgumentError, UnimplementedError } from '../../errors'; -import { Documents, documents } from './documents'; - -describe('Document Ref Tests', () => { - describe('Given DocumentServiceClient.Get throws an error', () => { - const MOCK_ERROR = { - code: 2, - message: 'UNIMPLEMENTED', - }; - let documentsClient: Documents; - let getMock; - - beforeAll(() => { - getMock = jest - .spyOn(GrpcKeyDocumentsClient.prototype, 'get') - .mockImplementation((request, callback: any) => { - callback(MOCK_ERROR, null); - - return null as any; - }); - documentsClient = documents(); - }); - - afterAll(() => { - jest.resetAllMocks(); - }); - - test('Then DocumentRef.Get should reject', async () => { - const doc = documentsClient.collection('test').doc('id'); - await expect(doc.get()).rejects.toEqual( - new UnimplementedError('UNIMPLEMENTED') - ); - }); - - test('The Grpc client for DocumentServiceClient.Put should have been called exactly once', () => { - expect(getMock).toBeCalledTimes(1); - }); - }); - - describe('Given DocumentServiceClient.Get succeeds', () => { - describe('And a id is provided', () => { - let getMock; - - beforeAll(() => { - getMock = jest - .spyOn(GrpcKeyDocumentsClient.prototype, 'get') - .mockImplementation((request, callback: any) => { - const response = new DocumentGetResponse(); - const mockDocument = new Document(); - mockDocument.setContent( - Struct.fromJavaScript({ - id: 'test', - }) - ); - response.setDocument(mockDocument); - callback(null, response); - - return null as any; - }); - }); - - afterAll(() => { - jest.resetAllMocks(); - }); - - test('Then DocumentServiceClient.Get should resolve with the provided id', async () => { - const doc = documents().collection('test').doc('id'); - - await expect(doc.get()).resolves.toStrictEqual({ - id: 'test', - }); - }); - - test('The Grpc client for DocumentServiceClient.Get should have been called exactly once', () => { - expect(getMock).toBeCalledTimes(1); - }); - }); - }); - - describe('Given DocumentServiceClient.Set throws an error', () => { - const MOCK_ERROR = { - code: 2, - message: 'UNIMPLEMENTED', - }; - let documentsClient: Documents; - let setMock; - - beforeAll(() => { - setMock = jest - .spyOn(GrpcKeyDocumentsClient.prototype, 'set') - .mockImplementation((request, callback: any) => { - callback(MOCK_ERROR, null); - - return null as any; - }); - documentsClient = documents(); - }); - - afterAll(() => { - jest.resetAllMocks(); - }); - - test('Then DocumentRef.Get should reject', async () => { - const doc = documentsClient.collection('test').doc('id'); - await expect( - doc.set({ - name: 'test', - }) - ).rejects.toEqual(new UnimplementedError('UNIMPLEMENTED')); - }); - - test('The Grpc client for DocumentServiceClient.Get should have been called exactly once', () => { - expect(setMock).toBeCalledTimes(1); - }); - }); - - describe('Given DocumentServiceClient.Delete throws an error', () => { - const MOCK_ERROR = { - code: 2, - message: 'UNIMPLEMENTED', - }; - let documentsClient: Documents; - let deleteMock; - - beforeAll(() => { - deleteMock = jest - .spyOn(GrpcKeyDocumentsClient.prototype, 'delete') - .mockImplementation((request, callback: any) => { - callback(MOCK_ERROR, null); - - return null as any; - }); - documentsClient = documents(); - }); - - afterAll(() => { - jest.resetAllMocks(); - }); - - test('Then DocumentRef.Delete should reject', async () => { - const doc = documentsClient.collection('test').doc('id'); - await expect(doc.delete()).rejects.toEqual( - new UnimplementedError('UNIMPLEMENTED') - ); - }); - - test('The Grpc client for DocumentServiceClient.Delete should have been called exactly once', () => { - expect(deleteMock).toBeCalledTimes(1); - }); - }); - - describe('Given Collection Depth Limit is exceeded', () => { - test('Then DocumentRef.Collection should throw correct error', () => { - const docRoot = documents().collection('test').doc('id'); - const nestedCollection = docRoot.collection('nested').doc('id'); - - const testNestedAgain = () => nestedCollection.collection('nested-again'); - - expect(testNestedAgain).toThrow( - new Error('Maximum collection depth 1 exceeded') - ); - }); - }); -}); diff --git a/src/api/documents/v0/document-ref.ts b/src/api/documents/v0/document-ref.ts deleted file mode 100644 index 9b882933..00000000 --- a/src/api/documents/v0/document-ref.ts +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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 { Struct } from 'google-protobuf/google/protobuf/struct_pb'; -import { - DocumentGetRequest, - DocumentGetResponse, - Key, - DocumentSetRequest, - DocumentDeleteRequest, -} from '@nitric/api/proto/document/v1/document_pb'; -import { DocumentServiceClient } from '@nitric/api/proto/document/v1/document_grpc_pb'; -import { fromGrpcError, InvalidArgumentError } from '../../errors'; -import { CollectionRef } from './collection-ref'; -import { MAX_COLLECTION_DEPTH } from './constants'; - -export type DocumentStructure = Record; - -/** - * Document Ref. - * - * Provides a Document Reference class. - * Used to create references to collections. - */ -export class DocumentRef { - private documentClient: DocumentServiceClient; - public readonly parent: CollectionRef; - public readonly id: string; - - constructor( - documentClient: DocumentServiceClient, - parent: CollectionRef, - id: string - ) { - this.documentClient = documentClient; - this.parent = parent; - this.id = id; - } - - /** - * Return the collection document reference value. - * - * @returns the collection document reference value, or null if not found - */ - public async get(): Promise { - const request = new DocumentGetRequest(); - request.setKey(this.toWire()); - - return new Promise((resolve, reject) => { - this.documentClient.get( - request, - (error, response: DocumentGetResponse) => { - if (error) { - reject(fromGrpcError(error)); - } else if (response.hasDocument()) { - const document = response.getDocument(); - const content = document.getContent().toJavaScript() as T; - - resolve(content); - } else { - resolve(null); - } - } - ); - }); - } - - /** - * Set the document content for this document reference in the database. If the - * document does not exist an new item will be created, otherwise an - * existing document will be update with the new value. - * - * @param value content the document content to store (required) - */ - public async set(value: T): Promise { - const request = new DocumentSetRequest(); - request.setKey(this.toWire()); - request.setContent(Struct.fromJavaScript(value)); - - return new Promise((resolve, reject) => { - this.documentClient.set(request, (error) => { - if (error) { - reject(fromGrpcError(error)); - } else { - resolve(); - } - }); - }); - } - - /** - * Delete this document reference from the database if it exists. - */ - public async delete(): Promise { - const request = new DocumentDeleteRequest(); - request.setKey(this.toWire()); - - return new Promise((resolve, reject) => { - this.documentClient.delete(request, (error) => { - if (error) { - reject(fromGrpcError(error)); - } else { - resolve(); - } - }); - }); - } - - private toWire(): Key { - const key = new Key(); - key.setCollection(this.parent['toWire']()); - key.setId(this.id); - return key; - } - - private depth(): number { - const parent = this.parent.parent; - - if (parent) { - return parent.depth() + 1; - } - - return 0; - } - - /** - * Gets a Collection instance that refers to the collection at the specified path. - * - * @param name The name of the collection (required) - * @returns The Collection instance - */ - public collection( - name: string - ): CollectionRef { - if (this.depth() >= MAX_COLLECTION_DEPTH) { - throw new Error( - `Maximum collection depth ${MAX_COLLECTION_DEPTH} exceeded` - ); - } - - return new CollectionRef(this.documentClient, name, this); - } -} diff --git a/src/api/documents/v0/document-snapshot.ts b/src/api/documents/v0/document-snapshot.ts deleted file mode 100644 index 5ff0d581..00000000 --- a/src/api/documents/v0/document-snapshot.ts +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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 { DocumentRef, DocumentStructure } from './document-ref'; - -export class DocumentSnapshot { - public readonly ref: DocumentRef; - public readonly content: T; - - constructor(ref: DocumentRef, content: T) { - this.ref = ref; - this.content = content; - } - - get id(): string { - return this.ref.id; - } -} diff --git a/src/api/documents/v0/documents.test.ts b/src/api/documents/v0/documents.test.ts deleted file mode 100644 index e695a9fe..00000000 --- a/src/api/documents/v0/documents.test.ts +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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 { documents } from './documents'; - -describe('Document Client Tests', () => { - describe('Given a new collection', () => { - test('Then collection should contain correct collection reference', () => { - const collection = documents().collection('customers'); - - expect(collection.name).toEqual('customers'); - }); - - test('Then collection.doc should return a document reference with correct collection and id', () => { - const doc = documents().collection('customers').doc('id'); - - expect(doc.parent.name).toEqual('customers'); - expect(doc.id).toEqual('id'); - }); - - test('Then collection.query should return a query with the correct collection reference', () => { - const query = documents().collection('customers').query(); - - expect(query.collection.name).toEqual('customers'); - }); - }); - - describe('Given a new nested collection', () => { - test('Then nested collection should contain correct parent references', () => { - const doc = documents().collection('customers').doc('id'); - const collection = doc.collection('orders'); - - expect(collection.name).toEqual('orders'); - expect(collection.parent).toBeDefined(); - expect(collection.parent.parent.name).toEqual('customers'); - }); - - test('Then collection.doc should return a document reference with correct collection and id', () => { - const doc = documents().collection('customers').doc('id'); - const orderDoc = doc.collection('orders').doc('orderId'); - - expect(orderDoc.parent.name).toEqual('orders'); - expect(orderDoc.id).toEqual('orderId'); - expect(orderDoc.parent.parent).toBeDefined(); - expect(orderDoc.parent.parent.parent.name).toEqual('customers'); - }); - - test('Then collection.query should return a query with the correct collection reference', () => { - const doc = documents().collection('customers').doc('id'); - const query = doc.collection('orders').query(); - - expect(query.collection.name).toEqual('orders'); - expect(query.collection.parent).toBeTruthy(); - expect(query.collection.parent.parent.name).toEqual('customers'); - }); - }); -}); diff --git a/src/api/documents/v0/documents.ts b/src/api/documents/v0/documents.ts deleted file mode 100644 index fc69c846..00000000 --- a/src/api/documents/v0/documents.ts +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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 { SERVICE_BIND } from '../../../constants'; -import { DocumentServiceClient } from '@nitric/api/proto/document/v1/document_grpc_pb'; -import * as grpc from '@grpc/grpc-js'; -import { CollectionRef } from './collection-ref'; -import { DocumentStructure } from './document-ref'; - -/** - * Documents - * - * Provides a Document API client. - * Used to create references to collections. - */ -export class Documents { - private documentClient: DocumentServiceClient; - - constructor() { - this.documentClient = new DocumentServiceClient( - SERVICE_BIND, - grpc.ChannelCredentials.createInsecure() - ); - } - - /** - * Gets a Collection instance that refers to the collection at the specified path. - * - * @param name The name of the collection (required) - * @returns The Collection instance - */ - public collection(name: string) { - return new CollectionRef(this.documentClient, name); - } -} - -// Documents client singleton -let DOCUMENTS = undefined; - -/** - * Documents API client. - * - * @returns a Documents API client. - * @example - * ```typescript - * import { documents } from "@nitric/sdk"; - * - * async function setCustomer() { - * const collection = documents().collection('customers'); - * - * collection.doc('id').set({ - * name: 'David', - * }); - * } - * ``` - */ -export const documents = (): Documents => { - if (!DOCUMENTS) { - DOCUMENTS = new Documents(); - } - - return DOCUMENTS; -}; diff --git a/src/api/documents/v0/query.test.ts b/src/api/documents/v0/query.test.ts deleted file mode 100644 index 5640d3a5..00000000 --- a/src/api/documents/v0/query.test.ts +++ /dev/null @@ -1,313 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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 { Struct } from 'google-protobuf/google/protobuf/struct_pb'; -import { PassThrough } from 'stream'; -import { DocumentServiceClient as GrpcKeyDocumentsClient } from '@nitric/api/proto/document/v1/document_grpc_pb'; -import { - DocumentQueryResponse, - DocumentQueryStreamResponse, - Document, - ExpressionValue, - Collection, - Key, -} from '@nitric/api/proto/document/v1/document_pb'; -import { documents, Documents } from './documents'; -import { DocumentSnapshot } from './document-snapshot'; -import { InvalidArgumentError, UnimplementedError } from '../../errors'; -import { DocumentRef } from './document-ref'; - -describe('Query Tests', () => { - describe('Adding a where clause to a query', () => { - const query = documents().collection('test').query(); - - test('Should return a reference to the original query', () => { - const w = query.where('test', '>=', 3); - expect(w).toStrictEqual(query); - }); - - test('Should append the expression to expressions array', () => { - expect(query['expressions']).toHaveLength(1); - const exp = query['expressions'][0]; - expect(exp.getOperand()).toStrictEqual('test'); - expect(exp.getOperator()).toStrictEqual('>='); - const testIntValue = new ExpressionValue(); - testIntValue.setIntValue(3); - expect(exp.getValue()).toStrictEqual(testIntValue); - }); - - test('Should append double value to expression correctly', () => { - query.where('test', '>=', 3.32); - expect(query['expressions']).toHaveLength(2); - const exp = query['expressions'][1]; - const testDoubleValue = new ExpressionValue(); - testDoubleValue.setDoubleValue(3.32); - expect(exp.getValue()).toStrictEqual(testDoubleValue); - }); - - test('Should append boolean value to expression correctly', () => { - query.where('test', '==', true); - expect(query['expressions']).toHaveLength(3); - const exp = query['expressions'][2]; - const testBoolValue = new ExpressionValue(); - testBoolValue.setBoolValue(true); - expect(exp.getValue()).toStrictEqual(testBoolValue); - }); - - test('Should append string value to expression correctly', () => { - query.where('test', '==', 'sydney'); - expect(query['expressions']).toHaveLength(4); - const exp = query['expressions'][3]; - const testStrValue = new ExpressionValue(); - testStrValue.setStringValue('sydney'); - expect(exp.getValue()).toStrictEqual(testStrValue); - }); - }); - - describe('Adding a limit clause to a query', () => { - const query = documents().collection('test').query(); - - test('Should return a reference to the original query', () => { - const w = query.limit(5); - expect(w).toStrictEqual(query); - }); - - test('Should set the query limit', () => { - expect(query['fetchLimit']).toStrictEqual(5); - }); - }); - - describe('Adding a paging token', () => { - const query = documents().collection('test').query(); - - const p = query.pagingFrom(new Map([['test', 'test']])); - - test('Should return a reference to the original query', () => { - expect(p).toStrictEqual(query); - }); - - test('Should set the paging token', () => { - expect(query['pagingToken']).toStrictEqual(new Map([['test', 'test']])); - }); - }); - - describe('Given DocumentServiceClient.Query throws an error', () => { - const MOCK_ERROR = { - code: 2, - message: 'UNIMPLEMENTED', - }; - let documentsClient: Documents; - let queryMock; - - beforeAll(() => { - queryMock = jest - .spyOn(GrpcKeyDocumentsClient.prototype, 'query') - .mockImplementation((request, callback: any) => { - callback(MOCK_ERROR, null); - - return null as any; - }); - documentsClient = documents(); - }); - - afterAll(() => { - jest.resetAllMocks(); - }); - - test('Then DocumentRef.Query should reject', async () => { - const query = documentsClient.collection('test').query(); - await expect(query.fetch()).rejects.toEqual( - new UnimplementedError('UNIMPLEMENTED') - ); - }); - - test('The Grpc client for DocumentServiceClient.Query should have been called exactly once', () => { - expect(queryMock).toBeCalledTimes(1); - }); - }); - - describe('Given DocumentServiceClient.Query succeeds', () => { - let queryMock; - let mockKey; - - beforeAll(() => { - queryMock = jest - .spyOn(GrpcKeyDocumentsClient.prototype, 'query') - .mockImplementation((request, callback: any) => { - const response = new DocumentQueryResponse(); - const mockDocument = new Document(); - mockDocument.setContent( - Struct.fromJavaScript({ - id: 'test', - }) - ); - const map = response.getPagingTokenMap(); - map.set('test-key', 'test-value'); - - const collection = new Collection(); - collection.setName('test'); - - mockKey = new Key(); - mockKey.setCollection(collection); - mockKey.setId('test'); - - mockDocument.setKey(mockKey); - response.setDocumentsList([mockDocument]); - callback(null, response); - - return null as any; - }); - }); - - afterAll(() => { - jest.resetAllMocks(); - }); - - test('Then DocumentServiceClient.Query should resolve with the correct documents', async () => { - const docClient = documents(); - const testCollection = docClient.collection('test'); - const q = testCollection.query(); - - const results = await q.fetch(); - - expect(results.documents).toStrictEqual([ - new DocumentSnapshot(testCollection.doc('test'), { - id: 'test', - }), - ]); - - expect(results.pagingToken).toStrictEqual( - new Map([['test-key', 'test-value']]) - ); - }); - - test('The Grpc client for DocumentServiceClient.Query should have been called exactly once', () => { - expect(queryMock).toBeCalledTimes(1); - }); - - test('Providing an invalid paging token should throw error', async () => { - const q = documents().collection('test').query(); - - q.pagingFrom('test' as any); - - await expect(q.fetch()).rejects.toEqual( - new Error('Invalid paging token provided!') - ); - }); - }); - - describe('Given DocumentServiceClient.QueryStream throws an error', () => { - const MOCK_ERROR = { - code: 2, - message: 'UNIMPLEMENTED', - }; - let documentsClient: Documents; - const mockStream = new PassThrough(); - let queryStreamMock; - - beforeAll(() => { - queryStreamMock = jest - .spyOn(GrpcKeyDocumentsClient.prototype, 'queryStream') - .mockReturnValueOnce(mockStream as any); - documentsClient = documents(); - }); - - afterAll(() => { - jest.resetAllMocks(); - }); - - test('Then DocumentRef.QueryStream should reject', async () => { - const query = documentsClient.collection('test').query(); - - const stream = query.stream(); - - mockStream.emit('error', MOCK_ERROR); - - const test = new Promise((res) => { - stream.on('error', (e) => { - res(e); - }); - }); - - await expect(test).resolves.toEqual( - new UnimplementedError('UNIMPLEMENTED') - ); - }); - - test('The Grpc client for DocumentServiceClient.QueryStream should have been called exactly once', () => { - expect(queryStreamMock).toBeCalledTimes(1); - }); - }); - - describe('Given DocumentServiceClient.QueryStream succeeds', () => { - let documentsClient: Documents; - const mockStream = new PassThrough(); - let queryStreamMock; - let mockKey; - - beforeAll(() => { - queryStreamMock = jest - .spyOn(GrpcKeyDocumentsClient.prototype, 'queryStream') - .mockReturnValueOnce(mockStream as any); - documentsClient = documents(); - }); - - afterAll(() => { - jest.resetAllMocks(); - }); - - test('Then DocumentRef.QueryStream should return correct response and support readable asyncIterator', async () => { - const chunks = []; - const col = documentsClient.collection('test'); - const query = col.query(); - - const stream = query.stream(); - - const response = new DocumentQueryStreamResponse(); - const doc = new Document(); - doc.setContent( - Struct.fromJavaScript({ - id: 'test', - }) - ); - - mockKey = new Key(); - - mockKey.setCollection(col['_collection']); - - doc.setKey(mockKey); - - response.setDocument(doc); - - mockStream.emit('data', response); - - mockStream.end(); - - for await (const chunk of stream) { - chunks.push(chunk); - } - - expect(chunks[0] instanceof DocumentSnapshot).toBe(true); - - const snapShot = chunks[0] as DocumentSnapshot; - - expect(snapShot.content).toStrictEqual({ - id: 'test', - }); - }); - - test('The Grpc client for DocumentServiceClient.QueryStream should have been called exactly once', () => { - expect(queryStreamMock).toBeCalledTimes(1); - }); - }); -}); diff --git a/src/api/documents/v0/query.ts b/src/api/documents/v0/query.ts deleted file mode 100644 index 07faaddd..00000000 --- a/src/api/documents/v0/query.ts +++ /dev/null @@ -1,274 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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 { Transform } from 'stream'; -import { - Expression, - ExpressionValue, - DocumentQueryRequest, - DocumentQueryResponse, - DocumentQueryStreamRequest, - DocumentQueryStreamResponse, -} from '@nitric/api/proto/document/v1/document_pb'; -import { DocumentServiceClient } from '@nitric/api/proto/document/v1/document_grpc_pb'; -import { WhereQueryOperator, WhereValueExpression } from '../../../types'; -import type { Map as ProtobufMap } from 'google-protobuf'; -import { DocumentRef, DocumentStructure } from './document-ref'; -import { CollectionRef } from './collection-ref'; -import { DocumentSnapshot } from './document-snapshot'; -import { fromGrpcError, InvalidArgumentError } from '../../errors'; -import { ServiceError } from '@grpc/grpc-js'; - -type PagingToken = Map; - -interface ReadableStream extends NodeJS.ReadableStream { - on(event: string | symbol, listener: (...args: T[]) => void): this; -} - -export interface FetchResponse { - documents: DocumentSnapshot[]; - pagingToken: Map; -} - -/** - * Convenience method to convert ProtobufMap objects to standard JavaScript Maps. - * - * @param protoMap map to convert - * @returns the map - */ -function protoMapToMap( - protoMap: ProtobufMap -): Map { - const jsMap = new Map(); - protoMap.forEach((value, key) => { - jsMap.set(key, value); - }); - return jsMap; -} - -/** - * Documents - * - * Provides a Document API client. - * Used to create references to collections. - */ -export class Query { - private documentClient: DocumentServiceClient; - public readonly collection: CollectionRef; - private expressions: Expression[]; - private pagingToken: PagingToken | ProtobufMap; - private fetchLimit: number; - - constructor( - documentClient: DocumentServiceClient, - collection: CollectionRef - ) { - this.documentClient = documentClient; - this.collection = collection; - - this.expressions = []; - } - - /** - * Add a where expression to the query. - * - * @param field operand the left hand side expression operand - * @param operator the query expression operator - * @param value right hand side operand - * @returns the Query operation - */ - public where( - field: string, - operator: WhereQueryOperator, - value: WhereValueExpression - ): Query { - const expression = new Expression(); - const expressionValue = new ExpressionValue(); - - expression.setOperand(field); - expression.setOperator(operator); - - switch (typeof value) { - case 'string': - expressionValue.setStringValue(value); - break; - case 'number': - if (Number.isInteger(value)) { - expressionValue.setIntValue(value); - } else { - expressionValue.setDoubleValue(value); - } - break; - case 'boolean': - expressionValue.setBoolValue(value); - break; - } - - expression.setValue(expressionValue); - this.expressions.push(expression); - - return this; - } - - /** - * Set the query paging continuation token. - * - * @param pagingToken used to determine where to continue paging from. - * @returns the Query operation - */ - public pagingFrom(pagingToken: PagingToken): Query { - this.pagingToken = pagingToken; - return this; - } - - /** - * Set the query fetch limit. - * - * @param limit the maximum number for results to return. - * @returns the Query operation - */ - public limit(limit: number): Query { - if (typeof limit !== 'number' || limit < 0) { - throw new Error('limit must be a positive integer or 0 for unlimited.'); - } - - this.fetchLimit = limit; - return this; - } - - public async fetch() { - const request = new DocumentQueryRequest(); - - request.setCollection(this.collection['toWire']()); - request.setLimit(this.fetchLimit); - - if (this.expressions.length) { - request.setExpressionsList(this.expressions); - } - - if (this.pagingToken != null) { - if (!(this.pagingToken instanceof Map)) { - throw new Error('Invalid paging token provided!'); - } - - const map = request.getPagingTokenMap(); - this.pagingToken.forEach((value, key) => { - map.set(key, value); - }); - } - - return new Promise>((resolve, reject) => { - this.documentClient.query( - request, - (error, response: DocumentQueryResponse) => { - if (error) { - reject(fromGrpcError(error)); - } else { - const pagingTokenMap = protoMapToMap(response.getPagingTokenMap()); - - // clear paging token map - request.clearPagingTokenMap(); - - const documents = response - .getDocumentsList() - .map( - (doc) => - new DocumentSnapshot( - new DocumentRef( - this.documentClient, - this.collection, - doc.getKey().getId() - ), - doc.getContent().toJavaScript() as T - ) - ); - - resolve({ - documents, - pagingToken: pagingTokenMap.size > 0 ? pagingTokenMap : null, - }); - } - } - ); - }); - } - - protected getStreamRequest() { - const request = new DocumentQueryStreamRequest(); - - request.setCollection(this.collection['toWire']()); - request.setLimit(this.fetchLimit); - request.setExpressionsList(this.expressions); - - return request; - } - - /** - * Queries the collection and returns a readable stream. - * - * @returns all query results as a stream - * @example - * ```typescript - * import { documents } from "@nitric/sdk"; - * - * const docs = documents(); - * - * async function getDocs() { - * const docs = []; - * const stream = docs - * .collection('customers') - * .query() - * .where('name', '==', 'david') - * .stream(); - * - * for await (const chunk of stream) { - * docs.push(chunk); - * } - * - * return docs; - * } - * ``` - * - */ - public stream(): ReadableStream> { - const responseStream = this.documentClient.queryStream( - this.getStreamRequest() - ); - - const transform = new Transform({ - objectMode: true, - transform: (result: DocumentQueryStreamResponse, encoding, callback) => { - const doc = result.getDocument(); - - callback( - undefined, - new DocumentSnapshot( - new DocumentRef( - this.documentClient, - this.collection, - doc.getKey().getId() - ), - doc.getContent().toJavaScript() as T - ) - ); - }, - }); - - responseStream.on('error', (e) => - transform.destroy(fromGrpcError(e as ServiceError)) - ); - responseStream.pipe(transform); - - return transform; - } -} diff --git a/src/api/errors/aborted.ts b/src/api/errors/aborted.ts deleted file mode 100644 index 03a3f92d..00000000 --- a/src/api/errors/aborted.ts +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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 { ErrorDetails } from '@nitric/sdk/gen/proto/error/v1/error_pb'; -import { NitricPluginError } from './plugin-error'; -/** - * AbortedError - * - * The operation was aborted - */ -export class AbortedError extends NitricPluginError { - constructor(message: string, details: ErrorDetails) { - super(message, details); - Object.setPrototypeOf(this, AbortedError.prototype); - } -} diff --git a/src/api/errors/already-exists.ts b/src/api/errors/already-exists.ts deleted file mode 100644 index 1ae5e73d..00000000 --- a/src/api/errors/already-exists.ts +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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 { ErrorDetails } from '@nitric/sdk/gen/proto/error/v1/error_pb'; -import { NitricPluginError } from './plugin-error'; - -/** - * AlreadyExistsError - * - * Client attempted to illegally create an entity that already exists - */ -export class AlreadyExistsError extends NitricPluginError { - constructor(message: string, details: ErrorDetails) { - super(message, details); - Object.setPrototypeOf(this, AlreadyExistsError.prototype); - } -} diff --git a/src/api/errors/cancelled.ts b/src/api/errors/cancelled.ts deleted file mode 100644 index 6b07245e..00000000 --- a/src/api/errors/cancelled.ts +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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 { - ErrorDetails, - ErrorScope, -} from '@nitric/sdk/gen/proto/error/v1/error_pb'; -import { NitricPluginError } from './plugin-error'; - -/** - * CancelledError - * - * Operation was cancelled (typically occurs client side) - */ -export class CancelledError extends NitricPluginError { - constructor(message: string, details: ErrorDetails) { - super(message, details); - Object.setPrototypeOf(this, CancelledError.prototype); - } -} diff --git a/src/api/errors/data-loss.ts b/src/api/errors/data-loss.ts deleted file mode 100644 index 6b6c1f0f..00000000 --- a/src/api/errors/data-loss.ts +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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 { ErrorDetails } from '@nitric/sdk/gen/proto/error/v1/error_pb'; -import { NitricPluginError } from './plugin-error'; - -/** - * DataLossError - * - * Unrecoverable data loss or corruption - */ -export class DataLossError extends NitricPluginError { - constructor(message: string, details: ErrorDetails) { - super(message, details); - Object.setPrototypeOf(this, DataLossError.prototype); - } -} diff --git a/src/api/errors/deadline-exceeded.ts b/src/api/errors/deadline-exceeded.ts deleted file mode 100644 index 9def83cc..00000000 --- a/src/api/errors/deadline-exceeded.ts +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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 { ErrorDetails } from '@nitric/sdk/gen/proto/error/v1/error_pb'; -import { NitricPluginError } from './plugin-error'; - -/** - * DeadlineExceededError - * - * Specified deadline was exceeded before the operation could complete - */ -export class DeadlineExceededError extends NitricPluginError { - constructor(message: string, details: ErrorDetails) { - super(message, details); - Object.setPrototypeOf(this, DeadlineExceededError.prototype); - } -} diff --git a/src/api/errors/failed-precondition.ts b/src/api/errors/failed-precondition.ts deleted file mode 100644 index ebc50b7a..00000000 --- a/src/api/errors/failed-precondition.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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 { ErrorDetails } from '@nitric/sdk/gen/proto/error/v1/error_pb'; -import { NitricPluginError } from './plugin-error'; - -/** - * FailedPreconditionError - * - * Operation was rejected due to the system being not being - * in a state required for the requested operation. - */ -export class FailedPreconditionError extends NitricPluginError { - constructor(message: string, details: ErrorDetails) { - super(message, details); - Object.setPrototypeOf(this, FailedPreconditionError.prototype); - } -} diff --git a/src/api/errors/index.test.ts b/src/api/errors/index.test.ts index e785d81b..07b4adf1 100644 --- a/src/api/errors/index.test.ts +++ b/src/api/errors/index.test.ts @@ -14,21 +14,24 @@ import { status } from '@grpc/grpc-js'; import { fromGrpcError } from '.'; -import { AbortedError } from './aborted'; -import { AlreadyExistsError } from './already-exists'; -import { CancelledError } from './cancelled'; -import { DataLossError } from './data-loss'; -import { FailedPreconditionError } from './failed-precondition'; -import { InternalError } from './internal'; -import { InvalidArgumentError } from './invalid-argument'; -import { NotFoundError } from './not-found'; -import { OutOfRangeError } from './out-of-range'; -import { PermissionDeniedError } from './permission-denied'; -import { ResourceExhaustedError } from './resource-exhausted'; -import { UnauthenticatedError } from './unauthenticated'; -import { UnavailableError } from './unavailable'; -import { UnimplementedError } from './unimplemented'; -import { UnknownError } from './unknown'; +import { + AbortedError, + AlreadyExistsError, + CancelledError, + DataLossError, + DeadlineExceededError, + FailedPreconditionError, + InternalError, + InvalidArgumentError, + NotFoundError, + OutOfRangeError, + PermissionDeniedError, + ResourceExhaustedError, + UnauthenticatedError, + UnavailableError, + UnimplementedError, + UnknownError, +} from './provider-error'; const DECODER = new TextDecoder(); diff --git a/src/api/errors/index.ts b/src/api/errors/index.ts index 8d0d8ede..7c6825f1 100644 --- a/src/api/errors/index.ts +++ b/src/api/errors/index.ts @@ -13,32 +13,29 @@ // limitations under the License. import { status, ServiceError } from '@grpc/grpc-js'; -import { AbortedError } from './aborted'; -import { AlreadyExistsError } from './already-exists'; -import { CancelledError } from './cancelled'; -import { DataLossError } from './data-loss'; -import { DeadlineExceededError } from './deadline-exceeded'; -import { FailedPreconditionError } from './failed-precondition'; -import { InternalError } from './internal'; -import { InvalidArgumentError } from './invalid-argument'; -import { NotFoundError } from './not-found'; -import { OutOfRangeError } from './out-of-range'; -import { PermissionDeniedError } from './permission-denied'; -import { ResourceExhaustedError } from './resource-exhausted'; -import { UnauthenticatedError } from './unauthenticated'; -import { UnavailableError } from './unavailable'; -import { UnimplementedError } from './unimplemented'; -import { UnknownError } from './unknown'; -import { parse } from '@nitric/grpc-error-status'; -import { ErrorDetails } from '@nitric/api/proto/error/v1/error_pb'; +import { + AbortedError, + AlreadyExistsError, + CancelledError, + DataLossError, + DeadlineExceededError, + FailedPreconditionError, + InternalError, + InvalidArgumentError, + NotFoundError, + OutOfRangeError, + PermissionDeniedError, + ResourceExhaustedError, + UnauthenticatedError, + UnavailableError, + UnimplementedError, + UnknownError, +} from './provider-error'; // Accept all codes except Status OK type codes = Exclude; -const STATUS_CODE_MAP: Record< - codes, - new (message: string, details: ErrorDetails) => Error -> = { +const STATUS_CODE_MAP: Record Error> = { [status.CANCELLED]: CancelledError, [status.UNKNOWN]: UnknownError, [status.INVALID_ARGUMENT]: InvalidArgumentError, @@ -66,23 +63,11 @@ const STATUS_CODE_MAP: Record< export const fromGrpcError = (error: ServiceError): Error => { const construct = STATUS_CODE_MAP[error.code]; - const errorStatus = parse(error); - - let errorDetails: ErrorDetails | undefined = undefined; - - if (errorStatus) { - const allDetails = errorStatus.parseDetails(ErrorDetails); - - if (allDetails.length > 0) { - errorDetails = allDetails[0]; - } - } - if (construct) { - return new construct(error.message, errorDetails); + return new construct(error); } - return new UnknownError(error.message, errorDetails); + return new UnknownError(error); }; // Re-export errors diff --git a/src/api/errors/internal.ts b/src/api/errors/internal.ts deleted file mode 100644 index ab9f1940..00000000 --- a/src/api/errors/internal.ts +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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 { ErrorDetails } from '@nitric/sdk/gen/proto/error/v1/error_pb'; -import { NitricPluginError } from './plugin-error'; - -/** - * InternalError - * - * Some invariant error has incurred internally - */ -export class InternalError extends NitricPluginError { - constructor(message: string, details: ErrorDetails) { - super(message, details); - Object.setPrototypeOf(this, InternalError.prototype); - } -} diff --git a/src/api/errors/invalid-argument.ts b/src/api/errors/invalid-argument.ts deleted file mode 100644 index 53332eae..00000000 --- a/src/api/errors/invalid-argument.ts +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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 { ErrorDetails } from '@nitric/sdk/gen/proto/error/v1/error_pb'; -import { NitricPluginError } from './plugin-error'; - -/** - * InvalidArgumentError - * - * Invalid argument was provided by the client - */ -export class InvalidArgumentError extends NitricPluginError { - constructor(message: string, details: ErrorDetails) { - super(message, details); - Object.setPrototypeOf(this, InvalidArgumentError.prototype); - } -} diff --git a/src/api/errors/not-found.ts b/src/api/errors/not-found.ts deleted file mode 100644 index b963c43e..00000000 --- a/src/api/errors/not-found.ts +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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 { ErrorDetails } from '@nitric/sdk/gen/proto/error/v1/error_pb'; -import { NitricPluginError } from './plugin-error'; - -/** - * NotFoundError - * - * Requested resource was not found - */ -export class NotFoundError extends NitricPluginError { - constructor(message: string, details: ErrorDetails) { - super(message, details); - Object.setPrototypeOf(this, NotFoundError.prototype); - } -} diff --git a/src/api/errors/out-of-range.ts b/src/api/errors/out-of-range.ts deleted file mode 100644 index ae187172..00000000 --- a/src/api/errors/out-of-range.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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 { ErrorDetails } from '@nitric/sdk/gen/proto/error/v1/error_pb'; -import { NitricPluginError } from './plugin-error'; - -/** - * OutOfRangeError - * - * The operation was attempted outside of valid range - * e.g. seeking past the end of a file or array, or specifying invalid offsets - */ -export class OutOfRangeError extends NitricPluginError { - constructor(message: string, details: ErrorDetails) { - super(message, details); - Object.setPrototypeOf(this, OutOfRangeError.prototype); - } -} diff --git a/src/api/errors/permission-denied.ts b/src/api/errors/permission-denied.ts deleted file mode 100644 index 96d592b6..00000000 --- a/src/api/errors/permission-denied.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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 { ErrorDetails } from '@nitric/sdk/gen/proto/error/v1/error_pb'; -import { NitricPluginError } from './plugin-error'; - -/** - * PermissionDeniedError - * - * The client is authenticated but does not have permission to - * perform the requested operation - */ -export class PermissionDeniedError extends NitricPluginError { - constructor(message: string, details: ErrorDetails) { - super(message, details); - Object.setPrototypeOf(this, PermissionDeniedError.prototype); - } -} diff --git a/src/api/errors/plugin-error.ts b/src/api/errors/plugin-error.ts deleted file mode 100644 index f80f17f2..00000000 --- a/src/api/errors/plugin-error.ts +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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 { ErrorDetails } from '@nitric/sdk/gen/proto/error/v1/error_pb'; - -/** - * CancelledError - * - * Operation was cancelled (typically occurs client side) - */ -export class NitricPluginError extends Error { - constructor(message: string, details?: ErrorDetails) { - let errorMessage = message; - if (details) { - errorMessage = `${message}; -Nitric Plugin Error: ${details.getScope().getPlugin()}.${details - .getScope() - .getService()} - Message: ${details.getMessage()} - Caused By: ${details.getCause()}`; - } - - super(errorMessage); - } -} diff --git a/src/api/errors/provider-error.ts b/src/api/errors/provider-error.ts new file mode 100644 index 00000000..96c94ed4 --- /dev/null +++ b/src/api/errors/provider-error.ts @@ -0,0 +1,172 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// 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 { ServiceError } from '@grpc/grpc-js'; +import { parse } from '@nitric/grpc-error-status'; +import { Struct } from 'google-protobuf/google/protobuf/struct_pb'; + +/** + * Nitric Provider Error + * + * Generic error for Nitric Provider errors + */ +export class NitricProviderError extends Error { + constructor(grpcError: ServiceError) { + const errorStatus = parse(grpcError); + + let errorDetails: Struct | undefined = undefined; + + if (errorStatus) { + const allDetails = errorStatus.parseDetails(Struct); + + if (allDetails.length > 0) { + errorDetails = allDetails[0]; + } + } + + let details = grpcError.details; + try { + details = JSON.stringify(errorDetails?.toJavaScript()); + } catch (e) { + // Ignore + console.debug( + 'provider returned error details in a format other than Struct. Unable to parse details' + ); + } + + const message = `${grpcError.message} +Nitric Provider Error: ${grpcError.name} + Code: ${grpcError.code} + Message: ${grpcError.message} + Details: ${details} + Metadata: ${JSON.stringify(grpcError.metadata)}`; + super(message); + } +} + +/** + * NotFoundError + * + * Requested resource was not found + */ +export class NotFoundError extends NitricProviderError {} + +/** + * PermissionDeniedError + * + * The client is authenticated but does not have permission to + * perform the requested operation + */ +export class PermissionDeniedError extends NitricProviderError {} + +/** + * AbortedError + * + * The operation was aborted + */ +export class AbortedError extends NitricProviderError {} + +/** + * AlreadyExistsError + * + * Client attempted to illegally create an entity that already exists + */ +export class AlreadyExistsError extends NitricProviderError {} + +/** + * CancelledError + * + * Operation was cancelled (typically occurs client side) + */ +export class CancelledError extends NitricProviderError {} + +/** + * DataLossError + * + * Unrecoverable data loss or corruption + */ +export class DataLossError extends NitricProviderError {} + +/** + * DeadlineExceededError + * + * Specified deadline was exceeded before the operation could complete + */ +export class DeadlineExceededError extends NitricProviderError {} + +/** + * FailedPreconditionError + * + * Operation was rejected due to the system being not being + * in a state required for the requested operation. + */ +export class FailedPreconditionError extends NitricProviderError {} + +/** + * InternalError + * + * Some invariant error has incurred internally + */ +export class InternalError extends NitricProviderError {} + +/** + * InvalidArgumentError + * + * Invalid argument was provided by the client + */ +export class InvalidArgumentError extends NitricProviderError {} + +/** + * OutOfRangeError + * + * The operation was attempted outside of valid range + * e.g. seeking past the end of a file or array, or specifying invalid offsets + */ +export class OutOfRangeError extends NitricProviderError {} + +/** + * ResourceExhaustedError + * + * The requested user resource has been exhausted. + * Examples include API quotas being exceeded or disk space running out + */ +export class ResourceExhaustedError extends NitricProviderError {} + +/** + * UnauthenticatedError + * + * The request does not have or has invalid credentials + */ +export class UnauthenticatedError extends NitricProviderError {} + +/** + * UnavailableError + * + * The request operation is currently unavailable + */ +export class UnavailableError extends NitricProviderError {} + +/** + * UnimplementedError + * + * The requested operation was not implemented for the service provider. + */ +export class UnimplementedError extends NitricProviderError {} + +/** + * UnknownError + * + * Not enough information received to determine discrete error type + */ +export class UnknownError extends NitricProviderError {} diff --git a/src/api/errors/resource-exhausted.ts b/src/api/errors/resource-exhausted.ts deleted file mode 100644 index 4c8f3748..00000000 --- a/src/api/errors/resource-exhausted.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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 { ErrorDetails } from '@nitric/sdk/gen/proto/error/v1/error_pb'; -import { NitricPluginError } from './plugin-error'; - -/** - * ResourceExhaustedError - * - * The requested user resource has been exhausted. - * Examples include API quotas being exceeded or diskspace running out - */ -export class ResourceExhaustedError extends NitricPluginError { - constructor(message: string, details: ErrorDetails) { - super(message, details); - Object.setPrototypeOf(this, ResourceExhaustedError.prototype); - } -} diff --git a/src/api/errors/unauthenticated.ts b/src/api/errors/unauthenticated.ts deleted file mode 100644 index 0fbe6d56..00000000 --- a/src/api/errors/unauthenticated.ts +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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 { ErrorDetails } from '@nitric/sdk/gen/proto/error/v1/error_pb'; -import { NitricPluginError } from './plugin-error'; - -/** - * UnauthenticatedError - * - * The request does not have or has invalid credentials - */ -export class UnauthenticatedError extends NitricPluginError { - constructor(message: string, details: ErrorDetails) { - super(message, details); - Object.setPrototypeOf(this, UnauthenticatedError.prototype); - } -} diff --git a/src/api/errors/unavailable.ts b/src/api/errors/unavailable.ts deleted file mode 100644 index 0b2e01ba..00000000 --- a/src/api/errors/unavailable.ts +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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 { ErrorDetails } from '@nitric/sdk/gen/proto/error/v1/error_pb'; -import { NitricPluginError } from './plugin-error'; - -/** - * UnavailableError - * - * The request operation is currently unavailable - */ -export class UnavailableError extends NitricPluginError { - constructor(message: string, details: ErrorDetails) { - super(message, details); - Object.setPrototypeOf(this, UnavailableError.prototype); - } -} diff --git a/src/api/errors/unimplemented.ts b/src/api/errors/unimplemented.ts deleted file mode 100644 index a8a0a052..00000000 --- a/src/api/errors/unimplemented.ts +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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 { ErrorDetails } from '@nitric/sdk/gen/proto/error/v1/error_pb'; -import { NitricPluginError } from './plugin-error'; - -/** - * UnimplementedError - * - * The requested operation was not implemented for the service provider. - */ -export class UnimplementedError extends NitricPluginError { - constructor(message: string, details?: ErrorDetails) { - super(message, details); - Object.setPrototypeOf(this, UnimplementedError.prototype); - } -} diff --git a/src/api/errors/unknown.ts b/src/api/errors/unknown.ts deleted file mode 100644 index f5f8a08a..00000000 --- a/src/api/errors/unknown.ts +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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 { ErrorDetails } from '@nitric/sdk/gen/proto/error/v1/error_pb'; -import { NitricPluginError } from './plugin-error'; - -/** - * UnknownError - * - * Not enough imformation recieved to determine discrete error type - */ -export class UnknownError extends NitricPluginError { - constructor(message: string, details: ErrorDetails) { - super(message, details); - Object.setPrototypeOf(this, UnknownError.prototype); - } -} diff --git a/src/api/events/v0/events.test.ts b/src/api/events/v0/events.test.ts deleted file mode 100644 index e53c3304..00000000 --- a/src/api/events/v0/events.test.ts +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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 { Eventing } from './events'; -import { - NitricTopic, - TopicListResponse, - EventPublishResponse, -} from '@nitric/api/proto/event/v1/event_pb'; -import { - EventServiceClient as GrpcEventServiceClient, - TopicServiceClient as GrpcTopicServiceClient, -} from '@nitric/api/proto/event/v1/event_grpc_pb'; -import { UnimplementedError } from '../../errors'; -import { NitricEvent } from '@nitric/sdk/types'; - -describe('Event Client Tests', () => { - describe('Given nitric.interfaces.event.EventServiceClient.publish throws an error', () => { - const MOCK_ERROR = { - code: 2, - message: 'UNIMPLEMENTED', - }; - let publishMock; - - beforeAll(() => { - publishMock = jest - .spyOn(GrpcEventServiceClient.prototype, 'publish') - .mockImplementation((request, callback: any) => { - callback(MOCK_ERROR, null); - return null as any; - }); - }); - - afterAll(() => { - jest.resetAllMocks(); - }); - - test('Then Eventing.Topic.publish should reject', async () => { - const topic = new Eventing().topic('test'); - await expect( - topic.publish({ - id: 'test', - payloadType: 'Test Payload', - payload: { - test: 'test', - }, - }) - ).rejects.toEqual(new UnimplementedError('UNIMPLEMENTED')); - }); - - test('The Grpc client for Eventing.publish should have been called exactly once', () => { - expect(publishMock).toBeCalledTimes(1); - }); - }); - - describe('Given nitric.api.event.Eventing.Publish succeeds', () => { - describe('And a id is provided', () => { - let publishMock; - - beforeAll(() => { - publishMock = jest - .spyOn(GrpcEventServiceClient.prototype, 'publish') - .mockImplementation((request, callback: any) => { - const response = new EventPublishResponse(); - response.setId(request.getEvent().getId()); - callback(null, response); - - return null as any; - }); - }); - - afterAll(() => { - jest.resetAllMocks(); - }); - - test('Then Eventing.publish should resolve with the provided id', async () => { - const client = new Eventing(); - const event = new NitricEvent({ test: 'test' }, 'test', 'Test Payload'); - await expect( - client - .topic('test') - .publish(new NitricEvent({ test: 'test' }, 'test', 'Test Payload')) - ).resolves.toStrictEqual(event); - }); - - test('The Grpc client for Eventing.publish should have been called exactly once', () => { - expect(publishMock).toBeCalledTimes(1); - }); - }); - }); - - describe('Given nitric.api.event.TopicServiceClient.List throws an error', () => { - const MOCK_ERROR = { - code: 2, - message: 'UNIMPLEMENTED', - }; - let listMock; - - beforeAll(() => { - listMock = jest - .spyOn(GrpcTopicServiceClient.prototype, 'list') - .mockImplementation((_, callback: any) => { - callback(MOCK_ERROR, null); - - return null as any; - }); - }); - - afterAll(() => { - jest.resetAllMocks(); - }); - - test('Then TopicServiceClient.publish should reject', async () => { - const eventing = new Eventing(); - await expect(eventing.topics()).rejects.toEqual( - new UnimplementedError('UNIMPLEMENTED') - ); - }); - - test('The Grpc client for TopicServiceClient.publish should have been called exactly once', () => { - expect(listMock).toBeCalledTimes(1); - }); - }); - - describe('Given nitric.api.event.TopicServiceClient.List succeeds', () => { - const MOCK_TOPIC = new NitricTopic(); - MOCK_TOPIC.setName('test-topic'); - const MOCK_TOPICS: NitricTopic[] = [MOCK_TOPIC]; - const MOCK_TOPICS_REPLY = new TopicListResponse(); - MOCK_TOPICS_REPLY.setTopicsList(MOCK_TOPICS); - - let listMock; - - beforeAll(() => { - listMock = jest - .spyOn(GrpcTopicServiceClient.prototype, 'list') - .mockImplementation((_, callback: any) => { - callback(null, MOCK_TOPICS_REPLY); - - return null as any; - }); - }); - - afterAll(() => { - jest.resetAllMocks(); - }); - - test('Then TopicServiceClient.publish should resolve with available topics', async () => { - const eventing = new Eventing(); - (await eventing.topics()).forEach((topic) => { - expect(topic.eventing).toBe(eventing); - expect(topic.name).toEqual('test-topic'); - }); - }); - - test('The Grpc client for TopicServiceClient.list should have been called exactly once', () => { - expect(listMock).toBeCalledTimes(1); - }); - }); -}); diff --git a/src/api/events/v0/events.ts b/src/api/events/v0/events.ts deleted file mode 100644 index fbc3910a..00000000 --- a/src/api/events/v0/events.ts +++ /dev/null @@ -1,246 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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 { SERVICE_BIND } from '../../../constants'; -import { - EventServiceClient, - TopicServiceClient, -} from '@nitric/api/proto/event/v1/event_grpc_pb'; -import { - NitricEvent as PbEvent, - EventPublishRequest, -} from '@nitric/api/proto/event/v1/event_pb'; -import { Struct } from 'google-protobuf/google/protobuf/struct_pb'; -import * as grpc from '@grpc/grpc-js'; -import { NitricEvent } from '../../../types'; -import { fromGrpcError, InvalidArgumentError } from '../../errors'; - -/** - * Construct event and topic service clients. - * - * @internal - * @returns event and topic service clients. - */ -function newEventServiceClients(): { - event: EventServiceClient; - topic: TopicServiceClient; -} { - const channel = grpc.ChannelCredentials.createInsecure(); - return { - event: new EventServiceClient(SERVICE_BIND, channel), - topic: new TopicServiceClient(SERVICE_BIND, channel), - }; -} - -export interface PublishOptions { - /** Number of seconds to delay message publishing by */ - delay?: number; -} - -const DEFAULT_PUBLISH_OPTS: PublishOptions = { - delay: 0, -}; - -export class Topic = Record> { - eventing: Eventing; - name: string; - - constructor(eventing: Eventing, name: string) { - this.eventing = eventing; - this.name = name; - } - - /** - * Publishes an event to a nitric topic. - * - * @param event The event to publish - * @param opts Additional publishing options - * @returns NitricEvent containing the unique id of the event (if not provided it will be generated) - * - * @example - * ```typescript - * import { Eventing } from "@nitric/sdk"; - * - * const eventing = Eventing(); - * - * async function publishEvent(): NitricEvent { - * const topic = eventing.topic("my-topic"); - * const event = { - * payloadType: "my-payload", - * payload: { - * value: "Hello World!" - * } - * }; - * // Publish immediately - * await topic.publish(event); - * - * // Publish after 10 seconds delay - * await topic.publish(event, { delay: 10 }); - * } - * ``` - */ - async publish( - event: T | NitricEvent, - opts: PublishOptions = DEFAULT_PUBLISH_OPTS - ): Promise> { - const nitricEvent = - event instanceof NitricEvent ? event : new NitricEvent(event); - - const publishOpts = { - ...DEFAULT_PUBLISH_OPTS, - ...opts, - }; - const request = new EventPublishRequest(); - const evt = new PbEvent(); - - evt.setId(nitricEvent.id); - evt.setPayload(Struct.fromJavaScript(nitricEvent.payload)); - evt.setPayloadType(nitricEvent.payloadType); - - request.setTopic(this.name); - request.setEvent(evt); - request.setDelay(publishOpts.delay); - - return new Promise>((resolve, reject) => { - this.eventing.EventServiceClient.publish(request, (error, response) => { - if (error) { - reject(fromGrpcError(error)); - } else { - resolve( - new NitricEvent( - nitricEvent.payload, - response.getId(), - nitricEvent.payloadType - ) - ); - } - }); - }); - } -} - -/** - * Eventing object encapsulating the Nitric gRPC clients for Event and Topic services. - * - * Used to created references to Topics and perform Event publishing operations. - * - * @example - * ```typescript - * import { Eventing } from "@nitric/sdk"; - * const eventing = new Eventing(); - * const topic = eventing.topic('notifications'); - * ``` - */ -export class Eventing { - private _clients: { - event: EventServiceClient; - topic: TopicServiceClient; - } = undefined; - - get EventServiceClient(): EventServiceClient { - if (!this._clients) { - this._clients = newEventServiceClients(); - } - - return this._clients.event; - } - - get TopicServiceClient(): TopicServiceClient { - if (!this._clients) { - this._clients = newEventServiceClients(); - } - - return this._clients.topic; - } - - /** - * Get a reference to a Topic. - * - * @param name Name of the topic, as defined in nitric.yaml. - * @returns a topic resource. - * @example - * ```typescript - * import { Eventing } from "@nitric/sdk"; - * const eventing = new Eventing(); - * const topic = eventing.topic('notifications'); - * ``` - */ - public topic = Record>( - name: string - ): Topic { - if (!name) { - throw new Error('A topic name is needed to use a Topic.'); - } - - return new Topic(this, name); - } - - /** - * Retrieve all available topic references by querying for available topics. - * - * @returns A promise containing the list of available nitric topics - * @example - * ```typescript - * import { Eventing } from "@nitric/sdk"; - * - * const eventing = new Eventing(); - * - * const topics = await eventing.topics(); - * ``` - */ - public async topics(): Promise { - return new Promise((resolve, reject) => { - this.TopicServiceClient.list(null, (error, response) => { - if (error) { - reject(fromGrpcError(error)); - } else { - resolve( - response.getTopicsList().map((topic) => this.topic(topic.getName())) - ); - } - }); - }); - } -} - -// Events client singleton -let EVENTS = undefined; - -/** - * Events API client. - * - * @returns an Events API client. - * @example - * ```typescript - * import { events } from "@nitric/sdk"; - * - * async function publishEvent() { - * const topic = events().topic('notifications'); - * - * await topic.publish({ - * payload: { - * amazing: 'thing happened!', - * }, - * }); - * - * return 'Successfully published notification'; - * } - * ``` - */ -export const events = (): Eventing => { - if (!EVENTS) { - EVENTS = new Eventing(); - } - - return EVENTS; -}; diff --git a/src/api/index.ts b/src/api/index.ts index ed84a79b..85be48fe 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -11,8 +11,8 @@ // 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. -export * from './events'; -export * from './documents'; +export * from './topics'; export * from './queues'; +export * from './keyvalue'; export * from './storage'; export * from './secrets'; diff --git a/src/api/documents/index.ts b/src/api/keyvalue/index.ts similarity index 96% rename from src/api/documents/index.ts rename to src/api/keyvalue/index.ts index f27e8b6b..b6310b07 100644 --- a/src/api/documents/index.ts +++ b/src/api/keyvalue/index.ts @@ -11,4 +11,4 @@ // 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. -export * from './v0'; +export * from './v1'; diff --git a/src/api/documents/v0/index.ts b/src/api/keyvalue/v1/index.ts similarity index 89% rename from src/api/documents/v0/index.ts rename to src/api/keyvalue/v1/index.ts index 113f87bf..d05e569d 100644 --- a/src/api/documents/v0/index.ts +++ b/src/api/keyvalue/v1/index.ts @@ -11,4 +11,5 @@ // 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. -export * from './documents'; +export * from './keyvalue'; +export { ValueStructure } from './store'; diff --git a/src/api/documents/v0/constants.ts b/src/api/keyvalue/v1/keyvalue.test.ts similarity index 66% rename from src/api/documents/v0/constants.ts rename to src/api/keyvalue/v1/keyvalue.test.ts index 6d385b6d..57b8fd2e 100644 --- a/src/api/documents/v0/constants.ts +++ b/src/api/keyvalue/v1/keyvalue.test.ts @@ -11,4 +11,14 @@ // 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. -export const MAX_COLLECTION_DEPTH = 1; +import { keyvalue } from './keyvalue'; + +describe('KeyValue Client Tests', () => { + describe('Given a new store', () => { + test('Then store should contain correct store reference', () => { + const store = keyvalue().store('customers'); + + expect(store.name).toEqual('customers'); + }); + }); +}); diff --git a/src/api/keyvalue/v1/keyvalue.ts b/src/api/keyvalue/v1/keyvalue.ts new file mode 100644 index 00000000..80cb9ea3 --- /dev/null +++ b/src/api/keyvalue/v1/keyvalue.ts @@ -0,0 +1,55 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// 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 { SERVICE_BIND } from '../../../constants'; +import { KeyValueClient } from '@nitric/proto/keyvalue/v1/keyvalue_grpc_pb'; +import * as grpc from '@grpc/grpc-js'; +import { StoreRef, ValueStructure } from './store'; + +/** + * KeyValue + * + * Provides a KeyValue API client. + * Used to create references to key/value stores. + */ +export class KeyValue { + private kvClient: KeyValueClient; + + constructor() { + this.kvClient = new KeyValueClient( + SERVICE_BIND, + grpc.ChannelCredentials.createInsecure() + ); + } + + /** + * Gets a store instance that refers to the store at the specified path. + * + * @param name The name of the store (required) + * @returns The Store instance + */ + public store(name: string): StoreRef { + return new StoreRef(this.kvClient, name); + } +} + +// KeyValue client singleton +let KEY_VALUE = undefined; + +export const keyvalue = (): KeyValue => { + if (!KEY_VALUE) { + KEY_VALUE = new KeyValue(); + } + + return KEY_VALUE; +}; diff --git a/src/api/keyvalue/v1/store.ts b/src/api/keyvalue/v1/store.ts new file mode 100644 index 00000000..4b22875c --- /dev/null +++ b/src/api/keyvalue/v1/store.ts @@ -0,0 +1,123 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// 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 { + KeyValueDeleteRequest, + KeyValueGetRequest, + KeyValueGetResponse, + KeyValueSetRequest, + ValueRef, +} from '@nitric/proto/keyvalue/v1/keyvalue_pb'; +import { KeyValueClient } from '@nitric/proto/keyvalue/v1/keyvalue_grpc_pb'; +import { fromGrpcError } from '../../errors'; +import { Struct } from 'google-protobuf/google/protobuf/struct_pb'; + +export type ValueStructure = Record; + +/** + * StoreRef + * + * Provides a KeyValue API StoreRef class. + */ +export class StoreRef { + private kvClient: KeyValueClient; + public readonly name: string; + + constructor(kvClient: KeyValueClient, name: string) { + this.kvClient = kvClient; + this.name = name; + } + + /** + * Return a value from the store + * + * @param key The key of the value to retrieve + * + * @returns the value or null if not found + */ + public async get(key: string): Promise { + const request = new KeyValueGetRequest(); + const ref = new ValueRef(); + ref.setStore(this.name); + ref.setKey(key); + request.setRef(ref); + + return new Promise((resolve, reject) => { + this.kvClient.get(request, (error, response: KeyValueGetResponse) => { + if (error) { + reject(fromGrpcError(error)); + } else if (response.hasValue()) { + const value = response.getValue(); + const content = value.getContent().toJavaScript() as T; + + resolve(content); + } else { + resolve(null); + } + }); + }); + } + + /** + * Set a value in the store + * + * @param key The key to store the value against + * @param value The value to store + * + * @returns void + */ + public async set(key: string, value: T): Promise { + const request = new KeyValueSetRequest(); + const ref = new ValueRef(); + ref.setStore(this.name); + ref.setKey(key); + request.setRef(ref); + const content = Struct.fromJavaScript(value); + request.setContent(content); + + return new Promise((resolve, reject) => { + this.kvClient.set(request, (error) => { + if (error) { + reject(fromGrpcError(error)); + } else { + resolve(); + } + }); + }); + } + + /** + * Delete a value from the store + * + * @param key The key of the key/value pair to delete + * + * @returns void + */ + public async delete(key: string): Promise { + const request = new KeyValueDeleteRequest(); + const ref = new ValueRef(); + ref.setStore(this.name); + ref.setKey(key); + request.setRef(ref); + + return new Promise((resolve, reject) => { + this.kvClient.delete(request, (error) => { + if (error) { + reject(fromGrpcError(error)); + } else { + resolve(); + } + }); + }); + } +} diff --git a/src/api/queues/index.ts b/src/api/queues/index.ts index f27e8b6b..b6310b07 100644 --- a/src/api/queues/index.ts +++ b/src/api/queues/index.ts @@ -11,4 +11,4 @@ // 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. -export * from './v0'; +export * from './v1'; diff --git a/src/api/queues/v0/index.ts b/src/api/queues/v1/index.ts similarity index 100% rename from src/api/queues/v0/index.ts rename to src/api/queues/v1/index.ts diff --git a/src/api/queues/v0/queues.test.ts b/src/api/queues/v1/queues.test.ts similarity index 58% rename from src/api/queues/v0/queues.test.ts rename to src/api/queues/v1/queues.test.ts index 28be0fbd..b078ab75 100644 --- a/src/api/queues/v0/queues.test.ts +++ b/src/api/queues/v1/queues.test.ts @@ -11,17 +11,17 @@ // 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 { Queueing, ReceivedTask } from './queues'; +import { Queueing, DequeuedMessage as QueueItem } from './queues'; -import { QueueServiceClient as GrpcQueueServiceClient } from '@nitric/api/proto/queue/v1/queue_grpc_pb'; +import { QueuesClient } from '@nitric/proto/queues/v1/queues_grpc_pb'; import { - NitricTask, - FailedTask, + FailedEnqueueMessage, QueueCompleteResponse, - QueueReceiveResponse, - QueueSendBatchResponse, - QueueSendResponse, -} from '@nitric/api/proto/queue/v1/queue_pb'; + QueueDequeueResponse, + QueueEnqueueResponse, + QueueMessage, + DequeuedMessage, +} from '@nitric/proto/queues/v1/queues_pb'; import { Struct } from 'google-protobuf/google/protobuf/struct_pb'; import { UnimplementedError } from '../../errors'; @@ -33,11 +33,11 @@ describe('Queue Client Tests', () => { code: 12, message: 'UNIMPLEMENTED', }; - let sendMock; + let enqueueMock; beforeAll(() => { - sendMock = jest - .spyOn(GrpcQueueServiceClient.prototype, 'sendBatch') + enqueueMock = jest + .spyOn(QueuesClient.prototype, 'enqueue') .mockImplementation((request, callback: any) => { callback(MOCK_ERROR, null); @@ -49,31 +49,27 @@ describe('Queue Client Tests', () => { jest.resetAllMocks(); }); - it('Then Queue.send should reject', async () => { + it('Then Queue.enqueue should reject', async () => { const queueing = new Queueing(); await expect( - queueing.queue('test').send({ - id: 'task', - payloadType: 'test', - payload: { test: 1 }, - }) - ).rejects.toEqual(new UnimplementedError('UNIMPLEMENTED')); + queueing.queue('test').enqueue({ test: 1 }) + ).rejects.toBeInstanceOf(UnimplementedError); }); - it('Then Queue.send should be called once', async () => { - expect(sendMock).toBeCalledTimes(1); + it('Then Queue.enqueue should be called once', async () => { + expect(enqueueMock).toBeCalledTimes(1); }); }); - describe('Given nitric.api.queue.QueueServiceClient.Send succeeds when an array of tasks are sent', () => { - let sendMock; + describe('Given nitric.api.queue.QueueServiceClient.Send succeeds when an array of messages are sent', () => { + let enqueueMock; beforeAll(() => { - sendMock = jest - .spyOn(GrpcQueueServiceClient.prototype, 'sendBatch') + enqueueMock = jest + .spyOn(QueuesClient.prototype, 'enqueue') .mockImplementation((request, callback: any) => { - const mockResponse = new QueueSendBatchResponse(); + const mockResponse = new QueueEnqueueResponse(); callback(null, mockResponse); @@ -85,47 +81,37 @@ describe('Queue Client Tests', () => { jest.resetAllMocks(); }); - it('Then Queue.Send with an array of tasks should resolve with no failed messages', async () => { + it('Then Queue.Send with an array of messages should resolve with no failed messages', async () => { const queueing = new Queueing(); await expect( - queueing.queue('test').send([ - { - id: 'task', - payloadType: 'test', - payload: { test: 1 }, - }, - ]) + queueing.queue('test').enqueue([{ test: 1 }]) ).resolves.toEqual([]); }); - it('Then Queue.Send with one task should resolve with no failed messages', async () => { + it('Then Queue.Send with one message should resolve with no failed messages', async () => { const queueing = new Queueing(); await expect( - queueing.queue('test').send({ - id: 'task', - payloadType: 'test', - payload: { test: 1 }, - }) + queueing.queue('test').enqueue({ test: 1 }) ).resolves.toEqual(undefined); }); it('Then Queue.Send should be called once', async () => { - expect(sendMock).toBeCalledTimes(2); + expect(enqueueMock).toBeCalledTimes(2); }); }); }); - describe('Receive', () => { - describe('Given nitric.api.queue.QueueServiceClient.Receive throws an error', () => { + describe('Dequeue', () => { + describe('Given nitric.api.queue.QueueServiceClient.Dequeue throws an error', () => { const MOCK_ERROR = { code: 12, message: 'UNIMPLEMENTED', }; - let receiveMock; + let dequeueMock; beforeAll(() => { - receiveMock = jest - .spyOn(GrpcQueueServiceClient.prototype, 'receive') + dequeueMock = jest + .spyOn(QueuesClient.prototype, 'dequeue') .mockImplementation((request, callback: any) => { callback(MOCK_ERROR, null); @@ -137,11 +123,11 @@ describe('Queue Client Tests', () => { jest.resetAllMocks(); }); - it('Then Queue.receive should reject', async () => { + it('Then Queue.dequeue should reject', async () => { const queueing = new Queueing(); - await expect(queueing.queue('test').receive(1)).rejects.toEqual( - new UnimplementedError('UNIMPLEMENTED') + await expect(queueing.queue('test').dequeue(1)).rejects.toBeInstanceOf( + UnimplementedError ); }); }); @@ -149,10 +135,10 @@ describe('Queue Client Tests', () => { describe('Given no queue items are returned', () => { beforeAll(() => { jest - .spyOn(GrpcQueueServiceClient.prototype, 'receive') + .spyOn(QueuesClient.prototype, 'dequeue') .mockImplementation((request, callback: any) => { - const mockResponse = new QueueReceiveResponse(); - mockResponse.setTasksList([]); + const mockResponse = new QueueDequeueResponse(); + mockResponse.setMessagesList([]); // const mockResponse = new PushResponse() // mockResponse.setFailedmessagesList([]) @@ -166,39 +152,31 @@ describe('Queue Client Tests', () => { jest.resetAllMocks(); }); - it('Then Queue.receive should resolve with an empty array', async () => { + it('Then Queue.dequeue should resolve with an empty array', async () => { const queueing = new Queueing(); - await expect(queueing.queue('test').receive(1)).resolves.toEqual([]); + await expect(queueing.queue('test').dequeue(1)).resolves.toEqual([]); }); }); describe('Given queue items are returned', () => { const queueName = 'test'; - const mockTasks = [ - { - id: 'test', - payloadType: 'Test Payload', - payload: { - test: 'test', - }, - }, - ]; + const mockMessages = [{ test: 'test' }]; beforeAll(() => { jest - .spyOn(GrpcQueueServiceClient.prototype, 'receive') + .spyOn(QueuesClient.prototype, 'dequeue') .mockImplementation((request, callback: any) => { - const mockResponse = new QueueReceiveResponse(); - mockResponse.setTasksList( - mockTasks.map((e) => { - const task = new NitricTask(); + const mockResponse = new QueueDequeueResponse(); + mockResponse.setMessagesList( + mockMessages.map((e) => { + const originalMessage = new QueueMessage(); + originalMessage.setStructPayload(Struct.fromJavaScript(e)); + const message = new DequeuedMessage(); - task.setId(e.id); - task.setPayloadType(e.payloadType); - task.setPayload(Struct.fromJavaScript(e.payload)); - task.setLeaseId(e.id); + message.setMessage(originalMessage); + message.setLeaseId('test-lease-id'); - return task; + return message; }) ); @@ -212,15 +190,15 @@ describe('Queue Client Tests', () => { jest.resetAllMocks(); }); - it('Then Queue.receive should resolve with an array of tasks', async () => { + it('Then Queue.dequeue should resolve with an array of messages', async () => { const queueing = new Queueing(); const queue = queueing.queue('test'); - await expect(queue.receive(1)).resolves.toEqual( - mockTasks.map((e) => { + await expect(queue.dequeue(1)).resolves.toEqual( + mockMessages.map((e) => { return expect.objectContaining({ - leaseId: e.id, + leaseId: 'test-lease-id', queue: queue, - ...e, + payload: e, }); }) ); @@ -238,7 +216,7 @@ describe('Queue Client Tests', () => { beforeAll(() => { completeMock = jest - .spyOn(GrpcQueueServiceClient.prototype, 'complete') + .spyOn(QueuesClient.prototype, 'complete') .mockImplementation((request, callback: any) => { callback(MOCK_ERROR, null); @@ -252,16 +230,14 @@ describe('Queue Client Tests', () => { it('Then Queue.complete should reject', async () => { const queueing = new Queueing(); - const task = new ReceivedTask({ - id: 'task', - payloadType: 'test', + const message = new QueueItem({ leaseId: '1', - payload: { test: 1 }, + message: { test: 1 }, queue: queueing.queue('test'), }); - await expect(task.complete()).rejects.toEqual( - new UnimplementedError('UNIMPLEMENTED') + await expect(message.complete()).rejects.toBeInstanceOf( + UnimplementedError ); }); @@ -275,7 +251,7 @@ describe('Queue Client Tests', () => { beforeAll(() => { completeMock = jest - .spyOn(GrpcQueueServiceClient.prototype, 'complete') + .spyOn(QueuesClient.prototype, 'complete') .mockImplementation((request, callback: any) => { const mockResponse = new QueueCompleteResponse(); @@ -291,15 +267,13 @@ describe('Queue Client Tests', () => { it('Then Queue.Complete should resolve with no failed messages', async () => { const queueing = new Queueing(); - const task = new ReceivedTask({ - id: 'task', - payloadType: 'test', + const message = new QueueItem({ leaseId: '1', - payload: { test: 1 }, + message: { test: 1 }, queue: queueing.queue('test'), }); - await expect(task.complete()).resolves.toBeUndefined(); + await expect(message.complete()).resolves.toBeUndefined(); }); it('Then Queue.complete should be called once', async () => { diff --git a/src/api/queues/v0/queues.ts b/src/api/queues/v1/queues.ts similarity index 54% rename from src/api/queues/v0/queues.ts rename to src/api/queues/v1/queues.ts index f1ee45eb..316a1880 100644 --- a/src/api/queues/v0/queues.ts +++ b/src/api/queues/v1/queues.ts @@ -11,47 +11,24 @@ // 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 { QueueServiceClient } from '@nitric/api/proto/queue/v1/queue_grpc_pb'; +import { QueuesClient as QueueServiceClient } from '@nitric/proto/queues/v1/queues_grpc_pb'; import { - NitricTask as NitricTaskPb, - QueueSendRequest, - QueueSendBatchRequest, - QueueReceiveRequest, + QueueEnqueueRequest, + QueueDequeueRequest, QueueCompleteRequest, -} from '@nitric/api/proto/queue/v1/queue_pb'; + QueueMessage, +} from '@nitric/proto/queues/v1/queues_pb'; import { SERVICE_BIND } from '../../../constants'; import * as grpc from '@grpc/grpc-js'; -import { NitricTask } from '../../../types'; import { Struct } from 'google-protobuf/google/protobuf/struct_pb'; -import { - fromGrpcError, - InvalidArgumentError, - InternalError, -} from '../../errors'; +import { fromGrpcError } from '../../errors'; /** * A message that has failed to be enqueued */ interface FailedMessage { - task: NitricTask; - message: string; -} - -/** - * Converts and SDK task representation to a wire representation to be sent to the Nitric Server. - * - * @internal - * @param task to convert - * @returns the wire representation of the task - */ -function taskToWire(task: NitricTask) { - const wireTask = new NitricTaskPb(); - - wireTask.setId(task.id); - wireTask.setPayloadType(task.payloadType); - wireTask.setPayload(Struct.fromJavaScript(task.payload)); - - return wireTask; + message: T; + details: string; } /** @@ -95,16 +72,16 @@ export class Queue = Record> { } /** - * Send an task to a queue, which can be retrieved by other services. + * Send an message to a queue, which can be retrieved by other services. * - * If an array of tasks is provided the returns promise will resolve to an array containing - * any tasks that failed to be sent to the queue. + * If an array of messages is provided the returns promise will resolve to an array containing + * any messages that failed to be sent to the queue. * - * When a single task is provided a void promise will be returned, which rejects if the - * task fails to be sent to the queue. + * When a single message is provided a void promise will be returned, which rejects if the + * message fails to be sent to the queue. * - * @param tasks one or more tasks to push to the queue - * @returns A void promise for a single task or a list of failed tasks when sending an array of tasks. + * @param messages one or more messages to push to the queue + * @returns A void promise for a single message or a list of failed messages when enqueueing an array of messages. * * Example: * ```typescript @@ -112,67 +89,58 @@ export class Queue = Record> { * * const queueing = new Queueing(); * const queue = queueing.queue("my-queue") - * await queue.send({ - * id: "1234"; - * payloadType: "my-payload"; - * payload: { - * value: "test" - * }; - * }); + * await queue.enqueue({ value: "test" }); */ - public async send(tasks: T[] | NitricTask[]): Promise[]>; - public async send(tasks: T | NitricTask): Promise; - public async send( - tasks: T[] | T | NitricTask | NitricTask[] - ): Promise[]> { + public async enqueue(messages: T[]): Promise[]>; + public async enqueue(messages: T): Promise; + public async enqueue(messages: T[] | T): Promise[]> { return new Promise((resolve, reject) => { - const request = new QueueSendBatchRequest(); + const request = new QueueEnqueueRequest(); - // Convert to NitricTask if not specified - const tasksArray = Array.isArray(tasks) ? tasks : [tasks]; - const nitricTasksArray = tasksArray.map((t) => - t instanceof NitricTask ? t : new NitricTask({ payload: t }) - ); + const messagesArray = Array.isArray(messages) ? messages : [messages]; - request.setTasksList(nitricTasksArray.map(taskToWire)); - request.setQueue(this.name); + request.setMessagesList( + messagesArray.map((inputMsg) => { + const message = new QueueMessage(); + message.setStructPayload(Struct.fromJavaScript(inputMsg)); + return message; + }) + ); + request.setQueueName(this.name); - this.queueing.QueueServiceClient.sendBatch(request, (error, response) => { + this.queueing.QueueServiceClient.enqueue(request, (error, response) => { if (error) { reject(fromGrpcError(error)); return; } - const failedTasks = response.getFailedtasksList().map((m) => ({ - task: new NitricTask({ - id: m.getTask().getId(), - payloadType: m.getTask().getPayloadType(), - payload: m.getTask().getPayload().toJavaScript() as T, - }), - message: m.getMessage(), + const failed = response.getFailedMessagesList().map((m) => ({ + message: m.getMessage().getStructPayload().toJavaScript() as T, + details: m.getDetails(), })); - if (!Array.isArray(tasks)) { - // Single Task returns - if (failedTasks.length > 0) { - reject(new Error(failedTasks[0].message)); + if (!Array.isArray(messages)) { + // Single message returns + if (failed.length > 0) { + reject(new Error(failed[0].details)); } resolve(); } else { - // Array of Tasks return - resolve(failedTasks); + // Multiple messages returns + resolve(failed); } }); }); } + /** * Pop 1 or more queue items from the specified queue up to the depth limit. * - * Nitric Tasks are leased for a limited period of time, where they may be worked on. + * Queue Messages are leased for a limited period of time, where they may be worked on. * Once complete or failed they must be acknowledged using request specified leaseId. * - * If the lease on a queue item expires before it is acknowledged or the lease is extended the task will be returned to the queue for reprocessing. + * If the lease on a queue item expires before it is acknowledged the message will be returned to the queue for reprocessing. * * @param depth the maximum number of items to return. Default 1, Min 1. - * @returns The list of received tasks + * @returns The list of dequeued messages * * Example: * ```typescript @@ -180,33 +148,31 @@ export class Queue = Record> { * * const queueing = new Queueing(); * - * const [task] = await queueing.queue("my-queue").receive(); + * const [message] = await queueing.queue("my-queue").dequeue(); * - * // do something with task + * // do something with the message * ``` */ - public async receive(depth?: number): Promise[]> { + public async dequeue(depth?: number): Promise[]> { return new Promise((resolve, reject) => { - const request = new QueueReceiveRequest(); + const request = new QueueDequeueRequest(); // Set the default and min depth to 1. if (Number.isNaN(depth) || depth < 1) { depth = 1; } - request.setQueue(this.name); + request.setQueueName(this.name); request.setDepth(depth); - this.queueing.QueueServiceClient.receive(request, (error, response) => { + this.queueing.QueueServiceClient.dequeue(request, (error, response) => { if (error) { reject(fromGrpcError(error)); } else { resolve( - response.getTasksList().map((m) => { - return new ReceivedTask({ - id: m.getId(), - payload: m.getPayload().toJavaScript() as T, - payloadType: m.getPayloadType(), + response.getMessagesList().map((m) => { + return new DequeuedMessage({ + message: m.getMessage().getStructPayload().toJavaScript() as T, leaseId: m.getLeaseId(), queue: this, }); @@ -218,26 +184,23 @@ export class Queue = Record> { } } -export class ReceivedTask< +export class DequeuedMessage< T extends Record = Record -> extends NitricTask { +> { + payload: T; leaseId: string; queue: Queue; constructor({ - id, leaseId, - payload, - payloadType, + message: payload, queue, }: { - id: string; - payload: T; - payloadType: string; + message: T; leaseId: string; queue: Queue; }) { - super({ id, payloadType, payload }); + this.payload = payload; this.leaseId = leaseId; this.queue = queue; } @@ -253,19 +216,19 @@ export class ReceivedTask< * * const queueing = new Queueing(); * - * const [task] = await queueing.queue("my-queue").receive(); + * const [message] = await queueing.queue("my-queue").dequeue(); * - * // do something with task + * // do something with the message * - * // complete the task - * await task.complete(); + * // remove the message from the queue + * await message.complete(); * ``` */ public async complete(): Promise { try { const request = new QueueCompleteRequest(); - request.setQueue(this.queue.name); + request.setQueueName(this.queue.name); request.setLeaseId(this.leaseId); return await new Promise((resolve, reject) => { @@ -297,7 +260,7 @@ let QUEUES = undefined; * async function publishToQueue() { * await queues() * .queue('my-queue') - * .send({ + * .enqueue({ * payload: { * example: 'payload', * }, diff --git a/src/api/secrets/index.ts b/src/api/secrets/index.ts index f27e8b6b..b6310b07 100644 --- a/src/api/secrets/index.ts +++ b/src/api/secrets/index.ts @@ -11,4 +11,4 @@ // 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. -export * from './v0'; +export * from './v1'; diff --git a/src/api/secrets/v0/index.ts b/src/api/secrets/v1/index.ts similarity index 100% rename from src/api/secrets/v0/index.ts rename to src/api/secrets/v1/index.ts diff --git a/src/api/secrets/v0/secret.test.ts b/src/api/secrets/v1/secret.test.ts similarity index 82% rename from src/api/secrets/v0/secret.test.ts rename to src/api/secrets/v1/secret.test.ts index 888be409..570a5839 100644 --- a/src/api/secrets/v0/secret.test.ts +++ b/src/api/secrets/v1/secret.test.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. import { Secrets } from './secrets'; -import { SecretServiceClient as GrpcSecretClient } from '@nitric/api/proto/secret/v1/secret_grpc_pb'; +import { SecretManagerClient as GrpcSecretClient } from '@nitric/proto/secrets/v1/secrets_grpc_pb'; import { SecretPutRequest, SecretPutResponse, @@ -20,19 +20,20 @@ import { SecretAccessResponse, SecretVersion as GrpcSecretVersion, Secret as GrpcSecret, -} from '@nitric/api/proto/secret/v1/secret_pb'; +} from '@nitric/proto/secrets/v1/secrets_pb'; import { UnimplementedError } from '../../errors'; +import { Metadata, status } from '@grpc/grpc-js'; describe('Secrets Client Tests', () => { describe('Given nitric.api.secrets.SecretsClient.Put throws an error', () => { const MOCK_ERROR = { - code: 12, + code: status.UNIMPLEMENTED, message: 'UNIMPLEMENTED', }; - let sendMock; + let putMock; beforeAll(() => { - sendMock = jest + putMock = jest .spyOn(GrpcSecretClient.prototype, 'put') .mockImplementation((request, callback: any) => { callback(MOCK_ERROR, null); @@ -47,22 +48,21 @@ describe('Secrets Client Tests', () => { it('then Secret.put should reject', async () => { const secrets = new Secrets(); - - await expect(secrets.secret('test').put('test-secret')).rejects.toEqual( - new UnimplementedError('UNIMPLEMENTED') - ); + await expect( + secrets.secret('test').put('test-secret') + ).rejects.toBeInstanceOf(UnimplementedError); }); it('then Secret.put should be called once', () => { - expect(sendMock).toBeCalledTimes(1); + expect(putMock).toBeCalledTimes(1); }); }); describe('Given nitric.api.secrets.SecretsClient.Put succeeds', () => { - let sendMock; + let putMock; beforeAll(() => { - sendMock = jest + putMock = jest .spyOn(GrpcSecretClient.prototype, 'put') .mockImplementation((request, callback: any) => { const mockResponse = new SecretPutResponse(); @@ -93,19 +93,19 @@ describe('Secrets Client Tests', () => { }); it('Then Secret.Put should be called once', async () => { - expect(sendMock).toBeCalledTimes(1); + expect(putMock).toBeCalledTimes(1); }); }); describe('Given nitric.api.secrets.SecretsClient.Access throws an error', () => { const MOCK_ERROR = { - code: 12, - message: 'UNIMPLEMENTED', + code: status.UNIMPLEMENTED, + message: 'The operation is not implemented.', }; - let sendMock; + let accessMock; beforeAll(() => { - sendMock = jest + accessMock = jest .spyOn(GrpcSecretClient.prototype, 'access') .mockImplementation((request, callback: any) => { callback(MOCK_ERROR, null); @@ -121,21 +121,21 @@ describe('Secrets Client Tests', () => { it('then Secret.access should reject', async () => { const secrets = new Secrets(); - await expect(secrets.secret('test').latest().access()).rejects.toEqual( - new UnimplementedError('UNIMPLEMENTED') - ); + await expect( + secrets.secret('test').latest().access() + ).rejects.toBeInstanceOf(UnimplementedError); }); it('then Secret.access should be called once', () => { - expect(sendMock).toBeCalledTimes(1); + expect(accessMock).toBeCalledTimes(1); }); }); describe('Given nitric.api.secrets.SecretsClient.Access succeeds', () => { - let sendMock; + let accessMock; beforeAll(() => { - sendMock = jest + accessMock = jest .spyOn(GrpcSecretClient.prototype, 'access') .mockImplementation((request, callback: any) => { const mockResponse = new SecretAccessResponse(); @@ -170,7 +170,7 @@ describe('Secrets Client Tests', () => { }); it('Then Secret.access should be called once', async () => { - expect(sendMock).toBeCalledTimes(1); + expect(accessMock).toBeCalledTimes(1); }); }); }); diff --git a/src/api/secrets/v0/secrets.ts b/src/api/secrets/v1/secrets.ts similarity index 95% rename from src/api/secrets/v0/secrets.ts rename to src/api/secrets/v1/secrets.ts index a6be5d25..3ca2f04c 100644 --- a/src/api/secrets/v0/secrets.ts +++ b/src/api/secrets/v1/secrets.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. import { SERVICE_BIND } from '../../../constants'; -import { SecretServiceClient } from '@nitric/api/proto/secret/v1/secret_grpc_pb'; +import { SecretManagerClient } from '@nitric/proto/secrets/v1/secrets_grpc_pb'; import { SecretPutRequest, SecretPutResponse, @@ -20,9 +20,9 @@ import { SecretAccessResponse, SecretVersion as GrpcSecretVersion, Secret as GrpcSecret, -} from '@nitric/api/proto/secret/v1/secret_pb'; +} from '@nitric/proto/secrets/v1/secrets_pb'; import * as grpc from '@grpc/grpc-js'; -import { fromGrpcError, InvalidArgumentError } from '../../errors'; +import { fromGrpcError } from '../../errors'; const ENCODER = new TextEncoder(); const DECODER = new TextDecoder(); @@ -31,10 +31,10 @@ const DECODER = new TextDecoder(); * Nitric secret client, facilitates writing and and accessing secrets.cd ../ */ export class Secrets { - SecretServiceClient: SecretServiceClient; + SecretManagerClient: SecretManagerClient; constructor() { - this.SecretServiceClient = new SecretServiceClient( + this.SecretManagerClient = new SecretManagerClient( SERVICE_BIND, grpc.ChannelCredentials.createInsecure() ); @@ -96,7 +96,7 @@ export class Secret { request.setSecret(Secret.toWire(this)); request.setValue(secretBuff); - this.secrets.SecretServiceClient.put( + this.secrets.SecretManagerClient.put( request, (error, response: SecretPutResponse) => { if (error) { @@ -198,7 +198,7 @@ class SecretVersion { const request = new SecretAccessRequest(); request.setSecretVersion(SecretVersion.toWire(this)); - this.secrets.SecretServiceClient.access( + this.secrets.SecretManagerClient.access( request, (error, response: SecretAccessResponse) => { if (error) { diff --git a/src/api/storage/index.ts b/src/api/storage/index.ts index f27e8b6b..b6310b07 100644 --- a/src/api/storage/index.ts +++ b/src/api/storage/index.ts @@ -11,4 +11,4 @@ // 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. -export * from './v0'; +export * from './v1'; diff --git a/src/api/storage/v0/index.ts b/src/api/storage/v1/index.ts similarity index 100% rename from src/api/storage/v0/index.ts rename to src/api/storage/v1/index.ts diff --git a/src/api/storage/v0/storage.test.ts b/src/api/storage/v1/storage.test.ts similarity index 79% rename from src/api/storage/v0/storage.test.ts rename to src/api/storage/v1/storage.test.ts index 4e959ad0..734aa2e4 100644 --- a/src/api/storage/v0/storage.test.ts +++ b/src/api/storage/v1/storage.test.ts @@ -12,32 +12,35 @@ // See the License for the specific language governing permissions and // limitations under the License. import { Bucket, FileMode, Storage } from './storage'; -import { StorageServiceClient as GrpcStorageClient } from '@nitric/api/proto/storage/v1/storage_grpc_pb'; +import { StorageClient as GrpcStorageClient } from '@nitric/proto/storage/v1/storage_grpc_pb'; import { StorageWriteResponse, StorageReadResponse, StorageDeleteResponse, StoragePreSignUrlResponse, StoragePreSignUrlRequest, - StorageListFilesResponse, - File, + StorageListBlobsResponse, + Blob, StorageExistsResponse, -} from '@nitric/api/proto/storage/v1/storage_pb'; +} from '@nitric/proto/storage/v1/storage_pb'; import { UnimplementedError } from '../../errors'; import { + BucketNotification, BucketNotificationType, BucketNotificationWorkerOptions, + FileNotification, FileNotificationWorkerOptions, bucket, } from '@nitric/sdk/resources'; -import { faas } from '@nitric/sdk'; -import { ResourceServiceClient } from '@nitric/sdk/gen/proto/resource/v1/resource_grpc_pb'; -import { ResourceDeclareResponse } from '@nitric/sdk/gen/proto/resource/v1/resource_pb'; +import { ResourcesClient } from '@nitric/proto/resources/v1/resources_grpc_pb'; +import { ResourceDeclareResponse } from '@nitric/proto/resources/v1/resources_pb'; +import { toDuration } from '@nitric/sdk/resources/common'; +import { Metadata, status } from '@grpc/grpc-js'; describe('Storage Client Tests', () => { describe('Given nitric.api.storage.StorageClient.Write throws an error', () => { const MOCK_ERROR = { - code: 2, + code: status.UNIMPLEMENTED, message: 'UNIMPLEMENTED', }; let writeMock; @@ -60,7 +63,7 @@ describe('Storage Client Tests', () => { const storage = new Storage(); await expect( storage.bucket('test_bucket').file('test/item').write(new Uint8Array()) - ).rejects.toEqual(new UnimplementedError('UNIMPLEMENTED')); + ).rejects.toBeInstanceOf(UnimplementedError); }); test('The Grpc client for Storage.write should have been called exactly once', () => { @@ -100,7 +103,7 @@ describe('Storage Client Tests', () => { describe('Given nitric.api.storage.StorageClient.Read throws an error', () => { const MOCK_ERROR = { - code: 2, + code: status.UNIMPLEMENTED, message: 'UNIMPLEMENTED', }; let readMock; @@ -123,7 +126,7 @@ describe('Storage Client Tests', () => { const storage = new Storage(); await expect( storage.bucket('test_bucket').file('test/item').read() - ).rejects.toEqual(new UnimplementedError('UNIMPLEMENTED')); + ).rejects.toBeInstanceOf(UnimplementedError); }); test('The Grpc client for Storage.read should have been called exactly once', () => { @@ -166,7 +169,7 @@ describe('Storage Client Tests', () => { describe('Given nitric.api.storage.StorageClient.Exists throws an error', () => { const MOCK_ERROR = { - code: 2, + code: status.UNIMPLEMENTED, message: 'UNIMPLEMENTED', }; let existsMock; @@ -189,7 +192,7 @@ describe('Storage Client Tests', () => { const storage = new Storage(); await expect( storage.bucket('test_bucket').file('test/item').exists() - ).rejects.toEqual(new UnimplementedError('UNIMPLEMENTED')); + ).rejects.toBeInstanceOf(UnimplementedError); }); test('The Grpc client for Storage.write should have been called exactly once', () => { @@ -229,7 +232,7 @@ describe('Storage Client Tests', () => { describe('Given nitric.api.storage.StorageClient.Delete throws an error', () => { const MOCK_ERROR = { - code: 2, + code: status.UNIMPLEMENTED, message: 'UNIMPLEMENTED', }; let deleteMock; @@ -250,9 +253,9 @@ describe('Storage Client Tests', () => { test('Then StorageClient.delete should reject', async () => { const client = new Storage(); - await expect(client.bucket('test').file('test').delete()).rejects.toEqual( - new UnimplementedError('UNIMPLEMENTED') - ); + await expect( + client.bucket('test').file('test').delete() + ).rejects.toBeInstanceOf(UnimplementedError); }); test('The Grpc client for Storage.delete should have been called exactly once', () => { @@ -291,7 +294,7 @@ describe('Storage Client Tests', () => { describe('Given nitric.api.storage.StorageClient.PresignUrl throws an error', () => { const MOCK_ERROR = { - code: 2, + code: status.UNIMPLEMENTED, message: 'UNIMPLEMENTED', }; let signUrlMock; @@ -313,8 +316,8 @@ describe('Storage Client Tests', () => { test('Then file.signUrl should reject', async () => { const client = new Storage(); await expect( - client.bucket('test').file('test').signUrl(FileMode.Read) - ).rejects.toEqual(new UnimplementedError('UNIMPLEMENTED')); + client.bucket('test').file('test').getDownloadUrl() + ).rejects.toBeInstanceOf(UnimplementedError); }); test('The Grpc client for file.signUrl should have been called exactly once', () => { @@ -363,7 +366,7 @@ describe('Storage Client Tests', () => { MOCK_REQUEST.setBucketName('test_bucket'); MOCK_REQUEST.setKey('test/item'); MOCK_REQUEST.setOperation(FileMode.Read); - MOCK_REQUEST.setExpiry(600); + MOCK_REQUEST.setExpiry(toDuration(600)); expect(preSignUrlMock).toBeCalledWith(MOCK_REQUEST, expect.anything()); }); }); @@ -390,7 +393,7 @@ describe('Storage Client Tests', () => { MOCK_REQUEST.setBucketName('test_bucket'); MOCK_REQUEST.setKey('test/item'); MOCK_REQUEST.setOperation(FileMode.Write); - MOCK_REQUEST.setExpiry(600); + MOCK_REQUEST.setExpiry(toDuration(600)); expect(preSignUrlMock).toBeCalledWith(MOCK_REQUEST, expect.anything()); }); }); @@ -417,23 +420,24 @@ describe('Storage Client Tests', () => { MOCK_REQUEST.setBucketName('test_bucket'); MOCK_REQUEST.setKey('test/item'); MOCK_REQUEST.setOperation(FileMode.Read); - MOCK_REQUEST.setExpiry(600); + MOCK_REQUEST.setExpiry(toDuration(600)); expect(preSignUrlMock).toBeCalledWith(MOCK_REQUEST, expect.anything()); }); }); }); - describe('Given nitric.api.storage.StorageClient.ListFiles throws an error', () => { + describe('Given nitric.api.storage.StorageClient.listBlobs throws an error', () => { const MOCK_ERROR = { - code: 2, + code: status.UNIMPLEMENTED, message: 'UNIMPLEMENTED', }; let listFilesMock; beforeAll(() => { + jest.spyOn(console, 'error').mockImplementation(() => {}); listFilesMock = jest - .spyOn(GrpcStorageClient.prototype, 'listFiles') + .spyOn(GrpcStorageClient.prototype, 'listBlobs') .mockImplementation((_, callback: any) => { callback(MOCK_ERROR, null); @@ -442,26 +446,26 @@ describe('Storage Client Tests', () => { }); afterAll(() => { - jest.resetAllMocks(); + jest.restoreAllMocks(); }); - test('Then StorageClient.listFiles should reject', async () => { + test('Then StorageClient.listBlobs should reject', async () => { const client = new Storage(); - await expect(client.bucket('test').files()).rejects.toEqual( - new UnimplementedError('UNIMPLEMENTED') + await expect(client.bucket('test').files()).rejects.toBeInstanceOf( + UnimplementedError ); }); - test('The Grpc client for Storage.listFiles should have been called exactly once', () => { + test('The Grpc client for Storage.listBlobs should have been called exactly once', () => { expect(listFilesMock).toBeCalledTimes(1); }); }); - describe('Given nitric.api.storage.StorageClient.ListFiles succeeds', () => { - const MOCK_REPLY = new StorageListFilesResponse(); - MOCK_REPLY.setFilesList( + describe('Given nitric.api.storage.StorageClient.listBlobs succeeds', () => { + const MOCK_REPLY = new StorageListBlobsResponse(); + MOCK_REPLY.setBlobsList( ['test/test.txt'].map((k) => { - const f = new File(); + const f = new Blob(); f.setKey(k); return f; }) @@ -471,7 +475,7 @@ describe('Storage Client Tests', () => { beforeAll(() => { listFilesMock = jest - .spyOn(GrpcStorageClient.prototype, 'listFiles') + .spyOn(GrpcStorageClient.prototype, 'listBlobs') .mockImplementation((_, callback: any) => { callback(null, MOCK_REPLY); @@ -483,7 +487,7 @@ describe('Storage Client Tests', () => { jest.resetAllMocks(); }); - test('Then StorageClient.listFiles should return files', async () => { + test('Then StorageClient.listBlobs should return files', async () => { const client = new Storage(); const files = await client.bucket('test').files(); @@ -491,19 +495,21 @@ describe('Storage Client Tests', () => { expect(files[0].name).toBe('test/test.txt'); }); - test('The Grpc client for Storage.listFiles should have been called exactly once', () => { + test('The Grpc client for Storage.listBlobs should have been called exactly once', () => { expect(listFilesMock).toBeCalledTimes(1); }); }); }); -jest.mock('../../../faas/index'); - describe('bucket notification', () => { - const startSpy = jest - .spyOn(faas.Faas.prototype, 'start') - .mockReturnValue(Promise.resolve()); - const mockFn = jest.fn(); + let startSpy; + let mockFn; + beforeAll(() => { + startSpy = jest + .spyOn(BucketNotification.prototype as any, 'start') + .mockReturnValue(Promise.resolve()); + mockFn = jest.fn(); + }); afterAll(() => { jest.clearAllMocks(); @@ -518,19 +524,6 @@ describe('bucket notification', () => { await bucket('test-bucket').on('write', 'test.png', mockFn); }); - it('should create a new FaasClient', () => { - expect(faas.Faas).toBeCalledTimes(1); - }); - - it('should provide Faas with BucketNotificationWorkerOptions', () => { - const expectedOpts = new BucketNotificationWorkerOptions( - 'test-bucket', - 'write', - 'test.png' - ); - expect(faas.Faas).toBeCalledWith(expectedOpts); - }); - it('should call FaasClient::start()', () => { expect(startSpy).toBeCalledTimes(1); }); @@ -545,19 +538,6 @@ describe('bucket notification', () => { await bucket('test-bucket').on('delete', 'test.png', mockFn); }); - it('should create a new FaasClient', () => { - expect(faas.Faas).toBeCalledTimes(1); - }); - - it('should provide Faas with BucketNotificationWorkerOptions', () => { - const expectedOpts = new BucketNotificationWorkerOptions( - 'test-bucket', - 'delete', - 'test.png' - ); - expect(faas.Faas).toBeCalledWith(expectedOpts); - }); - it('should call FaasClient::start()', () => { expect(startSpy).toBeCalledTimes(1); }); @@ -565,48 +545,43 @@ describe('bucket notification', () => { }); describe('file notification', () => { - const startSpy = jest - .spyOn(faas.Faas.prototype, 'start') - .mockReturnValue(Promise.resolve()); + let startSpy; + let existsSpy; + let mockFn; + + beforeAll(() => { + jest.spyOn(console, 'error').mockImplementation(() => {}); + startSpy = jest + .spyOn(FileNotification.prototype as any, 'start') + .mockReturnValue(Promise.resolve()); + + existsSpy = jest + .spyOn(ResourcesClient.prototype, 'declare') + .mockImplementation((_, callback: any) => { + const response = new ResourceDeclareResponse(); + callback(null, response); + return null as any; + }); - const existsSpy = jest - .spyOn(ResourceServiceClient.prototype, 'declare') - .mockImplementation((_, callback: any) => { - const response = new ResourceDeclareResponse(); - callback(null, response); - return null as any; - }); + mockFn = jest.fn(); + }); - const mockFn = jest.fn(); + afterAll(() => { + jest.restoreAllMocks(); + }); describe('When registering a file notification for creating', () => { let bucketResource: Bucket; beforeAll(async () => { + jest.resetAllMocks(); bucketResource = bucket('test-bucket-create').for('reading'); await bucketResource.on('write', 'test.png', mockFn); }); - afterAll(() => { - jest.resetAllMocks(); - }); - it('should declare the new resource', () => { expect(existsSpy).toBeCalledTimes(1); }); - it('should create a new FaasClient', () => { - expect(faas.Faas).toBeCalledTimes(1); - }); - - it('should provide Faas with FileNotificationWorkerOptions', () => { - const expectedOpts = new FileNotificationWorkerOptions( - bucketResource, - 'write', - 'test.png' - ); - expect(faas.Faas).toBeCalledWith(expectedOpts); - }); - it('should call FaasClient::start()', () => { expect(startSpy).toBeCalledTimes(1); }); @@ -615,31 +590,15 @@ describe('file notification', () => { describe('When registering a file notification for deleting', () => { let bucketResource: Bucket; beforeAll(async () => { + jest.resetAllMocks(); bucketResource = bucket('test-bucket-delete').for('reading'); await bucketResource.on('delete', 'test.png', mockFn); }); - afterAll(() => { - jest.resetAllMocks(); - }); - it('should declare the new resource', () => { expect(existsSpy).toBeCalledTimes(1); }); - it('should create a new FaasClient', () => { - expect(faas.Faas).toBeCalledTimes(1); - }); - - it('should provide Faas with FileNotificationWorkerOptions', () => { - const expectedOpts = new FileNotificationWorkerOptions( - bucketResource, - 'delete', - 'test.png' - ); - expect(faas.Faas).toBeCalledWith(expectedOpts); - }); - it('should call FaasClient::start()', () => { expect(startSpy).toBeCalledTimes(1); }); diff --git a/src/api/storage/v0/storage.ts b/src/api/storage/v1/storage.ts similarity index 85% rename from src/api/storage/v0/storage.ts rename to src/api/storage/v1/storage.ts index 19f70543..677c25f9 100644 --- a/src/api/storage/v0/storage.ts +++ b/src/api/storage/v1/storage.ts @@ -12,35 +12,32 @@ // See the License for the specific language governing permissions and // limitations under the License. import { SERVICE_BIND } from '../../../constants'; -import { StorageServiceClient } from '@nitric/api/proto/storage/v1/storage_grpc_pb'; +import { StorageClient } from '@nitric/proto/storage/v1/storage_grpc_pb'; import { StorageWriteRequest, StorageReadRequest, StorageDeleteRequest, StoragePreSignUrlRequest, - StorageListFilesRequest, + StorageListBlobsRequest, StorageExistsRequest, -} from '@nitric/api/proto/storage/v1/storage_pb'; +} from '@nitric/proto/storage/v1/storage_pb'; import * as grpc from '@grpc/grpc-js'; -import { fromGrpcError, InvalidArgumentError } from '../../errors'; import { - BucketNotificationMiddleware, - FileNotificationMiddleware, -} from '@nitric/sdk/faas'; -import { - BucketNotification, BucketNotificationType, FileNotification, } from '@nitric/sdk/resources'; +import { toDuration } from '@nitric/sdk/resources/common'; +import { FileNotificationMiddleware } from '@nitric/sdk/handlers/handler'; +import { fromGrpcError } from '../../errors'; /** * Nitric storage client, facilitates writing and reading from blob storage (buckets). */ export class Storage { - StorageServiceClient: StorageServiceClient; + StorageClient: StorageClient; constructor() { - this.StorageServiceClient = new StorageServiceClient( + this.StorageClient = new StorageClient( SERVICE_BIND, grpc.ChannelCredentials.createInsecure() ); @@ -78,18 +75,18 @@ export class Bucket { * @returns An array of file references */ public async files(): Promise { - const request = new StorageListFilesRequest(); + const request = new StorageListBlobsRequest(); request.setBucketName(this.name); - return await new Promise((res, rej) => { - this.storage.StorageServiceClient.listFiles(request, (err, data) => { + return await new Promise((resolve, reject) => { + this.storage.StorageClient.listBlobs(request, (err, data) => { if (err) { - rej(fromGrpcError(err)); + reject(fromGrpcError(err)); } - res( - data.getFilesList().map((f) => { + resolve( + data.getBlobsList().map((f) => { return new File(this.storage, this, f.getKey()); }) ); @@ -97,7 +94,7 @@ export class Bucket { }); } - public file(name: string) { + public file(name: string): File { if (!name) { throw new Error('A file name/path is required to use a File.'); } @@ -184,9 +181,9 @@ export class File { * @param mode the mode the url will access the file with. E.g. reading or writing. * @param opts file URL signing options. * @param opts.expiry how long the URL should be valid for in seconds. - * @deprecated for simplicity we suggest using getUploadUrl or getDownloadUrl. + * @returns a presigned url string. */ - public async signUrl( + async signUrl( mode: FileMode, opts: SignUrlOptions = DEFAULT_SIGN_URL_OPTS ): Promise { @@ -199,19 +196,16 @@ export class File { request.setBucketName(this.bucket.name); request.setKey(this.name); request.setOperation(mode); - request.setExpiry(expiry); + request.setExpiry(toDuration(expiry)); return new Promise((resolve, reject) => { - this.storage.StorageServiceClient.preSignUrl( - request, - (error, response) => { - if (error) { - reject(fromGrpcError(error)); - } else { - resolve(response.getUrl()); - } + this.storage.StorageClient.preSignUrl(request, (error, response) => { + if (error) { + reject(fromGrpcError(error)); + } else { + resolve(response.getUrl()); } - ); + }); }); } @@ -242,7 +236,7 @@ export class File { } return new Promise((resolve, reject) => { - this.storage.StorageServiceClient.write(request, (error) => { + this.storage.StorageClient.write(request, (error) => { if (error) { reject(fromGrpcError(error)); } else { @@ -272,7 +266,7 @@ export class File { request.setKey(this.name); return new Promise((resolve, reject) => { - this.storage.StorageServiceClient.read(request, (error, response) => { + this.storage.StorageClient.read(request, (error, response) => { if (error) { reject(fromGrpcError(error)); } else { @@ -302,7 +296,7 @@ export class File { request.setKey(this.name); return new Promise((resolve, reject) => { - this.storage.StorageServiceClient.delete(request, (error) => { + this.storage.StorageClient.delete(request, (error) => { if (error) { reject(fromGrpcError(error)); } else { @@ -328,11 +322,11 @@ export class File { */ public async exists(): Promise { const request = new StorageExistsRequest(); - request.setBucket(this.bucket.name); + request.setBucketName(this.bucket.name); request.setKey(this.name); return new Promise((resolve, reject) => { - this.storage.StorageServiceClient.exists(request, (error, response) => { + this.storage.StorageClient.exists(request, (error, response) => { if (error) { reject(fromGrpcError(error)); } else { diff --git a/src/api/events/index.ts b/src/api/topics/index.ts similarity index 96% rename from src/api/events/index.ts rename to src/api/topics/index.ts index f27e8b6b..b6310b07 100644 --- a/src/api/events/index.ts +++ b/src/api/topics/index.ts @@ -11,4 +11,4 @@ // 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. -export * from './v0'; +export * from './v1'; diff --git a/src/api/events/v0/index.ts b/src/api/topics/v1/index.ts similarity index 95% rename from src/api/events/v0/index.ts rename to src/api/topics/v1/index.ts index 690b6d45..75e85e5c 100644 --- a/src/api/events/v0/index.ts +++ b/src/api/topics/v1/index.ts @@ -11,4 +11,4 @@ // 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. -export * from './events'; +export * from './topics'; diff --git a/src/api/topics/v1/topics.test.ts b/src/api/topics/v1/topics.test.ts new file mode 100644 index 00000000..14176ffa --- /dev/null +++ b/src/api/topics/v1/topics.test.ts @@ -0,0 +1,79 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// 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 { Eventing, Topic } from './topics'; +import { TopicPublishResponse } from '@nitric/proto/topics/v1/topics_pb'; +import { TopicsClient as GrpcTopicServiceClient } from '@nitric/proto/topics/v1/topics_grpc_pb'; +import { UnimplementedError } from '../../errors'; +import { TopicsClient } from '@nitric/sdk/gen/nitric/proto/topics/v1/topics_grpc_pb'; +import { status } from '@grpc/grpc-js'; + +describe('Event Client Tests', () => { + describe('Given the grpc client returns an unimplemented error status', () => { + const MOCK_ERROR = { + code: status.UNIMPLEMENTED, + message: 'UNIMPLEMENTED', + }; + let publishMock; + beforeAll(() => { + publishMock = jest + .spyOn(TopicsClient.prototype, 'publish') + .mockImplementation((request, callback: any) => { + callback(MOCK_ERROR, null); + return null as any; + }); + }); + afterAll(() => { + jest.resetAllMocks(); + }); + test('Then publish call should return an UnimplementedError', async () => { + const topic = new Eventing().topic('test'); + await expect( + topic.publish({ + id: 'test', + payloadType: 'Test Payload', + payload: { + test: 'test', + }, + }) + ).rejects.toBeInstanceOf(UnimplementedError); + }); + test('The Grpc client for Eventing.publish should have been called exactly once', () => { + expect(publishMock).toBeCalledTimes(1); + }); + }); + describe('Given the grpc returns successfully', () => { + let publishMock; + beforeAll(() => { + publishMock = jest + .spyOn(TopicsClient.prototype, 'publish') + .mockImplementation((request, callback: any) => { + const response = new TopicPublishResponse(); + callback(null, response); + return null as any; + }); + }); + afterAll(() => { + jest.resetAllMocks(); + }); + test('Then Eventing.publish should resolve with the provided id', async () => { + const client = new Eventing(); + await expect( + client.topic('test').publish({ message: 'Test Payload' }) + ).resolves.toBeUndefined(); + }); + test('The Grpc client for Eventing.publish should have been called exactly once', () => { + expect(publishMock).toBeCalledTimes(1); + }); + }); +}); diff --git a/src/api/topics/v1/topics.ts b/src/api/topics/v1/topics.ts new file mode 100644 index 00000000..27fd3d34 --- /dev/null +++ b/src/api/topics/v1/topics.ts @@ -0,0 +1,175 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// 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 { SERVICE_BIND } from '../../../constants'; +import { TopicsClient } from '@nitric/proto/topics/v1/topics_grpc_pb'; +import { + TopicPublishRequest, + TopicMessage, +} from '@nitric/proto/topics/v1/topics_pb'; +import { Struct } from 'google-protobuf/google/protobuf/struct_pb'; +import * as grpc from '@grpc/grpc-js'; +import { toDuration } from '@nitric/sdk/resources/common'; +import { fromGrpcError } from '../../errors'; + +export interface PublishOptions { + /** Number of seconds to delay message publishing by */ + delay?: number; +} + +const DEFAULT_PUBLISH_OPTS: PublishOptions = { + delay: 0, +}; + +export class Topic = Record> { + private eventing: Eventing; + private name: string; + + constructor(eventing: Eventing, name: string) { + this.eventing = eventing; + this.name = name; + } + + /** + * Publishes a message to a topic. + * + * @param message The message to publish + * @param opts Additional publishing options + * @returns a promise that resolves when the message is published + * + * @example + * ```typescript + * import { Eventing } from "@nitric/sdk"; + * + * const eventing = Eventing(); + * + * async function publishEvent(): NitricEvent { + * const topic = eventing.topic("my-topic"); + * const event = { + * value: "Hello World!" + * }; + * // Publish immediately + * await topic.publish(event); + * + * // Publish after 10 seconds delay + * await topic.publish(event, { delay: 10 }); + * } + * ``` + */ + async publish( + message: T, + opts: PublishOptions = DEFAULT_PUBLISH_OPTS + ): Promise { + const publishOpts = { + ...DEFAULT_PUBLISH_OPTS, + ...opts, + }; + const request = new TopicPublishRequest(); + const msg = new TopicMessage(); + + msg.setStructPayload(Struct.fromJavaScript(message)); + + request.setTopicName(this.name); + request.setMessage(msg); + request.setDelay(toDuration(publishOpts.delay)); + + return new Promise((resolve, reject) => { + this.eventing.TopicServiceClient.publish(request, (error, _response) => { + if (error) { + reject(fromGrpcError(error)); + } else { + resolve(); + } + }); + }); + } +} + +/** + * Eventing object encapsulating the Nitric gRPC clients for Event and Topic services. + * + * Used to created references to Topics and perform Event publishing operations. + * + * @example + * ```typescript + * import { Eventing } from "@nitric/sdk"; + * const eventing = new Eventing(); + * const topic = eventing.topic('notifications'); + * ``` + */ +export class Eventing { + private _client: TopicsClient = undefined; + + get TopicServiceClient(): TopicsClient { + if (!this._client) { + this._client = new TopicsClient( + SERVICE_BIND, + grpc.ChannelCredentials.createInsecure() + ); + } + + return this._client; + } + + /** + * Get a reference to a Topic. + * + * @param name Name of the topic, as defined in nitric.yaml. + * @returns a topic resource. + * @example + * ```typescript + * import { Eventing } from "@nitric/sdk"; + * const eventing = new Eventing(); + * const topic = eventing.topic('notifications'); + * ``` + */ + public topic = Record>( + name: string + ): Topic { + if (!name) { + throw new Error('A topic name is needed to use a Topic.'); + } + + return new Topic(this, name); + } +} + +// Events client singleton +let TOPIC = undefined; + +/** + * Events API client. + * + * @returns an Events API client. + * @example + * ```typescript + * import { topic } from "@nitric/sdk"; + * + * const userCreatedTopic = topic('user-created').for('publishing') + * + * async function publishEvent() { + * await userCreatedTopic.publish({ + * amazing: 'thing happened!', + * }); + * + * return 'Successfully published notification'; + * } + * ``` + */ +export const topics = (): Eventing => { + if (!TOPIC) { + TOPIC = new Eventing(); + } + + return TOPIC; +}; diff --git a/src/api/websocket/v0/index.ts b/src/api/websocket/v1/index.ts similarity index 100% rename from src/api/websocket/v0/index.ts rename to src/api/websocket/v1/index.ts diff --git a/src/api/websocket/v0/websocket.ts b/src/api/websocket/v1/websocket.ts similarity index 81% rename from src/api/websocket/v0/websocket.ts rename to src/api/websocket/v1/websocket.ts index 2e68f25e..aa096d61 100644 --- a/src/api/websocket/v0/websocket.ts +++ b/src/api/websocket/v1/websocket.ts @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. import { SERVICE_BIND } from '../../../constants'; -import { WebsocketServiceClient } from '@nitric/api/proto/websocket/v1/websocket_grpc_pb'; +import { WebsocketClient } from '@nitric/proto/websockets/v1/websockets_grpc_pb'; import { WebsocketSendRequest, - WebsocketCloseRequest, -} from '@nitric/api/proto/websocket/v1/websocket_pb'; + WebsocketCloseConnectionRequest, +} from '@nitric/proto/websockets/v1/websockets_pb'; import * as grpc from '@grpc/grpc-js'; import { fromGrpcError } from '../../errors'; @@ -24,10 +24,10 @@ import { fromGrpcError } from '../../errors'; * Nitric websocket client, facilitates sending messages to connections on this websocket. */ export class Websocket { - client: WebsocketServiceClient; + client: WebsocketClient; constructor() { - this.client = new WebsocketServiceClient( + this.client = new WebsocketClient( SERVICE_BIND, grpc.ChannelCredentials.createInsecure() ); @@ -51,12 +51,12 @@ export class Websocket { const sendRequest = new WebsocketSendRequest(); - sendRequest.setSocket(socket); + sendRequest.setSocketName(socket); sendRequest.setConnectionId(connectionId); sendRequest.setData(payload); return new Promise((res, rej) => { - this.client.send(sendRequest, (error, data) => { + this.client.sendMessage(sendRequest, (error, _data) => { if (error) { rej(fromGrpcError(error)); } @@ -67,13 +67,13 @@ export class Websocket { } async close(socket: string, connectionId: string): Promise { - const closeRequest = new WebsocketCloseRequest(); + const closeRequest = new WebsocketCloseConnectionRequest(); - closeRequest.setSocket(socket); + closeRequest.setSocketName(socket); closeRequest.setConnectionId(connectionId); return new Promise((res, rej) => { - this.client.close(closeRequest, (error) => { + this.client.closeConnection(closeRequest, (error) => { if (error) { rej(fromGrpcError(error)); } diff --git a/src/context/base.ts b/src/context/base.ts new file mode 100644 index 00000000..7d2cc16c --- /dev/null +++ b/src/context/base.ts @@ -0,0 +1,78 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// 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. +export type JSONTypes = Record | Array | string; + +export abstract class AbstractRequest< + JSONT extends JSONTypes = Record +> { + readonly data: string | Uint8Array; + // readonly traceContext: api.Context; + + protected constructor(data: string | Uint8Array) { + this.data = data; + //this.traceContext = traceContext; + } + + /** + * Return the request payload as a string. + * If the request was a byte array it will converted using UTF-8 text decoding. + * + * @returns the request payload as a string + */ + text(): string { + const stringPayload = + typeof this.data === 'string' + ? this.data + : new TextDecoder('utf-8').decode(this.data); + + return stringPayload; + } + + /** + * Deserialize the request payload from JSON + * + * @returns JSON parsed request body + */ + json(): JSONT { + // attempt to deserialize as a JSON object + const textBody = this.text(); + return textBody ? JSON.parse(textBody) : undefined; + } +} + +export abstract class BaseContext< + Req extends AbstractRequest = AbstractRequest, + Resp extends Record = any +> { + protected request: Req; + protected response: Resp; + + /** + * Return the request object from this context. + * + * @returns the request object. + */ + get req(): Req { + return this.request; + } + + /** + * Return the response object from this context. + * + * @returns the response object. + */ + get res(): Resp { + return this.response; + } +} diff --git a/src/context/bucket.ts b/src/context/bucket.ts new file mode 100644 index 00000000..ba5c41c1 --- /dev/null +++ b/src/context/bucket.ts @@ -0,0 +1,129 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// 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 { + BlobEventRequest as BlobEventRequestPb, + BlobEventResponse as BlobEventResponsePb, + BlobEventType as BlobEventTypePb, +} from '@nitric/proto/storage/v1/storage_pb'; +import { AbstractRequest, BaseContext } from './base'; +import type { Bucket, File } from '../api/storage'; + +export class BlobEventContext extends BaseContext< + BlobEventRequest, + BucketNotificationResponse +> { + public get bucketNotification(): BlobEventContext { + return this; + } + + static fromRequest( + request: BlobEventRequestPb, + bucket: Bucket + ): BlobEventContext { + const ctx = new BlobEventContext(); + const blobEvent = request.getBlobEvent(); + + ctx.request = new BlobEventRequest( + blobEvent.getKey(), + blobEvent.getType(), + bucket + ); + + ctx.response = { + success: true, + }; + + return ctx; + } + + static toResponse(ctx: BlobEventContext): BlobEventResponsePb { + const blobEventRespsonse = new BlobEventResponsePb(); + blobEventRespsonse.setSuccess(ctx.res.success); + return blobEventRespsonse; + } +} + +export class BucketEventContext extends BaseContext< + BucketEventRequest, + BucketNotificationResponse +> { + public get bucketNotification(): BucketEventContext { + return this; + } + + static fromRequest(request: BlobEventRequestPb): BucketEventContext { + const ctx = new BucketEventContext(); + const blobEvent = request.getBlobEvent(); + + ctx.request = new BucketEventRequest( + blobEvent.getKey(), + blobEvent.getType() + ); + + ctx.response = { + success: true, + }; + + return ctx; + } + + static toResponse(ctx: BucketEventContext): BlobEventResponsePb { + const blobEventRespsonse = new BlobEventResponsePb(); + blobEventRespsonse.setSuccess(ctx.res.success); + return blobEventRespsonse; + } +} + +export enum BlobEventType { + Created, + Deleted, +} + +export class BucketEventRequest extends AbstractRequest { + public readonly key: string; + public readonly eventType: BlobEventType; + + constructor(key: string, notificationType: number) { + super(''); + + // Get reference to the bucket + this.key = key; + this.eventType = this.eventTypeToNotificationType(notificationType); + } + + private eventTypeToNotificationType = (eventType: number): BlobEventType => { + switch (eventType) { + case BlobEventTypePb.CREATED: + return BlobEventType.Created; + case BlobEventTypePb.DELETED: + return BlobEventType.Deleted; + default: + throw new Error(`event type unsupported: ${eventType}`); + } + }; +} + +export class BlobEventRequest extends BucketEventRequest { + public readonly file: File | undefined; + + constructor(key: string, notificationType: number, bucket: Bucket) { + super(key, notificationType); + + this.file = bucket.file(key); + } +} + +export interface BucketNotificationResponse { + success: boolean; +} diff --git a/src/context/http.ts b/src/context/http.ts new file mode 100644 index 00000000..7a68b3de --- /dev/null +++ b/src/context/http.ts @@ -0,0 +1,207 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// 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 { + HeaderValue, + HttpRequest as HttpRequestPb, + HttpResponse as HttpResponsePb, +} from '@nitric/proto/apis/v1/apis_pb'; +import { AbstractRequest, BaseContext } from './base'; +import { jsonResponse } from '../handlers/json'; + +type Method = 'GET' | 'POST' | 'DELETE' | 'PATCH' | 'PUT' | 'HEAD'; + +interface HttpRequestArgs { + data: string | Uint8Array; + method: Method | string; + path: string; + params: Record; + query: Record; + headers: Record; + // traceContext?: api.Context; +} + +export class HttpRequest extends AbstractRequest { + public readonly method: Method | string; + public readonly path: string; + public readonly params: Record; + public readonly query: Record; + public readonly headers: Record; + + constructor({ + data, + method, + path, + params, + query, + headers, + }: // traceContext, + HttpRequestArgs) { + super(data); + this.method = method; + this.path = path; + this.params = params; + this.query = query; + this.headers = headers; + } +} + +interface HttpResponseArgs { + body: string | Uint8Array; + status: number; + headers: Record; + ctx: HttpContext; +} + +export class HttpResponse { + public status: number; + public body: string | Uint8Array | Record; + public headers: Record; + private ctx: HttpContext; + + constructor({ status, headers, body, ctx }: HttpResponseArgs) { + this.status = status; + this.headers = headers; + this.body = body; + this.ctx = ctx; + } + + /** + * Helper method to encode to JSON string for JSON http responses. + * + * @returns HttpContext with body property set with an encoded JSON string and json headers set. + */ + get json(): ( + data: string | number | boolean | Record + ) => HttpContext { + return jsonResponse(this.ctx); + } +} + +export class HttpContext extends BaseContext { + public get http(): HttpContext { + return this; + } + + static fromHttpRequest(http: HttpRequestPb): HttpContext { + const ctx = new HttpContext(); + + const headers = ( + http + .getHeadersMap() + // getEntryList claims to return [string, faas.HeaderValue][], but really returns [string, string[][]][] + // we force the type to match the real return type. + .getEntryList() as unknown as [string, string[][]][] + ).reduce( + (acc, [key, [val]]) => ({ + ...acc, + [key.toLowerCase()]: val.length === 1 ? val[0] : val, + }), + {} + ); + + const query = ( + http + .getQueryParamsMap() + // getEntryList claims to return [string, faas.HeaderValue][], but really returns [string, string[][]][] + // we force the type to match the real return type. + .getEntryList() as unknown as [string, string[][]][] + ).reduce( + (acc, [key, [val]]) => ({ + ...acc, + [key]: + val.length === 1 + ? decodeURIComponent(val[0]) + : val.map((v) => decodeURIComponent(v)), + }), + {} + ); + + const params = http + .getPathParamsMap() + // getEntryList claims to return [string, faas.HeaderValue][], but really returns [string, string[][]][] + // we force the type to match the real return type. + .getEntryList() + .reduce( + (acc, [key, val]) => ({ + ...acc, + [key]: val.length === 1 ? val[0] : val, + }), + {} as Record + ); + + ctx.request = new HttpRequest({ + data: http.getBody(), + path: http.getPath(), + params, + query, + headers, + method: http.getMethod(), + //traceContext: getTraceContext(trigger.getTraceContext()), + }); + + ctx.response = new HttpResponse({ + status: 200, + headers: {}, + body: '', + ctx, + }); + + if (!ctx) { + throw new Error('failed to create context'); + } + + return ctx; + } + + static toHttpResponse(ctx: HttpContext): HttpResponsePb { + const httpCtx = ctx.http; + const resp = new HttpResponsePb(); + + // Convert the body content to bytes + let body: Uint8Array; + let bodyContentType: + | 'text/plain' + | 'application/octet-stream' + | 'application/json' = 'application/octet-stream'; + if (typeof httpCtx.response.body === 'string') { + body = new TextEncoder().encode(httpCtx.response.body); + bodyContentType = 'text/plain'; + } else if (httpCtx.response.body instanceof Uint8Array) { + body = httpCtx.response.body; + bodyContentType = 'application/octet-stream'; + } else { + body = new TextEncoder().encode(JSON.stringify(httpCtx.response.body)); + bodyContentType = 'application/json'; + } + + resp.setBody(body); + resp.setStatus(httpCtx.response.status); + + Object.entries(httpCtx.response.headers).forEach(([k, v]) => { + const headerVal = new HeaderValue(); + headerVal.setValueList(v); + resp.getHeadersMap().set(k.toLowerCase(), headerVal); + }); + + // Automatically set the content-type header if it's missing + const contentHeader = resp.getHeadersMap().get('content-type'); + if (!contentHeader || contentHeader.getValueList().length === 0) { + const headerVal = new HeaderValue(); + headerVal.setValueList([bodyContentType]); + resp.getHeadersMap().set('content-type', headerVal); + } + + return resp; + } +} diff --git a/src/context/index.ts b/src/context/index.ts new file mode 100644 index 00000000..83a6df67 --- /dev/null +++ b/src/context/index.ts @@ -0,0 +1,19 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// 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. +export * from './base'; +export * from './bucket'; +export * from './http'; +export * from './interval'; +export * from './message'; +export * from './websocket'; diff --git a/src/context/interval.ts b/src/context/interval.ts new file mode 100644 index 00000000..45ccc2c3 --- /dev/null +++ b/src/context/interval.ts @@ -0,0 +1,62 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// 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 { + IntervalRequest as IntervalRequestPb, + IntervalResponse as IntervalResponsePb, +} from '@nitric/proto/schedules/v1/schedules_pb'; +import { AbstractRequest, BaseContext } from './base'; + +export interface IntervalResponse { + success: boolean; +} + +export class IntervalRequest extends AbstractRequest { + public readonly schedule: string; + + constructor( + schedule: string + // traceContext: api.Context + ) { + super(''); + this.schedule = schedule; + } +} + +export class IntervalContext extends BaseContext< + IntervalRequest, + IntervalResponse +> { + public get event(): IntervalContext { + return this; + } + + static fromRequest(messageRequest: IntervalRequestPb): IntervalContext { + const schedule = messageRequest.getScheduleName(); + const ctx = new IntervalContext(); + + ctx.request = new IntervalRequest(schedule); + + ctx.response = { + success: true, + }; + + return ctx; + } + + static toResponse(_: IntervalContext): IntervalResponsePb { + const intervalResponse = new IntervalResponsePb(); + + return intervalResponse; + } +} diff --git a/src/context/message.ts b/src/context/message.ts new file mode 100644 index 00000000..11381b8d --- /dev/null +++ b/src/context/message.ts @@ -0,0 +1,70 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// 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 { + MessageRequest as MessageRequestPb, + MessageResponse as MessageResponsePb, +} from '@nitric/proto/topics/v1/topics_pb'; + +import { AbstractRequest, BaseContext } from './base'; + +export interface MessageResponse { + success: boolean; +} + +export class MessageRequest extends AbstractRequest { + public readonly topic: string; + + constructor( + data: string | Uint8Array, + topic: string + // traceContext: api.Context + ) { + super(data); + this.topic = topic; + } +} + +export class MessageContext extends BaseContext< + MessageRequest, + MessageResponse +> { + public get message(): MessageContext { + return this; + } + + static fromMessageRequest( + messageRequest: MessageRequestPb + ): MessageContext { + const topic = messageRequest.getTopicName(); + const ctx = new MessageContext(); + + const data = messageRequest.getMessage().getStructPayload().toJavaScript(); + + ctx.request = new MessageRequest(JSON.stringify(data), topic); + + ctx.response = { + success: true, + }; + + return ctx; + } + + static toMessageResponse(ctx: MessageContext): MessageResponsePb { + const evtCtx = ctx.message; + const messageResponse = new MessageResponsePb(); + messageResponse.setSuccess(evtCtx.res.success); + + return messageResponse; + } +} diff --git a/src/context/websocket.ts b/src/context/websocket.ts new file mode 100644 index 00000000..4c48b109 --- /dev/null +++ b/src/context/websocket.ts @@ -0,0 +1,126 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// 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 { + WebsocketConnectionResponse, + WebsocketEventRequest as WebsocketEventRequestPb, + WebsocketEventResponse as WebsocketEventResponsePb, + WebsocketEventType, +} from '@nitric/proto/websockets/v1/websockets_pb'; +import { AbstractRequest, BaseContext } from './base'; + +export class WebsocketNotificationContext extends BaseContext< + WebsocketNotificationRequest, + WebsocketNotificationResponse +> { + public get websocket(): WebsocketNotificationContext { + return this; + } + + static fromRequest( + request: WebsocketEventRequestPb + ): WebsocketNotificationContext { + const ctx = new WebsocketNotificationContext(); + const connection = request.getConnection(); + const query = connection + ? ( + connection + .getQueryParamsMap() + // getEntryList claims to return [string, faas.HeaderValue][], but really returns [string, string[][]][] + // we force the type to match the real return type. + .getEntryList() as unknown as [string, string[][]][] + ).reduce( + (acc, [key, [val]]) => ({ + ...acc, + [key]: val.map((v) => decodeURIComponent(v)), + }), + {} as Record + ) + : {}; + + const message = request.getMessage(); + + ctx.request = new WebsocketNotificationRequest( + message ? message.getBody() : '', + request.getSocketName(), + request.getWebsocketEventCase(), + request.getConnectionid(), + query + ); + + ctx.response = { + success: true, + }; + + return ctx; + } + + static toResponse( + ctx: WebsocketNotificationContext + ): WebsocketEventResponsePb { + const notifyCtx = ctx.websocket; + const eventResponse = new WebsocketEventResponsePb(); + const connectionResponse = new WebsocketConnectionResponse(); + connectionResponse.setReject(!notifyCtx.res.success); + + eventResponse.setConnectionResponse(connectionResponse); + return eventResponse; + } +} + +export enum WebsocketNotificationType { + Connected, + Disconnected, + Message, +} + +export type WebsocketEventType = 'connect' | 'disconnect' | 'message'; + +export class WebsocketNotificationRequest extends AbstractRequest { + public readonly socket: string; + public readonly eventType: WebsocketEventType; + public readonly connectionId: string; + public readonly query: Record; + + constructor( + data: string | Uint8Array, + socket: string, + eventType: number, + connectionId: string, + query: Record + ) { + super(data); + + this.socket = socket; + this.eventType = this.eventCaseToType(eventType); + this.connectionId = connectionId; + this.query = query; + } + + private eventCaseToType = (eventType: number) => { + switch (eventType) { + case WebsocketEventRequestPb.WebsocketEventCase.CONNECTION: + return 'connect'; + case WebsocketEventRequestPb.WebsocketEventCase.DISCONNECTION: + return 'disconnect'; + case WebsocketEventRequestPb.WebsocketEventCase.MESSAGE: + return 'message'; + default: + throw new Error(`event type unsupported: ${eventType}`); + } + }; +} + +export interface WebsocketNotificationResponse { + success: boolean; +} diff --git a/src/faas/index.ts b/src/faas/index.ts deleted file mode 100644 index f27e8b6b..00000000 --- a/src/faas/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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. -export * from './v0'; diff --git a/src/faas/v0/context.test.ts b/src/faas/v0/context.test.ts deleted file mode 100644 index f9e2c31d..00000000 --- a/src/faas/v0/context.test.ts +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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 { - HttpTriggerContext as GrpcHttpTriggerRequest, - TopicTriggerContext as GrpcTopicTriggerContext, - TriggerRequest, - HeaderValue, - QueryValue, - TriggerResponse, -} from '@nitric/api/proto/faas/v1/faas_pb'; -import { TriggerContext, HttpContext, EventContext } from '.'; - -describe('NitricTrigger.fromGrpcTriggerRequest', () => { - describe('From a HttpTriggerRequest', () => { - let trigger: TriggerContext; - - beforeAll(() => { - const ctx = new GrpcHttpTriggerRequest(); - ctx.setMethod('GET'); - ctx.setPath('/test/'); - const testHeader = new HeaderValue(); - testHeader.addValue('test'); - const testHeader2 = new HeaderValue(); - testHeader2.addValue('test2.1'); - testHeader2.addValue('test2.2'); - ctx.getHeadersMap().set('test', testHeader); - ctx.getHeadersMap().set('test2', testHeader2); - const testQuery = new QueryValue(); - testQuery.addValue('test'); - ctx.getQueryParamsMap().set('test', testQuery); - const testEncodedQuery = new QueryValue(); - testEncodedQuery.addValue(encodeURIComponent('/path/here')); - ctx.getQueryParamsMap().set('test-encoded', testEncodedQuery); - const request = new TriggerRequest(); - request.setData('Hello World'); - request.setHttp(ctx); - - trigger = TriggerContext.fromGrpcTriggerRequest(request); - }); - - it('should be HttpContext', () => { - expect(trigger instanceof HttpContext).toBeTruthy(); - }); - - it('should have HTTP context', () => { - expect(trigger.http).not.toBeUndefined(); - }); - - it('should have the triggers HTTP Method', () => { - expect(trigger.http.req.method).toBe('GET'); - }); - - it('should have the provided data', () => { - expect(trigger.http.req.data).toBe('Hello World'); - }); - - it('should have the provided headers', () => { - expect(trigger.http.req.headers['test']).toEqual('test'); - expect(trigger.http.req.headers['test2']).toEqual(['test2.1', 'test2.2']); - }); - - it('should have the provided query params', () => { - expect(trigger.http.req.query['test']).toBe('test'); - expect(trigger.http.req.query['test-encoded']).toBe('/path/here'); - }); - - it('should allow json response', () => { - const ctx = trigger.http.res.json({ message: 'success' }); - expect(ctx.res.headers).toEqual({ 'Content-Type': ['application/json'] }); - - expect( - JSON.parse(new TextDecoder('utf-8').decode(ctx.res.body as Uint8Array)) - ).toEqual({ - message: 'success', - }); - }); - }); - - // XXX: Remove once the deprecated old headers value is removed. - describe('From a HttpTriggerRequest with old headers', () => { - let trigger: TriggerContext; - - beforeAll(() => { - const ctx = new GrpcHttpTriggerRequest(); - ctx.setMethod('GET'); - ctx.setPath('/test/'); - ctx.getHeadersOldMap().set('test', 'test'); - ctx.getHeadersOldMap().set('test2', 'test2'); - const request = new TriggerRequest(); - request.setData('Hello World'); - request.setHttp(ctx); - - trigger = TriggerContext.fromGrpcTriggerRequest(request); - }); - - it('should have the old headers', () => { - expect(trigger.http.req.headers['test']).toEqual('test'); - expect(trigger.http.req.headers['test2']).toEqual('test2'); - }); - }); - - describe('From a TopicTriggerRequest', () => { - let trigger: TriggerContext; - - beforeAll(() => { - const ctx = new GrpcTopicTriggerContext(); - ctx.setTopic('test'); - - const request = new TriggerRequest(); - request.setData('Hello World'); - request.setTopic(ctx); - - trigger = TriggerContext.fromGrpcTriggerRequest(request); - }); - - it('should return an EventTriggerContext', () => { - expect(trigger instanceof EventContext).toBeTruthy(); - }); - - it('should have event trigger context', () => { - expect(trigger.event).not.toBeUndefined(); - }); - - it('should have the topic name that raised the trigger', () => { - expect(trigger.event.req.topic).toBe('test'); - }); - }); -}); - -describe('NitricTriggger.toGrpcTriggerResponse', () => { - const grpcTrigger = new GrpcHttpTriggerRequest(); - grpcTrigger.setMethod('GET'); - grpcTrigger.setPath('/test/'); - const request = new TriggerRequest(); - request.setData('Hello World'); - request.setHttp(grpcTrigger); - - describe('When the response body is text', () => { - let response: TriggerResponse; - - beforeEach(() => { - const ctx: TriggerContext = - TriggerContext.fromGrpcTriggerRequest(request); - ctx.http.res.body = 'test'; - response = HttpContext.toGrpcTriggerResponse(ctx); - }); - - it('Should convert to bytes', () => { - expect(response.getData() instanceof Uint8Array).toBe(true); - }); - - it('Should set the content-type to text', () => { - expect( - response.getHttp().getHeadersMap().get('content-type').getValueList() - ).toEqual(['text/plain']); - }); - }); - - describe('When the response body is an object', () => { - let response: TriggerResponse; - - beforeEach(() => { - const ctx: TriggerContext = - TriggerContext.fromGrpcTriggerRequest(request); - ctx.http.res.body = { any: 'object' }; - response = HttpContext.toGrpcTriggerResponse(ctx); - }); - - it('Should convert to bytes', () => { - expect(response.getData() instanceof Uint8Array).toBe(true); - }); - - it('Should set the content-type to json', () => { - expect( - response.getHttp().getHeadersMap().get('content-type').getValueList() - ).toEqual(['application/json']); - }); - }); - - describe('When the response body is bytes', () => { - let response: TriggerResponse; - - beforeEach(() => { - const ctx: TriggerContext = - TriggerContext.fromGrpcTriggerRequest(request); - ctx.http.res.body = new TextEncoder().encode('response text'); - response = HttpContext.toGrpcTriggerResponse(ctx); - }); - - it('Should not modify the body', () => { - expect(response.getData()).toEqual( - new TextEncoder().encode('response text') - ); - }); - - it('Should set the content-type to octet stream', () => { - expect( - response.getHttp().getHeadersMap().get('content-type').getValueList() - ).toEqual(['application/octet-stream']); - }); - }); - - describe('When the content-type is set', () => { - let response: TriggerResponse; - - beforeEach(() => { - const ctx: TriggerContext = - TriggerContext.fromGrpcTriggerRequest(request); - ctx.http.res.headers['Content-Type'] = ['application/json']; - ctx.http.res.body = new TextEncoder().encode( - '{"json":"which is already text"}' - ); - response = HttpContext.toGrpcTriggerResponse(ctx); - }); - - it('Should convert to bytes', () => { - expect(response.getData() instanceof Uint8Array).toBe(true); - }); - - it('Should not change the content-type header(s)', () => { - expect( - response.getHttp().getHeadersMap().get('content-type').getValueList() - ).toEqual(['application/json']); - }); - }); -}); diff --git a/src/faas/v0/context.ts b/src/faas/v0/context.ts deleted file mode 100644 index ab3019a6..00000000 --- a/src/faas/v0/context.ts +++ /dev/null @@ -1,703 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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 { - TriggerRequest, - TriggerResponse, - TraceContext, - HeaderValue, - HttpResponseContext, - NotificationResponseContext, - TopicResponseContext, - BucketNotificationType as ProtoBucketNotificationType, - WebsocketResponseContext, -} from '@nitric/api/proto/faas/v1/faas_pb'; -import * as api from '@opentelemetry/api'; -import * as jspb from 'google-protobuf'; -import { jsonResponse } from './json'; -import { Bucket, File } from '@nitric/sdk/api'; -import { - ApiWorkerOptions, - BucketNotificationWorkerOptions, - FileNotificationWorkerOptions, - SubscriptionWorkerOptions, - bucket, -} from '@nitric/sdk'; -import { FaasWorkerOptions } from './start'; - -export abstract class TriggerContext< - Req extends AbstractRequest = AbstractRequest, - Resp extends Record = any -> { - protected request: Req; - protected response: Resp; - - /** - * Noop base context http method. - * - * @returns undefined - */ - public get http(): HttpContext | undefined { - return undefined; - } - - /** - * Noop base context event method. - * - * @returns undefined - */ - public get event(): EventContext | undefined { - return undefined; - } - - /** - * Noop base context bucketNotification method - * - * @returns undefined - */ - public get bucketNotification(): BucketNotificationContext | undefined { - return undefined; - } - - /** - * Noop base context websocket method - * - * @returns undefined - */ - public get websocket(): WebsocketNotificationContext | undefined { - return undefined; - } - - /** - * Return the request object from this context. - * - * @returns the request object. - */ - get req(): Req { - return this.request; - } - - /** - * Return the response object from this context. - * - * @returns the response object. - */ - get res(): Resp { - return this.response; - } - - // Instantiate a concrete TriggerContext from the gRPC trigger model - static fromGrpcTriggerRequest( - trigger: TriggerRequest, - options?: FaasWorkerOptions - ): TriggerContext { - // create context - if (trigger.hasHttp()) { - return HttpContext.fromGrpcTriggerRequest(trigger); - } else if (trigger.hasTopic()) { - return EventContext.fromGrpcTriggerRequest(trigger); - } else if (trigger.hasNotification()) { - if (options instanceof FileNotificationWorkerOptions) { - return FileNotificationContext.fromGrpcTriggerRequest( - trigger, - options as FileNotificationWorkerOptions - ); - } - return BucketNotificationContext.fromGrpcTriggerRequest( - trigger, - options as BucketNotificationWorkerOptions - ); - } else if (trigger.hasWebsocket()) { - return WebsocketNotificationContext.fromGrpcTriggerRequest(trigger); - } - throw new Error('Unsupported trigger request type'); - } - - static toGrpcTriggerResponse(ctx: TriggerContext): TriggerResponse { - if (ctx.http) { - return HttpContext.toGrpcTriggerResponse(ctx); - } else if (ctx.event) { - return EventContext.toGrpcTriggerResponse(ctx); - } else if (ctx.bucketNotification) { - return BucketNotificationContext.toGrpcTriggerResponse(ctx); - } else if (ctx.websocket) { - return WebsocketNotificationContext.toGrpcTriggerResponse(ctx); - } - - throw new Error('Unsupported trigger context type'); - } -} - -export type JSONTypes = Record | Array | string; - -export abstract class AbstractRequest< - JSONT extends JSONTypes = Record -> { - readonly data: string | Uint8Array; - readonly traceContext: api.Context; - - protected constructor(data: string | Uint8Array, traceContext: api.Context) { - this.data = data; - this.traceContext = traceContext; - } - - /** - * Return the request payload as a string. - * If the request was a byte array it will converted using UTF-8 text decoding. - * - * @returns the request payload as a string - */ - text(): string { - const stringPayload = - typeof this.data === 'string' - ? this.data - : new TextDecoder('utf-8').decode(this.data); - - return stringPayload; - } - - /** - * Deserialize the request payload from JSON - * - * @returns JSON parsed request body - */ - json(): JSONT { - // attempt to deserialize as a JSON object - const textBody = this.text(); - return textBody ? JSON.parse(textBody) : undefined; - } -} - -export interface EventResponse { - success: boolean; -} - -type Method = 'GET' | 'POST' | 'DELETE' | 'PATCH' | 'PUT' | 'HEAD'; - -interface HttpRequestArgs { - data: string | Uint8Array; - method: Method | string; - path: string; - params: Record; - query: Record; - headers: Record; - traceContext?: api.Context; -} - -export class HttpRequest extends AbstractRequest { - public readonly method: Method | string; - public readonly path: string; - public readonly params: Record; - public readonly query: Record; - public readonly headers: Record; - - constructor({ - data, - method, - path, - params, - query, - headers, - traceContext, - }: HttpRequestArgs) { - super(data, traceContext); - this.method = method; - this.path = path; - this.params = params; - this.query = query; - this.headers = headers; - } -} - -interface HttpResponseArgs { - body: string | Uint8Array; - status: number; - headers: Record; - ctx: HttpContext; -} - -export class HttpResponse { - public status: number; - public body: string | Uint8Array | Record; - public headers: Record; - private ctx: HttpContext; - - constructor({ status, headers, body, ctx }: HttpResponseArgs) { - this.status = status; - this.headers = headers; - this.body = body; - this.ctx = ctx; - } - - /** - * Helper method to encode to JSON string for JSON http responses. - * - * @returns HttpContext with body property set with an encoded JSON string and json headers set. - */ - get json() { - return jsonResponse(this.ctx); - } -} - -export class EventRequest extends AbstractRequest { - public readonly topic: string; - - constructor( - data: string | Uint8Array, - topic: string, - traceContext: api.Context - ) { - super(data, traceContext); - this.topic = topic; - } -} - -// Propagate the context to the root context -export const getTraceContext = (traceContext: TraceContext): api.Context => { - const traceContextObject = traceContext - ? objectFromMap(traceContext.getValuesMap()) - : {}; - - return api.propagation.extract(api.context.active(), traceContextObject); -}; - -const objectFromMap = (map: jspb.Map) => { - return map - ? map.toObject().reduce((prev, [k, v]) => { - prev[k] = v; - return prev; - }, {}) - : {}; -}; - -// HTTP CONTEXT -export class HttpContext extends TriggerContext { - public get http(): HttpContext { - return this; - } - - static fromGrpcTriggerRequest( - trigger: TriggerRequest, - options?: ApiWorkerOptions - ): HttpContext { - const http = trigger.getHttp(); - const ctx = new HttpContext(); - - const headers = ( - http - .getHeadersMap() - // getEntryList claims to return [string, faas.HeaderValue][], but really returns [string, string[][]][] - // we force the type to match the real return type. - .getEntryList() as unknown as [string, string[][]][] - ).reduce( - (acc, [key, [val]]) => ({ - ...acc, - [key.toLowerCase()]: val.length === 1 ? val[0] : val, - }), - {} - ); - - const query = ( - http - .getQueryParamsMap() - // getEntryList claims to return [string, faas.HeaderValue][], but really returns [string, string[][]][] - // we force the type to match the real return type. - .getEntryList() as unknown as [string, string[][]][] - ).reduce( - (acc, [key, [val]]) => ({ - ...acc, - [key]: - val.length === 1 - ? decodeURIComponent(val[0]) - : val.map((v) => decodeURIComponent(v)), - }), - {} - ); - - const params = http - .getPathParamsMap() - // getEntryList claims to return [string, faas.HeaderValue][], but really returns [string, string[][]][] - // we force the type to match the real return type. - .getEntryList() - .reduce( - (acc, [key, val]) => ({ - ...acc, - [key]: val.length === 1 ? val[0] : val, - }), - {} as Record - ); - - const oldQuery = http - .getQueryParamsOldMap() - .toArray() - .reduce( - (acc, [key, val]) => ({ - ...acc, - [key]: decodeURIComponent(val), - }), - {} - ); - - const oldHeaders = http - .getHeadersOldMap() - .toArray() - .reduce( - (acc, [key, val]) => ({ - ...acc, - [key]: val, - }), - {} - ); - - ctx.request = new HttpRequest({ - data: trigger.getData(), - path: http.getPath(), - params, - // TODO: remove after 1.0 - // check for old query if new query is unpopulated. This is for backwards compatibility. - query: Object.keys(query).length ? query : oldQuery, - // TODO: remove after 1.0 - // check for old headers if new headers is unpopulated. This is for backwards compatibility. - headers: Object.keys(headers).length ? headers : oldHeaders, - method: http.getMethod(), - traceContext: getTraceContext(trigger.getTraceContext()), - }); - - ctx.response = new HttpResponse({ - status: 200, - headers: {}, - body: '', - ctx, - }); - - if (!ctx) { - throw new Error('failed to create context'); - } - - return ctx; - } - - static toGrpcTriggerResponse(ctx: TriggerContext): TriggerResponse { - const httpCtx = ctx.http; - const resp = new TriggerResponse(); - - resp.setHttp(new HttpResponseContext()); - - // Convert the body content to bytes - let body: Uint8Array; - let bodyContentType: - | 'text/plain' - | 'application/octet-stream' - | 'application/json' = 'application/octet-stream'; - if (typeof httpCtx.response.body === 'string') { - body = new TextEncoder().encode(httpCtx.response.body); - bodyContentType = 'text/plain'; - } else if (httpCtx.response.body instanceof Uint8Array) { - body = httpCtx.response.body; - bodyContentType = 'application/octet-stream'; - } else { - body = new TextEncoder().encode(JSON.stringify(httpCtx.response.body)); - bodyContentType = 'application/json'; - } - - resp.setData(body); - resp.getHttp().setStatus(httpCtx.response.status); - - Object.entries(httpCtx.response.headers).forEach(([k, v]) => { - const headerVal = new HeaderValue(); - headerVal.setValueList(v); - resp.getHttp().getHeadersMap().set(k.toLowerCase(), headerVal); - resp.getHttp().getHeadersOldMap().set(k.toLowerCase(), v[0]); - }); - - // Automatically set the content-type header if it's missing - const contentHeader = resp.getHttp().getHeadersMap().get('content-type'); - if (!contentHeader || contentHeader.getValueList().length === 0) { - const headerVal = new HeaderValue(); - headerVal.setValueList([bodyContentType]); - resp.getHttp().getHeadersMap().set('content-type', headerVal); - resp.getHttp().getHeadersOldMap().set('content-type', bodyContentType); - } - - return resp; - } -} - -export class EventContext extends TriggerContext< - EventRequest, - EventResponse -> { - public get event(): EventContext { - return this; - } - - static fromGrpcTriggerRequest( - trigger: TriggerRequest, - options?: SubscriptionWorkerOptions - ): EventContext { - const topic = trigger.getTopic(); - const ctx = new EventContext(); - - ctx.request = new EventRequest( - trigger.getData_asU8(), - topic.getTopic(), - getTraceContext(trigger.getTraceContext()) - ); - - ctx.response = { - success: true, - }; - - return ctx; - } - - static toGrpcTriggerResponse(ctx: TriggerContext): TriggerResponse { - const evtCtx = ctx.event; - const triggerResponse = new TriggerResponse(); - const topicResponse = new TopicResponseContext(); - topicResponse.setSuccess(evtCtx.res.success); - triggerResponse.setTopic(topicResponse); - return triggerResponse; - } -} - -// BUCKET NOTIFICATION CONTEXT -export class BucketNotificationContext extends TriggerContext< - BucketNotificationRequest, - BucketNotificationResponse -> { - public get bucketNotification(): BucketNotificationContext { - return this; - } - - static fromGrpcTriggerRequest( - trigger: TriggerRequest, - options?: BucketNotificationWorkerOptions - ): BucketNotificationContext { - const ctx = new BucketNotificationContext(); - const bucketConfig = trigger.getNotification().getBucket(); - - ctx.request = new BucketNotificationRequest( - trigger.getData_asU8(), - getTraceContext(trigger.getTraceContext()), - bucketConfig.getKey(), - bucketConfig.getType() - ); - - ctx.response = { - success: true, - }; - - return ctx; - } - - static toGrpcTriggerResponse( - ctx: TriggerContext - ): TriggerResponse { - const notifyCtx = ctx.bucketNotification; - const triggerResponse = new TriggerResponse(); - const notificationResponse = new NotificationResponseContext(); - notificationResponse.setSuccess(notifyCtx.res.success); - triggerResponse.setNotification(notificationResponse); - return triggerResponse; - } -} - -export enum BucketNotificationType { - Created, - Deleted, -} - -export class BucketNotificationRequest extends AbstractRequest { - public readonly key: string; - public readonly notificationType: BucketNotificationType; - - constructor( - data: string | Uint8Array, - traceContext: api.Context, - key: string, - notificationType: number - ) { - super(data, traceContext); - - // Get reference to the bucket - this.key = key; - this.notificationType = this.eventTypeToNotificationType(notificationType); - } - - private eventTypeToNotificationType = ( - eventType: number - ): BucketNotificationType => { - switch (eventType) { - case ProtoBucketNotificationType.CREATED: - return BucketNotificationType.Created; - case ProtoBucketNotificationType.DELETED: - return BucketNotificationType.Deleted; - default: - throw new Error(`event type unsupported: ${eventType}`); - } - }; -} - -export class FileNotificationContext extends TriggerContext< - FileNotificationRequest, - BucketNotificationResponse -> { - public get bucketNotification(): FileNotificationContext { - return this; - } - - static fromGrpcTriggerRequest( - trigger: TriggerRequest, - options: FileNotificationWorkerOptions - ): BucketNotificationContext { - const ctx = new FileNotificationContext(); - const bucketConfig = trigger.getNotification().getBucket(); - - ctx.request = new FileNotificationRequest( - trigger.getData_asU8(), - getTraceContext(trigger.getTraceContext()), - bucketConfig.getKey(), - bucketConfig.getType(), - options.bucketRef - ); - - ctx.response = { - success: true, - }; - - return ctx; - } - - static toGrpcTriggerResponse( - ctx: TriggerContext - ): TriggerResponse { - const notifyCtx = ctx.bucketNotification; - const triggerResponse = new TriggerResponse(); - const notificationResponse = new NotificationResponseContext(); - notificationResponse.setSuccess(notifyCtx.res.success); - triggerResponse.setNotification(notificationResponse); - return triggerResponse; - } -} -export class FileNotificationRequest extends BucketNotificationRequest { - public readonly file: File; - - constructor( - data: string | Uint8Array, - traceContext: api.Context, - key: string, - notificationType: number, - bucket: Bucket - ) { - super(data, traceContext, key, notificationType); - - this.file = bucket.file(key); - } -} - -export interface BucketNotificationResponse { - success: boolean; -} - -// WEBSOCKET NOTIFICATION CONTEXT - -export class WebsocketNotificationContext extends TriggerContext< - WebsocketNotificationRequest, - WebsocketNotificationResponse -> { - public get websocket(): WebsocketNotificationContext { - return this; - } - - static fromGrpcTriggerRequest( - trigger: TriggerRequest - ): WebsocketNotificationContext { - const ctx = new WebsocketNotificationContext(); - - const query = ( - trigger - .getWebsocket() - .getQueryParamsMap() - // getEntryList claims to return [string, faas.HeaderValue][], but really returns [string, string[][]][] - // we force the type to match the real return type. - .getEntryList() as unknown as [string, string[][]][] - ).reduce( - (acc, [key, [val]]) => ({ - ...acc, - [key]: val.map((v) => decodeURIComponent(v)), - }), - {} as Record - ); - - ctx.request = new WebsocketNotificationRequest( - trigger.getData_asU8(), - getTraceContext(trigger.getTraceContext()), - trigger.getWebsocket().getSocket(), - trigger.getWebsocket().getEvent(), - trigger.getWebsocket().getConnectionid(), - query - ); - - ctx.response = { - success: true, - }; - - return ctx; - } - - static toGrpcTriggerResponse( - ctx: TriggerContext - ): TriggerResponse { - const notifyCtx = ctx.websocket; - const triggerResponse = new TriggerResponse(); - const notificationResponse = new WebsocketResponseContext(); - notificationResponse.setSuccess(notifyCtx.res.success); - triggerResponse.setWebsocket(notificationResponse); - return triggerResponse; - } -} - -export enum WebsocketNotificationType { - Connected, - Disconnected, - Message, -} - -export class WebsocketNotificationRequest extends AbstractRequest { - public readonly socket: string; - public readonly notificationType: WebsocketNotificationType; - public readonly connectionId: string; - public readonly query: Record; - - constructor( - data: string | Uint8Array, - traceContext: api.Context, - socket: string, - notificationType: WebsocketNotificationType, - connectionId: string, - query: Record - ) { - super(data, traceContext); - - // Get reference to the bucket - this.socket = socket; - this.notificationType = notificationType; - this.connectionId = connectionId; - this.query = query; - } -} - -export interface WebsocketNotificationResponse { - success: boolean; -} diff --git a/src/faas/v0/start.test.ts b/src/faas/v0/start.test.ts deleted file mode 100644 index e89ebb57..00000000 --- a/src/faas/v0/start.test.ts +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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 { start } from './start'; -import { FaasServiceClient } from '@nitric/api/proto/faas/v1/faas_grpc_pb'; -import { - ServerMessage, - ClientMessage, -} from '@nitric/api/proto/faas/v1/faas_pb'; - -jest.mock('./traceProvider'); - -// We only need to handle half of the duplex stream -class MockClientStream { - public receivedMessages: Req[] = []; - - private listeners: { - [event: string]: ((req: Resp | string) => void)[]; - } = {}; - - public write(req: Req) { - this.receivedMessages.push(req); - } - - public on(event: string, cback: (req: Resp) => void) { - if (!this.listeners[event]) { - this.listeners[event] = []; - } - this.listeners[event].push(cback); - } - - public emit(event: string, req: Resp | string) { - if (this.listeners[event]) { - this.listeners[event].forEach((l) => l(req)); - } - } -} - -afterAll(() => { - jest.restoreAllMocks(); -}); - -describe('faas.start', () => { - let mockStream: MockClientStream; - describe('when starting the stream', () => { - mockStream = new MockClientStream() as any; - let streamSpy: jest.SpyInstance; - const f = jest.fn(); - - beforeAll(async () => { - streamSpy = jest - .spyOn(FaasServiceClient.prototype, 'triggerStream') - .mockReturnValueOnce(mockStream as any); - - const startPromise = start(f); - mockStream.emit('end', 'EOF'); - - await startPromise; - }); - - it('The first sent message should be an InitRequest', () => { - expect(mockStream.receivedMessages[0].hasInitRequest()).toBe(true); - }); - - it('Should start the server', () => { - expect(streamSpy).toBeCalled(); - }); - - it('Should not call the function', () => { - expect(f).toBeCalledTimes(0); - }); - }); -}); diff --git a/src/faas/v0/start.ts b/src/faas/v0/start.ts deleted file mode 100644 index 28a3f75b..00000000 --- a/src/faas/v0/start.ts +++ /dev/null @@ -1,439 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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 { SERVICE_BIND } from '../../constants'; - -import { FaasServiceClient } from '@nitric/api/proto/faas/v1/faas_grpc_pb'; -import { - ServerMessage, - ClientMessage, - HttpResponseContext, - HeaderValue, - TriggerResponse, - TopicResponseContext, - ScheduleCron, - ScheduleRate, - SubscriptionWorker, - ScheduleWorker, - InitRequest, - ApiWorker, - ApiWorkerOptions as ApiWorkerOptionsPb, - ApiWorkerScopes, - NotificationResponseContext, - BucketNotificationWorker, - BucketNotificationConfig, - HttpWorker, - WebsocketResponseContext, - WebsocketWorker, - WebsocketEvent, -} from '@nitric/api/proto/faas/v1/faas_pb'; - -import { - createHandler, - EventMiddleware, - GenericMiddleware, - HttpMiddleware, - ScheduleMiddleware, - BucketNotificationMiddleware, - TriggerContext, - TriggerMiddleware, - FileNotificationMiddleware, - WebsocketMiddleware, -} from '.'; - -import newTracerProvider from './traceProvider'; - -import { - ApiWorkerOptions, - CronWorkerOptions, - RateWorkerOptions, - SubscriptionWorkerOptions, - BucketNotificationWorkerOptions, -} from '../../resources'; - -import * as grpc from '@grpc/grpc-js'; -import { HttpWorkerOptions } from '@nitric/sdk/resources/http'; -import { WebsocketWorkerOptions } from '@nitric/sdk/resources/websocket'; - -export class FaasWorkerOptions {} - -type FaasClientOptions = - | ApiWorkerOptions - | RateWorkerOptions - | CronWorkerOptions - | FaasWorkerOptions - | HttpWorkerOptions - | BucketNotificationWorkerOptions; - -/** - * - */ -export class Faas { - private httpHandler?: HttpMiddleware; - private websocketHandler?: WebsocketMiddleware; - private eventHandler?: EventMiddleware | ScheduleMiddleware; - private bucketNotificationHandler?: - | BucketNotificationMiddleware - | FileNotificationMiddleware; - private anyHandler?: TriggerMiddleware; - private readonly options: FaasClientOptions; - - constructor(opts: FaasClientOptions) { - this.options = opts; - } - - /** - * Add an event handler to this Faas server - * - * @param handlers the functions to call to respond to events - * @returns self - */ - event(...handlers: EventMiddleware[] | ScheduleMiddleware[]): Faas { - this.eventHandler = createHandler(...handlers); - return this; - } - - /** - * Add an http handler to this Faas server - * - * @param handlers the functions to call to respond to http requests - * @returns self - */ - http(...handlers: HttpMiddleware[]): Faas { - this.httpHandler = createHandler(...handlers); - return this; - } - - /** - * Add a websocket handler to this Faas server - * - * @param handlers the functions to call to respond to http requests - * @returns self - */ - websocket(...handlers: WebsocketMiddleware[]): Faas { - this.websocketHandler = createHandler(...handlers); - return this; - } - - /** - * Add a notification handler to this Faas server - * - * @param handlers the functions to call to respond to notification requests - * @returns self - */ - bucketNotification( - ...handlers: BucketNotificationMiddleware[] | FileNotificationMiddleware[] - ): Faas { - this.bucketNotificationHandler = createHandler(...handlers); - return this; - } - - /** - * Get http handler for this server - * - * @returns the registered HTTP handler for this server - */ - private getHttpHandler(): HttpMiddleware | TriggerMiddleware | undefined { - return this.httpHandler || this.anyHandler; - } - - /** - * Get event handler for this server - * - * @returns the registered event handler for this server - */ - private getEventHandler(): EventMiddleware | TriggerMiddleware | undefined { - return this.eventHandler || this.anyHandler; - } - - /** - * Get notification handler for this server - * - * @returns the registered notification handler for this server - */ - private getBucketNotificationHandler(): - | BucketNotificationMiddleware - | FileNotificationMiddleware - | TriggerMiddleware - | undefined { - return this.bucketNotificationHandler || this.anyHandler; - } - - /** - * Get websocket handler for this server - * - * @returns the registered websocket handler - */ - private getWebsocketHandler(): - | WebsocketMiddleware - | TriggerMiddleware - | undefined { - return this.websocketHandler || this.anyHandler; - } - - /** - * Start the Faas server - * - * @param handlers to use as the default when no other handler is registered for the request type - * @returns a promise that resolves when the server terminates - */ - async start(...handlers: TriggerMiddleware[]): Promise { - const provider = newTracerProvider(); - - this.anyHandler = handlers.length && createHandler(...handlers); - if ( - !(this.options instanceof HttpWorkerOptions) && - !this.httpHandler && - !this.eventHandler && - !this.bucketNotificationHandler && - !this.websocketHandler && - !this.anyHandler - ) { - throw new Error('A handler function must be provided.'); - } - - // Actually start the server... - const faasClient = new FaasServiceClient( - SERVICE_BIND, - grpc.ChannelCredentials.createInsecure() - ); - - // Begin Bi-Di streaming - const faasStream = faasClient.triggerStream(); - - // Start Node application that HTTP proxy sits on - if ( - this.options instanceof HttpWorkerOptions && - process.env.NITRIC_ENVIRONMENT !== 'build' - ) { - this.options.app.listen(this.options.port, this.options.callback); - } - - faasStream.on('data', async (message: ServerMessage) => { - // We have an init response from the membrane - if (message.hasInitResponse()) { - console.log('Function connected with membrane'); - // We got an init response from the membrane - // The client can configure itself with any information provided by the membrane.. - } else if (message.hasTriggerRequest()) { - // We want to handle a function here... - const triggerRequest = message.getTriggerRequest(); - const responseMessage = new ClientMessage(); - - responseMessage.setId(message.getId()); - - try { - const ctx = TriggerContext.fromGrpcTriggerRequest( - triggerRequest, - this.options - ); - - let handler: GenericMiddleware = undefined; - let triggerType = 'Unknown'; - if (ctx.http) { - triggerType = 'HTTP'; - handler = - this.getHttpHandler() as GenericMiddleware; - } else if (ctx.event) { - triggerType = 'Event'; - handler = - this.getEventHandler() as GenericMiddleware; - } else if (ctx.bucketNotification) { - triggerType = 'Notification'; - handler = - this.getBucketNotificationHandler() as GenericMiddleware; - } else if (ctx.websocket) { - triggerType = 'Websocket'; - handler = - this.getWebsocketHandler() as GenericMiddleware; - } else { - console.error( - `received an unexpected trigger type, are you using an outdated version of the SDK?` - ); - } - - if (!handler) { - // No handler defined for the trigger type received. - console.error(`no handler defined for ${triggerType} triggers`); - faasStream.cancel(); - return; - } - - const result = (await handler(ctx, async (ctx) => ctx)) || ctx; - responseMessage.setTriggerResponse( - TriggerContext.toGrpcTriggerResponse(result) - ); - } catch (e) { - // generic error handling - console.error(e); - const triggerResponse = new TriggerResponse(); - responseMessage.setTriggerResponse(triggerResponse); - triggerResponse.setData( - new TextEncoder().encode('Internal Server Error') - ); - - if (triggerRequest.hasHttp()) { - const httpResponse = new HttpResponseContext(); - triggerResponse.setHttp(httpResponse); - httpResponse.setStatus(500); - const headersOld = httpResponse.getHeadersOldMap(); - headersOld.set('Content-Type', 'text/plain'); - const headers = httpResponse.getHeadersMap(); - const contentTypeHeader = new HeaderValue(); - contentTypeHeader.addValue('text/plain'); - headers.set('Content-Type', contentTypeHeader); - } else if (triggerRequest.hasTopic()) { - const topicResponse = new TopicResponseContext(); - topicResponse.setSuccess(false); - triggerResponse.setTopic(topicResponse); - } else if (triggerRequest.hasNotification()) { - const notificationResponse = new NotificationResponseContext(); - notificationResponse.setSuccess(false); - triggerResponse.setNotification(notificationResponse); - } else if (triggerRequest.hasWebsocket()) { - const notificationResponse = new WebsocketResponseContext(); - notificationResponse.setSuccess(false); - triggerResponse.setWebsocket(notificationResponse); - } - } - // Send the response back to the membrane - faasStream.write(responseMessage); - } - }); - - // Let the membrane know we're ready to start - const initRequest = new InitRequest(); - const initMessage = new ClientMessage(); - - if (this.options instanceof ApiWorkerOptions) { - const apiWorker = new ApiWorker(); - apiWorker.setApi(this.options.api); - apiWorker.setMethodsList(this.options.methods); - apiWorker.setPath(this.options.route); - - const opts = new ApiWorkerOptionsPb(); - if (this.options.opts && this.options.opts.security) { - if (Object.keys(this.options.opts.security).length == 0) { - // disable security if empty security is explicitly set - opts.setSecurityDisabled(true); - } else { - const methodOpts = this.options.opts; - Object.keys(methodOpts.security).forEach((k) => { - const scopes = new ApiWorkerScopes(); - scopes.setScopesList(methodOpts.security[k]); - opts.getSecurityMap().set(k, scopes); - }); - } - } - - apiWorker.setOptions(opts); - initRequest.setApi(apiWorker); - } else if (this.options instanceof RateWorkerOptions) { - const scheduleWorker = new ScheduleWorker(); - scheduleWorker.setKey(this.options.description); - const rate = new ScheduleRate(); - rate.setRate(`${this.options.rate} ${this.options.frequency}`); - scheduleWorker.setRate(rate); - initRequest.setSchedule(scheduleWorker); - } else if (this.options instanceof CronWorkerOptions) { - const scheduleWorker = new ScheduleWorker(); - scheduleWorker.setKey(this.options.description); - const cron = new ScheduleCron(); - cron.setCron(this.options.cron); - scheduleWorker.setCron(cron); - initRequest.setSchedule(scheduleWorker); - } else if (this.options instanceof SubscriptionWorkerOptions) { - const subscriptionWorker = new SubscriptionWorker(); - subscriptionWorker.setTopic(this.options.topic); - initRequest.setSubscription(subscriptionWorker); - } else if (this.options instanceof BucketNotificationWorkerOptions) { - const notificationWorker = new BucketNotificationWorker(); - notificationWorker.setBucket(this.options.bucket); - const config = new BucketNotificationConfig(); - config.setNotificationPrefixFilter(this.options.notificationPrefixFilter); - config.setNotificationType(this.options.notificationType); - notificationWorker.setConfig(config); - initRequest.setBucketNotification(notificationWorker); - } else if (this.options instanceof HttpWorkerOptions) { - const httpWorker = new HttpWorker(); - httpWorker.setPort(this.options.port); - initRequest.setHttpWorker(httpWorker); - } else if (this.options instanceof WebsocketWorkerOptions) { - const websocketWorker = new WebsocketWorker(); - websocketWorker.setSocket(this.options.socket); - websocketWorker.setEvent(this.options.eventType); - initRequest.setWebsocket(websocketWorker); - } - // Original faas workers should return a blank InitRequest for compatibility. - - initMessage.setInitRequest(initRequest); - faasStream.write(initMessage); - - // Block until the stream has closed... - await new Promise((res) => { - // The server has determined this stream must close - faasStream.on('end', () => { - console.log('Membrane has terminated the trigger stream'); - res(); - }); - }); - - // Shutdown the trace provider, flushing the stream and stopping listeners - await provider?.shutdown(); - } -} - -// Faas Singleton -let INSTANCE: Faas = undefined; - -const getFaasInstance = (): Faas => { - INSTANCE = INSTANCE || new Faas(new FaasWorkerOptions()); - return INSTANCE; -}; - -/** - * Register a HTTP handler - * - * @param handlers the functions to call to respond to http requests - * @returns the FaaS service factory - */ -export const http = (...handlers: HttpMiddleware[]): Faas => - getFaasInstance().http(...handlers); - -/** - * Register an event handler - * - * @param handlers the functions to call to respond to events - * @returns the FaaS service factory - */ -export const event = (...handlers: EventMiddleware[]): Faas => - getFaasInstance().event(...handlers); - -/** - * Register a notification handler - * - * @param handlers the functions to call to respond to events - * @returns the FaaS service factory - */ -export const notification = ( - ...handlers: BucketNotificationMiddleware[] -): Faas => getFaasInstance().bucketNotification(...handlers); - -/** - * Start the FaaS server with a universal handler - * - * @param handlers default handlers - * @returns a promise that resolves when the server terminates - */ -export const start = async (...handlers: TriggerMiddleware[]): Promise => - await getFaasInstance().start(...handlers); diff --git a/src/gen/nitric/proto/apis/v1/apis_grpc_pb.d.ts b/src/gen/nitric/proto/apis/v1/apis_grpc_pb.d.ts new file mode 100644 index 00000000..d24a6c9e --- /dev/null +++ b/src/gen/nitric/proto/apis/v1/apis_grpc_pb.d.ts @@ -0,0 +1,28 @@ +// GENERATED CODE -- DO NOT EDIT! + +// package: nitric.proto.apis.v1 +// file: nitric/proto/apis/v1/apis.proto + +import * as nitric_proto_apis_v1_apis_pb from "../../../../nitric/proto/apis/v1/apis_pb"; +import * as grpc from "@grpc/grpc-js"; + +interface IApiService extends grpc.ServiceDefinition { + serve: grpc.MethodDefinition; + apiDetails: grpc.MethodDefinition; +} + +export const ApiService: IApiService; + +export interface IApiServer extends grpc.UntypedServiceImplementation { + serve: grpc.handleBidiStreamingCall; + apiDetails: grpc.handleUnaryCall; +} + +export class ApiClient extends grpc.Client { + constructor(address: string, credentials: grpc.ChannelCredentials, options?: object); + serve(metadataOrOptions?: grpc.Metadata | grpc.CallOptions | null): grpc.ClientDuplexStream; + serve(metadata?: grpc.Metadata | null, options?: grpc.CallOptions | null): grpc.ClientDuplexStream; + apiDetails(argument: nitric_proto_apis_v1_apis_pb.ApiDetailsRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + apiDetails(argument: nitric_proto_apis_v1_apis_pb.ApiDetailsRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + apiDetails(argument: nitric_proto_apis_v1_apis_pb.ApiDetailsRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; +} diff --git a/src/gen/nitric/proto/apis/v1/apis_grpc_pb.js b/src/gen/nitric/proto/apis/v1/apis_grpc_pb.js new file mode 100644 index 00000000..fe30bc0c --- /dev/null +++ b/src/gen/nitric/proto/apis/v1/apis_grpc_pb.js @@ -0,0 +1,80 @@ +// GENERATED CODE -- DO NOT EDIT! + +'use strict'; +var grpc = require('@grpc/grpc-js'); +var nitric_proto_apis_v1_apis_pb = require('../../../../nitric/proto/apis/v1/apis_pb.js'); + +function serialize_nitric_proto_apis_v1_ApiDetailsRequest(arg) { + if (!(arg instanceof nitric_proto_apis_v1_apis_pb.ApiDetailsRequest)) { + throw new Error('Expected argument of type nitric.proto.apis.v1.ApiDetailsRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_apis_v1_ApiDetailsRequest(buffer_arg) { + return nitric_proto_apis_v1_apis_pb.ApiDetailsRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_apis_v1_ApiDetailsResponse(arg) { + if (!(arg instanceof nitric_proto_apis_v1_apis_pb.ApiDetailsResponse)) { + throw new Error('Expected argument of type nitric.proto.apis.v1.ApiDetailsResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_apis_v1_ApiDetailsResponse(buffer_arg) { + return nitric_proto_apis_v1_apis_pb.ApiDetailsResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_apis_v1_ClientMessage(arg) { + if (!(arg instanceof nitric_proto_apis_v1_apis_pb.ClientMessage)) { + throw new Error('Expected argument of type nitric.proto.apis.v1.ClientMessage'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_apis_v1_ClientMessage(buffer_arg) { + return nitric_proto_apis_v1_apis_pb.ClientMessage.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_apis_v1_ServerMessage(arg) { + if (!(arg instanceof nitric_proto_apis_v1_apis_pb.ServerMessage)) { + throw new Error('Expected argument of type nitric.proto.apis.v1.ServerMessage'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_apis_v1_ServerMessage(buffer_arg) { + return nitric_proto_apis_v1_apis_pb.ServerMessage.deserializeBinary(new Uint8Array(buffer_arg)); +} + + +// Service for API routing and handlers +var ApiService = exports.ApiService = { + // Serve a route on an API +serve: { + path: '/nitric.proto.apis.v1.Api/Serve', + requestStream: true, + responseStream: true, + requestType: nitric_proto_apis_v1_apis_pb.ClientMessage, + responseType: nitric_proto_apis_v1_apis_pb.ServerMessage, + requestSerialize: serialize_nitric_proto_apis_v1_ClientMessage, + requestDeserialize: deserialize_nitric_proto_apis_v1_ClientMessage, + responseSerialize: serialize_nitric_proto_apis_v1_ServerMessage, + responseDeserialize: deserialize_nitric_proto_apis_v1_ServerMessage, + }, + // Retrieve details about an API +apiDetails: { + path: '/nitric.proto.apis.v1.Api/ApiDetails', + requestStream: false, + responseStream: false, + requestType: nitric_proto_apis_v1_apis_pb.ApiDetailsRequest, + responseType: nitric_proto_apis_v1_apis_pb.ApiDetailsResponse, + requestSerialize: serialize_nitric_proto_apis_v1_ApiDetailsRequest, + requestDeserialize: deserialize_nitric_proto_apis_v1_ApiDetailsRequest, + responseSerialize: serialize_nitric_proto_apis_v1_ApiDetailsResponse, + responseDeserialize: deserialize_nitric_proto_apis_v1_ApiDetailsResponse, + }, +}; + +exports.ApiClient = grpc.makeGenericClientConstructor(ApiService); diff --git a/src/gen/nitric/proto/apis/v1/apis_pb.d.ts b/src/gen/nitric/proto/apis/v1/apis_pb.d.ts new file mode 100644 index 00000000..4d8bca59 --- /dev/null +++ b/src/gen/nitric/proto/apis/v1/apis_pb.d.ts @@ -0,0 +1,332 @@ +// package: nitric.proto.apis.v1 +// file: nitric/proto/apis/v1/apis.proto + +import * as jspb from "google-protobuf"; + +export class ApiDetailsRequest extends jspb.Message { + getApiName(): string; + setApiName(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ApiDetailsRequest.AsObject; + static toObject(includeInstance: boolean, msg: ApiDetailsRequest): ApiDetailsRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ApiDetailsRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ApiDetailsRequest; + static deserializeBinaryFromReader(message: ApiDetailsRequest, reader: jspb.BinaryReader): ApiDetailsRequest; +} + +export namespace ApiDetailsRequest { + export type AsObject = { + apiName: string, + } +} + +export class ApiDetailsResponse extends jspb.Message { + getUrl(): string; + setUrl(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ApiDetailsResponse.AsObject; + static toObject(includeInstance: boolean, msg: ApiDetailsResponse): ApiDetailsResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ApiDetailsResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ApiDetailsResponse; + static deserializeBinaryFromReader(message: ApiDetailsResponse, reader: jspb.BinaryReader): ApiDetailsResponse; +} + +export namespace ApiDetailsResponse { + export type AsObject = { + url: string, + } +} + +export class ClientMessage extends jspb.Message { + getId(): string; + setId(value: string): void; + + hasRegistrationRequest(): boolean; + clearRegistrationRequest(): void; + getRegistrationRequest(): RegistrationRequest | undefined; + setRegistrationRequest(value?: RegistrationRequest): void; + + hasHttpResponse(): boolean; + clearHttpResponse(): void; + getHttpResponse(): HttpResponse | undefined; + setHttpResponse(value?: HttpResponse): void; + + getContentCase(): ClientMessage.ContentCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ClientMessage.AsObject; + static toObject(includeInstance: boolean, msg: ClientMessage): ClientMessage.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ClientMessage, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ClientMessage; + static deserializeBinaryFromReader(message: ClientMessage, reader: jspb.BinaryReader): ClientMessage; +} + +export namespace ClientMessage { + export type AsObject = { + id: string, + registrationRequest?: RegistrationRequest.AsObject, + httpResponse?: HttpResponse.AsObject, + } + + export enum ContentCase { + CONTENT_NOT_SET = 0, + REGISTRATION_REQUEST = 2, + HTTP_RESPONSE = 3, + } +} + +export class HeaderValue extends jspb.Message { + clearValueList(): void; + getValueList(): Array; + setValueList(value: Array): void; + addValue(value: string, index?: number): string; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): HeaderValue.AsObject; + static toObject(includeInstance: boolean, msg: HeaderValue): HeaderValue.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: HeaderValue, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): HeaderValue; + static deserializeBinaryFromReader(message: HeaderValue, reader: jspb.BinaryReader): HeaderValue; +} + +export namespace HeaderValue { + export type AsObject = { + valueList: Array, + } +} + +export class QueryValue extends jspb.Message { + clearValueList(): void; + getValueList(): Array; + setValueList(value: Array): void; + addValue(value: string, index?: number): string; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): QueryValue.AsObject; + static toObject(includeInstance: boolean, msg: QueryValue): QueryValue.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: QueryValue, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): QueryValue; + static deserializeBinaryFromReader(message: QueryValue, reader: jspb.BinaryReader): QueryValue; +} + +export namespace QueryValue { + export type AsObject = { + valueList: Array, + } +} + +export class HttpRequest extends jspb.Message { + getMethod(): string; + setMethod(value: string): void; + + getPath(): string; + setPath(value: string): void; + + getHeadersMap(): jspb.Map; + clearHeadersMap(): void; + getQueryParamsMap(): jspb.Map; + clearQueryParamsMap(): void; + getPathParamsMap(): jspb.Map; + clearPathParamsMap(): void; + getBody(): Uint8Array | string; + getBody_asU8(): Uint8Array; + getBody_asB64(): string; + setBody(value: Uint8Array | string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): HttpRequest.AsObject; + static toObject(includeInstance: boolean, msg: HttpRequest): HttpRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: HttpRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): HttpRequest; + static deserializeBinaryFromReader(message: HttpRequest, reader: jspb.BinaryReader): HttpRequest; +} + +export namespace HttpRequest { + export type AsObject = { + method: string, + path: string, + headersMap: Array<[string, HeaderValue.AsObject]>, + queryParamsMap: Array<[string, QueryValue.AsObject]>, + pathParamsMap: Array<[string, string]>, + body: Uint8Array | string, + } +} + +export class HttpResponse extends jspb.Message { + getStatus(): number; + setStatus(value: number): void; + + getHeadersMap(): jspb.Map; + clearHeadersMap(): void; + getBody(): Uint8Array | string; + getBody_asU8(): Uint8Array; + getBody_asB64(): string; + setBody(value: Uint8Array | string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): HttpResponse.AsObject; + static toObject(includeInstance: boolean, msg: HttpResponse): HttpResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: HttpResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): HttpResponse; + static deserializeBinaryFromReader(message: HttpResponse, reader: jspb.BinaryReader): HttpResponse; +} + +export namespace HttpResponse { + export type AsObject = { + status: number, + headersMap: Array<[string, HeaderValue.AsObject]>, + body: Uint8Array | string, + } +} + +export class ServerMessage extends jspb.Message { + getId(): string; + setId(value: string): void; + + hasRegistrationResponse(): boolean; + clearRegistrationResponse(): void; + getRegistrationResponse(): RegistrationResponse | undefined; + setRegistrationResponse(value?: RegistrationResponse): void; + + hasHttpRequest(): boolean; + clearHttpRequest(): void; + getHttpRequest(): HttpRequest | undefined; + setHttpRequest(value?: HttpRequest): void; + + getContentCase(): ServerMessage.ContentCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ServerMessage.AsObject; + static toObject(includeInstance: boolean, msg: ServerMessage): ServerMessage.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ServerMessage, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ServerMessage; + static deserializeBinaryFromReader(message: ServerMessage, reader: jspb.BinaryReader): ServerMessage; +} + +export namespace ServerMessage { + export type AsObject = { + id: string, + registrationResponse?: RegistrationResponse.AsObject, + httpRequest?: HttpRequest.AsObject, + } + + export enum ContentCase { + CONTENT_NOT_SET = 0, + REGISTRATION_RESPONSE = 2, + HTTP_REQUEST = 3, + } +} + +export class RegistrationResponse extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): RegistrationResponse.AsObject; + static toObject(includeInstance: boolean, msg: RegistrationResponse): RegistrationResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: RegistrationResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): RegistrationResponse; + static deserializeBinaryFromReader(message: RegistrationResponse, reader: jspb.BinaryReader): RegistrationResponse; +} + +export namespace RegistrationResponse { + export type AsObject = { + } +} + +export class ApiWorkerScopes extends jspb.Message { + clearScopesList(): void; + getScopesList(): Array; + setScopesList(value: Array): void; + addScopes(value: string, index?: number): string; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ApiWorkerScopes.AsObject; + static toObject(includeInstance: boolean, msg: ApiWorkerScopes): ApiWorkerScopes.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ApiWorkerScopes, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ApiWorkerScopes; + static deserializeBinaryFromReader(message: ApiWorkerScopes, reader: jspb.BinaryReader): ApiWorkerScopes; +} + +export namespace ApiWorkerScopes { + export type AsObject = { + scopesList: Array, + } +} + +export class ApiWorkerOptions extends jspb.Message { + getSecurityMap(): jspb.Map; + clearSecurityMap(): void; + getSecurityDisabled(): boolean; + setSecurityDisabled(value: boolean): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ApiWorkerOptions.AsObject; + static toObject(includeInstance: boolean, msg: ApiWorkerOptions): ApiWorkerOptions.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ApiWorkerOptions, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ApiWorkerOptions; + static deserializeBinaryFromReader(message: ApiWorkerOptions, reader: jspb.BinaryReader): ApiWorkerOptions; +} + +export namespace ApiWorkerOptions { + export type AsObject = { + securityMap: Array<[string, ApiWorkerScopes.AsObject]>, + securityDisabled: boolean, + } +} + +export class RegistrationRequest extends jspb.Message { + getApi(): string; + setApi(value: string): void; + + getPath(): string; + setPath(value: string): void; + + clearMethodsList(): void; + getMethodsList(): Array; + setMethodsList(value: Array): void; + addMethods(value: string, index?: number): string; + + hasOptions(): boolean; + clearOptions(): void; + getOptions(): ApiWorkerOptions | undefined; + setOptions(value?: ApiWorkerOptions): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): RegistrationRequest.AsObject; + static toObject(includeInstance: boolean, msg: RegistrationRequest): RegistrationRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: RegistrationRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): RegistrationRequest; + static deserializeBinaryFromReader(message: RegistrationRequest, reader: jspb.BinaryReader): RegistrationRequest; +} + +export namespace RegistrationRequest { + export type AsObject = { + api: string, + path: string, + methodsList: Array, + options?: ApiWorkerOptions.AsObject, + } +} + diff --git a/src/gen/nitric/proto/apis/v1/apis_pb.js b/src/gen/nitric/proto/apis/v1/apis_pb.js new file mode 100644 index 00000000..16d5f12e --- /dev/null +++ b/src/gen/nitric/proto/apis/v1/apis_pb.js @@ -0,0 +1,2595 @@ +// source: nitric/proto/apis/v1/apis.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() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +goog.exportSymbol('proto.nitric.proto.apis.v1.ApiDetailsRequest', null, global); +goog.exportSymbol('proto.nitric.proto.apis.v1.ApiDetailsResponse', null, global); +goog.exportSymbol('proto.nitric.proto.apis.v1.ApiWorkerOptions', null, global); +goog.exportSymbol('proto.nitric.proto.apis.v1.ApiWorkerScopes', null, global); +goog.exportSymbol('proto.nitric.proto.apis.v1.ClientMessage', null, global); +goog.exportSymbol('proto.nitric.proto.apis.v1.ClientMessage.ContentCase', null, global); +goog.exportSymbol('proto.nitric.proto.apis.v1.HeaderValue', null, global); +goog.exportSymbol('proto.nitric.proto.apis.v1.HttpRequest', null, global); +goog.exportSymbol('proto.nitric.proto.apis.v1.HttpResponse', null, global); +goog.exportSymbol('proto.nitric.proto.apis.v1.QueryValue', null, global); +goog.exportSymbol('proto.nitric.proto.apis.v1.RegistrationRequest', null, global); +goog.exportSymbol('proto.nitric.proto.apis.v1.RegistrationResponse', null, global); +goog.exportSymbol('proto.nitric.proto.apis.v1.ServerMessage', null, global); +goog.exportSymbol('proto.nitric.proto.apis.v1.ServerMessage.ContentCase', 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.nitric.proto.apis.v1.ApiDetailsRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.apis.v1.ApiDetailsRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.apis.v1.ApiDetailsRequest.displayName = 'proto.nitric.proto.apis.v1.ApiDetailsRequest'; +} +/** + * 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.nitric.proto.apis.v1.ApiDetailsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.apis.v1.ApiDetailsResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.apis.v1.ApiDetailsResponse.displayName = 'proto.nitric.proto.apis.v1.ApiDetailsResponse'; +} +/** + * 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.nitric.proto.apis.v1.ClientMessage = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.proto.apis.v1.ClientMessage.oneofGroups_); +}; +goog.inherits(proto.nitric.proto.apis.v1.ClientMessage, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.apis.v1.ClientMessage.displayName = 'proto.nitric.proto.apis.v1.ClientMessage'; +} +/** + * 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.nitric.proto.apis.v1.HeaderValue = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.proto.apis.v1.HeaderValue.repeatedFields_, null); +}; +goog.inherits(proto.nitric.proto.apis.v1.HeaderValue, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.apis.v1.HeaderValue.displayName = 'proto.nitric.proto.apis.v1.HeaderValue'; +} +/** + * 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.nitric.proto.apis.v1.QueryValue = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.proto.apis.v1.QueryValue.repeatedFields_, null); +}; +goog.inherits(proto.nitric.proto.apis.v1.QueryValue, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.apis.v1.QueryValue.displayName = 'proto.nitric.proto.apis.v1.QueryValue'; +} +/** + * 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.nitric.proto.apis.v1.HttpRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.apis.v1.HttpRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.apis.v1.HttpRequest.displayName = 'proto.nitric.proto.apis.v1.HttpRequest'; +} +/** + * 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.nitric.proto.apis.v1.HttpResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.apis.v1.HttpResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.apis.v1.HttpResponse.displayName = 'proto.nitric.proto.apis.v1.HttpResponse'; +} +/** + * 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.nitric.proto.apis.v1.ServerMessage = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.proto.apis.v1.ServerMessage.oneofGroups_); +}; +goog.inherits(proto.nitric.proto.apis.v1.ServerMessage, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.apis.v1.ServerMessage.displayName = 'proto.nitric.proto.apis.v1.ServerMessage'; +} +/** + * 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.nitric.proto.apis.v1.RegistrationResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.apis.v1.RegistrationResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.apis.v1.RegistrationResponse.displayName = 'proto.nitric.proto.apis.v1.RegistrationResponse'; +} +/** + * 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.nitric.proto.apis.v1.ApiWorkerScopes = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.proto.apis.v1.ApiWorkerScopes.repeatedFields_, null); +}; +goog.inherits(proto.nitric.proto.apis.v1.ApiWorkerScopes, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.apis.v1.ApiWorkerScopes.displayName = 'proto.nitric.proto.apis.v1.ApiWorkerScopes'; +} +/** + * 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.nitric.proto.apis.v1.ApiWorkerOptions = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.apis.v1.ApiWorkerOptions, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.apis.v1.ApiWorkerOptions.displayName = 'proto.nitric.proto.apis.v1.ApiWorkerOptions'; +} +/** + * 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.nitric.proto.apis.v1.RegistrationRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.proto.apis.v1.RegistrationRequest.repeatedFields_, null); +}; +goog.inherits(proto.nitric.proto.apis.v1.RegistrationRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.apis.v1.RegistrationRequest.displayName = 'proto.nitric.proto.apis.v1.RegistrationRequest'; +} + + + +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.nitric.proto.apis.v1.ApiDetailsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.apis.v1.ApiDetailsRequest.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.nitric.proto.apis.v1.ApiDetailsRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.apis.v1.ApiDetailsRequest.toObject = function(includeInstance, msg) { + var f, obj = { + apiName: 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.nitric.proto.apis.v1.ApiDetailsRequest} + */ +proto.nitric.proto.apis.v1.ApiDetailsRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.apis.v1.ApiDetailsRequest; + return proto.nitric.proto.apis.v1.ApiDetailsRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.apis.v1.ApiDetailsRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.apis.v1.ApiDetailsRequest} + */ +proto.nitric.proto.apis.v1.ApiDetailsRequest.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.setApiName(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.apis.v1.ApiDetailsRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.apis.v1.ApiDetailsRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.apis.v1.ApiDetailsRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.apis.v1.ApiDetailsRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getApiName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string api_name = 1; + * @return {string} + */ +proto.nitric.proto.apis.v1.ApiDetailsRequest.prototype.getApiName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.apis.v1.ApiDetailsRequest} returns this + */ +proto.nitric.proto.apis.v1.ApiDetailsRequest.prototype.setApiName = 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.nitric.proto.apis.v1.ApiDetailsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.apis.v1.ApiDetailsResponse.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.nitric.proto.apis.v1.ApiDetailsResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.apis.v1.ApiDetailsResponse.toObject = function(includeInstance, msg) { + var f, obj = { + url: 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.nitric.proto.apis.v1.ApiDetailsResponse} + */ +proto.nitric.proto.apis.v1.ApiDetailsResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.apis.v1.ApiDetailsResponse; + return proto.nitric.proto.apis.v1.ApiDetailsResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.apis.v1.ApiDetailsResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.apis.v1.ApiDetailsResponse} + */ +proto.nitric.proto.apis.v1.ApiDetailsResponse.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.setUrl(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.apis.v1.ApiDetailsResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.apis.v1.ApiDetailsResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.apis.v1.ApiDetailsResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.apis.v1.ApiDetailsResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUrl(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string url = 1; + * @return {string} + */ +proto.nitric.proto.apis.v1.ApiDetailsResponse.prototype.getUrl = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.apis.v1.ApiDetailsResponse} returns this + */ +proto.nitric.proto.apis.v1.ApiDetailsResponse.prototype.setUrl = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.proto.apis.v1.ClientMessage.oneofGroups_ = [[2,3]]; + +/** + * @enum {number} + */ +proto.nitric.proto.apis.v1.ClientMessage.ContentCase = { + CONTENT_NOT_SET: 0, + REGISTRATION_REQUEST: 2, + HTTP_RESPONSE: 3 +}; + +/** + * @return {proto.nitric.proto.apis.v1.ClientMessage.ContentCase} + */ +proto.nitric.proto.apis.v1.ClientMessage.prototype.getContentCase = function() { + return /** @type {proto.nitric.proto.apis.v1.ClientMessage.ContentCase} */(jspb.Message.computeOneofCase(this, proto.nitric.proto.apis.v1.ClientMessage.oneofGroups_[0])); +}; + + + +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.nitric.proto.apis.v1.ClientMessage.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.apis.v1.ClientMessage.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.nitric.proto.apis.v1.ClientMessage} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.apis.v1.ClientMessage.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, ""), + registrationRequest: (f = msg.getRegistrationRequest()) && proto.nitric.proto.apis.v1.RegistrationRequest.toObject(includeInstance, f), + httpResponse: (f = msg.getHttpResponse()) && proto.nitric.proto.apis.v1.HttpResponse.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.nitric.proto.apis.v1.ClientMessage} + */ +proto.nitric.proto.apis.v1.ClientMessage.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.apis.v1.ClientMessage; + return proto.nitric.proto.apis.v1.ClientMessage.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.apis.v1.ClientMessage} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.apis.v1.ClientMessage} + */ +proto.nitric.proto.apis.v1.ClientMessage.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 = new proto.nitric.proto.apis.v1.RegistrationRequest; + reader.readMessage(value,proto.nitric.proto.apis.v1.RegistrationRequest.deserializeBinaryFromReader); + msg.setRegistrationRequest(value); + break; + case 3: + var value = new proto.nitric.proto.apis.v1.HttpResponse; + reader.readMessage(value,proto.nitric.proto.apis.v1.HttpResponse.deserializeBinaryFromReader); + msg.setHttpResponse(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.apis.v1.ClientMessage.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.apis.v1.ClientMessage.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.apis.v1.ClientMessage} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.apis.v1.ClientMessage.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getRegistrationRequest(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.nitric.proto.apis.v1.RegistrationRequest.serializeBinaryToWriter + ); + } + f = message.getHttpResponse(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.nitric.proto.apis.v1.HttpResponse.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string id = 1; + * @return {string} + */ +proto.nitric.proto.apis.v1.ClientMessage.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.apis.v1.ClientMessage} returns this + */ +proto.nitric.proto.apis.v1.ClientMessage.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional RegistrationRequest registration_request = 2; + * @return {?proto.nitric.proto.apis.v1.RegistrationRequest} + */ +proto.nitric.proto.apis.v1.ClientMessage.prototype.getRegistrationRequest = function() { + return /** @type{?proto.nitric.proto.apis.v1.RegistrationRequest} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.apis.v1.RegistrationRequest, 2)); +}; + + +/** + * @param {?proto.nitric.proto.apis.v1.RegistrationRequest|undefined} value + * @return {!proto.nitric.proto.apis.v1.ClientMessage} returns this +*/ +proto.nitric.proto.apis.v1.ClientMessage.prototype.setRegistrationRequest = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.nitric.proto.apis.v1.ClientMessage.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.apis.v1.ClientMessage} returns this + */ +proto.nitric.proto.apis.v1.ClientMessage.prototype.clearRegistrationRequest = function() { + return this.setRegistrationRequest(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.apis.v1.ClientMessage.prototype.hasRegistrationRequest = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional HttpResponse http_response = 3; + * @return {?proto.nitric.proto.apis.v1.HttpResponse} + */ +proto.nitric.proto.apis.v1.ClientMessage.prototype.getHttpResponse = function() { + return /** @type{?proto.nitric.proto.apis.v1.HttpResponse} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.apis.v1.HttpResponse, 3)); +}; + + +/** + * @param {?proto.nitric.proto.apis.v1.HttpResponse|undefined} value + * @return {!proto.nitric.proto.apis.v1.ClientMessage} returns this +*/ +proto.nitric.proto.apis.v1.ClientMessage.prototype.setHttpResponse = function(value) { + return jspb.Message.setOneofWrapperField(this, 3, proto.nitric.proto.apis.v1.ClientMessage.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.apis.v1.ClientMessage} returns this + */ +proto.nitric.proto.apis.v1.ClientMessage.prototype.clearHttpResponse = function() { + return this.setHttpResponse(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.apis.v1.ClientMessage.prototype.hasHttpResponse = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.nitric.proto.apis.v1.HeaderValue.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.nitric.proto.apis.v1.HeaderValue.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.apis.v1.HeaderValue.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.nitric.proto.apis.v1.HeaderValue} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.apis.v1.HeaderValue.toObject = function(includeInstance, msg) { + var f, obj = { + valueList: (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.nitric.proto.apis.v1.HeaderValue} + */ +proto.nitric.proto.apis.v1.HeaderValue.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.apis.v1.HeaderValue; + return proto.nitric.proto.apis.v1.HeaderValue.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.apis.v1.HeaderValue} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.apis.v1.HeaderValue} + */ +proto.nitric.proto.apis.v1.HeaderValue.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.addValue(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.apis.v1.HeaderValue.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.apis.v1.HeaderValue.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.apis.v1.HeaderValue} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.apis.v1.HeaderValue.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getValueList(); + if (f.length > 0) { + writer.writeRepeatedString( + 1, + f + ); + } +}; + + +/** + * repeated string value = 1; + * @return {!Array} + */ +proto.nitric.proto.apis.v1.HeaderValue.prototype.getValueList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.nitric.proto.apis.v1.HeaderValue} returns this + */ +proto.nitric.proto.apis.v1.HeaderValue.prototype.setValueList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.nitric.proto.apis.v1.HeaderValue} returns this + */ +proto.nitric.proto.apis.v1.HeaderValue.prototype.addValue = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.nitric.proto.apis.v1.HeaderValue} returns this + */ +proto.nitric.proto.apis.v1.HeaderValue.prototype.clearValueList = function() { + return this.setValueList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.nitric.proto.apis.v1.QueryValue.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.nitric.proto.apis.v1.QueryValue.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.apis.v1.QueryValue.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.nitric.proto.apis.v1.QueryValue} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.apis.v1.QueryValue.toObject = function(includeInstance, msg) { + var f, obj = { + valueList: (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.nitric.proto.apis.v1.QueryValue} + */ +proto.nitric.proto.apis.v1.QueryValue.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.apis.v1.QueryValue; + return proto.nitric.proto.apis.v1.QueryValue.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.apis.v1.QueryValue} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.apis.v1.QueryValue} + */ +proto.nitric.proto.apis.v1.QueryValue.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.addValue(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.apis.v1.QueryValue.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.apis.v1.QueryValue.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.apis.v1.QueryValue} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.apis.v1.QueryValue.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getValueList(); + if (f.length > 0) { + writer.writeRepeatedString( + 1, + f + ); + } +}; + + +/** + * repeated string value = 1; + * @return {!Array} + */ +proto.nitric.proto.apis.v1.QueryValue.prototype.getValueList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.nitric.proto.apis.v1.QueryValue} returns this + */ +proto.nitric.proto.apis.v1.QueryValue.prototype.setValueList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.nitric.proto.apis.v1.QueryValue} returns this + */ +proto.nitric.proto.apis.v1.QueryValue.prototype.addValue = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.nitric.proto.apis.v1.QueryValue} returns this + */ +proto.nitric.proto.apis.v1.QueryValue.prototype.clearValueList = function() { + return this.setValueList([]); +}; + + + + + +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.nitric.proto.apis.v1.HttpRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.apis.v1.HttpRequest.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.nitric.proto.apis.v1.HttpRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.apis.v1.HttpRequest.toObject = function(includeInstance, msg) { + var f, obj = { + method: jspb.Message.getFieldWithDefault(msg, 1, ""), + path: jspb.Message.getFieldWithDefault(msg, 2, ""), + headersMap: (f = msg.getHeadersMap()) ? f.toObject(includeInstance, proto.nitric.proto.apis.v1.HeaderValue.toObject) : [], + queryParamsMap: (f = msg.getQueryParamsMap()) ? f.toObject(includeInstance, proto.nitric.proto.apis.v1.QueryValue.toObject) : [], + pathParamsMap: (f = msg.getPathParamsMap()) ? f.toObject(includeInstance, undefined) : [], + body: msg.getBody_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.nitric.proto.apis.v1.HttpRequest} + */ +proto.nitric.proto.apis.v1.HttpRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.apis.v1.HttpRequest; + return proto.nitric.proto.apis.v1.HttpRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.apis.v1.HttpRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.apis.v1.HttpRequest} + */ +proto.nitric.proto.apis.v1.HttpRequest.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 = /** @type {string} */ (reader.readString()); + msg.setPath(value); + break; + case 3: + var value = msg.getHeadersMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.nitric.proto.apis.v1.HeaderValue.deserializeBinaryFromReader, "", new proto.nitric.proto.apis.v1.HeaderValue()); + }); + break; + case 4: + var value = msg.getQueryParamsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.nitric.proto.apis.v1.QueryValue.deserializeBinaryFromReader, "", new proto.nitric.proto.apis.v1.QueryValue()); + }); + break; + case 5: + var value = msg.getPathParamsMap(); + 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 = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setBody(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.apis.v1.HttpRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.apis.v1.HttpRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.apis.v1.HttpRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.apis.v1.HttpRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMethod(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getPath(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getHeadersMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(3, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.nitric.proto.apis.v1.HeaderValue.serializeBinaryToWriter); + } + f = message.getQueryParamsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(4, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.nitric.proto.apis.v1.QueryValue.serializeBinaryToWriter); + } + f = message.getPathParamsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } + f = message.getBody_asU8(); + if (f.length > 0) { + writer.writeBytes( + 6, + f + ); + } +}; + + +/** + * optional string method = 1; + * @return {string} + */ +proto.nitric.proto.apis.v1.HttpRequest.prototype.getMethod = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.apis.v1.HttpRequest} returns this + */ +proto.nitric.proto.apis.v1.HttpRequest.prototype.setMethod = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string path = 2; + * @return {string} + */ +proto.nitric.proto.apis.v1.HttpRequest.prototype.getPath = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.apis.v1.HttpRequest} returns this + */ +proto.nitric.proto.apis.v1.HttpRequest.prototype.setPath = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * map headers = 3; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.nitric.proto.apis.v1.HttpRequest.prototype.getHeadersMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 3, opt_noLazyCreate, + proto.nitric.proto.apis.v1.HeaderValue)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.nitric.proto.apis.v1.HttpRequest} returns this + */ +proto.nitric.proto.apis.v1.HttpRequest.prototype.clearHeadersMap = function() { + this.getHeadersMap().clear(); + return this;}; + + +/** + * map query_params = 4; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.nitric.proto.apis.v1.HttpRequest.prototype.getQueryParamsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 4, opt_noLazyCreate, + proto.nitric.proto.apis.v1.QueryValue)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.nitric.proto.apis.v1.HttpRequest} returns this + */ +proto.nitric.proto.apis.v1.HttpRequest.prototype.clearQueryParamsMap = function() { + this.getQueryParamsMap().clear(); + return this;}; + + +/** + * map path_params = 5; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.nitric.proto.apis.v1.HttpRequest.prototype.getPathParamsMap = 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.nitric.proto.apis.v1.HttpRequest} returns this + */ +proto.nitric.proto.apis.v1.HttpRequest.prototype.clearPathParamsMap = function() { + this.getPathParamsMap().clear(); + return this;}; + + +/** + * optional bytes body = 6; + * @return {!(string|Uint8Array)} + */ +proto.nitric.proto.apis.v1.HttpRequest.prototype.getBody = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * optional bytes body = 6; + * This is a type-conversion wrapper around `getBody()` + * @return {string} + */ +proto.nitric.proto.apis.v1.HttpRequest.prototype.getBody_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getBody())); +}; + + +/** + * optional bytes body = 6; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getBody()` + * @return {!Uint8Array} + */ +proto.nitric.proto.apis.v1.HttpRequest.prototype.getBody_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getBody())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.nitric.proto.apis.v1.HttpRequest} returns this + */ +proto.nitric.proto.apis.v1.HttpRequest.prototype.setBody = function(value) { + return jspb.Message.setProto3BytesField(this, 6, 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.nitric.proto.apis.v1.HttpResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.apis.v1.HttpResponse.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.nitric.proto.apis.v1.HttpResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.apis.v1.HttpResponse.toObject = function(includeInstance, msg) { + var f, obj = { + status: jspb.Message.getFieldWithDefault(msg, 1, 0), + headersMap: (f = msg.getHeadersMap()) ? f.toObject(includeInstance, proto.nitric.proto.apis.v1.HeaderValue.toObject) : [], + body: msg.getBody_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.nitric.proto.apis.v1.HttpResponse} + */ +proto.nitric.proto.apis.v1.HttpResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.apis.v1.HttpResponse; + return proto.nitric.proto.apis.v1.HttpResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.apis.v1.HttpResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.apis.v1.HttpResponse} + */ +proto.nitric.proto.apis.v1.HttpResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setStatus(value); + break; + case 2: + var value = msg.getHeadersMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.nitric.proto.apis.v1.HeaderValue.deserializeBinaryFromReader, "", new proto.nitric.proto.apis.v1.HeaderValue()); + }); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setBody(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.apis.v1.HttpResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.apis.v1.HttpResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.apis.v1.HttpResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.apis.v1.HttpResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStatus(); + if (f !== 0) { + writer.writeInt32( + 1, + f + ); + } + f = message.getHeadersMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.nitric.proto.apis.v1.HeaderValue.serializeBinaryToWriter); + } + f = message.getBody_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } +}; + + +/** + * optional int32 status = 1; + * @return {number} + */ +proto.nitric.proto.apis.v1.HttpResponse.prototype.getStatus = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.nitric.proto.apis.v1.HttpResponse} returns this + */ +proto.nitric.proto.apis.v1.HttpResponse.prototype.setStatus = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * map headers = 2; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.nitric.proto.apis.v1.HttpResponse.prototype.getHeadersMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 2, opt_noLazyCreate, + proto.nitric.proto.apis.v1.HeaderValue)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.nitric.proto.apis.v1.HttpResponse} returns this + */ +proto.nitric.proto.apis.v1.HttpResponse.prototype.clearHeadersMap = function() { + this.getHeadersMap().clear(); + return this;}; + + +/** + * optional bytes body = 3; + * @return {!(string|Uint8Array)} + */ +proto.nitric.proto.apis.v1.HttpResponse.prototype.getBody = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes body = 3; + * This is a type-conversion wrapper around `getBody()` + * @return {string} + */ +proto.nitric.proto.apis.v1.HttpResponse.prototype.getBody_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getBody())); +}; + + +/** + * optional bytes body = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getBody()` + * @return {!Uint8Array} + */ +proto.nitric.proto.apis.v1.HttpResponse.prototype.getBody_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getBody())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.nitric.proto.apis.v1.HttpResponse} returns this + */ +proto.nitric.proto.apis.v1.HttpResponse.prototype.setBody = function(value) { + return jspb.Message.setProto3BytesField(this, 3, value); +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.proto.apis.v1.ServerMessage.oneofGroups_ = [[2,3]]; + +/** + * @enum {number} + */ +proto.nitric.proto.apis.v1.ServerMessage.ContentCase = { + CONTENT_NOT_SET: 0, + REGISTRATION_RESPONSE: 2, + HTTP_REQUEST: 3 +}; + +/** + * @return {proto.nitric.proto.apis.v1.ServerMessage.ContentCase} + */ +proto.nitric.proto.apis.v1.ServerMessage.prototype.getContentCase = function() { + return /** @type {proto.nitric.proto.apis.v1.ServerMessage.ContentCase} */(jspb.Message.computeOneofCase(this, proto.nitric.proto.apis.v1.ServerMessage.oneofGroups_[0])); +}; + + + +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.nitric.proto.apis.v1.ServerMessage.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.apis.v1.ServerMessage.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.nitric.proto.apis.v1.ServerMessage} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.apis.v1.ServerMessage.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, ""), + registrationResponse: (f = msg.getRegistrationResponse()) && proto.nitric.proto.apis.v1.RegistrationResponse.toObject(includeInstance, f), + httpRequest: (f = msg.getHttpRequest()) && proto.nitric.proto.apis.v1.HttpRequest.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.nitric.proto.apis.v1.ServerMessage} + */ +proto.nitric.proto.apis.v1.ServerMessage.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.apis.v1.ServerMessage; + return proto.nitric.proto.apis.v1.ServerMessage.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.apis.v1.ServerMessage} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.apis.v1.ServerMessage} + */ +proto.nitric.proto.apis.v1.ServerMessage.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 = new proto.nitric.proto.apis.v1.RegistrationResponse; + reader.readMessage(value,proto.nitric.proto.apis.v1.RegistrationResponse.deserializeBinaryFromReader); + msg.setRegistrationResponse(value); + break; + case 3: + var value = new proto.nitric.proto.apis.v1.HttpRequest; + reader.readMessage(value,proto.nitric.proto.apis.v1.HttpRequest.deserializeBinaryFromReader); + msg.setHttpRequest(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.apis.v1.ServerMessage.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.apis.v1.ServerMessage.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.apis.v1.ServerMessage} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.apis.v1.ServerMessage.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getRegistrationResponse(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.nitric.proto.apis.v1.RegistrationResponse.serializeBinaryToWriter + ); + } + f = message.getHttpRequest(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.nitric.proto.apis.v1.HttpRequest.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string id = 1; + * @return {string} + */ +proto.nitric.proto.apis.v1.ServerMessage.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.apis.v1.ServerMessage} returns this + */ +proto.nitric.proto.apis.v1.ServerMessage.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional RegistrationResponse registration_response = 2; + * @return {?proto.nitric.proto.apis.v1.RegistrationResponse} + */ +proto.nitric.proto.apis.v1.ServerMessage.prototype.getRegistrationResponse = function() { + return /** @type{?proto.nitric.proto.apis.v1.RegistrationResponse} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.apis.v1.RegistrationResponse, 2)); +}; + + +/** + * @param {?proto.nitric.proto.apis.v1.RegistrationResponse|undefined} value + * @return {!proto.nitric.proto.apis.v1.ServerMessage} returns this +*/ +proto.nitric.proto.apis.v1.ServerMessage.prototype.setRegistrationResponse = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.nitric.proto.apis.v1.ServerMessage.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.apis.v1.ServerMessage} returns this + */ +proto.nitric.proto.apis.v1.ServerMessage.prototype.clearRegistrationResponse = function() { + return this.setRegistrationResponse(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.apis.v1.ServerMessage.prototype.hasRegistrationResponse = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional HttpRequest http_request = 3; + * @return {?proto.nitric.proto.apis.v1.HttpRequest} + */ +proto.nitric.proto.apis.v1.ServerMessage.prototype.getHttpRequest = function() { + return /** @type{?proto.nitric.proto.apis.v1.HttpRequest} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.apis.v1.HttpRequest, 3)); +}; + + +/** + * @param {?proto.nitric.proto.apis.v1.HttpRequest|undefined} value + * @return {!proto.nitric.proto.apis.v1.ServerMessage} returns this +*/ +proto.nitric.proto.apis.v1.ServerMessage.prototype.setHttpRequest = function(value) { + return jspb.Message.setOneofWrapperField(this, 3, proto.nitric.proto.apis.v1.ServerMessage.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.apis.v1.ServerMessage} returns this + */ +proto.nitric.proto.apis.v1.ServerMessage.prototype.clearHttpRequest = function() { + return this.setHttpRequest(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.apis.v1.ServerMessage.prototype.hasHttpRequest = 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.nitric.proto.apis.v1.RegistrationResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.apis.v1.RegistrationResponse.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.nitric.proto.apis.v1.RegistrationResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.apis.v1.RegistrationResponse.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.proto.apis.v1.RegistrationResponse} + */ +proto.nitric.proto.apis.v1.RegistrationResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.apis.v1.RegistrationResponse; + return proto.nitric.proto.apis.v1.RegistrationResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.apis.v1.RegistrationResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.apis.v1.RegistrationResponse} + */ +proto.nitric.proto.apis.v1.RegistrationResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.apis.v1.RegistrationResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.apis.v1.RegistrationResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.apis.v1.RegistrationResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.apis.v1.RegistrationResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.nitric.proto.apis.v1.ApiWorkerScopes.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.nitric.proto.apis.v1.ApiWorkerScopes.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.apis.v1.ApiWorkerScopes.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.nitric.proto.apis.v1.ApiWorkerScopes} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.apis.v1.ApiWorkerScopes.toObject = function(includeInstance, msg) { + var f, obj = { + scopesList: (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.nitric.proto.apis.v1.ApiWorkerScopes} + */ +proto.nitric.proto.apis.v1.ApiWorkerScopes.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.apis.v1.ApiWorkerScopes; + return proto.nitric.proto.apis.v1.ApiWorkerScopes.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.apis.v1.ApiWorkerScopes} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.apis.v1.ApiWorkerScopes} + */ +proto.nitric.proto.apis.v1.ApiWorkerScopes.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.addScopes(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.apis.v1.ApiWorkerScopes.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.apis.v1.ApiWorkerScopes.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.apis.v1.ApiWorkerScopes} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.apis.v1.ApiWorkerScopes.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getScopesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 1, + f + ); + } +}; + + +/** + * repeated string scopes = 1; + * @return {!Array} + */ +proto.nitric.proto.apis.v1.ApiWorkerScopes.prototype.getScopesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.nitric.proto.apis.v1.ApiWorkerScopes} returns this + */ +proto.nitric.proto.apis.v1.ApiWorkerScopes.prototype.setScopesList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.nitric.proto.apis.v1.ApiWorkerScopes} returns this + */ +proto.nitric.proto.apis.v1.ApiWorkerScopes.prototype.addScopes = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.nitric.proto.apis.v1.ApiWorkerScopes} returns this + */ +proto.nitric.proto.apis.v1.ApiWorkerScopes.prototype.clearScopesList = function() { + return this.setScopesList([]); +}; + + + + + +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.nitric.proto.apis.v1.ApiWorkerOptions.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.apis.v1.ApiWorkerOptions.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.nitric.proto.apis.v1.ApiWorkerOptions} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.apis.v1.ApiWorkerOptions.toObject = function(includeInstance, msg) { + var f, obj = { + securityMap: (f = msg.getSecurityMap()) ? f.toObject(includeInstance, proto.nitric.proto.apis.v1.ApiWorkerScopes.toObject) : [], + securityDisabled: jspb.Message.getBooleanFieldWithDefault(msg, 2, 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.nitric.proto.apis.v1.ApiWorkerOptions} + */ +proto.nitric.proto.apis.v1.ApiWorkerOptions.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.apis.v1.ApiWorkerOptions; + return proto.nitric.proto.apis.v1.ApiWorkerOptions.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.apis.v1.ApiWorkerOptions} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.apis.v1.ApiWorkerOptions} + */ +proto.nitric.proto.apis.v1.ApiWorkerOptions.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = msg.getSecurityMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.nitric.proto.apis.v1.ApiWorkerScopes.deserializeBinaryFromReader, "", new proto.nitric.proto.apis.v1.ApiWorkerScopes()); + }); + break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setSecurityDisabled(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.apis.v1.ApiWorkerOptions.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.apis.v1.ApiWorkerOptions.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.apis.v1.ApiWorkerOptions} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.apis.v1.ApiWorkerOptions.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSecurityMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.nitric.proto.apis.v1.ApiWorkerScopes.serializeBinaryToWriter); + } + f = message.getSecurityDisabled(); + if (f) { + writer.writeBool( + 2, + f + ); + } +}; + + +/** + * map security = 1; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.nitric.proto.apis.v1.ApiWorkerOptions.prototype.getSecurityMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 1, opt_noLazyCreate, + proto.nitric.proto.apis.v1.ApiWorkerScopes)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.nitric.proto.apis.v1.ApiWorkerOptions} returns this + */ +proto.nitric.proto.apis.v1.ApiWorkerOptions.prototype.clearSecurityMap = function() { + this.getSecurityMap().clear(); + return this;}; + + +/** + * optional bool security_disabled = 2; + * @return {boolean} + */ +proto.nitric.proto.apis.v1.ApiWorkerOptions.prototype.getSecurityDisabled = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.nitric.proto.apis.v1.ApiWorkerOptions} returns this + */ +proto.nitric.proto.apis.v1.ApiWorkerOptions.prototype.setSecurityDisabled = function(value) { + return jspb.Message.setProto3BooleanField(this, 2, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.nitric.proto.apis.v1.RegistrationRequest.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.nitric.proto.apis.v1.RegistrationRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.apis.v1.RegistrationRequest.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.nitric.proto.apis.v1.RegistrationRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.apis.v1.RegistrationRequest.toObject = function(includeInstance, msg) { + var f, obj = { + api: jspb.Message.getFieldWithDefault(msg, 1, ""), + path: jspb.Message.getFieldWithDefault(msg, 2, ""), + methodsList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f, + options: (f = msg.getOptions()) && proto.nitric.proto.apis.v1.ApiWorkerOptions.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.nitric.proto.apis.v1.RegistrationRequest} + */ +proto.nitric.proto.apis.v1.RegistrationRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.apis.v1.RegistrationRequest; + return proto.nitric.proto.apis.v1.RegistrationRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.apis.v1.RegistrationRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.apis.v1.RegistrationRequest} + */ +proto.nitric.proto.apis.v1.RegistrationRequest.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.setApi(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setPath(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.addMethods(value); + break; + case 4: + var value = new proto.nitric.proto.apis.v1.ApiWorkerOptions; + reader.readMessage(value,proto.nitric.proto.apis.v1.ApiWorkerOptions.deserializeBinaryFromReader); + msg.setOptions(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.apis.v1.RegistrationRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.apis.v1.RegistrationRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.apis.v1.RegistrationRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.apis.v1.RegistrationRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getApi(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getPath(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getMethodsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 3, + f + ); + } + f = message.getOptions(); + if (f != null) { + writer.writeMessage( + 4, + f, + proto.nitric.proto.apis.v1.ApiWorkerOptions.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string api = 1; + * @return {string} + */ +proto.nitric.proto.apis.v1.RegistrationRequest.prototype.getApi = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.apis.v1.RegistrationRequest} returns this + */ +proto.nitric.proto.apis.v1.RegistrationRequest.prototype.setApi = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string path = 2; + * @return {string} + */ +proto.nitric.proto.apis.v1.RegistrationRequest.prototype.getPath = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.apis.v1.RegistrationRequest} returns this + */ +proto.nitric.proto.apis.v1.RegistrationRequest.prototype.setPath = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * repeated string methods = 3; + * @return {!Array} + */ +proto.nitric.proto.apis.v1.RegistrationRequest.prototype.getMethodsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.nitric.proto.apis.v1.RegistrationRequest} returns this + */ +proto.nitric.proto.apis.v1.RegistrationRequest.prototype.setMethodsList = function(value) { + return jspb.Message.setField(this, 3, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.nitric.proto.apis.v1.RegistrationRequest} returns this + */ +proto.nitric.proto.apis.v1.RegistrationRequest.prototype.addMethods = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 3, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.nitric.proto.apis.v1.RegistrationRequest} returns this + */ +proto.nitric.proto.apis.v1.RegistrationRequest.prototype.clearMethodsList = function() { + return this.setMethodsList([]); +}; + + +/** + * optional ApiWorkerOptions options = 4; + * @return {?proto.nitric.proto.apis.v1.ApiWorkerOptions} + */ +proto.nitric.proto.apis.v1.RegistrationRequest.prototype.getOptions = function() { + return /** @type{?proto.nitric.proto.apis.v1.ApiWorkerOptions} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.apis.v1.ApiWorkerOptions, 4)); +}; + + +/** + * @param {?proto.nitric.proto.apis.v1.ApiWorkerOptions|undefined} value + * @return {!proto.nitric.proto.apis.v1.RegistrationRequest} returns this +*/ +proto.nitric.proto.apis.v1.RegistrationRequest.prototype.setOptions = function(value) { + return jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.apis.v1.RegistrationRequest} returns this + */ +proto.nitric.proto.apis.v1.RegistrationRequest.prototype.clearOptions = function() { + return this.setOptions(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.apis.v1.RegistrationRequest.prototype.hasOptions = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +goog.object.extend(exports, proto.nitric.proto.apis.v1); diff --git a/src/gen/nitric/proto/deployments/v1/deployments_grpc_pb.d.ts b/src/gen/nitric/proto/deployments/v1/deployments_grpc_pb.d.ts new file mode 100644 index 00000000..77bc871e --- /dev/null +++ b/src/gen/nitric/proto/deployments/v1/deployments_grpc_pb.d.ts @@ -0,0 +1,27 @@ +// GENERATED CODE -- DO NOT EDIT! + +// package: nitric.proto.deployments.v1 +// file: nitric/proto/deployments/v1/deployments.proto + +import * as nitric_proto_deployments_v1_deployments_pb from "../../../../nitric/proto/deployments/v1/deployments_pb"; +import * as grpc from "@grpc/grpc-js"; + +interface IDeploymentService extends grpc.ServiceDefinition { + up: grpc.MethodDefinition; + down: grpc.MethodDefinition; +} + +export const DeploymentService: IDeploymentService; + +export interface IDeploymentServer extends grpc.UntypedServiceImplementation { + up: grpc.handleServerStreamingCall; + down: grpc.handleServerStreamingCall; +} + +export class DeploymentClient extends grpc.Client { + constructor(address: string, credentials: grpc.ChannelCredentials, options?: object); + up(argument: nitric_proto_deployments_v1_deployments_pb.DeploymentUpRequest, metadataOrOptions?: grpc.Metadata | grpc.CallOptions | null): grpc.ClientReadableStream; + up(argument: nitric_proto_deployments_v1_deployments_pb.DeploymentUpRequest, metadata?: grpc.Metadata | null, options?: grpc.CallOptions | null): grpc.ClientReadableStream; + down(argument: nitric_proto_deployments_v1_deployments_pb.DeploymentDownRequest, metadataOrOptions?: grpc.Metadata | grpc.CallOptions | null): grpc.ClientReadableStream; + down(argument: nitric_proto_deployments_v1_deployments_pb.DeploymentDownRequest, metadata?: grpc.Metadata | null, options?: grpc.CallOptions | null): grpc.ClientReadableStream; +} diff --git a/src/gen/nitric/proto/deployments/v1/deployments_grpc_pb.js b/src/gen/nitric/proto/deployments/v1/deployments_grpc_pb.js new file mode 100644 index 00000000..50a797fc --- /dev/null +++ b/src/gen/nitric/proto/deployments/v1/deployments_grpc_pb.js @@ -0,0 +1,87 @@ +// GENERATED CODE -- DO NOT EDIT! + +'use strict'; +var grpc = require('@grpc/grpc-js'); +var nitric_proto_deployments_v1_deployments_pb = require('../../../../nitric/proto/deployments/v1/deployments_pb.js'); +var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js'); +var nitric_proto_resources_v1_resources_pb = require('../../../../nitric/proto/resources/v1/resources_pb.js'); +var nitric_proto_storage_v1_storage_pb = require('../../../../nitric/proto/storage/v1/storage_pb.js'); + +function serialize_nitric_proto_deployments_v1_DeploymentDownEvent(arg) { + if (!(arg instanceof nitric_proto_deployments_v1_deployments_pb.DeploymentDownEvent)) { + throw new Error('Expected argument of type nitric.proto.deployments.v1.DeploymentDownEvent'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_deployments_v1_DeploymentDownEvent(buffer_arg) { + return nitric_proto_deployments_v1_deployments_pb.DeploymentDownEvent.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_deployments_v1_DeploymentDownRequest(arg) { + if (!(arg instanceof nitric_proto_deployments_v1_deployments_pb.DeploymentDownRequest)) { + throw new Error('Expected argument of type nitric.proto.deployments.v1.DeploymentDownRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_deployments_v1_DeploymentDownRequest(buffer_arg) { + return nitric_proto_deployments_v1_deployments_pb.DeploymentDownRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_deployments_v1_DeploymentUpEvent(arg) { + if (!(arg instanceof nitric_proto_deployments_v1_deployments_pb.DeploymentUpEvent)) { + throw new Error('Expected argument of type nitric.proto.deployments.v1.DeploymentUpEvent'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_deployments_v1_DeploymentUpEvent(buffer_arg) { + return nitric_proto_deployments_v1_deployments_pb.DeploymentUpEvent.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_deployments_v1_DeploymentUpRequest(arg) { + if (!(arg instanceof nitric_proto_deployments_v1_deployments_pb.DeploymentUpRequest)) { + throw new Error('Expected argument of type nitric.proto.deployments.v1.DeploymentUpRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_deployments_v1_DeploymentUpRequest(buffer_arg) { + return nitric_proto_deployments_v1_deployments_pb.DeploymentUpRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + + +// The Nitric Deloyment Service contract +var DeploymentService = exports.DeploymentService = { + // Begins a new deployment +// Server will stream updates back to the connected client +// on the status of the deployment +up: { + path: '/nitric.proto.deployments.v1.Deployment/Up', + requestStream: false, + responseStream: true, + requestType: nitric_proto_deployments_v1_deployments_pb.DeploymentUpRequest, + responseType: nitric_proto_deployments_v1_deployments_pb.DeploymentUpEvent, + requestSerialize: serialize_nitric_proto_deployments_v1_DeploymentUpRequest, + requestDeserialize: deserialize_nitric_proto_deployments_v1_DeploymentUpRequest, + responseSerialize: serialize_nitric_proto_deployments_v1_DeploymentUpEvent, + responseDeserialize: deserialize_nitric_proto_deployments_v1_DeploymentUpEvent, + }, + // Tears down an existing deployment +// Server will stream updates back to the connected client +// on the status of the teardown +down: { + path: '/nitric.proto.deployments.v1.Deployment/Down', + requestStream: false, + responseStream: true, + requestType: nitric_proto_deployments_v1_deployments_pb.DeploymentDownRequest, + responseType: nitric_proto_deployments_v1_deployments_pb.DeploymentDownEvent, + requestSerialize: serialize_nitric_proto_deployments_v1_DeploymentDownRequest, + requestDeserialize: deserialize_nitric_proto_deployments_v1_DeploymentDownRequest, + responseSerialize: serialize_nitric_proto_deployments_v1_DeploymentDownEvent, + responseDeserialize: deserialize_nitric_proto_deployments_v1_DeploymentDownEvent, + }, +}; + +exports.DeploymentClient = grpc.makeGenericClientConstructor(DeploymentService); diff --git a/src/gen/proto/deploy/v1/deploy_pb.d.ts b/src/gen/nitric/proto/deployments/v1/deployments_pb.d.ts similarity index 65% rename from src/gen/proto/deploy/v1/deploy_pb.d.ts rename to src/gen/nitric/proto/deployments/v1/deployments_pb.d.ts index 61b2cb6b..d2597018 100644 --- a/src/gen/proto/deploy/v1/deploy_pb.d.ts +++ b/src/gen/nitric/proto/deployments/v1/deployments_pb.d.ts @@ -1,12 +1,12 @@ -// package: nitric.deploy.v1 -// file: proto/deploy/v1/deploy.proto +// package: nitric.proto.deployments.v1 +// file: nitric/proto/deployments/v1/deployments.proto import * as jspb from "google-protobuf"; import * as google_protobuf_struct_pb from "google-protobuf/google/protobuf/struct_pb"; -import * as proto_resource_v1_resource_pb from "../../../proto/resource/v1/resource_pb"; -import * as proto_faas_v1_faas_pb from "../../../proto/faas/v1/faas_pb"; +import * as nitric_proto_resources_v1_resources_pb from "../../../../nitric/proto/resources/v1/resources_pb"; +import * as nitric_proto_storage_v1_storage_pb from "../../../../nitric/proto/storage/v1/storage_pb"; -export class DeployUpRequest extends jspb.Message { +export class DeploymentUpRequest extends jspb.Message { hasSpec(): boolean; clearSpec(): void; getSpec(): Spec | undefined; @@ -17,83 +17,115 @@ export class DeployUpRequest extends jspb.Message { getAttributes(): google_protobuf_struct_pb.Struct | undefined; setAttributes(value?: google_protobuf_struct_pb.Struct): void; + getInteractive(): boolean; + setInteractive(value: boolean): void; + serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): DeployUpRequest.AsObject; - static toObject(includeInstance: boolean, msg: DeployUpRequest): DeployUpRequest.AsObject; + toObject(includeInstance?: boolean): DeploymentUpRequest.AsObject; + static toObject(includeInstance: boolean, msg: DeploymentUpRequest): DeploymentUpRequest.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo}; static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: DeployUpRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): DeployUpRequest; - static deserializeBinaryFromReader(message: DeployUpRequest, reader: jspb.BinaryReader): DeployUpRequest; + static serializeBinaryToWriter(message: DeploymentUpRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): DeploymentUpRequest; + static deserializeBinaryFromReader(message: DeploymentUpRequest, reader: jspb.BinaryReader): DeploymentUpRequest; } -export namespace DeployUpRequest { +export namespace DeploymentUpRequest { export type AsObject = { spec?: Spec.AsObject, attributes?: google_protobuf_struct_pb.Struct.AsObject, + interactive: boolean, } } -export class DeployUpEvent extends jspb.Message { +export class DeploymentUpEvent extends jspb.Message { hasMessage(): boolean; clearMessage(): void; - getMessage(): DeployEventMessage | undefined; - setMessage(value?: DeployEventMessage): void; + getMessage(): string; + setMessage(value: string): void; + + hasUpdate(): boolean; + clearUpdate(): void; + getUpdate(): ResourceUpdate | undefined; + setUpdate(value?: ResourceUpdate): void; hasResult(): boolean; clearResult(): void; - getResult(): DeployUpEventResult | undefined; - setResult(value?: DeployUpEventResult): void; + getResult(): UpResult | undefined; + setResult(value?: UpResult): void; - getContentCase(): DeployUpEvent.ContentCase; + getContentCase(): DeploymentUpEvent.ContentCase; serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): DeployUpEvent.AsObject; - static toObject(includeInstance: boolean, msg: DeployUpEvent): DeployUpEvent.AsObject; + toObject(includeInstance?: boolean): DeploymentUpEvent.AsObject; + static toObject(includeInstance: boolean, msg: DeploymentUpEvent): DeploymentUpEvent.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo}; static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: DeployUpEvent, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): DeployUpEvent; - static deserializeBinaryFromReader(message: DeployUpEvent, reader: jspb.BinaryReader): DeployUpEvent; + static serializeBinaryToWriter(message: DeploymentUpEvent, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): DeploymentUpEvent; + static deserializeBinaryFromReader(message: DeploymentUpEvent, reader: jspb.BinaryReader): DeploymentUpEvent; } -export namespace DeployUpEvent { +export namespace DeploymentUpEvent { export type AsObject = { - message?: DeployEventMessage.AsObject, - result?: DeployUpEventResult.AsObject, + message: string, + update?: ResourceUpdate.AsObject, + result?: UpResult.AsObject, } export enum ContentCase { CONTENT_NOT_SET = 0, MESSAGE = 1, - RESULT = 2, + UPDATE = 2, + RESULT = 3, } } -export class DeployEventMessage extends jspb.Message { +export class ResourceUpdate extends jspb.Message { + hasId(): boolean; + clearId(): void; + getId(): nitric_proto_resources_v1_resources_pb.ResourceIdentifier | undefined; + setId(value?: nitric_proto_resources_v1_resources_pb.ResourceIdentifier): void; + + getAction(): ResourceDeploymentActionMap[keyof ResourceDeploymentActionMap]; + setAction(value: ResourceDeploymentActionMap[keyof ResourceDeploymentActionMap]): void; + + getStatus(): ResourceDeploymentStatusMap[keyof ResourceDeploymentStatusMap]; + setStatus(value: ResourceDeploymentStatusMap[keyof ResourceDeploymentStatusMap]): void; + + getSubResource(): string; + setSubResource(value: string): void; + getMessage(): string; setMessage(value: string): void; serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): DeployEventMessage.AsObject; - static toObject(includeInstance: boolean, msg: DeployEventMessage): DeployEventMessage.AsObject; + toObject(includeInstance?: boolean): ResourceUpdate.AsObject; + static toObject(includeInstance: boolean, msg: ResourceUpdate): ResourceUpdate.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo}; static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: DeployEventMessage, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): DeployEventMessage; - static deserializeBinaryFromReader(message: DeployEventMessage, reader: jspb.BinaryReader): DeployEventMessage; + static serializeBinaryToWriter(message: ResourceUpdate, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ResourceUpdate; + static deserializeBinaryFromReader(message: ResourceUpdate, reader: jspb.BinaryReader): ResourceUpdate; } -export namespace DeployEventMessage { +export namespace ResourceUpdate { export type AsObject = { + id?: nitric_proto_resources_v1_resources_pb.ResourceIdentifier.AsObject, + action: ResourceDeploymentActionMap[keyof ResourceDeploymentActionMap], + status: ResourceDeploymentStatusMap[keyof ResourceDeploymentStatusMap], + subResource: string, message: string, } } export class UpResult extends jspb.Message { - hasStringResult(): boolean; - clearStringResult(): void; - getStringResult(): string; - setStringResult(value: string): void; + getSuccess(): boolean; + setSuccess(value: boolean): void; + + hasText(): boolean; + clearText(): void; + getText(): string; + setText(value: string): void; getContentCase(): UpResult.ContentCase; serializeBinary(): Uint8Array; @@ -108,110 +140,96 @@ export class UpResult extends jspb.Message { export namespace UpResult { export type AsObject = { - stringResult: string, + success: boolean, + text: string, } export enum ContentCase { CONTENT_NOT_SET = 0, - STRING_RESULT = 1, + TEXT = 2, } } -export class DeployUpEventResult extends jspb.Message { - getSuccess(): boolean; - setSuccess(value: boolean): void; - - hasResult(): boolean; - clearResult(): void; - getResult(): UpResult | undefined; - setResult(value?: UpResult): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): DeployUpEventResult.AsObject; - static toObject(includeInstance: boolean, msg: DeployUpEventResult): DeployUpEventResult.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: DeployUpEventResult, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): DeployUpEventResult; - static deserializeBinaryFromReader(message: DeployUpEventResult, reader: jspb.BinaryReader): DeployUpEventResult; -} - -export namespace DeployUpEventResult { - export type AsObject = { - success: boolean, - result?: UpResult.AsObject, - } -} - -export class DeployDownRequest extends jspb.Message { +export class DeploymentDownRequest extends jspb.Message { hasAttributes(): boolean; clearAttributes(): void; getAttributes(): google_protobuf_struct_pb.Struct | undefined; setAttributes(value?: google_protobuf_struct_pb.Struct): void; + getInteractive(): boolean; + setInteractive(value: boolean): void; + serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): DeployDownRequest.AsObject; - static toObject(includeInstance: boolean, msg: DeployDownRequest): DeployDownRequest.AsObject; + toObject(includeInstance?: boolean): DeploymentDownRequest.AsObject; + static toObject(includeInstance: boolean, msg: DeploymentDownRequest): DeploymentDownRequest.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo}; static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: DeployDownRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): DeployDownRequest; - static deserializeBinaryFromReader(message: DeployDownRequest, reader: jspb.BinaryReader): DeployDownRequest; + static serializeBinaryToWriter(message: DeploymentDownRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): DeploymentDownRequest; + static deserializeBinaryFromReader(message: DeploymentDownRequest, reader: jspb.BinaryReader): DeploymentDownRequest; } -export namespace DeployDownRequest { +export namespace DeploymentDownRequest { export type AsObject = { attributes?: google_protobuf_struct_pb.Struct.AsObject, + interactive: boolean, } } -export class DeployDownEvent extends jspb.Message { +export class DeploymentDownEvent extends jspb.Message { hasMessage(): boolean; clearMessage(): void; - getMessage(): DeployEventMessage | undefined; - setMessage(value?: DeployEventMessage): void; + getMessage(): string; + setMessage(value: string): void; hasResult(): boolean; clearResult(): void; - getResult(): DeployDownEventResult | undefined; - setResult(value?: DeployDownEventResult): void; + getResult(): DownResult | undefined; + setResult(value?: DownResult): void; + + hasUpdate(): boolean; + clearUpdate(): void; + getUpdate(): ResourceUpdate | undefined; + setUpdate(value?: ResourceUpdate): void; - getContentCase(): DeployDownEvent.ContentCase; + getContentCase(): DeploymentDownEvent.ContentCase; serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): DeployDownEvent.AsObject; - static toObject(includeInstance: boolean, msg: DeployDownEvent): DeployDownEvent.AsObject; + toObject(includeInstance?: boolean): DeploymentDownEvent.AsObject; + static toObject(includeInstance: boolean, msg: DeploymentDownEvent): DeploymentDownEvent.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo}; static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: DeployDownEvent, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): DeployDownEvent; - static deserializeBinaryFromReader(message: DeployDownEvent, reader: jspb.BinaryReader): DeployDownEvent; + static serializeBinaryToWriter(message: DeploymentDownEvent, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): DeploymentDownEvent; + static deserializeBinaryFromReader(message: DeploymentDownEvent, reader: jspb.BinaryReader): DeploymentDownEvent; } -export namespace DeployDownEvent { +export namespace DeploymentDownEvent { export type AsObject = { - message?: DeployEventMessage.AsObject, - result?: DeployDownEventResult.AsObject, + message: string, + result?: DownResult.AsObject, + update?: ResourceUpdate.AsObject, } export enum ContentCase { CONTENT_NOT_SET = 0, MESSAGE = 1, RESULT = 2, + UPDATE = 3, } } -export class DeployDownEventResult extends jspb.Message { +export class DownResult extends jspb.Message { serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): DeployDownEventResult.AsObject; - static toObject(includeInstance: boolean, msg: DeployDownEventResult): DeployDownEventResult.AsObject; + toObject(includeInstance?: boolean): DownResult.AsObject; + static toObject(includeInstance: boolean, msg: DownResult): DownResult.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo}; static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: DeployDownEventResult, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): DeployDownEventResult; - static deserializeBinaryFromReader(message: DeployDownEventResult, reader: jspb.BinaryReader): DeployDownEventResult; + static serializeBinaryToWriter(message: DownResult, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): DownResult; + static deserializeBinaryFromReader(message: DownResult, reader: jspb.BinaryReader): DownResult; } -export namespace DeployDownEventResult { +export namespace DownResult { export type AsObject = { } } @@ -236,7 +254,7 @@ export namespace ImageSource { } } -export class ExecutionUnit extends jspb.Message { +export class Service extends jspb.Message { hasImage(): boolean; clearImage(): void; getImage(): ImageSource | undefined; @@ -256,18 +274,18 @@ export class ExecutionUnit extends jspb.Message { getEnvMap(): jspb.Map; clearEnvMap(): void; - getSourceCase(): ExecutionUnit.SourceCase; + getSourceCase(): Service.SourceCase; serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): ExecutionUnit.AsObject; - static toObject(includeInstance: boolean, msg: ExecutionUnit): ExecutionUnit.AsObject; + toObject(includeInstance?: boolean): Service.AsObject; + static toObject(includeInstance: boolean, msg: Service): Service.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo}; static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: ExecutionUnit, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): ExecutionUnit; - static deserializeBinaryFromReader(message: ExecutionUnit, reader: jspb.BinaryReader): ExecutionUnit; + static serializeBinaryToWriter(message: Service, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Service; + static deserializeBinaryFromReader(message: Service, reader: jspb.BinaryReader): Service; } -export namespace ExecutionUnit { +export namespace Service { export type AsObject = { image?: ImageSource.AsObject, workers: number, @@ -284,10 +302,10 @@ export namespace ExecutionUnit { } export class Bucket extends jspb.Message { - clearNotificationsList(): void; - getNotificationsList(): Array; - setNotificationsList(value: Array): void; - addNotifications(value?: BucketNotificationTarget, index?: number): BucketNotificationTarget; + clearListenersList(): void; + getListenersList(): Array; + setListenersList(value: Array): void; + addListeners(value?: BucketListener, index?: number): BucketListener; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): Bucket.AsObject; @@ -301,41 +319,41 @@ export class Bucket extends jspb.Message { export namespace Bucket { export type AsObject = { - notificationsList: Array, + listenersList: Array, } } -export class BucketNotificationTarget extends jspb.Message { +export class BucketListener extends jspb.Message { hasConfig(): boolean; clearConfig(): void; - getConfig(): proto_faas_v1_faas_pb.BucketNotificationConfig | undefined; - setConfig(value?: proto_faas_v1_faas_pb.BucketNotificationConfig): void; + getConfig(): nitric_proto_storage_v1_storage_pb.RegistrationRequest | undefined; + setConfig(value?: nitric_proto_storage_v1_storage_pb.RegistrationRequest): void; - hasExecutionUnit(): boolean; - clearExecutionUnit(): void; - getExecutionUnit(): string; - setExecutionUnit(value: string): void; + hasService(): boolean; + clearService(): void; + getService(): string; + setService(value: string): void; - getTargetCase(): BucketNotificationTarget.TargetCase; + getTargetCase(): BucketListener.TargetCase; serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): BucketNotificationTarget.AsObject; - static toObject(includeInstance: boolean, msg: BucketNotificationTarget): BucketNotificationTarget.AsObject; + toObject(includeInstance?: boolean): BucketListener.AsObject; + static toObject(includeInstance: boolean, msg: BucketListener): BucketListener.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo}; static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: BucketNotificationTarget, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): BucketNotificationTarget; - static deserializeBinaryFromReader(message: BucketNotificationTarget, reader: jspb.BinaryReader): BucketNotificationTarget; + static serializeBinaryToWriter(message: BucketListener, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): BucketListener; + static deserializeBinaryFromReader(message: BucketListener, reader: jspb.BinaryReader): BucketListener; } -export namespace BucketNotificationTarget { +export namespace BucketListener { export type AsObject = { - config?: proto_faas_v1_faas_pb.BucketNotificationConfig.AsObject, - executionUnit: string, + config?: nitric_proto_storage_v1_storage_pb.RegistrationRequest.AsObject, + service: string, } export enum TargetCase { TARGET_NOT_SET = 0, - EXECUTION_UNIT = 2, + SERVICE = 2, } } @@ -377,18 +395,18 @@ export namespace Queue { } } -export class Collection extends jspb.Message { +export class KeyValueStore extends jspb.Message { serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Collection.AsObject; - static toObject(includeInstance: boolean, msg: Collection): Collection.AsObject; + toObject(includeInstance?: boolean): KeyValueStore.AsObject; + static toObject(includeInstance: boolean, msg: KeyValueStore): KeyValueStore.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo}; static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Collection, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Collection; - static deserializeBinaryFromReader(message: Collection, reader: jspb.BinaryReader): Collection; + static serializeBinaryToWriter(message: KeyValueStore, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): KeyValueStore; + static deserializeBinaryFromReader(message: KeyValueStore, reader: jspb.BinaryReader): KeyValueStore; } -export namespace Collection { +export namespace KeyValueStore { export type AsObject = { } } @@ -410,10 +428,10 @@ export namespace Secret { } export class SubscriptionTarget extends jspb.Message { - hasExecutionUnit(): boolean; - clearExecutionUnit(): void; - getExecutionUnit(): string; - setExecutionUnit(value: string): void; + hasService(): boolean; + clearService(): void; + getService(): string; + setService(value: string): void; getTargetCase(): SubscriptionTarget.TargetCase; serializeBinary(): Uint8Array; @@ -428,12 +446,12 @@ export class SubscriptionTarget extends jspb.Message { export namespace SubscriptionTarget { export type AsObject = { - executionUnit: string, + service: string, } export enum TargetCase { TARGET_NOT_SET = 0, - EXECUTION_UNIT = 1, + SERVICE = 1, } } @@ -460,10 +478,10 @@ export namespace TopicSubscription { } export class HttpTarget extends jspb.Message { - hasExecutionUnit(): boolean; - clearExecutionUnit(): void; - getExecutionUnit(): string; - setExecutionUnit(value: string): void; + hasService(): boolean; + clearService(): void; + getService(): string; + setService(value: string): void; getTargetCase(): HttpTarget.TargetCase; serializeBinary(): Uint8Array; @@ -478,12 +496,12 @@ export class HttpTarget extends jspb.Message { export namespace HttpTarget { export type AsObject = { - executionUnit: string, + service: string, } export enum TargetCase { TARGET_NOT_SET = 0, - EXECUTION_UNIT = 1, + SERVICE = 1, } } @@ -572,10 +590,10 @@ export namespace Websocket { } export class WebsocketTarget extends jspb.Message { - hasExecutionUnit(): boolean; - clearExecutionUnit(): void; - getExecutionUnit(): string; - setExecutionUnit(value: string): void; + hasService(): boolean; + clearService(): void; + getService(): string; + setService(value: string): void; getTargetCase(): WebsocketTarget.TargetCase; serializeBinary(): Uint8Array; @@ -590,20 +608,20 @@ export class WebsocketTarget extends jspb.Message { export namespace WebsocketTarget { export type AsObject = { - executionUnit: string, + service: string, } export enum TargetCase { TARGET_NOT_SET = 0, - EXECUTION_UNIT = 1, + SERVICE = 1, } } export class ScheduleTarget extends jspb.Message { - hasExecutionUnit(): boolean; - clearExecutionUnit(): void; - getExecutionUnit(): string; - setExecutionUnit(value: string): void; + hasService(): boolean; + clearService(): void; + getService(): string; + setService(value: string): void; getTargetCase(): ScheduleTarget.TargetCase; serializeBinary(): Uint8Array; @@ -618,24 +636,32 @@ export class ScheduleTarget extends jspb.Message { export namespace ScheduleTarget { export type AsObject = { - executionUnit: string, + service: string, } export enum TargetCase { TARGET_NOT_SET = 0, - EXECUTION_UNIT = 1, + SERVICE = 1, } } export class Schedule extends jspb.Message { - getCron(): string; - setCron(value: string): void; - hasTarget(): boolean; clearTarget(): void; getTarget(): ScheduleTarget | undefined; setTarget(value?: ScheduleTarget): void; + hasEvery(): boolean; + clearEvery(): void; + getEvery(): ScheduleEvery | undefined; + setEvery(value?: ScheduleEvery): void; + + hasCron(): boolean; + clearCron(): void; + getCron(): ScheduleCron | undefined; + setCron(value?: ScheduleCron): void; + + getCadenceCase(): Schedule.CadenceCase; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): Schedule.AsObject; static toObject(includeInstance: boolean, msg: Schedule): Schedule.AsObject; @@ -648,22 +674,68 @@ export class Schedule extends jspb.Message { export namespace Schedule { export type AsObject = { - cron: string, target?: ScheduleTarget.AsObject, + every?: ScheduleEvery.AsObject, + cron?: ScheduleCron.AsObject, + } + + export enum CadenceCase { + CADENCE_NOT_SET = 0, + EVERY = 10, + CRON = 11, } } -export class Resource extends jspb.Message { - getName(): string; - setName(value: string): void; +export class ScheduleEvery extends jspb.Message { + getRate(): string; + setRate(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ScheduleEvery.AsObject; + static toObject(includeInstance: boolean, msg: ScheduleEvery): ScheduleEvery.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ScheduleEvery, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ScheduleEvery; + static deserializeBinaryFromReader(message: ScheduleEvery, reader: jspb.BinaryReader): ScheduleEvery; +} + +export namespace ScheduleEvery { + export type AsObject = { + rate: string, + } +} + +export class ScheduleCron extends jspb.Message { + getExpression(): string; + setExpression(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ScheduleCron.AsObject; + static toObject(includeInstance: boolean, msg: ScheduleCron): ScheduleCron.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ScheduleCron, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ScheduleCron; + static deserializeBinaryFromReader(message: ScheduleCron, reader: jspb.BinaryReader): ScheduleCron; +} + +export namespace ScheduleCron { + export type AsObject = { + expression: string, + } +} - getType(): proto_resource_v1_resource_pb.ResourceTypeMap[keyof proto_resource_v1_resource_pb.ResourceTypeMap]; - setType(value: proto_resource_v1_resource_pb.ResourceTypeMap[keyof proto_resource_v1_resource_pb.ResourceTypeMap]): void; +export class Resource extends jspb.Message { + hasId(): boolean; + clearId(): void; + getId(): nitric_proto_resources_v1_resources_pb.ResourceIdentifier | undefined; + setId(value?: nitric_proto_resources_v1_resources_pb.ResourceIdentifier): void; - hasExecutionUnit(): boolean; - clearExecutionUnit(): void; - getExecutionUnit(): ExecutionUnit | undefined; - setExecutionUnit(value?: ExecutionUnit): void; + hasService(): boolean; + clearService(): void; + getService(): Service | undefined; + setService(value?: Service): void; hasBucket(): boolean; clearBucket(): void; @@ -675,11 +747,6 @@ export class Resource extends jspb.Message { getTopic(): Topic | undefined; setTopic(value?: Topic): void; - hasQueue(): boolean; - clearQueue(): void; - getQueue(): Queue | undefined; - setQueue(value?: Queue): void; - hasApi(): boolean; clearApi(): void; getApi(): Api | undefined; @@ -695,10 +762,10 @@ export class Resource extends jspb.Message { getSchedule(): Schedule | undefined; setSchedule(value?: Schedule): void; - hasCollection(): boolean; - clearCollection(): void; - getCollection(): Collection | undefined; - setCollection(value?: Collection): void; + hasKeyValueStore(): boolean; + clearKeyValueStore(): void; + getKeyValueStore(): KeyValueStore | undefined; + setKeyValueStore(value?: KeyValueStore): void; hasSecret(): boolean; clearSecret(): void; @@ -715,6 +782,11 @@ export class Resource extends jspb.Message { getHttp(): Http | undefined; setHttp(value?: Http): void; + hasQueue(): boolean; + clearQueue(): void; + getQueue(): Queue | undefined; + setQueue(value?: Queue): void; + getConfigCase(): Resource.ConfigCase; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): Resource.AsObject; @@ -728,34 +800,33 @@ export class Resource extends jspb.Message { export namespace Resource { export type AsObject = { - name: string, - type: proto_resource_v1_resource_pb.ResourceTypeMap[keyof proto_resource_v1_resource_pb.ResourceTypeMap], - executionUnit?: ExecutionUnit.AsObject, + id?: nitric_proto_resources_v1_resources_pb.ResourceIdentifier.AsObject, + service?: Service.AsObject, bucket?: Bucket.AsObject, topic?: Topic.AsObject, - queue?: Queue.AsObject, api?: Api.AsObject, policy?: Policy.AsObject, schedule?: Schedule.AsObject, - collection?: Collection.AsObject, + keyValueStore?: KeyValueStore.AsObject, secret?: Secret.AsObject, websocket?: Websocket.AsObject, http?: Http.AsObject, + queue?: Queue.AsObject, } export enum ConfigCase { CONFIG_NOT_SET = 0, - EXECUTION_UNIT = 10, + SERVICE = 10, BUCKET = 11, TOPIC = 12, - QUEUE = 13, - API = 14, - POLICY = 15, - SCHEDULE = 16, - COLLECTION = 17, - SECRET = 18, - WEBSOCKET = 19, - HTTP = 20, + API = 13, + POLICY = 14, + SCHEDULE = 15, + KEY_VALUE_STORE = 16, + SECRET = 17, + WEBSOCKET = 18, + HTTP = 19, + QUEUE = 20, } } @@ -766,9 +837,9 @@ export class Policy extends jspb.Message { addPrincipals(value?: Resource, index?: number): Resource; clearActionsList(): void; - getActionsList(): Array; - setActionsList(value: Array): void; - addActions(value: proto_resource_v1_resource_pb.ActionMap[keyof proto_resource_v1_resource_pb.ActionMap], index?: number): proto_resource_v1_resource_pb.ActionMap[keyof proto_resource_v1_resource_pb.ActionMap]; + getActionsList(): Array; + setActionsList(value: Array): void; + addActions(value: nitric_proto_resources_v1_resources_pb.ActionMap[keyof nitric_proto_resources_v1_resources_pb.ActionMap], index?: number): nitric_proto_resources_v1_resources_pb.ActionMap[keyof nitric_proto_resources_v1_resources_pb.ActionMap]; clearResourcesList(): void; getResourcesList(): Array; @@ -788,7 +859,7 @@ export class Policy extends jspb.Message { export namespace Policy { export type AsObject = { principalsList: Array, - actionsList: Array, + actionsList: Array, resourcesList: Array, } } @@ -815,3 +886,22 @@ export namespace Spec { } } +export interface ResourceDeploymentActionMap { + CREATE: 0; + UPDATE: 1; + REPLACE: 2; + SAME: 3; + DELETE: 4; +} + +export const ResourceDeploymentAction: ResourceDeploymentActionMap; + +export interface ResourceDeploymentStatusMap { + PENDING: 0; + IN_PROGRESS: 1; + SUCCESS: 2; + FAILED: 3; +} + +export const ResourceDeploymentStatus: ResourceDeploymentStatusMap; + diff --git a/src/gen/nitric/proto/deployments/v1/deployments_pb.js b/src/gen/nitric/proto/deployments/v1/deployments_pb.js new file mode 100644 index 00000000..92cc2466 --- /dev/null +++ b/src/gen/nitric/proto/deployments/v1/deployments_pb.js @@ -0,0 +1,6681 @@ +// source: nitric/proto/deployments/v1/deployments.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() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js'); +goog.object.extend(proto, google_protobuf_struct_pb); +var nitric_proto_resources_v1_resources_pb = require('../../../../nitric/proto/resources/v1/resources_pb.js'); +goog.object.extend(proto, nitric_proto_resources_v1_resources_pb); +var nitric_proto_storage_v1_storage_pb = require('../../../../nitric/proto/storage/v1/storage_pb.js'); +goog.object.extend(proto, nitric_proto_storage_v1_storage_pb); +goog.exportSymbol('proto.nitric.proto.deployments.v1.Api', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.Api.DocumentCase', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.Bucket', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.BucketListener', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.BucketListener.TargetCase', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.DeploymentDownEvent', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.DeploymentDownEvent.ContentCase', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.DeploymentDownRequest', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.DeploymentUpEvent', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.DeploymentUpEvent.ContentCase', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.DeploymentUpRequest', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.DownResult', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.Http', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.HttpTarget', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.HttpTarget.TargetCase', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.ImageSource', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.KeyValueStore', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.Policy', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.Queue', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.Resource', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.Resource.ConfigCase', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.ResourceDeploymentAction', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.ResourceDeploymentStatus', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.ResourceUpdate', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.Schedule', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.Schedule.CadenceCase', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.ScheduleCron', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.ScheduleEvery', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.ScheduleTarget', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.ScheduleTarget.TargetCase', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.Secret', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.Service', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.Service.SourceCase', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.Spec', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.SubscriptionTarget', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.SubscriptionTarget.TargetCase', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.Topic', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.TopicSubscription', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.UpResult', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.UpResult.ContentCase', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.Websocket', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.WebsocketTarget', null, global); +goog.exportSymbol('proto.nitric.proto.deployments.v1.WebsocketTarget.TargetCase', 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.nitric.proto.deployments.v1.DeploymentUpRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.deployments.v1.DeploymentUpRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.deployments.v1.DeploymentUpRequest.displayName = 'proto.nitric.proto.deployments.v1.DeploymentUpRequest'; +} +/** + * 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.nitric.proto.deployments.v1.DeploymentUpEvent = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.proto.deployments.v1.DeploymentUpEvent.oneofGroups_); +}; +goog.inherits(proto.nitric.proto.deployments.v1.DeploymentUpEvent, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.deployments.v1.DeploymentUpEvent.displayName = 'proto.nitric.proto.deployments.v1.DeploymentUpEvent'; +} +/** + * 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.nitric.proto.deployments.v1.ResourceUpdate = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.deployments.v1.ResourceUpdate, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.deployments.v1.ResourceUpdate.displayName = 'proto.nitric.proto.deployments.v1.ResourceUpdate'; +} +/** + * 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.nitric.proto.deployments.v1.UpResult = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.proto.deployments.v1.UpResult.oneofGroups_); +}; +goog.inherits(proto.nitric.proto.deployments.v1.UpResult, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.deployments.v1.UpResult.displayName = 'proto.nitric.proto.deployments.v1.UpResult'; +} +/** + * 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.nitric.proto.deployments.v1.DeploymentDownRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.deployments.v1.DeploymentDownRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.deployments.v1.DeploymentDownRequest.displayName = 'proto.nitric.proto.deployments.v1.DeploymentDownRequest'; +} +/** + * 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.nitric.proto.deployments.v1.DeploymentDownEvent = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.proto.deployments.v1.DeploymentDownEvent.oneofGroups_); +}; +goog.inherits(proto.nitric.proto.deployments.v1.DeploymentDownEvent, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.deployments.v1.DeploymentDownEvent.displayName = 'proto.nitric.proto.deployments.v1.DeploymentDownEvent'; +} +/** + * 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.nitric.proto.deployments.v1.DownResult = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.deployments.v1.DownResult, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.deployments.v1.DownResult.displayName = 'proto.nitric.proto.deployments.v1.DownResult'; +} +/** + * 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.nitric.proto.deployments.v1.ImageSource = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.deployments.v1.ImageSource, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.deployments.v1.ImageSource.displayName = 'proto.nitric.proto.deployments.v1.ImageSource'; +} +/** + * 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.nitric.proto.deployments.v1.Service = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.proto.deployments.v1.Service.oneofGroups_); +}; +goog.inherits(proto.nitric.proto.deployments.v1.Service, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.deployments.v1.Service.displayName = 'proto.nitric.proto.deployments.v1.Service'; +} +/** + * 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.nitric.proto.deployments.v1.Bucket = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.proto.deployments.v1.Bucket.repeatedFields_, null); +}; +goog.inherits(proto.nitric.proto.deployments.v1.Bucket, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.deployments.v1.Bucket.displayName = 'proto.nitric.proto.deployments.v1.Bucket'; +} +/** + * 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.nitric.proto.deployments.v1.BucketListener = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.proto.deployments.v1.BucketListener.oneofGroups_); +}; +goog.inherits(proto.nitric.proto.deployments.v1.BucketListener, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.deployments.v1.BucketListener.displayName = 'proto.nitric.proto.deployments.v1.BucketListener'; +} +/** + * 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.nitric.proto.deployments.v1.Topic = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.proto.deployments.v1.Topic.repeatedFields_, null); +}; +goog.inherits(proto.nitric.proto.deployments.v1.Topic, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.deployments.v1.Topic.displayName = 'proto.nitric.proto.deployments.v1.Topic'; +} +/** + * 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.nitric.proto.deployments.v1.Queue = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.deployments.v1.Queue, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.deployments.v1.Queue.displayName = 'proto.nitric.proto.deployments.v1.Queue'; +} +/** + * 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.nitric.proto.deployments.v1.KeyValueStore = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.deployments.v1.KeyValueStore, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.deployments.v1.KeyValueStore.displayName = 'proto.nitric.proto.deployments.v1.KeyValueStore'; +} +/** + * 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.nitric.proto.deployments.v1.Secret = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.deployments.v1.Secret, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.deployments.v1.Secret.displayName = 'proto.nitric.proto.deployments.v1.Secret'; +} +/** + * 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.nitric.proto.deployments.v1.SubscriptionTarget = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.proto.deployments.v1.SubscriptionTarget.oneofGroups_); +}; +goog.inherits(proto.nitric.proto.deployments.v1.SubscriptionTarget, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.deployments.v1.SubscriptionTarget.displayName = 'proto.nitric.proto.deployments.v1.SubscriptionTarget'; +} +/** + * 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.nitric.proto.deployments.v1.TopicSubscription = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.deployments.v1.TopicSubscription, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.deployments.v1.TopicSubscription.displayName = 'proto.nitric.proto.deployments.v1.TopicSubscription'; +} +/** + * 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.nitric.proto.deployments.v1.HttpTarget = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.proto.deployments.v1.HttpTarget.oneofGroups_); +}; +goog.inherits(proto.nitric.proto.deployments.v1.HttpTarget, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.deployments.v1.HttpTarget.displayName = 'proto.nitric.proto.deployments.v1.HttpTarget'; +} +/** + * 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.nitric.proto.deployments.v1.Http = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.deployments.v1.Http, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.deployments.v1.Http.displayName = 'proto.nitric.proto.deployments.v1.Http'; +} +/** + * 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.nitric.proto.deployments.v1.Api = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.proto.deployments.v1.Api.oneofGroups_); +}; +goog.inherits(proto.nitric.proto.deployments.v1.Api, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.deployments.v1.Api.displayName = 'proto.nitric.proto.deployments.v1.Api'; +} +/** + * 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.nitric.proto.deployments.v1.Websocket = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.deployments.v1.Websocket, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.deployments.v1.Websocket.displayName = 'proto.nitric.proto.deployments.v1.Websocket'; +} +/** + * 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.nitric.proto.deployments.v1.WebsocketTarget = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.proto.deployments.v1.WebsocketTarget.oneofGroups_); +}; +goog.inherits(proto.nitric.proto.deployments.v1.WebsocketTarget, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.deployments.v1.WebsocketTarget.displayName = 'proto.nitric.proto.deployments.v1.WebsocketTarget'; +} +/** + * 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.nitric.proto.deployments.v1.ScheduleTarget = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.proto.deployments.v1.ScheduleTarget.oneofGroups_); +}; +goog.inherits(proto.nitric.proto.deployments.v1.ScheduleTarget, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.deployments.v1.ScheduleTarget.displayName = 'proto.nitric.proto.deployments.v1.ScheduleTarget'; +} +/** + * 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.nitric.proto.deployments.v1.Schedule = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.proto.deployments.v1.Schedule.oneofGroups_); +}; +goog.inherits(proto.nitric.proto.deployments.v1.Schedule, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.deployments.v1.Schedule.displayName = 'proto.nitric.proto.deployments.v1.Schedule'; +} +/** + * 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.nitric.proto.deployments.v1.ScheduleEvery = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.deployments.v1.ScheduleEvery, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.deployments.v1.ScheduleEvery.displayName = 'proto.nitric.proto.deployments.v1.ScheduleEvery'; +} +/** + * 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.nitric.proto.deployments.v1.ScheduleCron = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.deployments.v1.ScheduleCron, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.deployments.v1.ScheduleCron.displayName = 'proto.nitric.proto.deployments.v1.ScheduleCron'; +} +/** + * 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.nitric.proto.deployments.v1.Resource = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.proto.deployments.v1.Resource.oneofGroups_); +}; +goog.inherits(proto.nitric.proto.deployments.v1.Resource, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.deployments.v1.Resource.displayName = 'proto.nitric.proto.deployments.v1.Resource'; +} +/** + * 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.nitric.proto.deployments.v1.Policy = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.proto.deployments.v1.Policy.repeatedFields_, null); +}; +goog.inherits(proto.nitric.proto.deployments.v1.Policy, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.deployments.v1.Policy.displayName = 'proto.nitric.proto.deployments.v1.Policy'; +} +/** + * 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.nitric.proto.deployments.v1.Spec = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.proto.deployments.v1.Spec.repeatedFields_, null); +}; +goog.inherits(proto.nitric.proto.deployments.v1.Spec, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.deployments.v1.Spec.displayName = 'proto.nitric.proto.deployments.v1.Spec'; +} + + + +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.nitric.proto.deployments.v1.DeploymentUpRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.deployments.v1.DeploymentUpRequest.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.nitric.proto.deployments.v1.DeploymentUpRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.DeploymentUpRequest.toObject = function(includeInstance, msg) { + var f, obj = { + spec: (f = msg.getSpec()) && proto.nitric.proto.deployments.v1.Spec.toObject(includeInstance, f), + attributes: (f = msg.getAttributes()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f), + interactive: jspb.Message.getBooleanFieldWithDefault(msg, 3, 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.nitric.proto.deployments.v1.DeploymentUpRequest} + */ +proto.nitric.proto.deployments.v1.DeploymentUpRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.deployments.v1.DeploymentUpRequest; + return proto.nitric.proto.deployments.v1.DeploymentUpRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.deployments.v1.DeploymentUpRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.deployments.v1.DeploymentUpRequest} + */ +proto.nitric.proto.deployments.v1.DeploymentUpRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.nitric.proto.deployments.v1.Spec; + reader.readMessage(value,proto.nitric.proto.deployments.v1.Spec.deserializeBinaryFromReader); + msg.setSpec(value); + break; + case 2: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setAttributes(value); + break; + case 3: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setInteractive(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.deployments.v1.DeploymentUpRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.deployments.v1.DeploymentUpRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.deployments.v1.DeploymentUpRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.DeploymentUpRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSpec(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.nitric.proto.deployments.v1.Spec.serializeBinaryToWriter + ); + } + f = message.getAttributes(); + if (f != null) { + writer.writeMessage( + 2, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } + f = message.getInteractive(); + if (f) { + writer.writeBool( + 3, + f + ); + } +}; + + +/** + * optional Spec spec = 1; + * @return {?proto.nitric.proto.deployments.v1.Spec} + */ +proto.nitric.proto.deployments.v1.DeploymentUpRequest.prototype.getSpec = function() { + return /** @type{?proto.nitric.proto.deployments.v1.Spec} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.deployments.v1.Spec, 1)); +}; + + +/** + * @param {?proto.nitric.proto.deployments.v1.Spec|undefined} value + * @return {!proto.nitric.proto.deployments.v1.DeploymentUpRequest} returns this +*/ +proto.nitric.proto.deployments.v1.DeploymentUpRequest.prototype.setSpec = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.DeploymentUpRequest} returns this + */ +proto.nitric.proto.deployments.v1.DeploymentUpRequest.prototype.clearSpec = function() { + return this.setSpec(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.DeploymentUpRequest.prototype.hasSpec = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional google.protobuf.Struct attributes = 2; + * @return {?proto.google.protobuf.Struct} + */ +proto.nitric.proto.deployments.v1.DeploymentUpRequest.prototype.getAttributes = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 2)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.nitric.proto.deployments.v1.DeploymentUpRequest} returns this +*/ +proto.nitric.proto.deployments.v1.DeploymentUpRequest.prototype.setAttributes = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.DeploymentUpRequest} returns this + */ +proto.nitric.proto.deployments.v1.DeploymentUpRequest.prototype.clearAttributes = function() { + return this.setAttributes(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.DeploymentUpRequest.prototype.hasAttributes = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional bool interactive = 3; + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.DeploymentUpRequest.prototype.getInteractive = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.nitric.proto.deployments.v1.DeploymentUpRequest} returns this + */ +proto.nitric.proto.deployments.v1.DeploymentUpRequest.prototype.setInteractive = function(value) { + return jspb.Message.setProto3BooleanField(this, 3, value); +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.proto.deployments.v1.DeploymentUpEvent.oneofGroups_ = [[1,2,3]]; + +/** + * @enum {number} + */ +proto.nitric.proto.deployments.v1.DeploymentUpEvent.ContentCase = { + CONTENT_NOT_SET: 0, + MESSAGE: 1, + UPDATE: 2, + RESULT: 3 +}; + +/** + * @return {proto.nitric.proto.deployments.v1.DeploymentUpEvent.ContentCase} + */ +proto.nitric.proto.deployments.v1.DeploymentUpEvent.prototype.getContentCase = function() { + return /** @type {proto.nitric.proto.deployments.v1.DeploymentUpEvent.ContentCase} */(jspb.Message.computeOneofCase(this, proto.nitric.proto.deployments.v1.DeploymentUpEvent.oneofGroups_[0])); +}; + + + +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.nitric.proto.deployments.v1.DeploymentUpEvent.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.deployments.v1.DeploymentUpEvent.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.nitric.proto.deployments.v1.DeploymentUpEvent} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.DeploymentUpEvent.toObject = function(includeInstance, msg) { + var f, obj = { + message: jspb.Message.getFieldWithDefault(msg, 1, ""), + update: (f = msg.getUpdate()) && proto.nitric.proto.deployments.v1.ResourceUpdate.toObject(includeInstance, f), + result: (f = msg.getResult()) && proto.nitric.proto.deployments.v1.UpResult.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.nitric.proto.deployments.v1.DeploymentUpEvent} + */ +proto.nitric.proto.deployments.v1.DeploymentUpEvent.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.deployments.v1.DeploymentUpEvent; + return proto.nitric.proto.deployments.v1.DeploymentUpEvent.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.deployments.v1.DeploymentUpEvent} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.deployments.v1.DeploymentUpEvent} + */ +proto.nitric.proto.deployments.v1.DeploymentUpEvent.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.setMessage(value); + break; + case 2: + var value = new proto.nitric.proto.deployments.v1.ResourceUpdate; + reader.readMessage(value,proto.nitric.proto.deployments.v1.ResourceUpdate.deserializeBinaryFromReader); + msg.setUpdate(value); + break; + case 3: + var value = new proto.nitric.proto.deployments.v1.UpResult; + reader.readMessage(value,proto.nitric.proto.deployments.v1.UpResult.deserializeBinaryFromReader); + msg.setResult(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.deployments.v1.DeploymentUpEvent.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.deployments.v1.DeploymentUpEvent.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.deployments.v1.DeploymentUpEvent} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.DeploymentUpEvent.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = message.getUpdate(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.nitric.proto.deployments.v1.ResourceUpdate.serializeBinaryToWriter + ); + } + f = message.getResult(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.nitric.proto.deployments.v1.UpResult.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string message = 1; + * @return {string} + */ +proto.nitric.proto.deployments.v1.DeploymentUpEvent.prototype.getMessage = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.deployments.v1.DeploymentUpEvent} returns this + */ +proto.nitric.proto.deployments.v1.DeploymentUpEvent.prototype.setMessage = function(value) { + return jspb.Message.setOneofField(this, 1, proto.nitric.proto.deployments.v1.DeploymentUpEvent.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.DeploymentUpEvent} returns this + */ +proto.nitric.proto.deployments.v1.DeploymentUpEvent.prototype.clearMessage = function() { + return jspb.Message.setOneofField(this, 1, proto.nitric.proto.deployments.v1.DeploymentUpEvent.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.DeploymentUpEvent.prototype.hasMessage = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional ResourceUpdate update = 2; + * @return {?proto.nitric.proto.deployments.v1.ResourceUpdate} + */ +proto.nitric.proto.deployments.v1.DeploymentUpEvent.prototype.getUpdate = function() { + return /** @type{?proto.nitric.proto.deployments.v1.ResourceUpdate} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.deployments.v1.ResourceUpdate, 2)); +}; + + +/** + * @param {?proto.nitric.proto.deployments.v1.ResourceUpdate|undefined} value + * @return {!proto.nitric.proto.deployments.v1.DeploymentUpEvent} returns this +*/ +proto.nitric.proto.deployments.v1.DeploymentUpEvent.prototype.setUpdate = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.nitric.proto.deployments.v1.DeploymentUpEvent.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.DeploymentUpEvent} returns this + */ +proto.nitric.proto.deployments.v1.DeploymentUpEvent.prototype.clearUpdate = function() { + return this.setUpdate(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.DeploymentUpEvent.prototype.hasUpdate = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional UpResult result = 3; + * @return {?proto.nitric.proto.deployments.v1.UpResult} + */ +proto.nitric.proto.deployments.v1.DeploymentUpEvent.prototype.getResult = function() { + return /** @type{?proto.nitric.proto.deployments.v1.UpResult} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.deployments.v1.UpResult, 3)); +}; + + +/** + * @param {?proto.nitric.proto.deployments.v1.UpResult|undefined} value + * @return {!proto.nitric.proto.deployments.v1.DeploymentUpEvent} returns this +*/ +proto.nitric.proto.deployments.v1.DeploymentUpEvent.prototype.setResult = function(value) { + return jspb.Message.setOneofWrapperField(this, 3, proto.nitric.proto.deployments.v1.DeploymentUpEvent.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.DeploymentUpEvent} returns this + */ +proto.nitric.proto.deployments.v1.DeploymentUpEvent.prototype.clearResult = function() { + return this.setResult(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.DeploymentUpEvent.prototype.hasResult = 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.nitric.proto.deployments.v1.ResourceUpdate.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.deployments.v1.ResourceUpdate.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.nitric.proto.deployments.v1.ResourceUpdate} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.ResourceUpdate.toObject = function(includeInstance, msg) { + var f, obj = { + id: (f = msg.getId()) && nitric_proto_resources_v1_resources_pb.ResourceIdentifier.toObject(includeInstance, f), + action: jspb.Message.getFieldWithDefault(msg, 3, 0), + status: jspb.Message.getFieldWithDefault(msg, 4, 0), + subResource: jspb.Message.getFieldWithDefault(msg, 5, ""), + message: jspb.Message.getFieldWithDefault(msg, 6, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.proto.deployments.v1.ResourceUpdate} + */ +proto.nitric.proto.deployments.v1.ResourceUpdate.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.deployments.v1.ResourceUpdate; + return proto.nitric.proto.deployments.v1.ResourceUpdate.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.deployments.v1.ResourceUpdate} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.deployments.v1.ResourceUpdate} + */ +proto.nitric.proto.deployments.v1.ResourceUpdate.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new nitric_proto_resources_v1_resources_pb.ResourceIdentifier; + reader.readMessage(value,nitric_proto_resources_v1_resources_pb.ResourceIdentifier.deserializeBinaryFromReader); + msg.setId(value); + break; + case 3: + var value = /** @type {!proto.nitric.proto.deployments.v1.ResourceDeploymentAction} */ (reader.readEnum()); + msg.setAction(value); + break; + case 4: + var value = /** @type {!proto.nitric.proto.deployments.v1.ResourceDeploymentStatus} */ (reader.readEnum()); + msg.setStatus(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setSubResource(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setMessage(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.deployments.v1.ResourceUpdate.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.deployments.v1.ResourceUpdate.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.deployments.v1.ResourceUpdate} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.ResourceUpdate.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f != null) { + writer.writeMessage( + 1, + f, + nitric_proto_resources_v1_resources_pb.ResourceIdentifier.serializeBinaryToWriter + ); + } + f = message.getAction(); + if (f !== 0.0) { + writer.writeEnum( + 3, + f + ); + } + f = message.getStatus(); + if (f !== 0.0) { + writer.writeEnum( + 4, + f + ); + } + f = message.getSubResource(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } + f = message.getMessage(); + if (f.length > 0) { + writer.writeString( + 6, + f + ); + } +}; + + +/** + * optional nitric.proto.resources.v1.ResourceIdentifier id = 1; + * @return {?proto.nitric.proto.resources.v1.ResourceIdentifier} + */ +proto.nitric.proto.deployments.v1.ResourceUpdate.prototype.getId = function() { + return /** @type{?proto.nitric.proto.resources.v1.ResourceIdentifier} */ ( + jspb.Message.getWrapperField(this, nitric_proto_resources_v1_resources_pb.ResourceIdentifier, 1)); +}; + + +/** + * @param {?proto.nitric.proto.resources.v1.ResourceIdentifier|undefined} value + * @return {!proto.nitric.proto.deployments.v1.ResourceUpdate} returns this +*/ +proto.nitric.proto.deployments.v1.ResourceUpdate.prototype.setId = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.ResourceUpdate} returns this + */ +proto.nitric.proto.deployments.v1.ResourceUpdate.prototype.clearId = function() { + return this.setId(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.ResourceUpdate.prototype.hasId = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional ResourceDeploymentAction action = 3; + * @return {!proto.nitric.proto.deployments.v1.ResourceDeploymentAction} + */ +proto.nitric.proto.deployments.v1.ResourceUpdate.prototype.getAction = function() { + return /** @type {!proto.nitric.proto.deployments.v1.ResourceDeploymentAction} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {!proto.nitric.proto.deployments.v1.ResourceDeploymentAction} value + * @return {!proto.nitric.proto.deployments.v1.ResourceUpdate} returns this + */ +proto.nitric.proto.deployments.v1.ResourceUpdate.prototype.setAction = function(value) { + return jspb.Message.setProto3EnumField(this, 3, value); +}; + + +/** + * optional ResourceDeploymentStatus status = 4; + * @return {!proto.nitric.proto.deployments.v1.ResourceDeploymentStatus} + */ +proto.nitric.proto.deployments.v1.ResourceUpdate.prototype.getStatus = function() { + return /** @type {!proto.nitric.proto.deployments.v1.ResourceDeploymentStatus} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {!proto.nitric.proto.deployments.v1.ResourceDeploymentStatus} value + * @return {!proto.nitric.proto.deployments.v1.ResourceUpdate} returns this + */ +proto.nitric.proto.deployments.v1.ResourceUpdate.prototype.setStatus = function(value) { + return jspb.Message.setProto3EnumField(this, 4, value); +}; + + +/** + * optional string sub_resource = 5; + * @return {string} + */ +proto.nitric.proto.deployments.v1.ResourceUpdate.prototype.getSubResource = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.deployments.v1.ResourceUpdate} returns this + */ +proto.nitric.proto.deployments.v1.ResourceUpdate.prototype.setSubResource = function(value) { + return jspb.Message.setProto3StringField(this, 5, value); +}; + + +/** + * optional string message = 6; + * @return {string} + */ +proto.nitric.proto.deployments.v1.ResourceUpdate.prototype.getMessage = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.deployments.v1.ResourceUpdate} returns this + */ +proto.nitric.proto.deployments.v1.ResourceUpdate.prototype.setMessage = function(value) { + return jspb.Message.setProto3StringField(this, 6, value); +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.proto.deployments.v1.UpResult.oneofGroups_ = [[2]]; + +/** + * @enum {number} + */ +proto.nitric.proto.deployments.v1.UpResult.ContentCase = { + CONTENT_NOT_SET: 0, + TEXT: 2 +}; + +/** + * @return {proto.nitric.proto.deployments.v1.UpResult.ContentCase} + */ +proto.nitric.proto.deployments.v1.UpResult.prototype.getContentCase = function() { + return /** @type {proto.nitric.proto.deployments.v1.UpResult.ContentCase} */(jspb.Message.computeOneofCase(this, proto.nitric.proto.deployments.v1.UpResult.oneofGroups_[0])); +}; + + + +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.nitric.proto.deployments.v1.UpResult.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.deployments.v1.UpResult.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.nitric.proto.deployments.v1.UpResult} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.UpResult.toObject = function(includeInstance, msg) { + var f, obj = { + success: jspb.Message.getBooleanFieldWithDefault(msg, 1, false), + text: 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.nitric.proto.deployments.v1.UpResult} + */ +proto.nitric.proto.deployments.v1.UpResult.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.deployments.v1.UpResult; + return proto.nitric.proto.deployments.v1.UpResult.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.deployments.v1.UpResult} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.deployments.v1.UpResult} + */ +proto.nitric.proto.deployments.v1.UpResult.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; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setText(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.deployments.v1.UpResult.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.deployments.v1.UpResult.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.deployments.v1.UpResult} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.UpResult.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSuccess(); + if (f) { + writer.writeBool( + 1, + f + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional bool success = 1; + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.UpResult.prototype.getSuccess = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.nitric.proto.deployments.v1.UpResult} returns this + */ +proto.nitric.proto.deployments.v1.UpResult.prototype.setSuccess = function(value) { + return jspb.Message.setProto3BooleanField(this, 1, value); +}; + + +/** + * optional string Text = 2; + * @return {string} + */ +proto.nitric.proto.deployments.v1.UpResult.prototype.getText = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.deployments.v1.UpResult} returns this + */ +proto.nitric.proto.deployments.v1.UpResult.prototype.setText = function(value) { + return jspb.Message.setOneofField(this, 2, proto.nitric.proto.deployments.v1.UpResult.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.UpResult} returns this + */ +proto.nitric.proto.deployments.v1.UpResult.prototype.clearText = function() { + return jspb.Message.setOneofField(this, 2, proto.nitric.proto.deployments.v1.UpResult.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.UpResult.prototype.hasText = 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.nitric.proto.deployments.v1.DeploymentDownRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.deployments.v1.DeploymentDownRequest.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.nitric.proto.deployments.v1.DeploymentDownRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.DeploymentDownRequest.toObject = function(includeInstance, msg) { + var f, obj = { + attributes: (f = msg.getAttributes()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f), + interactive: jspb.Message.getBooleanFieldWithDefault(msg, 2, 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.nitric.proto.deployments.v1.DeploymentDownRequest} + */ +proto.nitric.proto.deployments.v1.DeploymentDownRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.deployments.v1.DeploymentDownRequest; + return proto.nitric.proto.deployments.v1.DeploymentDownRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.deployments.v1.DeploymentDownRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.deployments.v1.DeploymentDownRequest} + */ +proto.nitric.proto.deployments.v1.DeploymentDownRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setAttributes(value); + break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setInteractive(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.deployments.v1.DeploymentDownRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.deployments.v1.DeploymentDownRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.deployments.v1.DeploymentDownRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.DeploymentDownRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAttributes(); + if (f != null) { + writer.writeMessage( + 1, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } + f = message.getInteractive(); + if (f) { + writer.writeBool( + 2, + f + ); + } +}; + + +/** + * optional google.protobuf.Struct attributes = 1; + * @return {?proto.google.protobuf.Struct} + */ +proto.nitric.proto.deployments.v1.DeploymentDownRequest.prototype.getAttributes = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 1)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.nitric.proto.deployments.v1.DeploymentDownRequest} returns this +*/ +proto.nitric.proto.deployments.v1.DeploymentDownRequest.prototype.setAttributes = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.DeploymentDownRequest} returns this + */ +proto.nitric.proto.deployments.v1.DeploymentDownRequest.prototype.clearAttributes = function() { + return this.setAttributes(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.DeploymentDownRequest.prototype.hasAttributes = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional bool interactive = 2; + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.DeploymentDownRequest.prototype.getInteractive = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.nitric.proto.deployments.v1.DeploymentDownRequest} returns this + */ +proto.nitric.proto.deployments.v1.DeploymentDownRequest.prototype.setInteractive = function(value) { + return jspb.Message.setProto3BooleanField(this, 2, value); +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.proto.deployments.v1.DeploymentDownEvent.oneofGroups_ = [[1,2,3]]; + +/** + * @enum {number} + */ +proto.nitric.proto.deployments.v1.DeploymentDownEvent.ContentCase = { + CONTENT_NOT_SET: 0, + MESSAGE: 1, + RESULT: 2, + UPDATE: 3 +}; + +/** + * @return {proto.nitric.proto.deployments.v1.DeploymentDownEvent.ContentCase} + */ +proto.nitric.proto.deployments.v1.DeploymentDownEvent.prototype.getContentCase = function() { + return /** @type {proto.nitric.proto.deployments.v1.DeploymentDownEvent.ContentCase} */(jspb.Message.computeOneofCase(this, proto.nitric.proto.deployments.v1.DeploymentDownEvent.oneofGroups_[0])); +}; + + + +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.nitric.proto.deployments.v1.DeploymentDownEvent.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.deployments.v1.DeploymentDownEvent.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.nitric.proto.deployments.v1.DeploymentDownEvent} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.DeploymentDownEvent.toObject = function(includeInstance, msg) { + var f, obj = { + message: jspb.Message.getFieldWithDefault(msg, 1, ""), + result: (f = msg.getResult()) && proto.nitric.proto.deployments.v1.DownResult.toObject(includeInstance, f), + update: (f = msg.getUpdate()) && proto.nitric.proto.deployments.v1.ResourceUpdate.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.nitric.proto.deployments.v1.DeploymentDownEvent} + */ +proto.nitric.proto.deployments.v1.DeploymentDownEvent.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.deployments.v1.DeploymentDownEvent; + return proto.nitric.proto.deployments.v1.DeploymentDownEvent.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.deployments.v1.DeploymentDownEvent} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.deployments.v1.DeploymentDownEvent} + */ +proto.nitric.proto.deployments.v1.DeploymentDownEvent.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.setMessage(value); + break; + case 2: + var value = new proto.nitric.proto.deployments.v1.DownResult; + reader.readMessage(value,proto.nitric.proto.deployments.v1.DownResult.deserializeBinaryFromReader); + msg.setResult(value); + break; + case 3: + var value = new proto.nitric.proto.deployments.v1.ResourceUpdate; + reader.readMessage(value,proto.nitric.proto.deployments.v1.ResourceUpdate.deserializeBinaryFromReader); + msg.setUpdate(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.deployments.v1.DeploymentDownEvent.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.deployments.v1.DeploymentDownEvent.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.deployments.v1.DeploymentDownEvent} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.DeploymentDownEvent.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = message.getResult(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.nitric.proto.deployments.v1.DownResult.serializeBinaryToWriter + ); + } + f = message.getUpdate(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.nitric.proto.deployments.v1.ResourceUpdate.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string message = 1; + * @return {string} + */ +proto.nitric.proto.deployments.v1.DeploymentDownEvent.prototype.getMessage = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.deployments.v1.DeploymentDownEvent} returns this + */ +proto.nitric.proto.deployments.v1.DeploymentDownEvent.prototype.setMessage = function(value) { + return jspb.Message.setOneofField(this, 1, proto.nitric.proto.deployments.v1.DeploymentDownEvent.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.DeploymentDownEvent} returns this + */ +proto.nitric.proto.deployments.v1.DeploymentDownEvent.prototype.clearMessage = function() { + return jspb.Message.setOneofField(this, 1, proto.nitric.proto.deployments.v1.DeploymentDownEvent.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.DeploymentDownEvent.prototype.hasMessage = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional DownResult result = 2; + * @return {?proto.nitric.proto.deployments.v1.DownResult} + */ +proto.nitric.proto.deployments.v1.DeploymentDownEvent.prototype.getResult = function() { + return /** @type{?proto.nitric.proto.deployments.v1.DownResult} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.deployments.v1.DownResult, 2)); +}; + + +/** + * @param {?proto.nitric.proto.deployments.v1.DownResult|undefined} value + * @return {!proto.nitric.proto.deployments.v1.DeploymentDownEvent} returns this +*/ +proto.nitric.proto.deployments.v1.DeploymentDownEvent.prototype.setResult = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.nitric.proto.deployments.v1.DeploymentDownEvent.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.DeploymentDownEvent} returns this + */ +proto.nitric.proto.deployments.v1.DeploymentDownEvent.prototype.clearResult = function() { + return this.setResult(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.DeploymentDownEvent.prototype.hasResult = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional ResourceUpdate update = 3; + * @return {?proto.nitric.proto.deployments.v1.ResourceUpdate} + */ +proto.nitric.proto.deployments.v1.DeploymentDownEvent.prototype.getUpdate = function() { + return /** @type{?proto.nitric.proto.deployments.v1.ResourceUpdate} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.deployments.v1.ResourceUpdate, 3)); +}; + + +/** + * @param {?proto.nitric.proto.deployments.v1.ResourceUpdate|undefined} value + * @return {!proto.nitric.proto.deployments.v1.DeploymentDownEvent} returns this +*/ +proto.nitric.proto.deployments.v1.DeploymentDownEvent.prototype.setUpdate = function(value) { + return jspb.Message.setOneofWrapperField(this, 3, proto.nitric.proto.deployments.v1.DeploymentDownEvent.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.DeploymentDownEvent} returns this + */ +proto.nitric.proto.deployments.v1.DeploymentDownEvent.prototype.clearUpdate = function() { + return this.setUpdate(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.DeploymentDownEvent.prototype.hasUpdate = 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.nitric.proto.deployments.v1.DownResult.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.deployments.v1.DownResult.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.nitric.proto.deployments.v1.DownResult} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.DownResult.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.proto.deployments.v1.DownResult} + */ +proto.nitric.proto.deployments.v1.DownResult.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.deployments.v1.DownResult; + return proto.nitric.proto.deployments.v1.DownResult.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.deployments.v1.DownResult} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.deployments.v1.DownResult} + */ +proto.nitric.proto.deployments.v1.DownResult.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.deployments.v1.DownResult.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.deployments.v1.DownResult.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.deployments.v1.DownResult} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.DownResult.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +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.nitric.proto.deployments.v1.ImageSource.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.deployments.v1.ImageSource.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.nitric.proto.deployments.v1.ImageSource} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.ImageSource.toObject = function(includeInstance, msg) { + var f, obj = { + uri: 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.nitric.proto.deployments.v1.ImageSource} + */ +proto.nitric.proto.deployments.v1.ImageSource.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.deployments.v1.ImageSource; + return proto.nitric.proto.deployments.v1.ImageSource.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.deployments.v1.ImageSource} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.deployments.v1.ImageSource} + */ +proto.nitric.proto.deployments.v1.ImageSource.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.setUri(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.deployments.v1.ImageSource.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.deployments.v1.ImageSource.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.deployments.v1.ImageSource} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.ImageSource.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUri(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string uri = 1; + * @return {string} + */ +proto.nitric.proto.deployments.v1.ImageSource.prototype.getUri = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.deployments.v1.ImageSource} returns this + */ +proto.nitric.proto.deployments.v1.ImageSource.prototype.setUri = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.proto.deployments.v1.Service.oneofGroups_ = [[1]]; + +/** + * @enum {number} + */ +proto.nitric.proto.deployments.v1.Service.SourceCase = { + SOURCE_NOT_SET: 0, + IMAGE: 1 +}; + +/** + * @return {proto.nitric.proto.deployments.v1.Service.SourceCase} + */ +proto.nitric.proto.deployments.v1.Service.prototype.getSourceCase = function() { + return /** @type {proto.nitric.proto.deployments.v1.Service.SourceCase} */(jspb.Message.computeOneofCase(this, proto.nitric.proto.deployments.v1.Service.oneofGroups_[0])); +}; + + + +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.nitric.proto.deployments.v1.Service.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.deployments.v1.Service.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.nitric.proto.deployments.v1.Service} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.Service.toObject = function(includeInstance, msg) { + var f, obj = { + image: (f = msg.getImage()) && proto.nitric.proto.deployments.v1.ImageSource.toObject(includeInstance, f), + workers: jspb.Message.getFieldWithDefault(msg, 10, 0), + timeout: jspb.Message.getFieldWithDefault(msg, 11, 0), + memory: jspb.Message.getFieldWithDefault(msg, 12, 0), + type: jspb.Message.getFieldWithDefault(msg, 13, ""), + envMap: (f = msg.getEnvMap()) ? 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.nitric.proto.deployments.v1.Service} + */ +proto.nitric.proto.deployments.v1.Service.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.deployments.v1.Service; + return proto.nitric.proto.deployments.v1.Service.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.deployments.v1.Service} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.deployments.v1.Service} + */ +proto.nitric.proto.deployments.v1.Service.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.nitric.proto.deployments.v1.ImageSource; + reader.readMessage(value,proto.nitric.proto.deployments.v1.ImageSource.deserializeBinaryFromReader); + msg.setImage(value); + break; + case 10: + var value = /** @type {number} */ (reader.readInt32()); + msg.setWorkers(value); + break; + case 11: + var value = /** @type {number} */ (reader.readInt32()); + msg.setTimeout(value); + break; + case 12: + var value = /** @type {number} */ (reader.readInt32()); + msg.setMemory(value); + break; + case 13: + var value = /** @type {string} */ (reader.readString()); + msg.setType(value); + break; + case 14: + var value = msg.getEnvMap(); + 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.nitric.proto.deployments.v1.Service.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.deployments.v1.Service.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.deployments.v1.Service} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.Service.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getImage(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.nitric.proto.deployments.v1.ImageSource.serializeBinaryToWriter + ); + } + f = message.getWorkers(); + if (f !== 0) { + writer.writeInt32( + 10, + f + ); + } + f = message.getTimeout(); + if (f !== 0) { + writer.writeInt32( + 11, + f + ); + } + f = message.getMemory(); + if (f !== 0) { + writer.writeInt32( + 12, + f + ); + } + f = message.getType(); + if (f.length > 0) { + writer.writeString( + 13, + f + ); + } + f = message.getEnvMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(14, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } +}; + + +/** + * optional ImageSource image = 1; + * @return {?proto.nitric.proto.deployments.v1.ImageSource} + */ +proto.nitric.proto.deployments.v1.Service.prototype.getImage = function() { + return /** @type{?proto.nitric.proto.deployments.v1.ImageSource} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.deployments.v1.ImageSource, 1)); +}; + + +/** + * @param {?proto.nitric.proto.deployments.v1.ImageSource|undefined} value + * @return {!proto.nitric.proto.deployments.v1.Service} returns this +*/ +proto.nitric.proto.deployments.v1.Service.prototype.setImage = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.nitric.proto.deployments.v1.Service.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.Service} returns this + */ +proto.nitric.proto.deployments.v1.Service.prototype.clearImage = function() { + return this.setImage(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.Service.prototype.hasImage = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional int32 workers = 10; + * @return {number} + */ +proto.nitric.proto.deployments.v1.Service.prototype.getWorkers = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 10, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.nitric.proto.deployments.v1.Service} returns this + */ +proto.nitric.proto.deployments.v1.Service.prototype.setWorkers = function(value) { + return jspb.Message.setProto3IntField(this, 10, value); +}; + + +/** + * optional int32 timeout = 11; + * @return {number} + */ +proto.nitric.proto.deployments.v1.Service.prototype.getTimeout = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 11, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.nitric.proto.deployments.v1.Service} returns this + */ +proto.nitric.proto.deployments.v1.Service.prototype.setTimeout = function(value) { + return jspb.Message.setProto3IntField(this, 11, value); +}; + + +/** + * optional int32 memory = 12; + * @return {number} + */ +proto.nitric.proto.deployments.v1.Service.prototype.getMemory = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 12, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.nitric.proto.deployments.v1.Service} returns this + */ +proto.nitric.proto.deployments.v1.Service.prototype.setMemory = function(value) { + return jspb.Message.setProto3IntField(this, 12, value); +}; + + +/** + * optional string type = 13; + * @return {string} + */ +proto.nitric.proto.deployments.v1.Service.prototype.getType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 13, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.deployments.v1.Service} returns this + */ +proto.nitric.proto.deployments.v1.Service.prototype.setType = function(value) { + return jspb.Message.setProto3StringField(this, 13, value); +}; + + +/** + * map env = 14; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.nitric.proto.deployments.v1.Service.prototype.getEnvMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 14, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.nitric.proto.deployments.v1.Service} returns this + */ +proto.nitric.proto.deployments.v1.Service.prototype.clearEnvMap = function() { + this.getEnvMap().clear(); + return this;}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.nitric.proto.deployments.v1.Bucket.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.nitric.proto.deployments.v1.Bucket.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.deployments.v1.Bucket.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.nitric.proto.deployments.v1.Bucket} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.Bucket.toObject = function(includeInstance, msg) { + var f, obj = { + listenersList: jspb.Message.toObjectList(msg.getListenersList(), + proto.nitric.proto.deployments.v1.BucketListener.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.nitric.proto.deployments.v1.Bucket} + */ +proto.nitric.proto.deployments.v1.Bucket.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.deployments.v1.Bucket; + return proto.nitric.proto.deployments.v1.Bucket.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.deployments.v1.Bucket} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.deployments.v1.Bucket} + */ +proto.nitric.proto.deployments.v1.Bucket.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.nitric.proto.deployments.v1.BucketListener; + reader.readMessage(value,proto.nitric.proto.deployments.v1.BucketListener.deserializeBinaryFromReader); + msg.addListeners(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.deployments.v1.Bucket.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.deployments.v1.Bucket.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.deployments.v1.Bucket} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.Bucket.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getListenersList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.nitric.proto.deployments.v1.BucketListener.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated BucketListener listeners = 1; + * @return {!Array} + */ +proto.nitric.proto.deployments.v1.Bucket.prototype.getListenersList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.nitric.proto.deployments.v1.BucketListener, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.nitric.proto.deployments.v1.Bucket} returns this +*/ +proto.nitric.proto.deployments.v1.Bucket.prototype.setListenersList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.nitric.proto.deployments.v1.BucketListener=} opt_value + * @param {number=} opt_index + * @return {!proto.nitric.proto.deployments.v1.BucketListener} + */ +proto.nitric.proto.deployments.v1.Bucket.prototype.addListeners = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.nitric.proto.deployments.v1.BucketListener, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.nitric.proto.deployments.v1.Bucket} returns this + */ +proto.nitric.proto.deployments.v1.Bucket.prototype.clearListenersList = function() { + return this.setListenersList([]); +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.proto.deployments.v1.BucketListener.oneofGroups_ = [[2]]; + +/** + * @enum {number} + */ +proto.nitric.proto.deployments.v1.BucketListener.TargetCase = { + TARGET_NOT_SET: 0, + SERVICE: 2 +}; + +/** + * @return {proto.nitric.proto.deployments.v1.BucketListener.TargetCase} + */ +proto.nitric.proto.deployments.v1.BucketListener.prototype.getTargetCase = function() { + return /** @type {proto.nitric.proto.deployments.v1.BucketListener.TargetCase} */(jspb.Message.computeOneofCase(this, proto.nitric.proto.deployments.v1.BucketListener.oneofGroups_[0])); +}; + + + +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.nitric.proto.deployments.v1.BucketListener.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.deployments.v1.BucketListener.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.nitric.proto.deployments.v1.BucketListener} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.BucketListener.toObject = function(includeInstance, msg) { + var f, obj = { + config: (f = msg.getConfig()) && nitric_proto_storage_v1_storage_pb.RegistrationRequest.toObject(includeInstance, f), + service: 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.nitric.proto.deployments.v1.BucketListener} + */ +proto.nitric.proto.deployments.v1.BucketListener.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.deployments.v1.BucketListener; + return proto.nitric.proto.deployments.v1.BucketListener.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.deployments.v1.BucketListener} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.deployments.v1.BucketListener} + */ +proto.nitric.proto.deployments.v1.BucketListener.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new nitric_proto_storage_v1_storage_pb.RegistrationRequest; + reader.readMessage(value,nitric_proto_storage_v1_storage_pb.RegistrationRequest.deserializeBinaryFromReader); + msg.setConfig(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setService(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.deployments.v1.BucketListener.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.deployments.v1.BucketListener.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.deployments.v1.BucketListener} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.BucketListener.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getConfig(); + if (f != null) { + writer.writeMessage( + 1, + f, + nitric_proto_storage_v1_storage_pb.RegistrationRequest.serializeBinaryToWriter + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional nitric.proto.storage.v1.RegistrationRequest config = 1; + * @return {?proto.nitric.proto.storage.v1.RegistrationRequest} + */ +proto.nitric.proto.deployments.v1.BucketListener.prototype.getConfig = function() { + return /** @type{?proto.nitric.proto.storage.v1.RegistrationRequest} */ ( + jspb.Message.getWrapperField(this, nitric_proto_storage_v1_storage_pb.RegistrationRequest, 1)); +}; + + +/** + * @param {?proto.nitric.proto.storage.v1.RegistrationRequest|undefined} value + * @return {!proto.nitric.proto.deployments.v1.BucketListener} returns this +*/ +proto.nitric.proto.deployments.v1.BucketListener.prototype.setConfig = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.BucketListener} returns this + */ +proto.nitric.proto.deployments.v1.BucketListener.prototype.clearConfig = function() { + return this.setConfig(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.BucketListener.prototype.hasConfig = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional string service = 2; + * @return {string} + */ +proto.nitric.proto.deployments.v1.BucketListener.prototype.getService = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.deployments.v1.BucketListener} returns this + */ +proto.nitric.proto.deployments.v1.BucketListener.prototype.setService = function(value) { + return jspb.Message.setOneofField(this, 2, proto.nitric.proto.deployments.v1.BucketListener.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.BucketListener} returns this + */ +proto.nitric.proto.deployments.v1.BucketListener.prototype.clearService = function() { + return jspb.Message.setOneofField(this, 2, proto.nitric.proto.deployments.v1.BucketListener.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.BucketListener.prototype.hasService = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.nitric.proto.deployments.v1.Topic.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.nitric.proto.deployments.v1.Topic.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.deployments.v1.Topic.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.nitric.proto.deployments.v1.Topic} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.Topic.toObject = function(includeInstance, msg) { + var f, obj = { + subscriptionsList: jspb.Message.toObjectList(msg.getSubscriptionsList(), + proto.nitric.proto.deployments.v1.SubscriptionTarget.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.nitric.proto.deployments.v1.Topic} + */ +proto.nitric.proto.deployments.v1.Topic.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.deployments.v1.Topic; + return proto.nitric.proto.deployments.v1.Topic.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.deployments.v1.Topic} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.deployments.v1.Topic} + */ +proto.nitric.proto.deployments.v1.Topic.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.nitric.proto.deployments.v1.SubscriptionTarget; + reader.readMessage(value,proto.nitric.proto.deployments.v1.SubscriptionTarget.deserializeBinaryFromReader); + msg.addSubscriptions(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.deployments.v1.Topic.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.deployments.v1.Topic.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.deployments.v1.Topic} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.Topic.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSubscriptionsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.nitric.proto.deployments.v1.SubscriptionTarget.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated SubscriptionTarget subscriptions = 1; + * @return {!Array} + */ +proto.nitric.proto.deployments.v1.Topic.prototype.getSubscriptionsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.nitric.proto.deployments.v1.SubscriptionTarget, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.nitric.proto.deployments.v1.Topic} returns this +*/ +proto.nitric.proto.deployments.v1.Topic.prototype.setSubscriptionsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.nitric.proto.deployments.v1.SubscriptionTarget=} opt_value + * @param {number=} opt_index + * @return {!proto.nitric.proto.deployments.v1.SubscriptionTarget} + */ +proto.nitric.proto.deployments.v1.Topic.prototype.addSubscriptions = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.nitric.proto.deployments.v1.SubscriptionTarget, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.nitric.proto.deployments.v1.Topic} returns this + */ +proto.nitric.proto.deployments.v1.Topic.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.nitric.proto.deployments.v1.Queue.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.deployments.v1.Queue.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.nitric.proto.deployments.v1.Queue} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.Queue.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.proto.deployments.v1.Queue} + */ +proto.nitric.proto.deployments.v1.Queue.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.deployments.v1.Queue; + return proto.nitric.proto.deployments.v1.Queue.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.deployments.v1.Queue} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.deployments.v1.Queue} + */ +proto.nitric.proto.deployments.v1.Queue.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.deployments.v1.Queue.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.deployments.v1.Queue.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.deployments.v1.Queue} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.Queue.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +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.nitric.proto.deployments.v1.KeyValueStore.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.deployments.v1.KeyValueStore.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.nitric.proto.deployments.v1.KeyValueStore} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.KeyValueStore.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.proto.deployments.v1.KeyValueStore} + */ +proto.nitric.proto.deployments.v1.KeyValueStore.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.deployments.v1.KeyValueStore; + return proto.nitric.proto.deployments.v1.KeyValueStore.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.deployments.v1.KeyValueStore} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.deployments.v1.KeyValueStore} + */ +proto.nitric.proto.deployments.v1.KeyValueStore.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.deployments.v1.KeyValueStore.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.deployments.v1.KeyValueStore.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.deployments.v1.KeyValueStore} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.KeyValueStore.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +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.nitric.proto.deployments.v1.Secret.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.deployments.v1.Secret.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.nitric.proto.deployments.v1.Secret} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.Secret.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.proto.deployments.v1.Secret} + */ +proto.nitric.proto.deployments.v1.Secret.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.deployments.v1.Secret; + return proto.nitric.proto.deployments.v1.Secret.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.deployments.v1.Secret} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.deployments.v1.Secret} + */ +proto.nitric.proto.deployments.v1.Secret.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.deployments.v1.Secret.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.deployments.v1.Secret.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.deployments.v1.Secret} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.Secret.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.proto.deployments.v1.SubscriptionTarget.oneofGroups_ = [[1]]; + +/** + * @enum {number} + */ +proto.nitric.proto.deployments.v1.SubscriptionTarget.TargetCase = { + TARGET_NOT_SET: 0, + SERVICE: 1 +}; + +/** + * @return {proto.nitric.proto.deployments.v1.SubscriptionTarget.TargetCase} + */ +proto.nitric.proto.deployments.v1.SubscriptionTarget.prototype.getTargetCase = function() { + return /** @type {proto.nitric.proto.deployments.v1.SubscriptionTarget.TargetCase} */(jspb.Message.computeOneofCase(this, proto.nitric.proto.deployments.v1.SubscriptionTarget.oneofGroups_[0])); +}; + + + +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.nitric.proto.deployments.v1.SubscriptionTarget.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.deployments.v1.SubscriptionTarget.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.nitric.proto.deployments.v1.SubscriptionTarget} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.SubscriptionTarget.toObject = function(includeInstance, msg) { + var f, obj = { + service: 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.nitric.proto.deployments.v1.SubscriptionTarget} + */ +proto.nitric.proto.deployments.v1.SubscriptionTarget.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.deployments.v1.SubscriptionTarget; + return proto.nitric.proto.deployments.v1.SubscriptionTarget.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.deployments.v1.SubscriptionTarget} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.deployments.v1.SubscriptionTarget} + */ +proto.nitric.proto.deployments.v1.SubscriptionTarget.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.setService(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.deployments.v1.SubscriptionTarget.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.deployments.v1.SubscriptionTarget.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.deployments.v1.SubscriptionTarget} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.SubscriptionTarget.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string service = 1; + * @return {string} + */ +proto.nitric.proto.deployments.v1.SubscriptionTarget.prototype.getService = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.deployments.v1.SubscriptionTarget} returns this + */ +proto.nitric.proto.deployments.v1.SubscriptionTarget.prototype.setService = function(value) { + return jspb.Message.setOneofField(this, 1, proto.nitric.proto.deployments.v1.SubscriptionTarget.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.SubscriptionTarget} returns this + */ +proto.nitric.proto.deployments.v1.SubscriptionTarget.prototype.clearService = function() { + return jspb.Message.setOneofField(this, 1, proto.nitric.proto.deployments.v1.SubscriptionTarget.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.SubscriptionTarget.prototype.hasService = 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.nitric.proto.deployments.v1.TopicSubscription.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.deployments.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.nitric.proto.deployments.v1.TopicSubscription} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.TopicSubscription.toObject = function(includeInstance, msg) { + var f, obj = { + target: (f = msg.getTarget()) && proto.nitric.proto.deployments.v1.SubscriptionTarget.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.nitric.proto.deployments.v1.TopicSubscription} + */ +proto.nitric.proto.deployments.v1.TopicSubscription.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.deployments.v1.TopicSubscription; + return proto.nitric.proto.deployments.v1.TopicSubscription.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.deployments.v1.TopicSubscription} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.deployments.v1.TopicSubscription} + */ +proto.nitric.proto.deployments.v1.TopicSubscription.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.nitric.proto.deployments.v1.SubscriptionTarget; + reader.readMessage(value,proto.nitric.proto.deployments.v1.SubscriptionTarget.deserializeBinaryFromReader); + msg.setTarget(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.deployments.v1.TopicSubscription.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.deployments.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.nitric.proto.deployments.v1.TopicSubscription} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.TopicSubscription.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTarget(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.nitric.proto.deployments.v1.SubscriptionTarget.serializeBinaryToWriter + ); + } +}; + + +/** + * optional SubscriptionTarget target = 1; + * @return {?proto.nitric.proto.deployments.v1.SubscriptionTarget} + */ +proto.nitric.proto.deployments.v1.TopicSubscription.prototype.getTarget = function() { + return /** @type{?proto.nitric.proto.deployments.v1.SubscriptionTarget} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.deployments.v1.SubscriptionTarget, 1)); +}; + + +/** + * @param {?proto.nitric.proto.deployments.v1.SubscriptionTarget|undefined} value + * @return {!proto.nitric.proto.deployments.v1.TopicSubscription} returns this +*/ +proto.nitric.proto.deployments.v1.TopicSubscription.prototype.setTarget = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.TopicSubscription} returns this + */ +proto.nitric.proto.deployments.v1.TopicSubscription.prototype.clearTarget = function() { + return this.setTarget(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.TopicSubscription.prototype.hasTarget = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.proto.deployments.v1.HttpTarget.oneofGroups_ = [[1]]; + +/** + * @enum {number} + */ +proto.nitric.proto.deployments.v1.HttpTarget.TargetCase = { + TARGET_NOT_SET: 0, + SERVICE: 1 +}; + +/** + * @return {proto.nitric.proto.deployments.v1.HttpTarget.TargetCase} + */ +proto.nitric.proto.deployments.v1.HttpTarget.prototype.getTargetCase = function() { + return /** @type {proto.nitric.proto.deployments.v1.HttpTarget.TargetCase} */(jspb.Message.computeOneofCase(this, proto.nitric.proto.deployments.v1.HttpTarget.oneofGroups_[0])); +}; + + + +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.nitric.proto.deployments.v1.HttpTarget.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.deployments.v1.HttpTarget.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.nitric.proto.deployments.v1.HttpTarget} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.HttpTarget.toObject = function(includeInstance, msg) { + var f, obj = { + service: 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.nitric.proto.deployments.v1.HttpTarget} + */ +proto.nitric.proto.deployments.v1.HttpTarget.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.deployments.v1.HttpTarget; + return proto.nitric.proto.deployments.v1.HttpTarget.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.deployments.v1.HttpTarget} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.deployments.v1.HttpTarget} + */ +proto.nitric.proto.deployments.v1.HttpTarget.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.setService(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.deployments.v1.HttpTarget.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.deployments.v1.HttpTarget.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.deployments.v1.HttpTarget} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.HttpTarget.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string service = 1; + * @return {string} + */ +proto.nitric.proto.deployments.v1.HttpTarget.prototype.getService = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.deployments.v1.HttpTarget} returns this + */ +proto.nitric.proto.deployments.v1.HttpTarget.prototype.setService = function(value) { + return jspb.Message.setOneofField(this, 1, proto.nitric.proto.deployments.v1.HttpTarget.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.HttpTarget} returns this + */ +proto.nitric.proto.deployments.v1.HttpTarget.prototype.clearService = function() { + return jspb.Message.setOneofField(this, 1, proto.nitric.proto.deployments.v1.HttpTarget.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.HttpTarget.prototype.hasService = 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.nitric.proto.deployments.v1.Http.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.deployments.v1.Http.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.nitric.proto.deployments.v1.Http} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.Http.toObject = function(includeInstance, msg) { + var f, obj = { + target: (f = msg.getTarget()) && proto.nitric.proto.deployments.v1.HttpTarget.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.nitric.proto.deployments.v1.Http} + */ +proto.nitric.proto.deployments.v1.Http.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.deployments.v1.Http; + return proto.nitric.proto.deployments.v1.Http.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.deployments.v1.Http} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.deployments.v1.Http} + */ +proto.nitric.proto.deployments.v1.Http.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.nitric.proto.deployments.v1.HttpTarget; + reader.readMessage(value,proto.nitric.proto.deployments.v1.HttpTarget.deserializeBinaryFromReader); + msg.setTarget(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.deployments.v1.Http.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.deployments.v1.Http.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.deployments.v1.Http} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.Http.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTarget(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.nitric.proto.deployments.v1.HttpTarget.serializeBinaryToWriter + ); + } +}; + + +/** + * optional HttpTarget target = 1; + * @return {?proto.nitric.proto.deployments.v1.HttpTarget} + */ +proto.nitric.proto.deployments.v1.Http.prototype.getTarget = function() { + return /** @type{?proto.nitric.proto.deployments.v1.HttpTarget} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.deployments.v1.HttpTarget, 1)); +}; + + +/** + * @param {?proto.nitric.proto.deployments.v1.HttpTarget|undefined} value + * @return {!proto.nitric.proto.deployments.v1.Http} returns this +*/ +proto.nitric.proto.deployments.v1.Http.prototype.setTarget = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.Http} returns this + */ +proto.nitric.proto.deployments.v1.Http.prototype.clearTarget = function() { + return this.setTarget(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.Http.prototype.hasTarget = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.proto.deployments.v1.Api.oneofGroups_ = [[1]]; + +/** + * @enum {number} + */ +proto.nitric.proto.deployments.v1.Api.DocumentCase = { + DOCUMENT_NOT_SET: 0, + OPENAPI: 1 +}; + +/** + * @return {proto.nitric.proto.deployments.v1.Api.DocumentCase} + */ +proto.nitric.proto.deployments.v1.Api.prototype.getDocumentCase = function() { + return /** @type {proto.nitric.proto.deployments.v1.Api.DocumentCase} */(jspb.Message.computeOneofCase(this, proto.nitric.proto.deployments.v1.Api.oneofGroups_[0])); +}; + + + +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.nitric.proto.deployments.v1.Api.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.deployments.v1.Api.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.nitric.proto.deployments.v1.Api} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.Api.toObject = function(includeInstance, msg) { + var f, obj = { + openapi: 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.nitric.proto.deployments.v1.Api} + */ +proto.nitric.proto.deployments.v1.Api.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.deployments.v1.Api; + return proto.nitric.proto.deployments.v1.Api.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.deployments.v1.Api} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.deployments.v1.Api} + */ +proto.nitric.proto.deployments.v1.Api.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.setOpenapi(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.deployments.v1.Api.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.deployments.v1.Api.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.deployments.v1.Api} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.Api.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string openapi = 1; + * @return {string} + */ +proto.nitric.proto.deployments.v1.Api.prototype.getOpenapi = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.deployments.v1.Api} returns this + */ +proto.nitric.proto.deployments.v1.Api.prototype.setOpenapi = function(value) { + return jspb.Message.setOneofField(this, 1, proto.nitric.proto.deployments.v1.Api.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.Api} returns this + */ +proto.nitric.proto.deployments.v1.Api.prototype.clearOpenapi = function() { + return jspb.Message.setOneofField(this, 1, proto.nitric.proto.deployments.v1.Api.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.Api.prototype.hasOpenapi = 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.nitric.proto.deployments.v1.Websocket.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.deployments.v1.Websocket.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.nitric.proto.deployments.v1.Websocket} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.Websocket.toObject = function(includeInstance, msg) { + var f, obj = { + connectTarget: (f = msg.getConnectTarget()) && proto.nitric.proto.deployments.v1.WebsocketTarget.toObject(includeInstance, f), + disconnectTarget: (f = msg.getDisconnectTarget()) && proto.nitric.proto.deployments.v1.WebsocketTarget.toObject(includeInstance, f), + messageTarget: (f = msg.getMessageTarget()) && proto.nitric.proto.deployments.v1.WebsocketTarget.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.nitric.proto.deployments.v1.Websocket} + */ +proto.nitric.proto.deployments.v1.Websocket.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.deployments.v1.Websocket; + return proto.nitric.proto.deployments.v1.Websocket.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.deployments.v1.Websocket} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.deployments.v1.Websocket} + */ +proto.nitric.proto.deployments.v1.Websocket.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.nitric.proto.deployments.v1.WebsocketTarget; + reader.readMessage(value,proto.nitric.proto.deployments.v1.WebsocketTarget.deserializeBinaryFromReader); + msg.setConnectTarget(value); + break; + case 2: + var value = new proto.nitric.proto.deployments.v1.WebsocketTarget; + reader.readMessage(value,proto.nitric.proto.deployments.v1.WebsocketTarget.deserializeBinaryFromReader); + msg.setDisconnectTarget(value); + break; + case 3: + var value = new proto.nitric.proto.deployments.v1.WebsocketTarget; + reader.readMessage(value,proto.nitric.proto.deployments.v1.WebsocketTarget.deserializeBinaryFromReader); + msg.setMessageTarget(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.deployments.v1.Websocket.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.deployments.v1.Websocket.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.deployments.v1.Websocket} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.Websocket.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getConnectTarget(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.nitric.proto.deployments.v1.WebsocketTarget.serializeBinaryToWriter + ); + } + f = message.getDisconnectTarget(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.nitric.proto.deployments.v1.WebsocketTarget.serializeBinaryToWriter + ); + } + f = message.getMessageTarget(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.nitric.proto.deployments.v1.WebsocketTarget.serializeBinaryToWriter + ); + } +}; + + +/** + * optional WebsocketTarget connect_target = 1; + * @return {?proto.nitric.proto.deployments.v1.WebsocketTarget} + */ +proto.nitric.proto.deployments.v1.Websocket.prototype.getConnectTarget = function() { + return /** @type{?proto.nitric.proto.deployments.v1.WebsocketTarget} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.deployments.v1.WebsocketTarget, 1)); +}; + + +/** + * @param {?proto.nitric.proto.deployments.v1.WebsocketTarget|undefined} value + * @return {!proto.nitric.proto.deployments.v1.Websocket} returns this +*/ +proto.nitric.proto.deployments.v1.Websocket.prototype.setConnectTarget = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.Websocket} returns this + */ +proto.nitric.proto.deployments.v1.Websocket.prototype.clearConnectTarget = function() { + return this.setConnectTarget(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.Websocket.prototype.hasConnectTarget = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional WebsocketTarget disconnect_target = 2; + * @return {?proto.nitric.proto.deployments.v1.WebsocketTarget} + */ +proto.nitric.proto.deployments.v1.Websocket.prototype.getDisconnectTarget = function() { + return /** @type{?proto.nitric.proto.deployments.v1.WebsocketTarget} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.deployments.v1.WebsocketTarget, 2)); +}; + + +/** + * @param {?proto.nitric.proto.deployments.v1.WebsocketTarget|undefined} value + * @return {!proto.nitric.proto.deployments.v1.Websocket} returns this +*/ +proto.nitric.proto.deployments.v1.Websocket.prototype.setDisconnectTarget = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.Websocket} returns this + */ +proto.nitric.proto.deployments.v1.Websocket.prototype.clearDisconnectTarget = function() { + return this.setDisconnectTarget(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.Websocket.prototype.hasDisconnectTarget = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional WebsocketTarget message_target = 3; + * @return {?proto.nitric.proto.deployments.v1.WebsocketTarget} + */ +proto.nitric.proto.deployments.v1.Websocket.prototype.getMessageTarget = function() { + return /** @type{?proto.nitric.proto.deployments.v1.WebsocketTarget} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.deployments.v1.WebsocketTarget, 3)); +}; + + +/** + * @param {?proto.nitric.proto.deployments.v1.WebsocketTarget|undefined} value + * @return {!proto.nitric.proto.deployments.v1.Websocket} returns this +*/ +proto.nitric.proto.deployments.v1.Websocket.prototype.setMessageTarget = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.Websocket} returns this + */ +proto.nitric.proto.deployments.v1.Websocket.prototype.clearMessageTarget = function() { + return this.setMessageTarget(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.Websocket.prototype.hasMessageTarget = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.proto.deployments.v1.WebsocketTarget.oneofGroups_ = [[1]]; + +/** + * @enum {number} + */ +proto.nitric.proto.deployments.v1.WebsocketTarget.TargetCase = { + TARGET_NOT_SET: 0, + SERVICE: 1 +}; + +/** + * @return {proto.nitric.proto.deployments.v1.WebsocketTarget.TargetCase} + */ +proto.nitric.proto.deployments.v1.WebsocketTarget.prototype.getTargetCase = function() { + return /** @type {proto.nitric.proto.deployments.v1.WebsocketTarget.TargetCase} */(jspb.Message.computeOneofCase(this, proto.nitric.proto.deployments.v1.WebsocketTarget.oneofGroups_[0])); +}; + + + +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.nitric.proto.deployments.v1.WebsocketTarget.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.deployments.v1.WebsocketTarget.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.nitric.proto.deployments.v1.WebsocketTarget} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.WebsocketTarget.toObject = function(includeInstance, msg) { + var f, obj = { + service: 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.nitric.proto.deployments.v1.WebsocketTarget} + */ +proto.nitric.proto.deployments.v1.WebsocketTarget.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.deployments.v1.WebsocketTarget; + return proto.nitric.proto.deployments.v1.WebsocketTarget.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.deployments.v1.WebsocketTarget} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.deployments.v1.WebsocketTarget} + */ +proto.nitric.proto.deployments.v1.WebsocketTarget.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.setService(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.deployments.v1.WebsocketTarget.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.deployments.v1.WebsocketTarget.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.deployments.v1.WebsocketTarget} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.WebsocketTarget.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string service = 1; + * @return {string} + */ +proto.nitric.proto.deployments.v1.WebsocketTarget.prototype.getService = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.deployments.v1.WebsocketTarget} returns this + */ +proto.nitric.proto.deployments.v1.WebsocketTarget.prototype.setService = function(value) { + return jspb.Message.setOneofField(this, 1, proto.nitric.proto.deployments.v1.WebsocketTarget.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.WebsocketTarget} returns this + */ +proto.nitric.proto.deployments.v1.WebsocketTarget.prototype.clearService = function() { + return jspb.Message.setOneofField(this, 1, proto.nitric.proto.deployments.v1.WebsocketTarget.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.WebsocketTarget.prototype.hasService = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.proto.deployments.v1.ScheduleTarget.oneofGroups_ = [[1]]; + +/** + * @enum {number} + */ +proto.nitric.proto.deployments.v1.ScheduleTarget.TargetCase = { + TARGET_NOT_SET: 0, + SERVICE: 1 +}; + +/** + * @return {proto.nitric.proto.deployments.v1.ScheduleTarget.TargetCase} + */ +proto.nitric.proto.deployments.v1.ScheduleTarget.prototype.getTargetCase = function() { + return /** @type {proto.nitric.proto.deployments.v1.ScheduleTarget.TargetCase} */(jspb.Message.computeOneofCase(this, proto.nitric.proto.deployments.v1.ScheduleTarget.oneofGroups_[0])); +}; + + + +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.nitric.proto.deployments.v1.ScheduleTarget.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.deployments.v1.ScheduleTarget.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.nitric.proto.deployments.v1.ScheduleTarget} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.ScheduleTarget.toObject = function(includeInstance, msg) { + var f, obj = { + service: 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.nitric.proto.deployments.v1.ScheduleTarget} + */ +proto.nitric.proto.deployments.v1.ScheduleTarget.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.deployments.v1.ScheduleTarget; + return proto.nitric.proto.deployments.v1.ScheduleTarget.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.deployments.v1.ScheduleTarget} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.deployments.v1.ScheduleTarget} + */ +proto.nitric.proto.deployments.v1.ScheduleTarget.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.setService(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.deployments.v1.ScheduleTarget.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.deployments.v1.ScheduleTarget.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.deployments.v1.ScheduleTarget} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.ScheduleTarget.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string service = 1; + * @return {string} + */ +proto.nitric.proto.deployments.v1.ScheduleTarget.prototype.getService = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.deployments.v1.ScheduleTarget} returns this + */ +proto.nitric.proto.deployments.v1.ScheduleTarget.prototype.setService = function(value) { + return jspb.Message.setOneofField(this, 1, proto.nitric.proto.deployments.v1.ScheduleTarget.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.ScheduleTarget} returns this + */ +proto.nitric.proto.deployments.v1.ScheduleTarget.prototype.clearService = function() { + return jspb.Message.setOneofField(this, 1, proto.nitric.proto.deployments.v1.ScheduleTarget.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.ScheduleTarget.prototype.hasService = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.proto.deployments.v1.Schedule.oneofGroups_ = [[10,11]]; + +/** + * @enum {number} + */ +proto.nitric.proto.deployments.v1.Schedule.CadenceCase = { + CADENCE_NOT_SET: 0, + EVERY: 10, + CRON: 11 +}; + +/** + * @return {proto.nitric.proto.deployments.v1.Schedule.CadenceCase} + */ +proto.nitric.proto.deployments.v1.Schedule.prototype.getCadenceCase = function() { + return /** @type {proto.nitric.proto.deployments.v1.Schedule.CadenceCase} */(jspb.Message.computeOneofCase(this, proto.nitric.proto.deployments.v1.Schedule.oneofGroups_[0])); +}; + + + +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.nitric.proto.deployments.v1.Schedule.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.deployments.v1.Schedule.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.nitric.proto.deployments.v1.Schedule} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.Schedule.toObject = function(includeInstance, msg) { + var f, obj = { + target: (f = msg.getTarget()) && proto.nitric.proto.deployments.v1.ScheduleTarget.toObject(includeInstance, f), + every: (f = msg.getEvery()) && proto.nitric.proto.deployments.v1.ScheduleEvery.toObject(includeInstance, f), + cron: (f = msg.getCron()) && proto.nitric.proto.deployments.v1.ScheduleCron.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.nitric.proto.deployments.v1.Schedule} + */ +proto.nitric.proto.deployments.v1.Schedule.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.deployments.v1.Schedule; + return proto.nitric.proto.deployments.v1.Schedule.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.deployments.v1.Schedule} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.deployments.v1.Schedule} + */ +proto.nitric.proto.deployments.v1.Schedule.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.nitric.proto.deployments.v1.ScheduleTarget; + reader.readMessage(value,proto.nitric.proto.deployments.v1.ScheduleTarget.deserializeBinaryFromReader); + msg.setTarget(value); + break; + case 10: + var value = new proto.nitric.proto.deployments.v1.ScheduleEvery; + reader.readMessage(value,proto.nitric.proto.deployments.v1.ScheduleEvery.deserializeBinaryFromReader); + msg.setEvery(value); + break; + case 11: + var value = new proto.nitric.proto.deployments.v1.ScheduleCron; + reader.readMessage(value,proto.nitric.proto.deployments.v1.ScheduleCron.deserializeBinaryFromReader); + msg.setCron(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.deployments.v1.Schedule.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.deployments.v1.Schedule.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.deployments.v1.Schedule} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.Schedule.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTarget(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.nitric.proto.deployments.v1.ScheduleTarget.serializeBinaryToWriter + ); + } + f = message.getEvery(); + if (f != null) { + writer.writeMessage( + 10, + f, + proto.nitric.proto.deployments.v1.ScheduleEvery.serializeBinaryToWriter + ); + } + f = message.getCron(); + if (f != null) { + writer.writeMessage( + 11, + f, + proto.nitric.proto.deployments.v1.ScheduleCron.serializeBinaryToWriter + ); + } +}; + + +/** + * optional ScheduleTarget target = 1; + * @return {?proto.nitric.proto.deployments.v1.ScheduleTarget} + */ +proto.nitric.proto.deployments.v1.Schedule.prototype.getTarget = function() { + return /** @type{?proto.nitric.proto.deployments.v1.ScheduleTarget} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.deployments.v1.ScheduleTarget, 1)); +}; + + +/** + * @param {?proto.nitric.proto.deployments.v1.ScheduleTarget|undefined} value + * @return {!proto.nitric.proto.deployments.v1.Schedule} returns this +*/ +proto.nitric.proto.deployments.v1.Schedule.prototype.setTarget = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.Schedule} returns this + */ +proto.nitric.proto.deployments.v1.Schedule.prototype.clearTarget = function() { + return this.setTarget(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.Schedule.prototype.hasTarget = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional ScheduleEvery every = 10; + * @return {?proto.nitric.proto.deployments.v1.ScheduleEvery} + */ +proto.nitric.proto.deployments.v1.Schedule.prototype.getEvery = function() { + return /** @type{?proto.nitric.proto.deployments.v1.ScheduleEvery} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.deployments.v1.ScheduleEvery, 10)); +}; + + +/** + * @param {?proto.nitric.proto.deployments.v1.ScheduleEvery|undefined} value + * @return {!proto.nitric.proto.deployments.v1.Schedule} returns this +*/ +proto.nitric.proto.deployments.v1.Schedule.prototype.setEvery = function(value) { + return jspb.Message.setOneofWrapperField(this, 10, proto.nitric.proto.deployments.v1.Schedule.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.Schedule} returns this + */ +proto.nitric.proto.deployments.v1.Schedule.prototype.clearEvery = function() { + return this.setEvery(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.Schedule.prototype.hasEvery = function() { + return jspb.Message.getField(this, 10) != null; +}; + + +/** + * optional ScheduleCron cron = 11; + * @return {?proto.nitric.proto.deployments.v1.ScheduleCron} + */ +proto.nitric.proto.deployments.v1.Schedule.prototype.getCron = function() { + return /** @type{?proto.nitric.proto.deployments.v1.ScheduleCron} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.deployments.v1.ScheduleCron, 11)); +}; + + +/** + * @param {?proto.nitric.proto.deployments.v1.ScheduleCron|undefined} value + * @return {!proto.nitric.proto.deployments.v1.Schedule} returns this +*/ +proto.nitric.proto.deployments.v1.Schedule.prototype.setCron = function(value) { + return jspb.Message.setOneofWrapperField(this, 11, proto.nitric.proto.deployments.v1.Schedule.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.Schedule} returns this + */ +proto.nitric.proto.deployments.v1.Schedule.prototype.clearCron = function() { + return this.setCron(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.Schedule.prototype.hasCron = function() { + return jspb.Message.getField(this, 11) != 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.nitric.proto.deployments.v1.ScheduleEvery.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.deployments.v1.ScheduleEvery.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.nitric.proto.deployments.v1.ScheduleEvery} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.ScheduleEvery.toObject = function(includeInstance, msg) { + var f, obj = { + rate: 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.nitric.proto.deployments.v1.ScheduleEvery} + */ +proto.nitric.proto.deployments.v1.ScheduleEvery.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.deployments.v1.ScheduleEvery; + return proto.nitric.proto.deployments.v1.ScheduleEvery.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.deployments.v1.ScheduleEvery} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.deployments.v1.ScheduleEvery} + */ +proto.nitric.proto.deployments.v1.ScheduleEvery.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.setRate(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.deployments.v1.ScheduleEvery.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.deployments.v1.ScheduleEvery.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.deployments.v1.ScheduleEvery} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.ScheduleEvery.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRate(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string rate = 1; + * @return {string} + */ +proto.nitric.proto.deployments.v1.ScheduleEvery.prototype.getRate = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.deployments.v1.ScheduleEvery} returns this + */ +proto.nitric.proto.deployments.v1.ScheduleEvery.prototype.setRate = 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.nitric.proto.deployments.v1.ScheduleCron.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.deployments.v1.ScheduleCron.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.nitric.proto.deployments.v1.ScheduleCron} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.ScheduleCron.toObject = function(includeInstance, msg) { + var f, obj = { + expression: 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.nitric.proto.deployments.v1.ScheduleCron} + */ +proto.nitric.proto.deployments.v1.ScheduleCron.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.deployments.v1.ScheduleCron; + return proto.nitric.proto.deployments.v1.ScheduleCron.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.deployments.v1.ScheduleCron} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.deployments.v1.ScheduleCron} + */ +proto.nitric.proto.deployments.v1.ScheduleCron.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.setExpression(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.deployments.v1.ScheduleCron.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.deployments.v1.ScheduleCron.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.deployments.v1.ScheduleCron} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.ScheduleCron.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getExpression(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string expression = 1; + * @return {string} + */ +proto.nitric.proto.deployments.v1.ScheduleCron.prototype.getExpression = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.deployments.v1.ScheduleCron} returns this + */ +proto.nitric.proto.deployments.v1.ScheduleCron.prototype.setExpression = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.proto.deployments.v1.Resource.oneofGroups_ = [[10,11,12,13,14,15,16,17,18,19,20]]; + +/** + * @enum {number} + */ +proto.nitric.proto.deployments.v1.Resource.ConfigCase = { + CONFIG_NOT_SET: 0, + SERVICE: 10, + BUCKET: 11, + TOPIC: 12, + API: 13, + POLICY: 14, + SCHEDULE: 15, + KEY_VALUE_STORE: 16, + SECRET: 17, + WEBSOCKET: 18, + HTTP: 19, + QUEUE: 20 +}; + +/** + * @return {proto.nitric.proto.deployments.v1.Resource.ConfigCase} + */ +proto.nitric.proto.deployments.v1.Resource.prototype.getConfigCase = function() { + return /** @type {proto.nitric.proto.deployments.v1.Resource.ConfigCase} */(jspb.Message.computeOneofCase(this, proto.nitric.proto.deployments.v1.Resource.oneofGroups_[0])); +}; + + + +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.nitric.proto.deployments.v1.Resource.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.deployments.v1.Resource.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.nitric.proto.deployments.v1.Resource} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.Resource.toObject = function(includeInstance, msg) { + var f, obj = { + id: (f = msg.getId()) && nitric_proto_resources_v1_resources_pb.ResourceIdentifier.toObject(includeInstance, f), + service: (f = msg.getService()) && proto.nitric.proto.deployments.v1.Service.toObject(includeInstance, f), + bucket: (f = msg.getBucket()) && proto.nitric.proto.deployments.v1.Bucket.toObject(includeInstance, f), + topic: (f = msg.getTopic()) && proto.nitric.proto.deployments.v1.Topic.toObject(includeInstance, f), + api: (f = msg.getApi()) && proto.nitric.proto.deployments.v1.Api.toObject(includeInstance, f), + policy: (f = msg.getPolicy()) && proto.nitric.proto.deployments.v1.Policy.toObject(includeInstance, f), + schedule: (f = msg.getSchedule()) && proto.nitric.proto.deployments.v1.Schedule.toObject(includeInstance, f), + keyValueStore: (f = msg.getKeyValueStore()) && proto.nitric.proto.deployments.v1.KeyValueStore.toObject(includeInstance, f), + secret: (f = msg.getSecret()) && proto.nitric.proto.deployments.v1.Secret.toObject(includeInstance, f), + websocket: (f = msg.getWebsocket()) && proto.nitric.proto.deployments.v1.Websocket.toObject(includeInstance, f), + http: (f = msg.getHttp()) && proto.nitric.proto.deployments.v1.Http.toObject(includeInstance, f), + queue: (f = msg.getQueue()) && proto.nitric.proto.deployments.v1.Queue.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.nitric.proto.deployments.v1.Resource} + */ +proto.nitric.proto.deployments.v1.Resource.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.deployments.v1.Resource; + return proto.nitric.proto.deployments.v1.Resource.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.deployments.v1.Resource} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.deployments.v1.Resource} + */ +proto.nitric.proto.deployments.v1.Resource.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new nitric_proto_resources_v1_resources_pb.ResourceIdentifier; + reader.readMessage(value,nitric_proto_resources_v1_resources_pb.ResourceIdentifier.deserializeBinaryFromReader); + msg.setId(value); + break; + case 10: + var value = new proto.nitric.proto.deployments.v1.Service; + reader.readMessage(value,proto.nitric.proto.deployments.v1.Service.deserializeBinaryFromReader); + msg.setService(value); + break; + case 11: + var value = new proto.nitric.proto.deployments.v1.Bucket; + reader.readMessage(value,proto.nitric.proto.deployments.v1.Bucket.deserializeBinaryFromReader); + msg.setBucket(value); + break; + case 12: + var value = new proto.nitric.proto.deployments.v1.Topic; + reader.readMessage(value,proto.nitric.proto.deployments.v1.Topic.deserializeBinaryFromReader); + msg.setTopic(value); + break; + case 13: + var value = new proto.nitric.proto.deployments.v1.Api; + reader.readMessage(value,proto.nitric.proto.deployments.v1.Api.deserializeBinaryFromReader); + msg.setApi(value); + break; + case 14: + var value = new proto.nitric.proto.deployments.v1.Policy; + reader.readMessage(value,proto.nitric.proto.deployments.v1.Policy.deserializeBinaryFromReader); + msg.setPolicy(value); + break; + case 15: + var value = new proto.nitric.proto.deployments.v1.Schedule; + reader.readMessage(value,proto.nitric.proto.deployments.v1.Schedule.deserializeBinaryFromReader); + msg.setSchedule(value); + break; + case 16: + var value = new proto.nitric.proto.deployments.v1.KeyValueStore; + reader.readMessage(value,proto.nitric.proto.deployments.v1.KeyValueStore.deserializeBinaryFromReader); + msg.setKeyValueStore(value); + break; + case 17: + var value = new proto.nitric.proto.deployments.v1.Secret; + reader.readMessage(value,proto.nitric.proto.deployments.v1.Secret.deserializeBinaryFromReader); + msg.setSecret(value); + break; + case 18: + var value = new proto.nitric.proto.deployments.v1.Websocket; + reader.readMessage(value,proto.nitric.proto.deployments.v1.Websocket.deserializeBinaryFromReader); + msg.setWebsocket(value); + break; + case 19: + var value = new proto.nitric.proto.deployments.v1.Http; + reader.readMessage(value,proto.nitric.proto.deployments.v1.Http.deserializeBinaryFromReader); + msg.setHttp(value); + break; + case 20: + var value = new proto.nitric.proto.deployments.v1.Queue; + reader.readMessage(value,proto.nitric.proto.deployments.v1.Queue.deserializeBinaryFromReader); + msg.setQueue(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.deployments.v1.Resource.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.deployments.v1.Resource.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.deployments.v1.Resource} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.Resource.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f != null) { + writer.writeMessage( + 1, + f, + nitric_proto_resources_v1_resources_pb.ResourceIdentifier.serializeBinaryToWriter + ); + } + f = message.getService(); + if (f != null) { + writer.writeMessage( + 10, + f, + proto.nitric.proto.deployments.v1.Service.serializeBinaryToWriter + ); + } + f = message.getBucket(); + if (f != null) { + writer.writeMessage( + 11, + f, + proto.nitric.proto.deployments.v1.Bucket.serializeBinaryToWriter + ); + } + f = message.getTopic(); + if (f != null) { + writer.writeMessage( + 12, + f, + proto.nitric.proto.deployments.v1.Topic.serializeBinaryToWriter + ); + } + f = message.getApi(); + if (f != null) { + writer.writeMessage( + 13, + f, + proto.nitric.proto.deployments.v1.Api.serializeBinaryToWriter + ); + } + f = message.getPolicy(); + if (f != null) { + writer.writeMessage( + 14, + f, + proto.nitric.proto.deployments.v1.Policy.serializeBinaryToWriter + ); + } + f = message.getSchedule(); + if (f != null) { + writer.writeMessage( + 15, + f, + proto.nitric.proto.deployments.v1.Schedule.serializeBinaryToWriter + ); + } + f = message.getKeyValueStore(); + if (f != null) { + writer.writeMessage( + 16, + f, + proto.nitric.proto.deployments.v1.KeyValueStore.serializeBinaryToWriter + ); + } + f = message.getSecret(); + if (f != null) { + writer.writeMessage( + 17, + f, + proto.nitric.proto.deployments.v1.Secret.serializeBinaryToWriter + ); + } + f = message.getWebsocket(); + if (f != null) { + writer.writeMessage( + 18, + f, + proto.nitric.proto.deployments.v1.Websocket.serializeBinaryToWriter + ); + } + f = message.getHttp(); + if (f != null) { + writer.writeMessage( + 19, + f, + proto.nitric.proto.deployments.v1.Http.serializeBinaryToWriter + ); + } + f = message.getQueue(); + if (f != null) { + writer.writeMessage( + 20, + f, + proto.nitric.proto.deployments.v1.Queue.serializeBinaryToWriter + ); + } +}; + + +/** + * optional nitric.proto.resources.v1.ResourceIdentifier id = 1; + * @return {?proto.nitric.proto.resources.v1.ResourceIdentifier} + */ +proto.nitric.proto.deployments.v1.Resource.prototype.getId = function() { + return /** @type{?proto.nitric.proto.resources.v1.ResourceIdentifier} */ ( + jspb.Message.getWrapperField(this, nitric_proto_resources_v1_resources_pb.ResourceIdentifier, 1)); +}; + + +/** + * @param {?proto.nitric.proto.resources.v1.ResourceIdentifier|undefined} value + * @return {!proto.nitric.proto.deployments.v1.Resource} returns this +*/ +proto.nitric.proto.deployments.v1.Resource.prototype.setId = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.Resource} returns this + */ +proto.nitric.proto.deployments.v1.Resource.prototype.clearId = function() { + return this.setId(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.Resource.prototype.hasId = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional Service service = 10; + * @return {?proto.nitric.proto.deployments.v1.Service} + */ +proto.nitric.proto.deployments.v1.Resource.prototype.getService = function() { + return /** @type{?proto.nitric.proto.deployments.v1.Service} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.deployments.v1.Service, 10)); +}; + + +/** + * @param {?proto.nitric.proto.deployments.v1.Service|undefined} value + * @return {!proto.nitric.proto.deployments.v1.Resource} returns this +*/ +proto.nitric.proto.deployments.v1.Resource.prototype.setService = function(value) { + return jspb.Message.setOneofWrapperField(this, 10, proto.nitric.proto.deployments.v1.Resource.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.Resource} returns this + */ +proto.nitric.proto.deployments.v1.Resource.prototype.clearService = function() { + return this.setService(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.Resource.prototype.hasService = function() { + return jspb.Message.getField(this, 10) != null; +}; + + +/** + * optional Bucket bucket = 11; + * @return {?proto.nitric.proto.deployments.v1.Bucket} + */ +proto.nitric.proto.deployments.v1.Resource.prototype.getBucket = function() { + return /** @type{?proto.nitric.proto.deployments.v1.Bucket} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.deployments.v1.Bucket, 11)); +}; + + +/** + * @param {?proto.nitric.proto.deployments.v1.Bucket|undefined} value + * @return {!proto.nitric.proto.deployments.v1.Resource} returns this +*/ +proto.nitric.proto.deployments.v1.Resource.prototype.setBucket = function(value) { + return jspb.Message.setOneofWrapperField(this, 11, proto.nitric.proto.deployments.v1.Resource.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.Resource} returns this + */ +proto.nitric.proto.deployments.v1.Resource.prototype.clearBucket = function() { + return this.setBucket(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.Resource.prototype.hasBucket = function() { + return jspb.Message.getField(this, 11) != null; +}; + + +/** + * optional Topic topic = 12; + * @return {?proto.nitric.proto.deployments.v1.Topic} + */ +proto.nitric.proto.deployments.v1.Resource.prototype.getTopic = function() { + return /** @type{?proto.nitric.proto.deployments.v1.Topic} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.deployments.v1.Topic, 12)); +}; + + +/** + * @param {?proto.nitric.proto.deployments.v1.Topic|undefined} value + * @return {!proto.nitric.proto.deployments.v1.Resource} returns this +*/ +proto.nitric.proto.deployments.v1.Resource.prototype.setTopic = function(value) { + return jspb.Message.setOneofWrapperField(this, 12, proto.nitric.proto.deployments.v1.Resource.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.Resource} returns this + */ +proto.nitric.proto.deployments.v1.Resource.prototype.clearTopic = function() { + return this.setTopic(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.Resource.prototype.hasTopic = function() { + return jspb.Message.getField(this, 12) != null; +}; + + +/** + * optional Api api = 13; + * @return {?proto.nitric.proto.deployments.v1.Api} + */ +proto.nitric.proto.deployments.v1.Resource.prototype.getApi = function() { + return /** @type{?proto.nitric.proto.deployments.v1.Api} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.deployments.v1.Api, 13)); +}; + + +/** + * @param {?proto.nitric.proto.deployments.v1.Api|undefined} value + * @return {!proto.nitric.proto.deployments.v1.Resource} returns this +*/ +proto.nitric.proto.deployments.v1.Resource.prototype.setApi = function(value) { + return jspb.Message.setOneofWrapperField(this, 13, proto.nitric.proto.deployments.v1.Resource.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.Resource} returns this + */ +proto.nitric.proto.deployments.v1.Resource.prototype.clearApi = function() { + return this.setApi(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.Resource.prototype.hasApi = function() { + return jspb.Message.getField(this, 13) != null; +}; + + +/** + * optional Policy policy = 14; + * @return {?proto.nitric.proto.deployments.v1.Policy} + */ +proto.nitric.proto.deployments.v1.Resource.prototype.getPolicy = function() { + return /** @type{?proto.nitric.proto.deployments.v1.Policy} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.deployments.v1.Policy, 14)); +}; + + +/** + * @param {?proto.nitric.proto.deployments.v1.Policy|undefined} value + * @return {!proto.nitric.proto.deployments.v1.Resource} returns this +*/ +proto.nitric.proto.deployments.v1.Resource.prototype.setPolicy = function(value) { + return jspb.Message.setOneofWrapperField(this, 14, proto.nitric.proto.deployments.v1.Resource.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.Resource} returns this + */ +proto.nitric.proto.deployments.v1.Resource.prototype.clearPolicy = function() { + return this.setPolicy(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.Resource.prototype.hasPolicy = function() { + return jspb.Message.getField(this, 14) != null; +}; + + +/** + * optional Schedule schedule = 15; + * @return {?proto.nitric.proto.deployments.v1.Schedule} + */ +proto.nitric.proto.deployments.v1.Resource.prototype.getSchedule = function() { + return /** @type{?proto.nitric.proto.deployments.v1.Schedule} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.deployments.v1.Schedule, 15)); +}; + + +/** + * @param {?proto.nitric.proto.deployments.v1.Schedule|undefined} value + * @return {!proto.nitric.proto.deployments.v1.Resource} returns this +*/ +proto.nitric.proto.deployments.v1.Resource.prototype.setSchedule = function(value) { + return jspb.Message.setOneofWrapperField(this, 15, proto.nitric.proto.deployments.v1.Resource.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.Resource} returns this + */ +proto.nitric.proto.deployments.v1.Resource.prototype.clearSchedule = function() { + return this.setSchedule(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.Resource.prototype.hasSchedule = function() { + return jspb.Message.getField(this, 15) != null; +}; + + +/** + * optional KeyValueStore key_value_store = 16; + * @return {?proto.nitric.proto.deployments.v1.KeyValueStore} + */ +proto.nitric.proto.deployments.v1.Resource.prototype.getKeyValueStore = function() { + return /** @type{?proto.nitric.proto.deployments.v1.KeyValueStore} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.deployments.v1.KeyValueStore, 16)); +}; + + +/** + * @param {?proto.nitric.proto.deployments.v1.KeyValueStore|undefined} value + * @return {!proto.nitric.proto.deployments.v1.Resource} returns this +*/ +proto.nitric.proto.deployments.v1.Resource.prototype.setKeyValueStore = function(value) { + return jspb.Message.setOneofWrapperField(this, 16, proto.nitric.proto.deployments.v1.Resource.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.Resource} returns this + */ +proto.nitric.proto.deployments.v1.Resource.prototype.clearKeyValueStore = function() { + return this.setKeyValueStore(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.Resource.prototype.hasKeyValueStore = function() { + return jspb.Message.getField(this, 16) != null; +}; + + +/** + * optional Secret secret = 17; + * @return {?proto.nitric.proto.deployments.v1.Secret} + */ +proto.nitric.proto.deployments.v1.Resource.prototype.getSecret = function() { + return /** @type{?proto.nitric.proto.deployments.v1.Secret} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.deployments.v1.Secret, 17)); +}; + + +/** + * @param {?proto.nitric.proto.deployments.v1.Secret|undefined} value + * @return {!proto.nitric.proto.deployments.v1.Resource} returns this +*/ +proto.nitric.proto.deployments.v1.Resource.prototype.setSecret = function(value) { + return jspb.Message.setOneofWrapperField(this, 17, proto.nitric.proto.deployments.v1.Resource.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.Resource} returns this + */ +proto.nitric.proto.deployments.v1.Resource.prototype.clearSecret = function() { + return this.setSecret(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.Resource.prototype.hasSecret = function() { + return jspb.Message.getField(this, 17) != null; +}; + + +/** + * optional Websocket websocket = 18; + * @return {?proto.nitric.proto.deployments.v1.Websocket} + */ +proto.nitric.proto.deployments.v1.Resource.prototype.getWebsocket = function() { + return /** @type{?proto.nitric.proto.deployments.v1.Websocket} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.deployments.v1.Websocket, 18)); +}; + + +/** + * @param {?proto.nitric.proto.deployments.v1.Websocket|undefined} value + * @return {!proto.nitric.proto.deployments.v1.Resource} returns this +*/ +proto.nitric.proto.deployments.v1.Resource.prototype.setWebsocket = function(value) { + return jspb.Message.setOneofWrapperField(this, 18, proto.nitric.proto.deployments.v1.Resource.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.Resource} returns this + */ +proto.nitric.proto.deployments.v1.Resource.prototype.clearWebsocket = function() { + return this.setWebsocket(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.Resource.prototype.hasWebsocket = function() { + return jspb.Message.getField(this, 18) != null; +}; + + +/** + * optional Http http = 19; + * @return {?proto.nitric.proto.deployments.v1.Http} + */ +proto.nitric.proto.deployments.v1.Resource.prototype.getHttp = function() { + return /** @type{?proto.nitric.proto.deployments.v1.Http} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.deployments.v1.Http, 19)); +}; + + +/** + * @param {?proto.nitric.proto.deployments.v1.Http|undefined} value + * @return {!proto.nitric.proto.deployments.v1.Resource} returns this +*/ +proto.nitric.proto.deployments.v1.Resource.prototype.setHttp = function(value) { + return jspb.Message.setOneofWrapperField(this, 19, proto.nitric.proto.deployments.v1.Resource.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.Resource} returns this + */ +proto.nitric.proto.deployments.v1.Resource.prototype.clearHttp = function() { + return this.setHttp(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.Resource.prototype.hasHttp = function() { + return jspb.Message.getField(this, 19) != null; +}; + + +/** + * optional Queue queue = 20; + * @return {?proto.nitric.proto.deployments.v1.Queue} + */ +proto.nitric.proto.deployments.v1.Resource.prototype.getQueue = function() { + return /** @type{?proto.nitric.proto.deployments.v1.Queue} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.deployments.v1.Queue, 20)); +}; + + +/** + * @param {?proto.nitric.proto.deployments.v1.Queue|undefined} value + * @return {!proto.nitric.proto.deployments.v1.Resource} returns this +*/ +proto.nitric.proto.deployments.v1.Resource.prototype.setQueue = function(value) { + return jspb.Message.setOneofWrapperField(this, 20, proto.nitric.proto.deployments.v1.Resource.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.deployments.v1.Resource} returns this + */ +proto.nitric.proto.deployments.v1.Resource.prototype.clearQueue = function() { + return this.setQueue(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.deployments.v1.Resource.prototype.hasQueue = function() { + return jspb.Message.getField(this, 20) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.nitric.proto.deployments.v1.Policy.repeatedFields_ = [1,2,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.nitric.proto.deployments.v1.Policy.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.deployments.v1.Policy.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.nitric.proto.deployments.v1.Policy} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.Policy.toObject = function(includeInstance, msg) { + var f, obj = { + principalsList: jspb.Message.toObjectList(msg.getPrincipalsList(), + proto.nitric.proto.deployments.v1.Resource.toObject, includeInstance), + actionsList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f, + resourcesList: jspb.Message.toObjectList(msg.getResourcesList(), + proto.nitric.proto.deployments.v1.Resource.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.nitric.proto.deployments.v1.Policy} + */ +proto.nitric.proto.deployments.v1.Policy.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.deployments.v1.Policy; + return proto.nitric.proto.deployments.v1.Policy.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.deployments.v1.Policy} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.deployments.v1.Policy} + */ +proto.nitric.proto.deployments.v1.Policy.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.nitric.proto.deployments.v1.Resource; + reader.readMessage(value,proto.nitric.proto.deployments.v1.Resource.deserializeBinaryFromReader); + msg.addPrincipals(value); + break; + case 2: + var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedEnum() : [reader.readEnum()]); + for (var i = 0; i < values.length; i++) { + msg.addActions(values[i]); + } + break; + case 3: + var value = new proto.nitric.proto.deployments.v1.Resource; + reader.readMessage(value,proto.nitric.proto.deployments.v1.Resource.deserializeBinaryFromReader); + msg.addResources(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.deployments.v1.Policy.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.deployments.v1.Policy.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.deployments.v1.Policy} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.Policy.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPrincipalsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.nitric.proto.deployments.v1.Resource.serializeBinaryToWriter + ); + } + f = message.getActionsList(); + if (f.length > 0) { + writer.writePackedEnum( + 2, + f + ); + } + f = message.getResourcesList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 3, + f, + proto.nitric.proto.deployments.v1.Resource.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated Resource principals = 1; + * @return {!Array} + */ +proto.nitric.proto.deployments.v1.Policy.prototype.getPrincipalsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.nitric.proto.deployments.v1.Resource, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.nitric.proto.deployments.v1.Policy} returns this +*/ +proto.nitric.proto.deployments.v1.Policy.prototype.setPrincipalsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.nitric.proto.deployments.v1.Resource=} opt_value + * @param {number=} opt_index + * @return {!proto.nitric.proto.deployments.v1.Resource} + */ +proto.nitric.proto.deployments.v1.Policy.prototype.addPrincipals = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.nitric.proto.deployments.v1.Resource, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.nitric.proto.deployments.v1.Policy} returns this + */ +proto.nitric.proto.deployments.v1.Policy.prototype.clearPrincipalsList = function() { + return this.setPrincipalsList([]); +}; + + +/** + * repeated nitric.proto.resources.v1.Action actions = 2; + * @return {!Array} + */ +proto.nitric.proto.deployments.v1.Policy.prototype.getActionsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.nitric.proto.deployments.v1.Policy} returns this + */ +proto.nitric.proto.deployments.v1.Policy.prototype.setActionsList = function(value) { + return jspb.Message.setField(this, 2, value || []); +}; + + +/** + * @param {!proto.nitric.proto.resources.v1.Action} value + * @param {number=} opt_index + * @return {!proto.nitric.proto.deployments.v1.Policy} returns this + */ +proto.nitric.proto.deployments.v1.Policy.prototype.addActions = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 2, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.nitric.proto.deployments.v1.Policy} returns this + */ +proto.nitric.proto.deployments.v1.Policy.prototype.clearActionsList = function() { + return this.setActionsList([]); +}; + + +/** + * repeated Resource resources = 3; + * @return {!Array} + */ +proto.nitric.proto.deployments.v1.Policy.prototype.getResourcesList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.nitric.proto.deployments.v1.Resource, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.nitric.proto.deployments.v1.Policy} returns this +*/ +proto.nitric.proto.deployments.v1.Policy.prototype.setResourcesList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 3, value); +}; + + +/** + * @param {!proto.nitric.proto.deployments.v1.Resource=} opt_value + * @param {number=} opt_index + * @return {!proto.nitric.proto.deployments.v1.Resource} + */ +proto.nitric.proto.deployments.v1.Policy.prototype.addResources = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.nitric.proto.deployments.v1.Resource, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.nitric.proto.deployments.v1.Policy} returns this + */ +proto.nitric.proto.deployments.v1.Policy.prototype.clearResourcesList = function() { + return this.setResourcesList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.nitric.proto.deployments.v1.Spec.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.nitric.proto.deployments.v1.Spec.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.deployments.v1.Spec.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.nitric.proto.deployments.v1.Spec} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.Spec.toObject = function(includeInstance, msg) { + var f, obj = { + resourcesList: jspb.Message.toObjectList(msg.getResourcesList(), + proto.nitric.proto.deployments.v1.Resource.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.nitric.proto.deployments.v1.Spec} + */ +proto.nitric.proto.deployments.v1.Spec.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.deployments.v1.Spec; + return proto.nitric.proto.deployments.v1.Spec.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.deployments.v1.Spec} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.deployments.v1.Spec} + */ +proto.nitric.proto.deployments.v1.Spec.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.nitric.proto.deployments.v1.Resource; + reader.readMessage(value,proto.nitric.proto.deployments.v1.Resource.deserializeBinaryFromReader); + msg.addResources(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.deployments.v1.Spec.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.deployments.v1.Spec.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.deployments.v1.Spec} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.deployments.v1.Spec.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getResourcesList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.nitric.proto.deployments.v1.Resource.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated Resource resources = 1; + * @return {!Array} + */ +proto.nitric.proto.deployments.v1.Spec.prototype.getResourcesList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.nitric.proto.deployments.v1.Resource, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.nitric.proto.deployments.v1.Spec} returns this +*/ +proto.nitric.proto.deployments.v1.Spec.prototype.setResourcesList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.nitric.proto.deployments.v1.Resource=} opt_value + * @param {number=} opt_index + * @return {!proto.nitric.proto.deployments.v1.Resource} + */ +proto.nitric.proto.deployments.v1.Spec.prototype.addResources = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.nitric.proto.deployments.v1.Resource, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.nitric.proto.deployments.v1.Spec} returns this + */ +proto.nitric.proto.deployments.v1.Spec.prototype.clearResourcesList = function() { + return this.setResourcesList([]); +}; + + +/** + * @enum {number} + */ +proto.nitric.proto.deployments.v1.ResourceDeploymentAction = { + CREATE: 0, + UPDATE: 1, + REPLACE: 2, + SAME: 3, + DELETE: 4 +}; + +/** + * @enum {number} + */ +proto.nitric.proto.deployments.v1.ResourceDeploymentStatus = { + PENDING: 0, + IN_PROGRESS: 1, + SUCCESS: 2, + FAILED: 3 +}; + +goog.object.extend(exports, proto.nitric.proto.deployments.v1); diff --git a/src/gen/nitric/proto/http/v1/http_grpc_pb.d.ts b/src/gen/nitric/proto/http/v1/http_grpc_pb.d.ts new file mode 100644 index 00000000..5765e210 --- /dev/null +++ b/src/gen/nitric/proto/http/v1/http_grpc_pb.d.ts @@ -0,0 +1,23 @@ +// GENERATED CODE -- DO NOT EDIT! + +// package: nitric.proto.http.v1 +// file: nitric/proto/http/v1/http.proto + +import * as nitric_proto_http_v1_http_pb from "../../../../nitric/proto/http/v1/http_pb"; +import * as grpc from "@grpc/grpc-js"; + +interface IHttpService extends grpc.ServiceDefinition { + proxy: grpc.MethodDefinition; +} + +export const HttpService: IHttpService; + +export interface IHttpServer extends grpc.UntypedServiceImplementation { + proxy: grpc.handleBidiStreamingCall; +} + +export class HttpClient extends grpc.Client { + constructor(address: string, credentials: grpc.ChannelCredentials, options?: object); + proxy(metadataOrOptions?: grpc.Metadata | grpc.CallOptions | null): grpc.ClientDuplexStream; + proxy(metadata?: grpc.Metadata | null, options?: grpc.CallOptions | null): grpc.ClientDuplexStream; +} diff --git a/src/gen/nitric/proto/http/v1/http_grpc_pb.js b/src/gen/nitric/proto/http/v1/http_grpc_pb.js new file mode 100644 index 00000000..3fac3f88 --- /dev/null +++ b/src/gen/nitric/proto/http/v1/http_grpc_pb.js @@ -0,0 +1,46 @@ +// GENERATED CODE -- DO NOT EDIT! + +'use strict'; +var grpc = require('@grpc/grpc-js'); +var nitric_proto_http_v1_http_pb = require('../../../../nitric/proto/http/v1/http_pb.js'); + +function serialize_nitric_proto_http_v1_ClientMessage(arg) { + if (!(arg instanceof nitric_proto_http_v1_http_pb.ClientMessage)) { + throw new Error('Expected argument of type nitric.proto.http.v1.ClientMessage'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_http_v1_ClientMessage(buffer_arg) { + return nitric_proto_http_v1_http_pb.ClientMessage.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_http_v1_ServerMessage(arg) { + if (!(arg instanceof nitric_proto_http_v1_http_pb.ServerMessage)) { + throw new Error('Expected argument of type nitric.proto.http.v1.ServerMessage'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_http_v1_ServerMessage(buffer_arg) { + return nitric_proto_http_v1_http_pb.ServerMessage.deserializeBinary(new Uint8Array(buffer_arg)); +} + + +// Service for proxying HTTP requests +var HttpService = exports.HttpService = { + // Proxy an HTTP server +proxy: { + path: '/nitric.proto.http.v1.Http/Proxy', + requestStream: true, + responseStream: true, + requestType: nitric_proto_http_v1_http_pb.ClientMessage, + responseType: nitric_proto_http_v1_http_pb.ServerMessage, + requestSerialize: serialize_nitric_proto_http_v1_ClientMessage, + requestDeserialize: deserialize_nitric_proto_http_v1_ClientMessage, + responseSerialize: serialize_nitric_proto_http_v1_ServerMessage, + responseDeserialize: deserialize_nitric_proto_http_v1_ServerMessage, + }, +}; + +exports.HttpClient = grpc.makeGenericClientConstructor(HttpService); diff --git a/src/gen/nitric/proto/http/v1/http_pb.d.ts b/src/gen/nitric/proto/http/v1/http_pb.d.ts new file mode 100644 index 00000000..6334d02d --- /dev/null +++ b/src/gen/nitric/proto/http/v1/http_pb.d.ts @@ -0,0 +1,63 @@ +// package: nitric.proto.http.v1 +// file: nitric/proto/http/v1/http.proto + +import * as jspb from "google-protobuf"; + +export class ClientMessage extends jspb.Message { + hasRequest(): boolean; + clearRequest(): void; + getRequest(): HttpProxyRequest | undefined; + setRequest(value?: HttpProxyRequest): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ClientMessage.AsObject; + static toObject(includeInstance: boolean, msg: ClientMessage): ClientMessage.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ClientMessage, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ClientMessage; + static deserializeBinaryFromReader(message: ClientMessage, reader: jspb.BinaryReader): ClientMessage; +} + +export namespace ClientMessage { + export type AsObject = { + request?: HttpProxyRequest.AsObject, + } +} + +export class ServerMessage extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ServerMessage.AsObject; + static toObject(includeInstance: boolean, msg: ServerMessage): ServerMessage.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ServerMessage, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ServerMessage; + static deserializeBinaryFromReader(message: ServerMessage, reader: jspb.BinaryReader): ServerMessage; +} + +export namespace ServerMessage { + export type AsObject = { + } +} + +export class HttpProxyRequest extends jspb.Message { + getHost(): string; + setHost(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): HttpProxyRequest.AsObject; + static toObject(includeInstance: boolean, msg: HttpProxyRequest): HttpProxyRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: HttpProxyRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): HttpProxyRequest; + static deserializeBinaryFromReader(message: HttpProxyRequest, reader: jspb.BinaryReader): HttpProxyRequest; +} + +export namespace HttpProxyRequest { + export type AsObject = { + host: string, + } +} + diff --git a/src/gen/nitric/proto/http/v1/http_pb.js b/src/gen/nitric/proto/http/v1/http_pb.js new file mode 100644 index 00000000..b05a3d18 --- /dev/null +++ b/src/gen/nitric/proto/http/v1/http_pb.js @@ -0,0 +1,472 @@ +// source: nitric/proto/http/v1/http.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() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +goog.exportSymbol('proto.nitric.proto.http.v1.ClientMessage', null, global); +goog.exportSymbol('proto.nitric.proto.http.v1.HttpProxyRequest', null, global); +goog.exportSymbol('proto.nitric.proto.http.v1.ServerMessage', 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.nitric.proto.http.v1.ClientMessage = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.http.v1.ClientMessage, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.http.v1.ClientMessage.displayName = 'proto.nitric.proto.http.v1.ClientMessage'; +} +/** + * 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.nitric.proto.http.v1.ServerMessage = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.http.v1.ServerMessage, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.http.v1.ServerMessage.displayName = 'proto.nitric.proto.http.v1.ServerMessage'; +} +/** + * 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.nitric.proto.http.v1.HttpProxyRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.http.v1.HttpProxyRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.http.v1.HttpProxyRequest.displayName = 'proto.nitric.proto.http.v1.HttpProxyRequest'; +} + + + +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.nitric.proto.http.v1.ClientMessage.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.http.v1.ClientMessage.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.nitric.proto.http.v1.ClientMessage} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.http.v1.ClientMessage.toObject = function(includeInstance, msg) { + var f, obj = { + request: (f = msg.getRequest()) && proto.nitric.proto.http.v1.HttpProxyRequest.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.nitric.proto.http.v1.ClientMessage} + */ +proto.nitric.proto.http.v1.ClientMessage.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.http.v1.ClientMessage; + return proto.nitric.proto.http.v1.ClientMessage.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.http.v1.ClientMessage} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.http.v1.ClientMessage} + */ +proto.nitric.proto.http.v1.ClientMessage.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.nitric.proto.http.v1.HttpProxyRequest; + reader.readMessage(value,proto.nitric.proto.http.v1.HttpProxyRequest.deserializeBinaryFromReader); + msg.setRequest(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.http.v1.ClientMessage.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.http.v1.ClientMessage.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.http.v1.ClientMessage} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.http.v1.ClientMessage.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRequest(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.nitric.proto.http.v1.HttpProxyRequest.serializeBinaryToWriter + ); + } +}; + + +/** + * optional HttpProxyRequest request = 1; + * @return {?proto.nitric.proto.http.v1.HttpProxyRequest} + */ +proto.nitric.proto.http.v1.ClientMessage.prototype.getRequest = function() { + return /** @type{?proto.nitric.proto.http.v1.HttpProxyRequest} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.http.v1.HttpProxyRequest, 1)); +}; + + +/** + * @param {?proto.nitric.proto.http.v1.HttpProxyRequest|undefined} value + * @return {!proto.nitric.proto.http.v1.ClientMessage} returns this +*/ +proto.nitric.proto.http.v1.ClientMessage.prototype.setRequest = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.http.v1.ClientMessage} returns this + */ +proto.nitric.proto.http.v1.ClientMessage.prototype.clearRequest = function() { + return this.setRequest(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.http.v1.ClientMessage.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.nitric.proto.http.v1.ServerMessage.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.http.v1.ServerMessage.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.nitric.proto.http.v1.ServerMessage} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.http.v1.ServerMessage.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.proto.http.v1.ServerMessage} + */ +proto.nitric.proto.http.v1.ServerMessage.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.http.v1.ServerMessage; + return proto.nitric.proto.http.v1.ServerMessage.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.http.v1.ServerMessage} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.http.v1.ServerMessage} + */ +proto.nitric.proto.http.v1.ServerMessage.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.http.v1.ServerMessage.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.http.v1.ServerMessage.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.http.v1.ServerMessage} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.http.v1.ServerMessage.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +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.nitric.proto.http.v1.HttpProxyRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.http.v1.HttpProxyRequest.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.nitric.proto.http.v1.HttpProxyRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.http.v1.HttpProxyRequest.toObject = function(includeInstance, msg) { + var f, obj = { + host: 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.nitric.proto.http.v1.HttpProxyRequest} + */ +proto.nitric.proto.http.v1.HttpProxyRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.http.v1.HttpProxyRequest; + return proto.nitric.proto.http.v1.HttpProxyRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.http.v1.HttpProxyRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.http.v1.HttpProxyRequest} + */ +proto.nitric.proto.http.v1.HttpProxyRequest.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.setHost(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.http.v1.HttpProxyRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.http.v1.HttpProxyRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.http.v1.HttpProxyRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.http.v1.HttpProxyRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getHost(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string host = 1; + * @return {string} + */ +proto.nitric.proto.http.v1.HttpProxyRequest.prototype.getHost = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.http.v1.HttpProxyRequest} returns this + */ +proto.nitric.proto.http.v1.HttpProxyRequest.prototype.setHost = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +goog.object.extend(exports, proto.nitric.proto.http.v1); diff --git a/src/gen/nitric/proto/keyvalue/v1/keyvalue_grpc_pb.d.ts b/src/gen/nitric/proto/keyvalue/v1/keyvalue_grpc_pb.d.ts new file mode 100644 index 00000000..4c9fc065 --- /dev/null +++ b/src/gen/nitric/proto/keyvalue/v1/keyvalue_grpc_pb.d.ts @@ -0,0 +1,34 @@ +// GENERATED CODE -- DO NOT EDIT! + +// package: nitric.proto.KeyValue.v1 +// file: nitric/proto/keyvalue/v1/keyvalue.proto + +import * as nitric_proto_keyvalue_v1_keyvalue_pb from "../../../../nitric/proto/keyvalue/v1/keyvalue_pb"; +import * as grpc from "@grpc/grpc-js"; + +interface IKeyValueService extends grpc.ServiceDefinition { + get: grpc.MethodDefinition; + set: grpc.MethodDefinition; + delete: grpc.MethodDefinition; +} + +export const KeyValueService: IKeyValueService; + +export interface IKeyValueServer extends grpc.UntypedServiceImplementation { + get: grpc.handleUnaryCall; + set: grpc.handleUnaryCall; + delete: grpc.handleUnaryCall; +} + +export class KeyValueClient extends grpc.Client { + constructor(address: string, credentials: grpc.ChannelCredentials, options?: object); + get(argument: nitric_proto_keyvalue_v1_keyvalue_pb.KeyValueGetRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + get(argument: nitric_proto_keyvalue_v1_keyvalue_pb.KeyValueGetRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + get(argument: nitric_proto_keyvalue_v1_keyvalue_pb.KeyValueGetRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + set(argument: nitric_proto_keyvalue_v1_keyvalue_pb.KeyValueSetRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + set(argument: nitric_proto_keyvalue_v1_keyvalue_pb.KeyValueSetRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + set(argument: nitric_proto_keyvalue_v1_keyvalue_pb.KeyValueSetRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + delete(argument: nitric_proto_keyvalue_v1_keyvalue_pb.KeyValueDeleteRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + delete(argument: nitric_proto_keyvalue_v1_keyvalue_pb.KeyValueDeleteRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + delete(argument: nitric_proto_keyvalue_v1_keyvalue_pb.KeyValueDeleteRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; +} diff --git a/src/gen/nitric/proto/keyvalue/v1/keyvalue_grpc_pb.js b/src/gen/nitric/proto/keyvalue/v1/keyvalue_grpc_pb.js new file mode 100644 index 00000000..60a8caca --- /dev/null +++ b/src/gen/nitric/proto/keyvalue/v1/keyvalue_grpc_pb.js @@ -0,0 +1,115 @@ +// GENERATED CODE -- DO NOT EDIT! + +'use strict'; +var grpc = require('@grpc/grpc-js'); +var nitric_proto_keyvalue_v1_keyvalue_pb = require('../../../../nitric/proto/keyvalue/v1/keyvalue_pb.js'); +var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js'); + +function serialize_nitric_proto_KeyValue_v1_KeyValueDeleteRequest(arg) { + if (!(arg instanceof nitric_proto_keyvalue_v1_keyvalue_pb.KeyValueDeleteRequest)) { + throw new Error('Expected argument of type nitric.proto.KeyValue.v1.KeyValueDeleteRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_KeyValue_v1_KeyValueDeleteRequest(buffer_arg) { + return nitric_proto_keyvalue_v1_keyvalue_pb.KeyValueDeleteRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_KeyValue_v1_KeyValueDeleteResponse(arg) { + if (!(arg instanceof nitric_proto_keyvalue_v1_keyvalue_pb.KeyValueDeleteResponse)) { + throw new Error('Expected argument of type nitric.proto.KeyValue.v1.KeyValueDeleteResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_KeyValue_v1_KeyValueDeleteResponse(buffer_arg) { + return nitric_proto_keyvalue_v1_keyvalue_pb.KeyValueDeleteResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_KeyValue_v1_KeyValueGetRequest(arg) { + if (!(arg instanceof nitric_proto_keyvalue_v1_keyvalue_pb.KeyValueGetRequest)) { + throw new Error('Expected argument of type nitric.proto.KeyValue.v1.KeyValueGetRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_KeyValue_v1_KeyValueGetRequest(buffer_arg) { + return nitric_proto_keyvalue_v1_keyvalue_pb.KeyValueGetRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_KeyValue_v1_KeyValueGetResponse(arg) { + if (!(arg instanceof nitric_proto_keyvalue_v1_keyvalue_pb.KeyValueGetResponse)) { + throw new Error('Expected argument of type nitric.proto.KeyValue.v1.KeyValueGetResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_KeyValue_v1_KeyValueGetResponse(buffer_arg) { + return nitric_proto_keyvalue_v1_keyvalue_pb.KeyValueGetResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_KeyValue_v1_KeyValueSetRequest(arg) { + if (!(arg instanceof nitric_proto_keyvalue_v1_keyvalue_pb.KeyValueSetRequest)) { + throw new Error('Expected argument of type nitric.proto.KeyValue.v1.KeyValueSetRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_KeyValue_v1_KeyValueSetRequest(buffer_arg) { + return nitric_proto_keyvalue_v1_keyvalue_pb.KeyValueSetRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_KeyValue_v1_KeyValueSetResponse(arg) { + if (!(arg instanceof nitric_proto_keyvalue_v1_keyvalue_pb.KeyValueSetResponse)) { + throw new Error('Expected argument of type nitric.proto.KeyValue.v1.KeyValueSetResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_KeyValue_v1_KeyValueSetResponse(buffer_arg) { + return nitric_proto_keyvalue_v1_keyvalue_pb.KeyValueSetResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + + +// Service for storage and retrieval of simple JSON keyValue +var KeyValueService = exports.KeyValueService = { + // Get an existing value +get: { + path: '/nitric.proto.KeyValue.v1.KeyValue/Get', + requestStream: false, + responseStream: false, + requestType: nitric_proto_keyvalue_v1_keyvalue_pb.KeyValueGetRequest, + responseType: nitric_proto_keyvalue_v1_keyvalue_pb.KeyValueGetResponse, + requestSerialize: serialize_nitric_proto_KeyValue_v1_KeyValueGetRequest, + requestDeserialize: deserialize_nitric_proto_KeyValue_v1_KeyValueGetRequest, + responseSerialize: serialize_nitric_proto_KeyValue_v1_KeyValueGetResponse, + responseDeserialize: deserialize_nitric_proto_KeyValue_v1_KeyValueGetResponse, + }, + // Create a new or overwrite an existing value +set: { + path: '/nitric.proto.KeyValue.v1.KeyValue/Set', + requestStream: false, + responseStream: false, + requestType: nitric_proto_keyvalue_v1_keyvalue_pb.KeyValueSetRequest, + responseType: nitric_proto_keyvalue_v1_keyvalue_pb.KeyValueSetResponse, + requestSerialize: serialize_nitric_proto_KeyValue_v1_KeyValueSetRequest, + requestDeserialize: deserialize_nitric_proto_KeyValue_v1_KeyValueSetRequest, + responseSerialize: serialize_nitric_proto_KeyValue_v1_KeyValueSetResponse, + responseDeserialize: deserialize_nitric_proto_KeyValue_v1_KeyValueSetResponse, + }, + // Delete a key and its value +delete: { + path: '/nitric.proto.KeyValue.v1.KeyValue/Delete', + requestStream: false, + responseStream: false, + requestType: nitric_proto_keyvalue_v1_keyvalue_pb.KeyValueDeleteRequest, + responseType: nitric_proto_keyvalue_v1_keyvalue_pb.KeyValueDeleteResponse, + requestSerialize: serialize_nitric_proto_KeyValue_v1_KeyValueDeleteRequest, + requestDeserialize: deserialize_nitric_proto_KeyValue_v1_KeyValueDeleteRequest, + responseSerialize: serialize_nitric_proto_KeyValue_v1_KeyValueDeleteResponse, + responseDeserialize: deserialize_nitric_proto_KeyValue_v1_KeyValueDeleteResponse, + }, +}; + +exports.KeyValueClient = grpc.makeGenericClientConstructor(KeyValueService); diff --git a/src/gen/nitric/proto/keyvalue/v1/keyvalue_pb.d.ts b/src/gen/nitric/proto/keyvalue/v1/keyvalue_pb.d.ts new file mode 100644 index 00000000..e0bd0bb7 --- /dev/null +++ b/src/gen/nitric/proto/keyvalue/v1/keyvalue_pb.d.ts @@ -0,0 +1,204 @@ +// package: nitric.proto.KeyValue.v1 +// file: nitric/proto/keyvalue/v1/keyvalue.proto + +import * as jspb from "google-protobuf"; +import * as google_protobuf_struct_pb from "google-protobuf/google/protobuf/struct_pb"; + +export class Store extends jspb.Message { + getName(): string; + setName(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Store.AsObject; + static toObject(includeInstance: boolean, msg: Store): Store.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Store, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Store; + static deserializeBinaryFromReader(message: Store, reader: jspb.BinaryReader): Store; +} + +export namespace Store { + export type AsObject = { + name: string, + } +} + +export class ValueRef extends jspb.Message { + getStore(): string; + setStore(value: string): void; + + getKey(): string; + setKey(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ValueRef.AsObject; + static toObject(includeInstance: boolean, msg: ValueRef): ValueRef.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ValueRef, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ValueRef; + static deserializeBinaryFromReader(message: ValueRef, reader: jspb.BinaryReader): ValueRef; +} + +export namespace ValueRef { + export type AsObject = { + store: string, + key: string, + } +} + +export class Value extends jspb.Message { + hasRef(): boolean; + clearRef(): void; + getRef(): ValueRef | undefined; + setRef(value?: ValueRef): void; + + hasContent(): boolean; + clearContent(): void; + getContent(): google_protobuf_struct_pb.Struct | undefined; + setContent(value?: google_protobuf_struct_pb.Struct): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Value.AsObject; + static toObject(includeInstance: boolean, msg: Value): Value.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Value, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Value; + static deserializeBinaryFromReader(message: Value, reader: jspb.BinaryReader): Value; +} + +export namespace Value { + export type AsObject = { + ref?: ValueRef.AsObject, + content?: google_protobuf_struct_pb.Struct.AsObject, + } +} + +export class KeyValueGetRequest extends jspb.Message { + hasRef(): boolean; + clearRef(): void; + getRef(): ValueRef | undefined; + setRef(value?: ValueRef): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): KeyValueGetRequest.AsObject; + static toObject(includeInstance: boolean, msg: KeyValueGetRequest): KeyValueGetRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: KeyValueGetRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): KeyValueGetRequest; + static deserializeBinaryFromReader(message: KeyValueGetRequest, reader: jspb.BinaryReader): KeyValueGetRequest; +} + +export namespace KeyValueGetRequest { + export type AsObject = { + ref?: ValueRef.AsObject, + } +} + +export class KeyValueGetResponse extends jspb.Message { + hasValue(): boolean; + clearValue(): void; + getValue(): Value | undefined; + setValue(value?: Value): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): KeyValueGetResponse.AsObject; + static toObject(includeInstance: boolean, msg: KeyValueGetResponse): KeyValueGetResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: KeyValueGetResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): KeyValueGetResponse; + static deserializeBinaryFromReader(message: KeyValueGetResponse, reader: jspb.BinaryReader): KeyValueGetResponse; +} + +export namespace KeyValueGetResponse { + export type AsObject = { + value?: Value.AsObject, + } +} + +export class KeyValueSetRequest extends jspb.Message { + hasRef(): boolean; + clearRef(): void; + getRef(): ValueRef | undefined; + setRef(value?: ValueRef): void; + + hasContent(): boolean; + clearContent(): void; + getContent(): google_protobuf_struct_pb.Struct | undefined; + setContent(value?: google_protobuf_struct_pb.Struct): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): KeyValueSetRequest.AsObject; + static toObject(includeInstance: boolean, msg: KeyValueSetRequest): KeyValueSetRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: KeyValueSetRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): KeyValueSetRequest; + static deserializeBinaryFromReader(message: KeyValueSetRequest, reader: jspb.BinaryReader): KeyValueSetRequest; +} + +export namespace KeyValueSetRequest { + export type AsObject = { + ref?: ValueRef.AsObject, + content?: google_protobuf_struct_pb.Struct.AsObject, + } +} + +export class KeyValueSetResponse extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): KeyValueSetResponse.AsObject; + static toObject(includeInstance: boolean, msg: KeyValueSetResponse): KeyValueSetResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: KeyValueSetResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): KeyValueSetResponse; + static deserializeBinaryFromReader(message: KeyValueSetResponse, reader: jspb.BinaryReader): KeyValueSetResponse; +} + +export namespace KeyValueSetResponse { + export type AsObject = { + } +} + +export class KeyValueDeleteRequest extends jspb.Message { + hasRef(): boolean; + clearRef(): void; + getRef(): ValueRef | undefined; + setRef(value?: ValueRef): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): KeyValueDeleteRequest.AsObject; + static toObject(includeInstance: boolean, msg: KeyValueDeleteRequest): KeyValueDeleteRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: KeyValueDeleteRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): KeyValueDeleteRequest; + static deserializeBinaryFromReader(message: KeyValueDeleteRequest, reader: jspb.BinaryReader): KeyValueDeleteRequest; +} + +export namespace KeyValueDeleteRequest { + export type AsObject = { + ref?: ValueRef.AsObject, + } +} + +export class KeyValueDeleteResponse extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): KeyValueDeleteResponse.AsObject; + static toObject(includeInstance: boolean, msg: KeyValueDeleteResponse): KeyValueDeleteResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: KeyValueDeleteResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): KeyValueDeleteResponse; + static deserializeBinaryFromReader(message: KeyValueDeleteResponse, reader: jspb.BinaryReader): KeyValueDeleteResponse; +} + +export namespace KeyValueDeleteResponse { + export type AsObject = { + } +} + diff --git a/src/gen/nitric/proto/keyvalue/v1/keyvalue_pb.js b/src/gen/nitric/proto/keyvalue/v1/keyvalue_pb.js new file mode 100644 index 00000000..a642d9ab --- /dev/null +++ b/src/gen/nitric/proto/keyvalue/v1/keyvalue_pb.js @@ -0,0 +1,1573 @@ +// source: nitric/proto/keyvalue/v1/keyvalue.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() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js'); +goog.object.extend(proto, google_protobuf_struct_pb); +goog.exportSymbol('proto.nitric.proto.KeyValue.v1.KeyValueDeleteRequest', null, global); +goog.exportSymbol('proto.nitric.proto.KeyValue.v1.KeyValueDeleteResponse', null, global); +goog.exportSymbol('proto.nitric.proto.KeyValue.v1.KeyValueGetRequest', null, global); +goog.exportSymbol('proto.nitric.proto.KeyValue.v1.KeyValueGetResponse', null, global); +goog.exportSymbol('proto.nitric.proto.KeyValue.v1.KeyValueSetRequest', null, global); +goog.exportSymbol('proto.nitric.proto.KeyValue.v1.KeyValueSetResponse', null, global); +goog.exportSymbol('proto.nitric.proto.KeyValue.v1.Store', null, global); +goog.exportSymbol('proto.nitric.proto.KeyValue.v1.Value', null, global); +goog.exportSymbol('proto.nitric.proto.KeyValue.v1.ValueRef', 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.nitric.proto.KeyValue.v1.Store = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.KeyValue.v1.Store, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.KeyValue.v1.Store.displayName = 'proto.nitric.proto.KeyValue.v1.Store'; +} +/** + * 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.nitric.proto.KeyValue.v1.ValueRef = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.KeyValue.v1.ValueRef, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.KeyValue.v1.ValueRef.displayName = 'proto.nitric.proto.KeyValue.v1.ValueRef'; +} +/** + * 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.nitric.proto.KeyValue.v1.Value = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.KeyValue.v1.Value, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.KeyValue.v1.Value.displayName = 'proto.nitric.proto.KeyValue.v1.Value'; +} +/** + * 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.nitric.proto.KeyValue.v1.KeyValueGetRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.KeyValue.v1.KeyValueGetRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.KeyValue.v1.KeyValueGetRequest.displayName = 'proto.nitric.proto.KeyValue.v1.KeyValueGetRequest'; +} +/** + * 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.nitric.proto.KeyValue.v1.KeyValueGetResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.KeyValue.v1.KeyValueGetResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.KeyValue.v1.KeyValueGetResponse.displayName = 'proto.nitric.proto.KeyValue.v1.KeyValueGetResponse'; +} +/** + * 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.nitric.proto.KeyValue.v1.KeyValueSetRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.KeyValue.v1.KeyValueSetRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.KeyValue.v1.KeyValueSetRequest.displayName = 'proto.nitric.proto.KeyValue.v1.KeyValueSetRequest'; +} +/** + * 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.nitric.proto.KeyValue.v1.KeyValueSetResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.KeyValue.v1.KeyValueSetResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.KeyValue.v1.KeyValueSetResponse.displayName = 'proto.nitric.proto.KeyValue.v1.KeyValueSetResponse'; +} +/** + * 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.nitric.proto.KeyValue.v1.KeyValueDeleteRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.KeyValue.v1.KeyValueDeleteRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.KeyValue.v1.KeyValueDeleteRequest.displayName = 'proto.nitric.proto.KeyValue.v1.KeyValueDeleteRequest'; +} +/** + * 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.nitric.proto.KeyValue.v1.KeyValueDeleteResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.KeyValue.v1.KeyValueDeleteResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.KeyValue.v1.KeyValueDeleteResponse.displayName = 'proto.nitric.proto.KeyValue.v1.KeyValueDeleteResponse'; +} + + + +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.nitric.proto.KeyValue.v1.Store.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.KeyValue.v1.Store.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.nitric.proto.KeyValue.v1.Store} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.KeyValue.v1.Store.toObject = function(includeInstance, msg) { + var f, obj = { + name: 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.nitric.proto.KeyValue.v1.Store} + */ +proto.nitric.proto.KeyValue.v1.Store.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.KeyValue.v1.Store; + return proto.nitric.proto.KeyValue.v1.Store.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.KeyValue.v1.Store} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.KeyValue.v1.Store} + */ +proto.nitric.proto.KeyValue.v1.Store.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; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.KeyValue.v1.Store.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.KeyValue.v1.Store.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.KeyValue.v1.Store} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.KeyValue.v1.Store.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.nitric.proto.KeyValue.v1.Store.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.KeyValue.v1.Store} returns this + */ +proto.nitric.proto.KeyValue.v1.Store.prototype.setName = 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.nitric.proto.KeyValue.v1.ValueRef.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.KeyValue.v1.ValueRef.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.nitric.proto.KeyValue.v1.ValueRef} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.KeyValue.v1.ValueRef.toObject = function(includeInstance, msg) { + var f, obj = { + store: jspb.Message.getFieldWithDefault(msg, 1, ""), + key: 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.nitric.proto.KeyValue.v1.ValueRef} + */ +proto.nitric.proto.KeyValue.v1.ValueRef.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.KeyValue.v1.ValueRef; + return proto.nitric.proto.KeyValue.v1.ValueRef.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.KeyValue.v1.ValueRef} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.KeyValue.v1.ValueRef} + */ +proto.nitric.proto.KeyValue.v1.ValueRef.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.setStore(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setKey(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.KeyValue.v1.ValueRef.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.KeyValue.v1.ValueRef.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.KeyValue.v1.ValueRef} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.KeyValue.v1.ValueRef.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStore(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getKey(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional string store = 1; + * @return {string} + */ +proto.nitric.proto.KeyValue.v1.ValueRef.prototype.getStore = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.KeyValue.v1.ValueRef} returns this + */ +proto.nitric.proto.KeyValue.v1.ValueRef.prototype.setStore = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string key = 2; + * @return {string} + */ +proto.nitric.proto.KeyValue.v1.ValueRef.prototype.getKey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.KeyValue.v1.ValueRef} returns this + */ +proto.nitric.proto.KeyValue.v1.ValueRef.prototype.setKey = 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.nitric.proto.KeyValue.v1.Value.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.KeyValue.v1.Value.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.nitric.proto.KeyValue.v1.Value} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.KeyValue.v1.Value.toObject = function(includeInstance, msg) { + var f, obj = { + ref: (f = msg.getRef()) && proto.nitric.proto.KeyValue.v1.ValueRef.toObject(includeInstance, f), + content: (f = msg.getContent()) && google_protobuf_struct_pb.Struct.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.nitric.proto.KeyValue.v1.Value} + */ +proto.nitric.proto.KeyValue.v1.Value.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.KeyValue.v1.Value; + return proto.nitric.proto.KeyValue.v1.Value.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.KeyValue.v1.Value} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.KeyValue.v1.Value} + */ +proto.nitric.proto.KeyValue.v1.Value.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.nitric.proto.KeyValue.v1.ValueRef; + reader.readMessage(value,proto.nitric.proto.KeyValue.v1.ValueRef.deserializeBinaryFromReader); + msg.setRef(value); + break; + case 2: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setContent(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.KeyValue.v1.Value.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.KeyValue.v1.Value.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.KeyValue.v1.Value} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.KeyValue.v1.Value.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRef(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.nitric.proto.KeyValue.v1.ValueRef.serializeBinaryToWriter + ); + } + f = message.getContent(); + if (f != null) { + writer.writeMessage( + 2, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } +}; + + +/** + * optional ValueRef ref = 1; + * @return {?proto.nitric.proto.KeyValue.v1.ValueRef} + */ +proto.nitric.proto.KeyValue.v1.Value.prototype.getRef = function() { + return /** @type{?proto.nitric.proto.KeyValue.v1.ValueRef} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.KeyValue.v1.ValueRef, 1)); +}; + + +/** + * @param {?proto.nitric.proto.KeyValue.v1.ValueRef|undefined} value + * @return {!proto.nitric.proto.KeyValue.v1.Value} returns this +*/ +proto.nitric.proto.KeyValue.v1.Value.prototype.setRef = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.KeyValue.v1.Value} returns this + */ +proto.nitric.proto.KeyValue.v1.Value.prototype.clearRef = function() { + return this.setRef(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.KeyValue.v1.Value.prototype.hasRef = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional google.protobuf.Struct content = 2; + * @return {?proto.google.protobuf.Struct} + */ +proto.nitric.proto.KeyValue.v1.Value.prototype.getContent = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 2)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.nitric.proto.KeyValue.v1.Value} returns this +*/ +proto.nitric.proto.KeyValue.v1.Value.prototype.setContent = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.KeyValue.v1.Value} returns this + */ +proto.nitric.proto.KeyValue.v1.Value.prototype.clearContent = function() { + return this.setContent(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.KeyValue.v1.Value.prototype.hasContent = 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.nitric.proto.KeyValue.v1.KeyValueGetRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.KeyValue.v1.KeyValueGetRequest.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.nitric.proto.KeyValue.v1.KeyValueGetRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.KeyValue.v1.KeyValueGetRequest.toObject = function(includeInstance, msg) { + var f, obj = { + ref: (f = msg.getRef()) && proto.nitric.proto.KeyValue.v1.ValueRef.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.nitric.proto.KeyValue.v1.KeyValueGetRequest} + */ +proto.nitric.proto.KeyValue.v1.KeyValueGetRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.KeyValue.v1.KeyValueGetRequest; + return proto.nitric.proto.KeyValue.v1.KeyValueGetRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.KeyValue.v1.KeyValueGetRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.KeyValue.v1.KeyValueGetRequest} + */ +proto.nitric.proto.KeyValue.v1.KeyValueGetRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.nitric.proto.KeyValue.v1.ValueRef; + reader.readMessage(value,proto.nitric.proto.KeyValue.v1.ValueRef.deserializeBinaryFromReader); + msg.setRef(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.KeyValue.v1.KeyValueGetRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.KeyValue.v1.KeyValueGetRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.KeyValue.v1.KeyValueGetRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.KeyValue.v1.KeyValueGetRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRef(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.nitric.proto.KeyValue.v1.ValueRef.serializeBinaryToWriter + ); + } +}; + + +/** + * optional ValueRef ref = 1; + * @return {?proto.nitric.proto.KeyValue.v1.ValueRef} + */ +proto.nitric.proto.KeyValue.v1.KeyValueGetRequest.prototype.getRef = function() { + return /** @type{?proto.nitric.proto.KeyValue.v1.ValueRef} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.KeyValue.v1.ValueRef, 1)); +}; + + +/** + * @param {?proto.nitric.proto.KeyValue.v1.ValueRef|undefined} value + * @return {!proto.nitric.proto.KeyValue.v1.KeyValueGetRequest} returns this +*/ +proto.nitric.proto.KeyValue.v1.KeyValueGetRequest.prototype.setRef = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.KeyValue.v1.KeyValueGetRequest} returns this + */ +proto.nitric.proto.KeyValue.v1.KeyValueGetRequest.prototype.clearRef = function() { + return this.setRef(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.KeyValue.v1.KeyValueGetRequest.prototype.hasRef = 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.nitric.proto.KeyValue.v1.KeyValueGetResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.KeyValue.v1.KeyValueGetResponse.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.nitric.proto.KeyValue.v1.KeyValueGetResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.KeyValue.v1.KeyValueGetResponse.toObject = function(includeInstance, msg) { + var f, obj = { + value: (f = msg.getValue()) && proto.nitric.proto.KeyValue.v1.Value.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.nitric.proto.KeyValue.v1.KeyValueGetResponse} + */ +proto.nitric.proto.KeyValue.v1.KeyValueGetResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.KeyValue.v1.KeyValueGetResponse; + return proto.nitric.proto.KeyValue.v1.KeyValueGetResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.KeyValue.v1.KeyValueGetResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.KeyValue.v1.KeyValueGetResponse} + */ +proto.nitric.proto.KeyValue.v1.KeyValueGetResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.nitric.proto.KeyValue.v1.Value; + reader.readMessage(value,proto.nitric.proto.KeyValue.v1.Value.deserializeBinaryFromReader); + msg.setValue(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.KeyValue.v1.KeyValueGetResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.KeyValue.v1.KeyValueGetResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.KeyValue.v1.KeyValueGetResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.KeyValue.v1.KeyValueGetResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getValue(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.nitric.proto.KeyValue.v1.Value.serializeBinaryToWriter + ); + } +}; + + +/** + * optional Value value = 1; + * @return {?proto.nitric.proto.KeyValue.v1.Value} + */ +proto.nitric.proto.KeyValue.v1.KeyValueGetResponse.prototype.getValue = function() { + return /** @type{?proto.nitric.proto.KeyValue.v1.Value} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.KeyValue.v1.Value, 1)); +}; + + +/** + * @param {?proto.nitric.proto.KeyValue.v1.Value|undefined} value + * @return {!proto.nitric.proto.KeyValue.v1.KeyValueGetResponse} returns this +*/ +proto.nitric.proto.KeyValue.v1.KeyValueGetResponse.prototype.setValue = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.KeyValue.v1.KeyValueGetResponse} returns this + */ +proto.nitric.proto.KeyValue.v1.KeyValueGetResponse.prototype.clearValue = function() { + return this.setValue(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.KeyValue.v1.KeyValueGetResponse.prototype.hasValue = 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.nitric.proto.KeyValue.v1.KeyValueSetRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.KeyValue.v1.KeyValueSetRequest.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.nitric.proto.KeyValue.v1.KeyValueSetRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.KeyValue.v1.KeyValueSetRequest.toObject = function(includeInstance, msg) { + var f, obj = { + ref: (f = msg.getRef()) && proto.nitric.proto.KeyValue.v1.ValueRef.toObject(includeInstance, f), + content: (f = msg.getContent()) && google_protobuf_struct_pb.Struct.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.nitric.proto.KeyValue.v1.KeyValueSetRequest} + */ +proto.nitric.proto.KeyValue.v1.KeyValueSetRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.KeyValue.v1.KeyValueSetRequest; + return proto.nitric.proto.KeyValue.v1.KeyValueSetRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.KeyValue.v1.KeyValueSetRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.KeyValue.v1.KeyValueSetRequest} + */ +proto.nitric.proto.KeyValue.v1.KeyValueSetRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.nitric.proto.KeyValue.v1.ValueRef; + reader.readMessage(value,proto.nitric.proto.KeyValue.v1.ValueRef.deserializeBinaryFromReader); + msg.setRef(value); + break; + case 3: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setContent(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.KeyValue.v1.KeyValueSetRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.KeyValue.v1.KeyValueSetRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.KeyValue.v1.KeyValueSetRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.KeyValue.v1.KeyValueSetRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRef(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.nitric.proto.KeyValue.v1.ValueRef.serializeBinaryToWriter + ); + } + f = message.getContent(); + if (f != null) { + writer.writeMessage( + 3, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } +}; + + +/** + * optional ValueRef ref = 1; + * @return {?proto.nitric.proto.KeyValue.v1.ValueRef} + */ +proto.nitric.proto.KeyValue.v1.KeyValueSetRequest.prototype.getRef = function() { + return /** @type{?proto.nitric.proto.KeyValue.v1.ValueRef} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.KeyValue.v1.ValueRef, 1)); +}; + + +/** + * @param {?proto.nitric.proto.KeyValue.v1.ValueRef|undefined} value + * @return {!proto.nitric.proto.KeyValue.v1.KeyValueSetRequest} returns this +*/ +proto.nitric.proto.KeyValue.v1.KeyValueSetRequest.prototype.setRef = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.KeyValue.v1.KeyValueSetRequest} returns this + */ +proto.nitric.proto.KeyValue.v1.KeyValueSetRequest.prototype.clearRef = function() { + return this.setRef(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.KeyValue.v1.KeyValueSetRequest.prototype.hasRef = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional google.protobuf.Struct content = 3; + * @return {?proto.google.protobuf.Struct} + */ +proto.nitric.proto.KeyValue.v1.KeyValueSetRequest.prototype.getContent = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 3)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.nitric.proto.KeyValue.v1.KeyValueSetRequest} returns this +*/ +proto.nitric.proto.KeyValue.v1.KeyValueSetRequest.prototype.setContent = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.KeyValue.v1.KeyValueSetRequest} returns this + */ +proto.nitric.proto.KeyValue.v1.KeyValueSetRequest.prototype.clearContent = function() { + return this.setContent(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.KeyValue.v1.KeyValueSetRequest.prototype.hasContent = 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.nitric.proto.KeyValue.v1.KeyValueSetResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.KeyValue.v1.KeyValueSetResponse.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.nitric.proto.KeyValue.v1.KeyValueSetResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.KeyValue.v1.KeyValueSetResponse.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.proto.KeyValue.v1.KeyValueSetResponse} + */ +proto.nitric.proto.KeyValue.v1.KeyValueSetResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.KeyValue.v1.KeyValueSetResponse; + return proto.nitric.proto.KeyValue.v1.KeyValueSetResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.KeyValue.v1.KeyValueSetResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.KeyValue.v1.KeyValueSetResponse} + */ +proto.nitric.proto.KeyValue.v1.KeyValueSetResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.KeyValue.v1.KeyValueSetResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.KeyValue.v1.KeyValueSetResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.KeyValue.v1.KeyValueSetResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.KeyValue.v1.KeyValueSetResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +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.nitric.proto.KeyValue.v1.KeyValueDeleteRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.KeyValue.v1.KeyValueDeleteRequest.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.nitric.proto.KeyValue.v1.KeyValueDeleteRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.KeyValue.v1.KeyValueDeleteRequest.toObject = function(includeInstance, msg) { + var f, obj = { + ref: (f = msg.getRef()) && proto.nitric.proto.KeyValue.v1.ValueRef.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.nitric.proto.KeyValue.v1.KeyValueDeleteRequest} + */ +proto.nitric.proto.KeyValue.v1.KeyValueDeleteRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.KeyValue.v1.KeyValueDeleteRequest; + return proto.nitric.proto.KeyValue.v1.KeyValueDeleteRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.KeyValue.v1.KeyValueDeleteRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.KeyValue.v1.KeyValueDeleteRequest} + */ +proto.nitric.proto.KeyValue.v1.KeyValueDeleteRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.nitric.proto.KeyValue.v1.ValueRef; + reader.readMessage(value,proto.nitric.proto.KeyValue.v1.ValueRef.deserializeBinaryFromReader); + msg.setRef(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.KeyValue.v1.KeyValueDeleteRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.KeyValue.v1.KeyValueDeleteRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.KeyValue.v1.KeyValueDeleteRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.KeyValue.v1.KeyValueDeleteRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRef(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.nitric.proto.KeyValue.v1.ValueRef.serializeBinaryToWriter + ); + } +}; + + +/** + * optional ValueRef ref = 1; + * @return {?proto.nitric.proto.KeyValue.v1.ValueRef} + */ +proto.nitric.proto.KeyValue.v1.KeyValueDeleteRequest.prototype.getRef = function() { + return /** @type{?proto.nitric.proto.KeyValue.v1.ValueRef} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.KeyValue.v1.ValueRef, 1)); +}; + + +/** + * @param {?proto.nitric.proto.KeyValue.v1.ValueRef|undefined} value + * @return {!proto.nitric.proto.KeyValue.v1.KeyValueDeleteRequest} returns this +*/ +proto.nitric.proto.KeyValue.v1.KeyValueDeleteRequest.prototype.setRef = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.KeyValue.v1.KeyValueDeleteRequest} returns this + */ +proto.nitric.proto.KeyValue.v1.KeyValueDeleteRequest.prototype.clearRef = function() { + return this.setRef(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.KeyValue.v1.KeyValueDeleteRequest.prototype.hasRef = 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.nitric.proto.KeyValue.v1.KeyValueDeleteResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.KeyValue.v1.KeyValueDeleteResponse.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.nitric.proto.KeyValue.v1.KeyValueDeleteResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.KeyValue.v1.KeyValueDeleteResponse.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.proto.KeyValue.v1.KeyValueDeleteResponse} + */ +proto.nitric.proto.KeyValue.v1.KeyValueDeleteResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.KeyValue.v1.KeyValueDeleteResponse; + return proto.nitric.proto.KeyValue.v1.KeyValueDeleteResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.KeyValue.v1.KeyValueDeleteResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.KeyValue.v1.KeyValueDeleteResponse} + */ +proto.nitric.proto.KeyValue.v1.KeyValueDeleteResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.KeyValue.v1.KeyValueDeleteResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.KeyValue.v1.KeyValueDeleteResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.KeyValue.v1.KeyValueDeleteResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.KeyValue.v1.KeyValueDeleteResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + +goog.object.extend(exports, proto.nitric.proto.KeyValue.v1); diff --git a/src/gen/nitric/proto/queues/v1/queues_grpc_pb.d.ts b/src/gen/nitric/proto/queues/v1/queues_grpc_pb.d.ts new file mode 100644 index 00000000..e2bf508a --- /dev/null +++ b/src/gen/nitric/proto/queues/v1/queues_grpc_pb.d.ts @@ -0,0 +1,34 @@ +// GENERATED CODE -- DO NOT EDIT! + +// package: nitric.proto.queues.v1 +// file: nitric/proto/queues/v1/queues.proto + +import * as nitric_proto_queues_v1_queues_pb from "../../../../nitric/proto/queues/v1/queues_pb"; +import * as grpc from "@grpc/grpc-js"; + +interface IQueuesService extends grpc.ServiceDefinition { + enqueue: grpc.MethodDefinition; + dequeue: grpc.MethodDefinition; + complete: grpc.MethodDefinition; +} + +export const QueuesService: IQueuesService; + +export interface IQueuesServer extends grpc.UntypedServiceImplementation { + enqueue: grpc.handleUnaryCall; + dequeue: grpc.handleUnaryCall; + complete: grpc.handleUnaryCall; +} + +export class QueuesClient extends grpc.Client { + constructor(address: string, credentials: grpc.ChannelCredentials, options?: object); + enqueue(argument: nitric_proto_queues_v1_queues_pb.QueueEnqueueRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + enqueue(argument: nitric_proto_queues_v1_queues_pb.QueueEnqueueRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + enqueue(argument: nitric_proto_queues_v1_queues_pb.QueueEnqueueRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + dequeue(argument: nitric_proto_queues_v1_queues_pb.QueueDequeueRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + dequeue(argument: nitric_proto_queues_v1_queues_pb.QueueDequeueRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + dequeue(argument: nitric_proto_queues_v1_queues_pb.QueueDequeueRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + complete(argument: nitric_proto_queues_v1_queues_pb.QueueCompleteRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + complete(argument: nitric_proto_queues_v1_queues_pb.QueueCompleteRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + complete(argument: nitric_proto_queues_v1_queues_pb.QueueCompleteRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; +} diff --git a/src/gen/nitric/proto/queues/v1/queues_grpc_pb.js b/src/gen/nitric/proto/queues/v1/queues_grpc_pb.js new file mode 100644 index 00000000..133f999a --- /dev/null +++ b/src/gen/nitric/proto/queues/v1/queues_grpc_pb.js @@ -0,0 +1,115 @@ +// GENERATED CODE -- DO NOT EDIT! + +'use strict'; +var grpc = require('@grpc/grpc-js'); +var nitric_proto_queues_v1_queues_pb = require('../../../../nitric/proto/queues/v1/queues_pb.js'); +var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js'); + +function serialize_nitric_proto_queues_v1_QueueCompleteRequest(arg) { + if (!(arg instanceof nitric_proto_queues_v1_queues_pb.QueueCompleteRequest)) { + throw new Error('Expected argument of type nitric.proto.queues.v1.QueueCompleteRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_queues_v1_QueueCompleteRequest(buffer_arg) { + return nitric_proto_queues_v1_queues_pb.QueueCompleteRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_queues_v1_QueueCompleteResponse(arg) { + if (!(arg instanceof nitric_proto_queues_v1_queues_pb.QueueCompleteResponse)) { + throw new Error('Expected argument of type nitric.proto.queues.v1.QueueCompleteResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_queues_v1_QueueCompleteResponse(buffer_arg) { + return nitric_proto_queues_v1_queues_pb.QueueCompleteResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_queues_v1_QueueDequeueRequest(arg) { + if (!(arg instanceof nitric_proto_queues_v1_queues_pb.QueueDequeueRequest)) { + throw new Error('Expected argument of type nitric.proto.queues.v1.QueueDequeueRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_queues_v1_QueueDequeueRequest(buffer_arg) { + return nitric_proto_queues_v1_queues_pb.QueueDequeueRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_queues_v1_QueueDequeueResponse(arg) { + if (!(arg instanceof nitric_proto_queues_v1_queues_pb.QueueDequeueResponse)) { + throw new Error('Expected argument of type nitric.proto.queues.v1.QueueDequeueResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_queues_v1_QueueDequeueResponse(buffer_arg) { + return nitric_proto_queues_v1_queues_pb.QueueDequeueResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_queues_v1_QueueEnqueueRequest(arg) { + if (!(arg instanceof nitric_proto_queues_v1_queues_pb.QueueEnqueueRequest)) { + throw new Error('Expected argument of type nitric.proto.queues.v1.QueueEnqueueRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_queues_v1_QueueEnqueueRequest(buffer_arg) { + return nitric_proto_queues_v1_queues_pb.QueueEnqueueRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_queues_v1_QueueEnqueueResponse(arg) { + if (!(arg instanceof nitric_proto_queues_v1_queues_pb.QueueEnqueueResponse)) { + throw new Error('Expected argument of type nitric.proto.queues.v1.QueueEnqueueResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_queues_v1_QueueEnqueueResponse(buffer_arg) { + return nitric_proto_queues_v1_queues_pb.QueueEnqueueResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + + +// The Nitric Queue Service contract +var QueuesService = exports.QueuesService = { + // Send message(s) to a queue +enqueue: { + path: '/nitric.proto.queues.v1.Queues/Enqueue', + requestStream: false, + responseStream: false, + requestType: nitric_proto_queues_v1_queues_pb.QueueEnqueueRequest, + responseType: nitric_proto_queues_v1_queues_pb.QueueEnqueueResponse, + requestSerialize: serialize_nitric_proto_queues_v1_QueueEnqueueRequest, + requestDeserialize: deserialize_nitric_proto_queues_v1_QueueEnqueueRequest, + responseSerialize: serialize_nitric_proto_queues_v1_QueueEnqueueResponse, + responseDeserialize: deserialize_nitric_proto_queues_v1_QueueEnqueueResponse, + }, + // Receive message(s) from a queue +dequeue: { + path: '/nitric.proto.queues.v1.Queues/Dequeue', + requestStream: false, + responseStream: false, + requestType: nitric_proto_queues_v1_queues_pb.QueueDequeueRequest, + responseType: nitric_proto_queues_v1_queues_pb.QueueDequeueResponse, + requestSerialize: serialize_nitric_proto_queues_v1_QueueDequeueRequest, + requestDeserialize: deserialize_nitric_proto_queues_v1_QueueDequeueRequest, + responseSerialize: serialize_nitric_proto_queues_v1_QueueDequeueResponse, + responseDeserialize: deserialize_nitric_proto_queues_v1_QueueDequeueResponse, + }, + // Complete an message previously popped from a queue +complete: { + path: '/nitric.proto.queues.v1.Queues/Complete', + requestStream: false, + responseStream: false, + requestType: nitric_proto_queues_v1_queues_pb.QueueCompleteRequest, + responseType: nitric_proto_queues_v1_queues_pb.QueueCompleteResponse, + requestSerialize: serialize_nitric_proto_queues_v1_QueueCompleteRequest, + requestDeserialize: deserialize_nitric_proto_queues_v1_QueueCompleteRequest, + responseSerialize: serialize_nitric_proto_queues_v1_QueueCompleteResponse, + responseDeserialize: deserialize_nitric_proto_queues_v1_QueueCompleteResponse, + }, +}; + +exports.QueuesClient = grpc.makeGenericClientConstructor(QueuesService); diff --git a/src/gen/nitric/proto/queues/v1/queues_pb.d.ts b/src/gen/nitric/proto/queues/v1/queues_pb.d.ts new file mode 100644 index 00000000..7c78e80a --- /dev/null +++ b/src/gen/nitric/proto/queues/v1/queues_pb.d.ts @@ -0,0 +1,220 @@ +// package: nitric.proto.queues.v1 +// file: nitric/proto/queues/v1/queues.proto + +import * as jspb from "google-protobuf"; +import * as google_protobuf_struct_pb from "google-protobuf/google/protobuf/struct_pb"; + +export class QueueEnqueueRequest extends jspb.Message { + getQueueName(): string; + setQueueName(value: string): void; + + clearMessagesList(): void; + getMessagesList(): Array; + setMessagesList(value: Array): void; + addMessages(value?: QueueMessage, index?: number): QueueMessage; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): QueueEnqueueRequest.AsObject; + static toObject(includeInstance: boolean, msg: QueueEnqueueRequest): QueueEnqueueRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: QueueEnqueueRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): QueueEnqueueRequest; + static deserializeBinaryFromReader(message: QueueEnqueueRequest, reader: jspb.BinaryReader): QueueEnqueueRequest; +} + +export namespace QueueEnqueueRequest { + export type AsObject = { + queueName: string, + messagesList: Array, + } +} + +export class QueueEnqueueResponse extends jspb.Message { + clearFailedMessagesList(): void; + getFailedMessagesList(): Array; + setFailedMessagesList(value: Array): void; + addFailedMessages(value?: FailedEnqueueMessage, index?: number): FailedEnqueueMessage; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): QueueEnqueueResponse.AsObject; + static toObject(includeInstance: boolean, msg: QueueEnqueueResponse): QueueEnqueueResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: QueueEnqueueResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): QueueEnqueueResponse; + static deserializeBinaryFromReader(message: QueueEnqueueResponse, reader: jspb.BinaryReader): QueueEnqueueResponse; +} + +export namespace QueueEnqueueResponse { + export type AsObject = { + failedMessagesList: Array, + } +} + +export class QueueDequeueRequest extends jspb.Message { + getQueueName(): string; + setQueueName(value: string): void; + + getDepth(): number; + setDepth(value: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): QueueDequeueRequest.AsObject; + static toObject(includeInstance: boolean, msg: QueueDequeueRequest): QueueDequeueRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: QueueDequeueRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): QueueDequeueRequest; + static deserializeBinaryFromReader(message: QueueDequeueRequest, reader: jspb.BinaryReader): QueueDequeueRequest; +} + +export namespace QueueDequeueRequest { + export type AsObject = { + queueName: string, + depth: number, + } +} + +export class QueueDequeueResponse extends jspb.Message { + clearMessagesList(): void; + getMessagesList(): Array; + setMessagesList(value: Array): void; + addMessages(value?: DequeuedMessage, index?: number): DequeuedMessage; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): QueueDequeueResponse.AsObject; + static toObject(includeInstance: boolean, msg: QueueDequeueResponse): QueueDequeueResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: QueueDequeueResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): QueueDequeueResponse; + static deserializeBinaryFromReader(message: QueueDequeueResponse, reader: jspb.BinaryReader): QueueDequeueResponse; +} + +export namespace QueueDequeueResponse { + export type AsObject = { + messagesList: Array, + } +} + +export class QueueCompleteRequest extends jspb.Message { + getQueueName(): string; + setQueueName(value: string): void; + + getLeaseId(): string; + setLeaseId(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): QueueCompleteRequest.AsObject; + static toObject(includeInstance: boolean, msg: QueueCompleteRequest): QueueCompleteRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: QueueCompleteRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): QueueCompleteRequest; + static deserializeBinaryFromReader(message: QueueCompleteRequest, reader: jspb.BinaryReader): QueueCompleteRequest; +} + +export namespace QueueCompleteRequest { + export type AsObject = { + queueName: string, + leaseId: string, + } +} + +export class QueueCompleteResponse extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): QueueCompleteResponse.AsObject; + static toObject(includeInstance: boolean, msg: QueueCompleteResponse): QueueCompleteResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: QueueCompleteResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): QueueCompleteResponse; + static deserializeBinaryFromReader(message: QueueCompleteResponse, reader: jspb.BinaryReader): QueueCompleteResponse; +} + +export namespace QueueCompleteResponse { + export type AsObject = { + } +} + +export class QueueMessage extends jspb.Message { + hasStructPayload(): boolean; + clearStructPayload(): void; + getStructPayload(): google_protobuf_struct_pb.Struct | undefined; + setStructPayload(value?: google_protobuf_struct_pb.Struct): void; + + getContentCase(): QueueMessage.ContentCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): QueueMessage.AsObject; + static toObject(includeInstance: boolean, msg: QueueMessage): QueueMessage.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: QueueMessage, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): QueueMessage; + static deserializeBinaryFromReader(message: QueueMessage, reader: jspb.BinaryReader): QueueMessage; +} + +export namespace QueueMessage { + export type AsObject = { + structPayload?: google_protobuf_struct_pb.Struct.AsObject, + } + + export enum ContentCase { + CONTENT_NOT_SET = 0, + STRUCT_PAYLOAD = 1, + } +} + +export class DequeuedMessage extends jspb.Message { + getLeaseId(): string; + setLeaseId(value: string): void; + + hasMessage(): boolean; + clearMessage(): void; + getMessage(): QueueMessage | undefined; + setMessage(value?: QueueMessage): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): DequeuedMessage.AsObject; + static toObject(includeInstance: boolean, msg: DequeuedMessage): DequeuedMessage.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: DequeuedMessage, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): DequeuedMessage; + static deserializeBinaryFromReader(message: DequeuedMessage, reader: jspb.BinaryReader): DequeuedMessage; +} + +export namespace DequeuedMessage { + export type AsObject = { + leaseId: string, + message?: QueueMessage.AsObject, + } +} + +export class FailedEnqueueMessage extends jspb.Message { + hasMessage(): boolean; + clearMessage(): void; + getMessage(): QueueMessage | undefined; + setMessage(value?: QueueMessage): void; + + getDetails(): string; + setDetails(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): FailedEnqueueMessage.AsObject; + static toObject(includeInstance: boolean, msg: FailedEnqueueMessage): FailedEnqueueMessage.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: FailedEnqueueMessage, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): FailedEnqueueMessage; + static deserializeBinaryFromReader(message: FailedEnqueueMessage, reader: jspb.BinaryReader): FailedEnqueueMessage; +} + +export namespace FailedEnqueueMessage { + export type AsObject = { + message?: QueueMessage.AsObject, + details: string, + } +} + diff --git a/src/gen/proto/queue/v1/queue_pb.js b/src/gen/nitric/proto/queues/v1/queues_pb.js similarity index 51% rename from src/gen/proto/queue/v1/queue_pb.js rename to src/gen/nitric/proto/queues/v1/queues_pb.js index b52edeb8..afa09305 100644 --- a/src/gen/proto/queue/v1/queue_pb.js +++ b/src/gen/nitric/proto/queues/v1/queues_pb.js @@ -1,4 +1,4 @@ -// source: proto/queue/v1/queue.proto +// source: nitric/proto/queues/v1/queues.proto /** * @fileoverview * @enhanceable @@ -23,18 +23,16 @@ var global = (function() { var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js'); goog.object.extend(proto, google_protobuf_struct_pb); -var validate_validate_pb = require('../../../validate/validate_pb.js'); -goog.object.extend(proto, validate_validate_pb); -goog.exportSymbol('proto.nitric.queue.v1.FailedTask', null, global); -goog.exportSymbol('proto.nitric.queue.v1.NitricTask', null, global); -goog.exportSymbol('proto.nitric.queue.v1.QueueCompleteRequest', null, global); -goog.exportSymbol('proto.nitric.queue.v1.QueueCompleteResponse', null, global); -goog.exportSymbol('proto.nitric.queue.v1.QueueReceiveRequest', null, global); -goog.exportSymbol('proto.nitric.queue.v1.QueueReceiveResponse', null, global); -goog.exportSymbol('proto.nitric.queue.v1.QueueSendBatchRequest', null, global); -goog.exportSymbol('proto.nitric.queue.v1.QueueSendBatchResponse', null, global); -goog.exportSymbol('proto.nitric.queue.v1.QueueSendRequest', null, global); -goog.exportSymbol('proto.nitric.queue.v1.QueueSendResponse', null, global); +goog.exportSymbol('proto.nitric.proto.queues.v1.DequeuedMessage', null, global); +goog.exportSymbol('proto.nitric.proto.queues.v1.FailedEnqueueMessage', null, global); +goog.exportSymbol('proto.nitric.proto.queues.v1.QueueCompleteRequest', null, global); +goog.exportSymbol('proto.nitric.proto.queues.v1.QueueCompleteResponse', null, global); +goog.exportSymbol('proto.nitric.proto.queues.v1.QueueDequeueRequest', null, global); +goog.exportSymbol('proto.nitric.proto.queues.v1.QueueDequeueResponse', null, global); +goog.exportSymbol('proto.nitric.proto.queues.v1.QueueEnqueueRequest', null, global); +goog.exportSymbol('proto.nitric.proto.queues.v1.QueueEnqueueResponse', null, global); +goog.exportSymbol('proto.nitric.proto.queues.v1.QueueMessage', null, global); +goog.exportSymbol('proto.nitric.proto.queues.v1.QueueMessage.ContentCase', null, global); /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -45,16 +43,16 @@ goog.exportSymbol('proto.nitric.queue.v1.QueueSendResponse', null, global); * @extends {jspb.Message} * @constructor */ -proto.nitric.queue.v1.QueueSendRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.nitric.proto.queues.v1.QueueEnqueueRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.proto.queues.v1.QueueEnqueueRequest.repeatedFields_, null); }; -goog.inherits(proto.nitric.queue.v1.QueueSendRequest, jspb.Message); +goog.inherits(proto.nitric.proto.queues.v1.QueueEnqueueRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.nitric.queue.v1.QueueSendRequest.displayName = 'proto.nitric.queue.v1.QueueSendRequest'; + proto.nitric.proto.queues.v1.QueueEnqueueRequest.displayName = 'proto.nitric.proto.queues.v1.QueueEnqueueRequest'; } /** * Generated by JsPbCodeGenerator. @@ -66,16 +64,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.nitric.queue.v1.QueueSendResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.nitric.proto.queues.v1.QueueEnqueueResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.proto.queues.v1.QueueEnqueueResponse.repeatedFields_, null); }; -goog.inherits(proto.nitric.queue.v1.QueueSendResponse, jspb.Message); +goog.inherits(proto.nitric.proto.queues.v1.QueueEnqueueResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.nitric.queue.v1.QueueSendResponse.displayName = 'proto.nitric.queue.v1.QueueSendResponse'; + proto.nitric.proto.queues.v1.QueueEnqueueResponse.displayName = 'proto.nitric.proto.queues.v1.QueueEnqueueResponse'; } /** * Generated by JsPbCodeGenerator. @@ -87,16 +85,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.nitric.queue.v1.QueueSendBatchRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.queue.v1.QueueSendBatchRequest.repeatedFields_, null); +proto.nitric.proto.queues.v1.QueueDequeueRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.nitric.queue.v1.QueueSendBatchRequest, jspb.Message); +goog.inherits(proto.nitric.proto.queues.v1.QueueDequeueRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.nitric.queue.v1.QueueSendBatchRequest.displayName = 'proto.nitric.queue.v1.QueueSendBatchRequest'; + proto.nitric.proto.queues.v1.QueueDequeueRequest.displayName = 'proto.nitric.proto.queues.v1.QueueDequeueRequest'; } /** * Generated by JsPbCodeGenerator. @@ -108,16 +106,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.nitric.queue.v1.QueueSendBatchResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.queue.v1.QueueSendBatchResponse.repeatedFields_, null); +proto.nitric.proto.queues.v1.QueueDequeueResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.proto.queues.v1.QueueDequeueResponse.repeatedFields_, null); }; -goog.inherits(proto.nitric.queue.v1.QueueSendBatchResponse, jspb.Message); +goog.inherits(proto.nitric.proto.queues.v1.QueueDequeueResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.nitric.queue.v1.QueueSendBatchResponse.displayName = 'proto.nitric.queue.v1.QueueSendBatchResponse'; + proto.nitric.proto.queues.v1.QueueDequeueResponse.displayName = 'proto.nitric.proto.queues.v1.QueueDequeueResponse'; } /** * Generated by JsPbCodeGenerator. @@ -129,16 +127,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.nitric.queue.v1.QueueReceiveRequest = function(opt_data) { +proto.nitric.proto.queues.v1.QueueCompleteRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.nitric.queue.v1.QueueReceiveRequest, jspb.Message); +goog.inherits(proto.nitric.proto.queues.v1.QueueCompleteRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.nitric.queue.v1.QueueReceiveRequest.displayName = 'proto.nitric.queue.v1.QueueReceiveRequest'; + proto.nitric.proto.queues.v1.QueueCompleteRequest.displayName = 'proto.nitric.proto.queues.v1.QueueCompleteRequest'; } /** * Generated by JsPbCodeGenerator. @@ -150,16 +148,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.nitric.queue.v1.QueueReceiveResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.queue.v1.QueueReceiveResponse.repeatedFields_, null); +proto.nitric.proto.queues.v1.QueueCompleteResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.nitric.queue.v1.QueueReceiveResponse, jspb.Message); +goog.inherits(proto.nitric.proto.queues.v1.QueueCompleteResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.nitric.queue.v1.QueueReceiveResponse.displayName = 'proto.nitric.queue.v1.QueueReceiveResponse'; + proto.nitric.proto.queues.v1.QueueCompleteResponse.displayName = 'proto.nitric.proto.queues.v1.QueueCompleteResponse'; } /** * Generated by JsPbCodeGenerator. @@ -171,16 +169,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.nitric.queue.v1.QueueCompleteRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.nitric.proto.queues.v1.QueueMessage = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.proto.queues.v1.QueueMessage.oneofGroups_); }; -goog.inherits(proto.nitric.queue.v1.QueueCompleteRequest, jspb.Message); +goog.inherits(proto.nitric.proto.queues.v1.QueueMessage, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.nitric.queue.v1.QueueCompleteRequest.displayName = 'proto.nitric.queue.v1.QueueCompleteRequest'; + proto.nitric.proto.queues.v1.QueueMessage.displayName = 'proto.nitric.proto.queues.v1.QueueMessage'; } /** * Generated by JsPbCodeGenerator. @@ -192,16 +190,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.nitric.queue.v1.QueueCompleteResponse = function(opt_data) { +proto.nitric.proto.queues.v1.DequeuedMessage = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.nitric.queue.v1.QueueCompleteResponse, jspb.Message); +goog.inherits(proto.nitric.proto.queues.v1.DequeuedMessage, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.nitric.queue.v1.QueueCompleteResponse.displayName = 'proto.nitric.queue.v1.QueueCompleteResponse'; + proto.nitric.proto.queues.v1.DequeuedMessage.displayName = 'proto.nitric.proto.queues.v1.DequeuedMessage'; } /** * Generated by JsPbCodeGenerator. @@ -213,38 +211,24 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.nitric.queue.v1.FailedTask = function(opt_data) { +proto.nitric.proto.queues.v1.FailedEnqueueMessage = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.nitric.queue.v1.FailedTask, jspb.Message); +goog.inherits(proto.nitric.proto.queues.v1.FailedEnqueueMessage, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.nitric.queue.v1.FailedTask.displayName = 'proto.nitric.queue.v1.FailedTask'; + proto.nitric.proto.queues.v1.FailedEnqueueMessage.displayName = 'proto.nitric.proto.queues.v1.FailedEnqueueMessage'; } + /** - * 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 + * List of repeated fields within this message type. + * @private {!Array} + * @const */ -proto.nitric.queue.v1.NitricTask = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.queue.v1.NitricTask, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.queue.v1.NitricTask.displayName = 'proto.nitric.queue.v1.NitricTask'; -} +proto.nitric.proto.queues.v1.QueueEnqueueRequest.repeatedFields_ = [2]; @@ -261,8 +245,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.nitric.queue.v1.QueueSendRequest.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.queue.v1.QueueSendRequest.toObject(opt_includeInstance, this); +proto.nitric.proto.queues.v1.QueueEnqueueRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.queues.v1.QueueEnqueueRequest.toObject(opt_includeInstance, this); }; @@ -271,14 +255,15 @@ proto.nitric.queue.v1.QueueSendRequest.prototype.toObject = function(opt_include * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.nitric.queue.v1.QueueSendRequest} msg The msg instance to transform. + * @param {!proto.nitric.proto.queues.v1.QueueEnqueueRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.queue.v1.QueueSendRequest.toObject = function(includeInstance, msg) { +proto.nitric.proto.queues.v1.QueueEnqueueRequest.toObject = function(includeInstance, msg) { var f, obj = { - queue: jspb.Message.getFieldWithDefault(msg, 1, ""), - task: (f = msg.getTask()) && proto.nitric.queue.v1.NitricTask.toObject(includeInstance, f) + queueName: jspb.Message.getFieldWithDefault(msg, 1, ""), + messagesList: jspb.Message.toObjectList(msg.getMessagesList(), + proto.nitric.proto.queues.v1.QueueMessage.toObject, includeInstance) }; if (includeInstance) { @@ -292,23 +277,23 @@ proto.nitric.queue.v1.QueueSendRequest.toObject = function(includeInstance, msg) /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.queue.v1.QueueSendRequest} + * @return {!proto.nitric.proto.queues.v1.QueueEnqueueRequest} */ -proto.nitric.queue.v1.QueueSendRequest.deserializeBinary = function(bytes) { +proto.nitric.proto.queues.v1.QueueEnqueueRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.queue.v1.QueueSendRequest; - return proto.nitric.queue.v1.QueueSendRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.nitric.proto.queues.v1.QueueEnqueueRequest; + return proto.nitric.proto.queues.v1.QueueEnqueueRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.nitric.queue.v1.QueueSendRequest} msg The message object to deserialize into. + * @param {!proto.nitric.proto.queues.v1.QueueEnqueueRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.queue.v1.QueueSendRequest} + * @return {!proto.nitric.proto.queues.v1.QueueEnqueueRequest} */ -proto.nitric.queue.v1.QueueSendRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.nitric.proto.queues.v1.QueueEnqueueRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -317,12 +302,12 @@ proto.nitric.queue.v1.QueueSendRequest.deserializeBinaryFromReader = function(ms switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); - msg.setQueue(value); + msg.setQueueName(value); break; case 2: - var value = new proto.nitric.queue.v1.NitricTask; - reader.readMessage(value,proto.nitric.queue.v1.NitricTask.deserializeBinaryFromReader); - msg.setTask(value); + var value = new proto.nitric.proto.queues.v1.QueueMessage; + reader.readMessage(value,proto.nitric.proto.queues.v1.QueueMessage.deserializeBinaryFromReader); + msg.addMessages(value); break; default: reader.skipField(); @@ -337,9 +322,9 @@ proto.nitric.queue.v1.QueueSendRequest.deserializeBinaryFromReader = function(ms * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.nitric.queue.v1.QueueSendRequest.prototype.serializeBinary = function() { +proto.nitric.proto.queues.v1.QueueEnqueueRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.nitric.queue.v1.QueueSendRequest.serializeBinaryToWriter(this, writer); + proto.nitric.proto.queues.v1.QueueEnqueueRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -347,86 +332,94 @@ proto.nitric.queue.v1.QueueSendRequest.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.nitric.queue.v1.QueueSendRequest} message + * @param {!proto.nitric.proto.queues.v1.QueueEnqueueRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.queue.v1.QueueSendRequest.serializeBinaryToWriter = function(message, writer) { +proto.nitric.proto.queues.v1.QueueEnqueueRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getQueue(); + f = message.getQueueName(); if (f.length > 0) { writer.writeString( 1, f ); } - f = message.getTask(); - if (f != null) { - writer.writeMessage( + f = message.getMessagesList(); + if (f.length > 0) { + writer.writeRepeatedMessage( 2, f, - proto.nitric.queue.v1.NitricTask.serializeBinaryToWriter + proto.nitric.proto.queues.v1.QueueMessage.serializeBinaryToWriter ); } }; /** - * optional string queue = 1; + * optional string queue_name = 1; * @return {string} */ -proto.nitric.queue.v1.QueueSendRequest.prototype.getQueue = function() { +proto.nitric.proto.queues.v1.QueueEnqueueRequest.prototype.getQueueName = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value - * @return {!proto.nitric.queue.v1.QueueSendRequest} returns this + * @return {!proto.nitric.proto.queues.v1.QueueEnqueueRequest} returns this */ -proto.nitric.queue.v1.QueueSendRequest.prototype.setQueue = function(value) { +proto.nitric.proto.queues.v1.QueueEnqueueRequest.prototype.setQueueName = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** - * optional NitricTask task = 2; - * @return {?proto.nitric.queue.v1.NitricTask} + * repeated QueueMessage messages = 2; + * @return {!Array} */ -proto.nitric.queue.v1.QueueSendRequest.prototype.getTask = function() { - return /** @type{?proto.nitric.queue.v1.NitricTask} */ ( - jspb.Message.getWrapperField(this, proto.nitric.queue.v1.NitricTask, 2)); +proto.nitric.proto.queues.v1.QueueEnqueueRequest.prototype.getMessagesList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.nitric.proto.queues.v1.QueueMessage, 2)); }; /** - * @param {?proto.nitric.queue.v1.NitricTask|undefined} value - * @return {!proto.nitric.queue.v1.QueueSendRequest} returns this + * @param {!Array} value + * @return {!proto.nitric.proto.queues.v1.QueueEnqueueRequest} returns this */ -proto.nitric.queue.v1.QueueSendRequest.prototype.setTask = function(value) { - return jspb.Message.setWrapperField(this, 2, value); +proto.nitric.proto.queues.v1.QueueEnqueueRequest.prototype.setMessagesList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 2, value); }; /** - * Clears the message field making it undefined. - * @return {!proto.nitric.queue.v1.QueueSendRequest} returns this + * @param {!proto.nitric.proto.queues.v1.QueueMessage=} opt_value + * @param {number=} opt_index + * @return {!proto.nitric.proto.queues.v1.QueueMessage} */ -proto.nitric.queue.v1.QueueSendRequest.prototype.clearTask = function() { - return this.setTask(undefined); +proto.nitric.proto.queues.v1.QueueEnqueueRequest.prototype.addMessages = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.nitric.proto.queues.v1.QueueMessage, opt_index); }; /** - * Returns whether this field is set. - * @return {boolean} + * Clears the list making it empty but non-null. + * @return {!proto.nitric.proto.queues.v1.QueueEnqueueRequest} returns this */ -proto.nitric.queue.v1.QueueSendRequest.prototype.hasTask = function() { - return jspb.Message.getField(this, 2) != null; +proto.nitric.proto.queues.v1.QueueEnqueueRequest.prototype.clearMessagesList = function() { + return this.setMessagesList([]); }; +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.nitric.proto.queues.v1.QueueEnqueueResponse.repeatedFields_ = [1]; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -442,8 +435,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.nitric.queue.v1.QueueSendResponse.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.queue.v1.QueueSendResponse.toObject(opt_includeInstance, this); +proto.nitric.proto.queues.v1.QueueEnqueueResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.queues.v1.QueueEnqueueResponse.toObject(opt_includeInstance, this); }; @@ -452,13 +445,14 @@ proto.nitric.queue.v1.QueueSendResponse.prototype.toObject = function(opt_includ * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.nitric.queue.v1.QueueSendResponse} msg The msg instance to transform. + * @param {!proto.nitric.proto.queues.v1.QueueEnqueueResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.queue.v1.QueueSendResponse.toObject = function(includeInstance, msg) { +proto.nitric.proto.queues.v1.QueueEnqueueResponse.toObject = function(includeInstance, msg) { var f, obj = { - + failedMessagesList: jspb.Message.toObjectList(msg.getFailedMessagesList(), + proto.nitric.proto.queues.v1.FailedEnqueueMessage.toObject, includeInstance) }; if (includeInstance) { @@ -472,29 +466,34 @@ proto.nitric.queue.v1.QueueSendResponse.toObject = function(includeInstance, msg /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.queue.v1.QueueSendResponse} + * @return {!proto.nitric.proto.queues.v1.QueueEnqueueResponse} */ -proto.nitric.queue.v1.QueueSendResponse.deserializeBinary = function(bytes) { +proto.nitric.proto.queues.v1.QueueEnqueueResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.queue.v1.QueueSendResponse; - return proto.nitric.queue.v1.QueueSendResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.nitric.proto.queues.v1.QueueEnqueueResponse; + return proto.nitric.proto.queues.v1.QueueEnqueueResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.nitric.queue.v1.QueueSendResponse} msg The message object to deserialize into. + * @param {!proto.nitric.proto.queues.v1.QueueEnqueueResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.queue.v1.QueueSendResponse} + * @return {!proto.nitric.proto.queues.v1.QueueEnqueueResponse} */ -proto.nitric.queue.v1.QueueSendResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.nitric.proto.queues.v1.QueueEnqueueResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { + case 1: + var value = new proto.nitric.proto.queues.v1.FailedEnqueueMessage; + reader.readMessage(value,proto.nitric.proto.queues.v1.FailedEnqueueMessage.deserializeBinaryFromReader); + msg.addFailedMessages(value); + break; default: reader.skipField(); break; @@ -508,9 +507,9 @@ proto.nitric.queue.v1.QueueSendResponse.deserializeBinaryFromReader = function(m * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.nitric.queue.v1.QueueSendResponse.prototype.serializeBinary = function() { +proto.nitric.proto.queues.v1.QueueEnqueueResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.nitric.queue.v1.QueueSendResponse.serializeBinaryToWriter(this, writer); + proto.nitric.proto.queues.v1.QueueEnqueueResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -518,22 +517,61 @@ proto.nitric.queue.v1.QueueSendResponse.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.nitric.queue.v1.QueueSendResponse} message + * @param {!proto.nitric.proto.queues.v1.QueueEnqueueResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.queue.v1.QueueSendResponse.serializeBinaryToWriter = function(message, writer) { +proto.nitric.proto.queues.v1.QueueEnqueueResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; + f = message.getFailedMessagesList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.nitric.proto.queues.v1.FailedEnqueueMessage.serializeBinaryToWriter + ); + } }; +/** + * repeated FailedEnqueueMessage failed_messages = 1; + * @return {!Array} + */ +proto.nitric.proto.queues.v1.QueueEnqueueResponse.prototype.getFailedMessagesList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.nitric.proto.queues.v1.FailedEnqueueMessage, 1)); +}; + /** - * List of repeated fields within this message type. - * @private {!Array} - * @const + * @param {!Array} value + * @return {!proto.nitric.proto.queues.v1.QueueEnqueueResponse} returns this +*/ +proto.nitric.proto.queues.v1.QueueEnqueueResponse.prototype.setFailedMessagesList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.nitric.proto.queues.v1.FailedEnqueueMessage=} opt_value + * @param {number=} opt_index + * @return {!proto.nitric.proto.queues.v1.FailedEnqueueMessage} + */ +proto.nitric.proto.queues.v1.QueueEnqueueResponse.prototype.addFailedMessages = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.nitric.proto.queues.v1.FailedEnqueueMessage, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.nitric.proto.queues.v1.QueueEnqueueResponse} returns this */ -proto.nitric.queue.v1.QueueSendBatchRequest.repeatedFields_ = [2]; +proto.nitric.proto.queues.v1.QueueEnqueueResponse.prototype.clearFailedMessagesList = function() { + return this.setFailedMessagesList([]); +}; + + @@ -550,8 +588,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.nitric.queue.v1.QueueSendBatchRequest.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.queue.v1.QueueSendBatchRequest.toObject(opt_includeInstance, this); +proto.nitric.proto.queues.v1.QueueDequeueRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.queues.v1.QueueDequeueRequest.toObject(opt_includeInstance, this); }; @@ -560,15 +598,14 @@ proto.nitric.queue.v1.QueueSendBatchRequest.prototype.toObject = function(opt_in * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.nitric.queue.v1.QueueSendBatchRequest} msg The msg instance to transform. + * @param {!proto.nitric.proto.queues.v1.QueueDequeueRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.queue.v1.QueueSendBatchRequest.toObject = function(includeInstance, msg) { +proto.nitric.proto.queues.v1.QueueDequeueRequest.toObject = function(includeInstance, msg) { var f, obj = { - queue: jspb.Message.getFieldWithDefault(msg, 1, ""), - tasksList: jspb.Message.toObjectList(msg.getTasksList(), - proto.nitric.queue.v1.NitricTask.toObject, includeInstance) + queueName: jspb.Message.getFieldWithDefault(msg, 1, ""), + depth: jspb.Message.getFieldWithDefault(msg, 2, 0) }; if (includeInstance) { @@ -582,23 +619,23 @@ proto.nitric.queue.v1.QueueSendBatchRequest.toObject = function(includeInstance, /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.queue.v1.QueueSendBatchRequest} + * @return {!proto.nitric.proto.queues.v1.QueueDequeueRequest} */ -proto.nitric.queue.v1.QueueSendBatchRequest.deserializeBinary = function(bytes) { +proto.nitric.proto.queues.v1.QueueDequeueRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.queue.v1.QueueSendBatchRequest; - return proto.nitric.queue.v1.QueueSendBatchRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.nitric.proto.queues.v1.QueueDequeueRequest; + return proto.nitric.proto.queues.v1.QueueDequeueRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.nitric.queue.v1.QueueSendBatchRequest} msg The message object to deserialize into. + * @param {!proto.nitric.proto.queues.v1.QueueDequeueRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.queue.v1.QueueSendBatchRequest} + * @return {!proto.nitric.proto.queues.v1.QueueDequeueRequest} */ -proto.nitric.queue.v1.QueueSendBatchRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.nitric.proto.queues.v1.QueueDequeueRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -607,12 +644,11 @@ proto.nitric.queue.v1.QueueSendBatchRequest.deserializeBinaryFromReader = functi switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); - msg.setQueue(value); + msg.setQueueName(value); break; case 2: - var value = new proto.nitric.queue.v1.NitricTask; - reader.readMessage(value,proto.nitric.queue.v1.NitricTask.deserializeBinaryFromReader); - msg.addTasks(value); + var value = /** @type {number} */ (reader.readInt32()); + msg.setDepth(value); break; default: reader.skipField(); @@ -627,9 +663,9 @@ proto.nitric.queue.v1.QueueSendBatchRequest.deserializeBinaryFromReader = functi * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.nitric.queue.v1.QueueSendBatchRequest.prototype.serializeBinary = function() { +proto.nitric.proto.queues.v1.QueueDequeueRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.nitric.queue.v1.QueueSendBatchRequest.serializeBinaryToWriter(this, writer); + proto.nitric.proto.queues.v1.QueueDequeueRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -637,83 +673,62 @@ proto.nitric.queue.v1.QueueSendBatchRequest.prototype.serializeBinary = function /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.nitric.queue.v1.QueueSendBatchRequest} message + * @param {!proto.nitric.proto.queues.v1.QueueDequeueRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.queue.v1.QueueSendBatchRequest.serializeBinaryToWriter = function(message, writer) { +proto.nitric.proto.queues.v1.QueueDequeueRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getQueue(); + f = message.getQueueName(); if (f.length > 0) { writer.writeString( 1, f ); } - f = message.getTasksList(); - if (f.length > 0) { - writer.writeRepeatedMessage( + f = message.getDepth(); + if (f !== 0) { + writer.writeInt32( 2, - f, - proto.nitric.queue.v1.NitricTask.serializeBinaryToWriter + f ); } }; /** - * optional string queue = 1; + * optional string queue_name = 1; * @return {string} */ -proto.nitric.queue.v1.QueueSendBatchRequest.prototype.getQueue = function() { +proto.nitric.proto.queues.v1.QueueDequeueRequest.prototype.getQueueName = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value - * @return {!proto.nitric.queue.v1.QueueSendBatchRequest} returns this + * @return {!proto.nitric.proto.queues.v1.QueueDequeueRequest} returns this */ -proto.nitric.queue.v1.QueueSendBatchRequest.prototype.setQueue = function(value) { +proto.nitric.proto.queues.v1.QueueDequeueRequest.prototype.setQueueName = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** - * repeated NitricTask tasks = 2; - * @return {!Array} - */ -proto.nitric.queue.v1.QueueSendBatchRequest.prototype.getTasksList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.nitric.queue.v1.NitricTask, 2)); -}; - - -/** - * @param {!Array} value - * @return {!proto.nitric.queue.v1.QueueSendBatchRequest} returns this -*/ -proto.nitric.queue.v1.QueueSendBatchRequest.prototype.setTasksList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 2, value); -}; - - -/** - * @param {!proto.nitric.queue.v1.NitricTask=} opt_value - * @param {number=} opt_index - * @return {!proto.nitric.queue.v1.NitricTask} + * optional int32 depth = 2; + * @return {number} */ -proto.nitric.queue.v1.QueueSendBatchRequest.prototype.addTasks = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.nitric.queue.v1.NitricTask, opt_index); +proto.nitric.proto.queues.v1.QueueDequeueRequest.prototype.getDepth = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** - * Clears the list making it empty but non-null. - * @return {!proto.nitric.queue.v1.QueueSendBatchRequest} returns this + * @param {number} value + * @return {!proto.nitric.proto.queues.v1.QueueDequeueRequest} returns this */ -proto.nitric.queue.v1.QueueSendBatchRequest.prototype.clearTasksList = function() { - return this.setTasksList([]); +proto.nitric.proto.queues.v1.QueueDequeueRequest.prototype.setDepth = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); }; @@ -723,7 +738,7 @@ proto.nitric.queue.v1.QueueSendBatchRequest.prototype.clearTasksList = function( * @private {!Array} * @const */ -proto.nitric.queue.v1.QueueSendBatchResponse.repeatedFields_ = [1]; +proto.nitric.proto.queues.v1.QueueDequeueResponse.repeatedFields_ = [1]; @@ -740,8 +755,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.nitric.queue.v1.QueueSendBatchResponse.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.queue.v1.QueueSendBatchResponse.toObject(opt_includeInstance, this); +proto.nitric.proto.queues.v1.QueueDequeueResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.queues.v1.QueueDequeueResponse.toObject(opt_includeInstance, this); }; @@ -750,14 +765,14 @@ proto.nitric.queue.v1.QueueSendBatchResponse.prototype.toObject = function(opt_i * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.nitric.queue.v1.QueueSendBatchResponse} msg The msg instance to transform. + * @param {!proto.nitric.proto.queues.v1.QueueDequeueResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.queue.v1.QueueSendBatchResponse.toObject = function(includeInstance, msg) { +proto.nitric.proto.queues.v1.QueueDequeueResponse.toObject = function(includeInstance, msg) { var f, obj = { - failedtasksList: jspb.Message.toObjectList(msg.getFailedtasksList(), - proto.nitric.queue.v1.FailedTask.toObject, includeInstance) + messagesList: jspb.Message.toObjectList(msg.getMessagesList(), + proto.nitric.proto.queues.v1.DequeuedMessage.toObject, includeInstance) }; if (includeInstance) { @@ -771,23 +786,23 @@ proto.nitric.queue.v1.QueueSendBatchResponse.toObject = function(includeInstance /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.queue.v1.QueueSendBatchResponse} + * @return {!proto.nitric.proto.queues.v1.QueueDequeueResponse} */ -proto.nitric.queue.v1.QueueSendBatchResponse.deserializeBinary = function(bytes) { +proto.nitric.proto.queues.v1.QueueDequeueResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.queue.v1.QueueSendBatchResponse; - return proto.nitric.queue.v1.QueueSendBatchResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.nitric.proto.queues.v1.QueueDequeueResponse; + return proto.nitric.proto.queues.v1.QueueDequeueResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.nitric.queue.v1.QueueSendBatchResponse} msg The message object to deserialize into. + * @param {!proto.nitric.proto.queues.v1.QueueDequeueResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.queue.v1.QueueSendBatchResponse} + * @return {!proto.nitric.proto.queues.v1.QueueDequeueResponse} */ -proto.nitric.queue.v1.QueueSendBatchResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.nitric.proto.queues.v1.QueueDequeueResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -795,9 +810,9 @@ proto.nitric.queue.v1.QueueSendBatchResponse.deserializeBinaryFromReader = funct var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.nitric.queue.v1.FailedTask; - reader.readMessage(value,proto.nitric.queue.v1.FailedTask.deserializeBinaryFromReader); - msg.addFailedtasks(value); + var value = new proto.nitric.proto.queues.v1.DequeuedMessage; + reader.readMessage(value,proto.nitric.proto.queues.v1.DequeuedMessage.deserializeBinaryFromReader); + msg.addMessages(value); break; default: reader.skipField(); @@ -812,9 +827,9 @@ proto.nitric.queue.v1.QueueSendBatchResponse.deserializeBinaryFromReader = funct * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.nitric.queue.v1.QueueSendBatchResponse.prototype.serializeBinary = function() { +proto.nitric.proto.queues.v1.QueueDequeueResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.nitric.queue.v1.QueueSendBatchResponse.serializeBinaryToWriter(this, writer); + proto.nitric.proto.queues.v1.QueueDequeueResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -822,58 +837,58 @@ proto.nitric.queue.v1.QueueSendBatchResponse.prototype.serializeBinary = functio /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.nitric.queue.v1.QueueSendBatchResponse} message + * @param {!proto.nitric.proto.queues.v1.QueueDequeueResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.queue.v1.QueueSendBatchResponse.serializeBinaryToWriter = function(message, writer) { +proto.nitric.proto.queues.v1.QueueDequeueResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getFailedtasksList(); + f = message.getMessagesList(); if (f.length > 0) { writer.writeRepeatedMessage( 1, f, - proto.nitric.queue.v1.FailedTask.serializeBinaryToWriter + proto.nitric.proto.queues.v1.DequeuedMessage.serializeBinaryToWriter ); } }; /** - * repeated FailedTask failedTasks = 1; - * @return {!Array} + * repeated DequeuedMessage messages = 1; + * @return {!Array} */ -proto.nitric.queue.v1.QueueSendBatchResponse.prototype.getFailedtasksList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.nitric.queue.v1.FailedTask, 1)); +proto.nitric.proto.queues.v1.QueueDequeueResponse.prototype.getMessagesList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.nitric.proto.queues.v1.DequeuedMessage, 1)); }; /** - * @param {!Array} value - * @return {!proto.nitric.queue.v1.QueueSendBatchResponse} returns this + * @param {!Array} value + * @return {!proto.nitric.proto.queues.v1.QueueDequeueResponse} returns this */ -proto.nitric.queue.v1.QueueSendBatchResponse.prototype.setFailedtasksList = function(value) { +proto.nitric.proto.queues.v1.QueueDequeueResponse.prototype.setMessagesList = function(value) { return jspb.Message.setRepeatedWrapperField(this, 1, value); }; /** - * @param {!proto.nitric.queue.v1.FailedTask=} opt_value + * @param {!proto.nitric.proto.queues.v1.DequeuedMessage=} opt_value * @param {number=} opt_index - * @return {!proto.nitric.queue.v1.FailedTask} + * @return {!proto.nitric.proto.queues.v1.DequeuedMessage} */ -proto.nitric.queue.v1.QueueSendBatchResponse.prototype.addFailedtasks = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.nitric.queue.v1.FailedTask, opt_index); +proto.nitric.proto.queues.v1.QueueDequeueResponse.prototype.addMessages = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.nitric.proto.queues.v1.DequeuedMessage, opt_index); }; /** * Clears the list making it empty but non-null. - * @return {!proto.nitric.queue.v1.QueueSendBatchResponse} returns this + * @return {!proto.nitric.proto.queues.v1.QueueDequeueResponse} returns this */ -proto.nitric.queue.v1.QueueSendBatchResponse.prototype.clearFailedtasksList = function() { - return this.setFailedtasksList([]); +proto.nitric.proto.queues.v1.QueueDequeueResponse.prototype.clearMessagesList = function() { + return this.setMessagesList([]); }; @@ -893,8 +908,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.nitric.queue.v1.QueueReceiveRequest.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.queue.v1.QueueReceiveRequest.toObject(opt_includeInstance, this); +proto.nitric.proto.queues.v1.QueueCompleteRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.queues.v1.QueueCompleteRequest.toObject(opt_includeInstance, this); }; @@ -903,14 +918,14 @@ proto.nitric.queue.v1.QueueReceiveRequest.prototype.toObject = function(opt_incl * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.nitric.queue.v1.QueueReceiveRequest} msg The msg instance to transform. + * @param {!proto.nitric.proto.queues.v1.QueueCompleteRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.queue.v1.QueueReceiveRequest.toObject = function(includeInstance, msg) { +proto.nitric.proto.queues.v1.QueueCompleteRequest.toObject = function(includeInstance, msg) { var f, obj = { - queue: jspb.Message.getFieldWithDefault(msg, 1, ""), - depth: jspb.Message.getFieldWithDefault(msg, 2, 0) + queueName: jspb.Message.getFieldWithDefault(msg, 1, ""), + leaseId: jspb.Message.getFieldWithDefault(msg, 2, "") }; if (includeInstance) { @@ -924,23 +939,23 @@ proto.nitric.queue.v1.QueueReceiveRequest.toObject = function(includeInstance, m /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.queue.v1.QueueReceiveRequest} + * @return {!proto.nitric.proto.queues.v1.QueueCompleteRequest} */ -proto.nitric.queue.v1.QueueReceiveRequest.deserializeBinary = function(bytes) { +proto.nitric.proto.queues.v1.QueueCompleteRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.queue.v1.QueueReceiveRequest; - return proto.nitric.queue.v1.QueueReceiveRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.nitric.proto.queues.v1.QueueCompleteRequest; + return proto.nitric.proto.queues.v1.QueueCompleteRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.nitric.queue.v1.QueueReceiveRequest} msg The message object to deserialize into. + * @param {!proto.nitric.proto.queues.v1.QueueCompleteRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.queue.v1.QueueReceiveRequest} + * @return {!proto.nitric.proto.queues.v1.QueueCompleteRequest} */ -proto.nitric.queue.v1.QueueReceiveRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.nitric.proto.queues.v1.QueueCompleteRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -949,11 +964,11 @@ proto.nitric.queue.v1.QueueReceiveRequest.deserializeBinaryFromReader = function switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); - msg.setQueue(value); + msg.setQueueName(value); break; case 2: - var value = /** @type {number} */ (reader.readInt32()); - msg.setDepth(value); + var value = /** @type {string} */ (reader.readString()); + msg.setLeaseId(value); break; default: reader.skipField(); @@ -968,9 +983,9 @@ proto.nitric.queue.v1.QueueReceiveRequest.deserializeBinaryFromReader = function * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.nitric.queue.v1.QueueReceiveRequest.prototype.serializeBinary = function() { +proto.nitric.proto.queues.v1.QueueCompleteRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.nitric.queue.v1.QueueReceiveRequest.serializeBinaryToWriter(this, writer); + proto.nitric.proto.queues.v1.QueueCompleteRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -978,22 +993,22 @@ proto.nitric.queue.v1.QueueReceiveRequest.prototype.serializeBinary = function() /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.nitric.queue.v1.QueueReceiveRequest} message + * @param {!proto.nitric.proto.queues.v1.QueueCompleteRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.queue.v1.QueueReceiveRequest.serializeBinaryToWriter = function(message, writer) { +proto.nitric.proto.queues.v1.QueueCompleteRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getQueue(); + f = message.getQueueName(); if (f.length > 0) { writer.writeString( 1, f ); } - f = message.getDepth(); - if (f !== 0) { - writer.writeInt32( + f = message.getLeaseId(); + if (f.length > 0) { + writer.writeString( 2, f ); @@ -1002,49 +1017,42 @@ proto.nitric.queue.v1.QueueReceiveRequest.serializeBinaryToWriter = function(mes /** - * optional string queue = 1; + * optional string queue_name = 1; * @return {string} */ -proto.nitric.queue.v1.QueueReceiveRequest.prototype.getQueue = function() { +proto.nitric.proto.queues.v1.QueueCompleteRequest.prototype.getQueueName = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value - * @return {!proto.nitric.queue.v1.QueueReceiveRequest} returns this + * @return {!proto.nitric.proto.queues.v1.QueueCompleteRequest} returns this */ -proto.nitric.queue.v1.QueueReceiveRequest.prototype.setQueue = function(value) { +proto.nitric.proto.queues.v1.QueueCompleteRequest.prototype.setQueueName = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** - * optional int32 depth = 2; - * @return {number} + * optional string lease_id = 2; + * @return {string} */ -proto.nitric.queue.v1.QueueReceiveRequest.prototype.getDepth = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +proto.nitric.proto.queues.v1.QueueCompleteRequest.prototype.getLeaseId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** - * @param {number} value - * @return {!proto.nitric.queue.v1.QueueReceiveRequest} returns this + * @param {string} value + * @return {!proto.nitric.proto.queues.v1.QueueCompleteRequest} returns this */ -proto.nitric.queue.v1.QueueReceiveRequest.prototype.setDepth = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); +proto.nitric.proto.queues.v1.QueueCompleteRequest.prototype.setLeaseId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); }; -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.nitric.queue.v1.QueueReceiveResponse.repeatedFields_ = [1]; - if (jspb.Message.GENERATE_TO_OBJECT) { @@ -1060,8 +1068,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.nitric.queue.v1.QueueReceiveResponse.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.queue.v1.QueueReceiveResponse.toObject(opt_includeInstance, this); +proto.nitric.proto.queues.v1.QueueCompleteResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.queues.v1.QueueCompleteResponse.toObject(opt_includeInstance, this); }; @@ -1070,14 +1078,13 @@ proto.nitric.queue.v1.QueueReceiveResponse.prototype.toObject = function(opt_inc * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.nitric.queue.v1.QueueReceiveResponse} msg The msg instance to transform. + * @param {!proto.nitric.proto.queues.v1.QueueCompleteResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.queue.v1.QueueReceiveResponse.toObject = function(includeInstance, msg) { +proto.nitric.proto.queues.v1.QueueCompleteResponse.toObject = function(includeInstance, msg) { var f, obj = { - tasksList: jspb.Message.toObjectList(msg.getTasksList(), - proto.nitric.queue.v1.NitricTask.toObject, includeInstance) + }; if (includeInstance) { @@ -1091,34 +1098,29 @@ proto.nitric.queue.v1.QueueReceiveResponse.toObject = function(includeInstance, /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.queue.v1.QueueReceiveResponse} + * @return {!proto.nitric.proto.queues.v1.QueueCompleteResponse} */ -proto.nitric.queue.v1.QueueReceiveResponse.deserializeBinary = function(bytes) { +proto.nitric.proto.queues.v1.QueueCompleteResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.queue.v1.QueueReceiveResponse; - return proto.nitric.queue.v1.QueueReceiveResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.nitric.proto.queues.v1.QueueCompleteResponse; + return proto.nitric.proto.queues.v1.QueueCompleteResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.nitric.queue.v1.QueueReceiveResponse} msg The message object to deserialize into. + * @param {!proto.nitric.proto.queues.v1.QueueCompleteResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.queue.v1.QueueReceiveResponse} + * @return {!proto.nitric.proto.queues.v1.QueueCompleteResponse} */ -proto.nitric.queue.v1.QueueReceiveResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.nitric.proto.queues.v1.QueueCompleteResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { - case 1: - var value = new proto.nitric.queue.v1.NitricTask; - reader.readMessage(value,proto.nitric.queue.v1.NitricTask.deserializeBinaryFromReader); - msg.addTasks(value); - break; default: reader.skipField(); break; @@ -1132,9 +1134,9 @@ proto.nitric.queue.v1.QueueReceiveResponse.deserializeBinaryFromReader = functio * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.nitric.queue.v1.QueueReceiveResponse.prototype.serializeBinary = function() { +proto.nitric.proto.queues.v1.QueueCompleteResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.nitric.queue.v1.QueueReceiveResponse.serializeBinaryToWriter(this, writer); + proto.nitric.proto.queues.v1.QueueCompleteResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1142,64 +1144,43 @@ proto.nitric.queue.v1.QueueReceiveResponse.prototype.serializeBinary = function( /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.nitric.queue.v1.QueueReceiveResponse} message + * @param {!proto.nitric.proto.queues.v1.QueueCompleteResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.queue.v1.QueueReceiveResponse.serializeBinaryToWriter = function(message, writer) { +proto.nitric.proto.queues.v1.QueueCompleteResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getTasksList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.nitric.queue.v1.NitricTask.serializeBinaryToWriter - ); - } }; -/** - * repeated NitricTask tasks = 1; - * @return {!Array} - */ -proto.nitric.queue.v1.QueueReceiveResponse.prototype.getTasksList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.nitric.queue.v1.NitricTask, 1)); -}; - /** - * @param {!Array} value - * @return {!proto.nitric.queue.v1.QueueReceiveResponse} returns this -*/ -proto.nitric.queue.v1.QueueReceiveResponse.prototype.setTasksList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 1, value); -}; - + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.proto.queues.v1.QueueMessage.oneofGroups_ = [[1]]; /** - * @param {!proto.nitric.queue.v1.NitricTask=} opt_value - * @param {number=} opt_index - * @return {!proto.nitric.queue.v1.NitricTask} + * @enum {number} */ -proto.nitric.queue.v1.QueueReceiveResponse.prototype.addTasks = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.nitric.queue.v1.NitricTask, opt_index); +proto.nitric.proto.queues.v1.QueueMessage.ContentCase = { + CONTENT_NOT_SET: 0, + STRUCT_PAYLOAD: 1 }; - /** - * Clears the list making it empty but non-null. - * @return {!proto.nitric.queue.v1.QueueReceiveResponse} returns this + * @return {proto.nitric.proto.queues.v1.QueueMessage.ContentCase} */ -proto.nitric.queue.v1.QueueReceiveResponse.prototype.clearTasksList = function() { - return this.setTasksList([]); +proto.nitric.proto.queues.v1.QueueMessage.prototype.getContentCase = function() { + return /** @type {proto.nitric.proto.queues.v1.QueueMessage.ContentCase} */(jspb.Message.computeOneofCase(this, proto.nitric.proto.queues.v1.QueueMessage.oneofGroups_[0])); }; - - if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. @@ -1213,8 +1194,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.nitric.queue.v1.QueueCompleteRequest.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.queue.v1.QueueCompleteRequest.toObject(opt_includeInstance, this); +proto.nitric.proto.queues.v1.QueueMessage.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.queues.v1.QueueMessage.toObject(opt_includeInstance, this); }; @@ -1223,14 +1204,13 @@ proto.nitric.queue.v1.QueueCompleteRequest.prototype.toObject = function(opt_inc * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.nitric.queue.v1.QueueCompleteRequest} msg The msg instance to transform. + * @param {!proto.nitric.proto.queues.v1.QueueMessage} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.queue.v1.QueueCompleteRequest.toObject = function(includeInstance, msg) { +proto.nitric.proto.queues.v1.QueueMessage.toObject = function(includeInstance, msg) { var f, obj = { - queue: jspb.Message.getFieldWithDefault(msg, 1, ""), - leaseId: jspb.Message.getFieldWithDefault(msg, 2, "") + structPayload: (f = msg.getStructPayload()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f) }; if (includeInstance) { @@ -1244,23 +1224,23 @@ proto.nitric.queue.v1.QueueCompleteRequest.toObject = function(includeInstance, /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.queue.v1.QueueCompleteRequest} + * @return {!proto.nitric.proto.queues.v1.QueueMessage} */ -proto.nitric.queue.v1.QueueCompleteRequest.deserializeBinary = function(bytes) { +proto.nitric.proto.queues.v1.QueueMessage.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.queue.v1.QueueCompleteRequest; - return proto.nitric.queue.v1.QueueCompleteRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.nitric.proto.queues.v1.QueueMessage; + return proto.nitric.proto.queues.v1.QueueMessage.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.nitric.queue.v1.QueueCompleteRequest} msg The message object to deserialize into. + * @param {!proto.nitric.proto.queues.v1.QueueMessage} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.queue.v1.QueueCompleteRequest} + * @return {!proto.nitric.proto.queues.v1.QueueMessage} */ -proto.nitric.queue.v1.QueueCompleteRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.nitric.proto.queues.v1.QueueMessage.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1268,12 +1248,9 @@ proto.nitric.queue.v1.QueueCompleteRequest.deserializeBinaryFromReader = functio var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setQueue(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setLeaseId(value); + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setStructPayload(value); break; default: reader.skipField(); @@ -1288,9 +1265,9 @@ proto.nitric.queue.v1.QueueCompleteRequest.deserializeBinaryFromReader = functio * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.nitric.queue.v1.QueueCompleteRequest.prototype.serializeBinary = function() { +proto.nitric.proto.queues.v1.QueueMessage.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.nitric.queue.v1.QueueCompleteRequest.serializeBinaryToWriter(this, writer); + proto.nitric.proto.queues.v1.QueueMessage.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1298,163 +1275,57 @@ proto.nitric.queue.v1.QueueCompleteRequest.prototype.serializeBinary = function( /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.nitric.queue.v1.QueueCompleteRequest} message + * @param {!proto.nitric.proto.queues.v1.QueueMessage} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.queue.v1.QueueCompleteRequest.serializeBinaryToWriter = function(message, writer) { +proto.nitric.proto.queues.v1.QueueMessage.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getQueue(); - if (f.length > 0) { - writer.writeString( + f = message.getStructPayload(); + if (f != null) { + writer.writeMessage( 1, - f - ); - } - f = message.getLeaseId(); - if (f.length > 0) { - writer.writeString( - 2, - f + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter ); } }; /** - * optional string queue = 1; - * @return {string} - */ -proto.nitric.queue.v1.QueueCompleteRequest.prototype.getQueue = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.queue.v1.QueueCompleteRequest} returns this - */ -proto.nitric.queue.v1.QueueCompleteRequest.prototype.setQueue = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string lease_id = 2; - * @return {string} - */ -proto.nitric.queue.v1.QueueCompleteRequest.prototype.getLeaseId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.queue.v1.QueueCompleteRequest} returns this - */ -proto.nitric.queue.v1.QueueCompleteRequest.prototype.setLeaseId = 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.nitric.queue.v1.QueueCompleteResponse.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.queue.v1.QueueCompleteResponse.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.nitric.queue.v1.QueueCompleteResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.queue.v1.QueueCompleteResponse.toObject = function(includeInstance, msg) { - var f, obj = { - - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.queue.v1.QueueCompleteResponse} + * optional google.protobuf.Struct struct_payload = 1; + * @return {?proto.google.protobuf.Struct} */ -proto.nitric.queue.v1.QueueCompleteResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.queue.v1.QueueCompleteResponse; - return proto.nitric.queue.v1.QueueCompleteResponse.deserializeBinaryFromReader(msg, reader); +proto.nitric.proto.queues.v1.QueueMessage.prototype.getStructPayload = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 1)); }; /** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.queue.v1.QueueCompleteResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.queue.v1.QueueCompleteResponse} - */ -proto.nitric.queue.v1.QueueCompleteResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - default: - reader.skipField(); - break; - } - } - return msg; + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.nitric.proto.queues.v1.QueueMessage} returns this +*/ +proto.nitric.proto.queues.v1.QueueMessage.prototype.setStructPayload = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.nitric.proto.queues.v1.QueueMessage.oneofGroups_[0], value); }; /** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.queues.v1.QueueMessage} returns this */ -proto.nitric.queue.v1.QueueCompleteResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.queue.v1.QueueCompleteResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); +proto.nitric.proto.queues.v1.QueueMessage.prototype.clearStructPayload = function() { + return this.setStructPayload(undefined); }; /** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.queue.v1.QueueCompleteResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages + * Returns whether this field is set. + * @return {boolean} */ -proto.nitric.queue.v1.QueueCompleteResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; +proto.nitric.proto.queues.v1.QueueMessage.prototype.hasStructPayload = function() { + return jspb.Message.getField(this, 1) != null; }; @@ -1474,8 +1345,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.nitric.queue.v1.FailedTask.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.queue.v1.FailedTask.toObject(opt_includeInstance, this); +proto.nitric.proto.queues.v1.DequeuedMessage.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.queues.v1.DequeuedMessage.toObject(opt_includeInstance, this); }; @@ -1484,14 +1355,14 @@ proto.nitric.queue.v1.FailedTask.prototype.toObject = function(opt_includeInstan * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.nitric.queue.v1.FailedTask} msg The msg instance to transform. + * @param {!proto.nitric.proto.queues.v1.DequeuedMessage} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.queue.v1.FailedTask.toObject = function(includeInstance, msg) { +proto.nitric.proto.queues.v1.DequeuedMessage.toObject = function(includeInstance, msg) { var f, obj = { - task: (f = msg.getTask()) && proto.nitric.queue.v1.NitricTask.toObject(includeInstance, f), - message: jspb.Message.getFieldWithDefault(msg, 2, "") + leaseId: jspb.Message.getFieldWithDefault(msg, 1, ""), + message: (f = msg.getMessage()) && proto.nitric.proto.queues.v1.QueueMessage.toObject(includeInstance, f) }; if (includeInstance) { @@ -1505,23 +1376,23 @@ proto.nitric.queue.v1.FailedTask.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.queue.v1.FailedTask} + * @return {!proto.nitric.proto.queues.v1.DequeuedMessage} */ -proto.nitric.queue.v1.FailedTask.deserializeBinary = function(bytes) { +proto.nitric.proto.queues.v1.DequeuedMessage.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.queue.v1.FailedTask; - return proto.nitric.queue.v1.FailedTask.deserializeBinaryFromReader(msg, reader); + var msg = new proto.nitric.proto.queues.v1.DequeuedMessage; + return proto.nitric.proto.queues.v1.DequeuedMessage.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.nitric.queue.v1.FailedTask} msg The message object to deserialize into. + * @param {!proto.nitric.proto.queues.v1.DequeuedMessage} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.queue.v1.FailedTask} + * @return {!proto.nitric.proto.queues.v1.DequeuedMessage} */ -proto.nitric.queue.v1.FailedTask.deserializeBinaryFromReader = function(msg, reader) { +proto.nitric.proto.queues.v1.DequeuedMessage.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1529,12 +1400,12 @@ proto.nitric.queue.v1.FailedTask.deserializeBinaryFromReader = function(msg, rea var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.nitric.queue.v1.NitricTask; - reader.readMessage(value,proto.nitric.queue.v1.NitricTask.deserializeBinaryFromReader); - msg.setTask(value); + var value = /** @type {string} */ (reader.readString()); + msg.setLeaseId(value); break; case 2: - var value = /** @type {string} */ (reader.readString()); + var value = new proto.nitric.proto.queues.v1.QueueMessage; + reader.readMessage(value,proto.nitric.proto.queues.v1.QueueMessage.deserializeBinaryFromReader); msg.setMessage(value); break; default: @@ -1550,9 +1421,9 @@ proto.nitric.queue.v1.FailedTask.deserializeBinaryFromReader = function(msg, rea * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.nitric.queue.v1.FailedTask.prototype.serializeBinary = function() { +proto.nitric.proto.queues.v1.DequeuedMessage.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.nitric.queue.v1.FailedTask.serializeBinaryToWriter(this, writer); + proto.nitric.proto.queues.v1.DequeuedMessage.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1560,82 +1431,82 @@ proto.nitric.queue.v1.FailedTask.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.nitric.queue.v1.FailedTask} message + * @param {!proto.nitric.proto.queues.v1.DequeuedMessage} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.queue.v1.FailedTask.serializeBinaryToWriter = function(message, writer) { +proto.nitric.proto.queues.v1.DequeuedMessage.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getTask(); - if (f != null) { - writer.writeMessage( + f = message.getLeaseId(); + if (f.length > 0) { + writer.writeString( 1, - f, - proto.nitric.queue.v1.NitricTask.serializeBinaryToWriter + f ); } f = message.getMessage(); - if (f.length > 0) { - writer.writeString( + if (f != null) { + writer.writeMessage( 2, - f + f, + proto.nitric.proto.queues.v1.QueueMessage.serializeBinaryToWriter ); } }; /** - * optional NitricTask task = 1; - * @return {?proto.nitric.queue.v1.NitricTask} + * optional string lease_id = 1; + * @return {string} */ -proto.nitric.queue.v1.FailedTask.prototype.getTask = function() { - return /** @type{?proto.nitric.queue.v1.NitricTask} */ ( - jspb.Message.getWrapperField(this, proto.nitric.queue.v1.NitricTask, 1)); +proto.nitric.proto.queues.v1.DequeuedMessage.prototype.getLeaseId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * @param {?proto.nitric.queue.v1.NitricTask|undefined} value - * @return {!proto.nitric.queue.v1.FailedTask} returns this -*/ -proto.nitric.queue.v1.FailedTask.prototype.setTask = function(value) { - return jspb.Message.setWrapperField(this, 1, value); + * @param {string} value + * @return {!proto.nitric.proto.queues.v1.DequeuedMessage} returns this + */ +proto.nitric.proto.queues.v1.DequeuedMessage.prototype.setLeaseId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); }; /** - * Clears the message field making it undefined. - * @return {!proto.nitric.queue.v1.FailedTask} returns this + * optional QueueMessage message = 2; + * @return {?proto.nitric.proto.queues.v1.QueueMessage} */ -proto.nitric.queue.v1.FailedTask.prototype.clearTask = function() { - return this.setTask(undefined); +proto.nitric.proto.queues.v1.DequeuedMessage.prototype.getMessage = function() { + return /** @type{?proto.nitric.proto.queues.v1.QueueMessage} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.queues.v1.QueueMessage, 2)); }; /** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.queue.v1.FailedTask.prototype.hasTask = function() { - return jspb.Message.getField(this, 1) != null; + * @param {?proto.nitric.proto.queues.v1.QueueMessage|undefined} value + * @return {!proto.nitric.proto.queues.v1.DequeuedMessage} returns this +*/ +proto.nitric.proto.queues.v1.DequeuedMessage.prototype.setMessage = function(value) { + return jspb.Message.setWrapperField(this, 2, value); }; /** - * optional string message = 2; - * @return {string} + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.queues.v1.DequeuedMessage} returns this */ -proto.nitric.queue.v1.FailedTask.prototype.getMessage = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +proto.nitric.proto.queues.v1.DequeuedMessage.prototype.clearMessage = function() { + return this.setMessage(undefined); }; /** - * @param {string} value - * @return {!proto.nitric.queue.v1.FailedTask} returns this + * Returns whether this field is set. + * @return {boolean} */ -proto.nitric.queue.v1.FailedTask.prototype.setMessage = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); +proto.nitric.proto.queues.v1.DequeuedMessage.prototype.hasMessage = function() { + return jspb.Message.getField(this, 2) != null; }; @@ -1655,8 +1526,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.nitric.queue.v1.NitricTask.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.queue.v1.NitricTask.toObject(opt_includeInstance, this); +proto.nitric.proto.queues.v1.FailedEnqueueMessage.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.queues.v1.FailedEnqueueMessage.toObject(opt_includeInstance, this); }; @@ -1665,16 +1536,14 @@ proto.nitric.queue.v1.NitricTask.prototype.toObject = function(opt_includeInstan * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.nitric.queue.v1.NitricTask} msg The msg instance to transform. + * @param {!proto.nitric.proto.queues.v1.FailedEnqueueMessage} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.queue.v1.NitricTask.toObject = function(includeInstance, msg) { +proto.nitric.proto.queues.v1.FailedEnqueueMessage.toObject = function(includeInstance, msg) { var f, obj = { - id: jspb.Message.getFieldWithDefault(msg, 1, ""), - leaseId: jspb.Message.getFieldWithDefault(msg, 2, ""), - payloadType: jspb.Message.getFieldWithDefault(msg, 3, ""), - payload: (f = msg.getPayload()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f) + message: (f = msg.getMessage()) && proto.nitric.proto.queues.v1.QueueMessage.toObject(includeInstance, f), + details: jspb.Message.getFieldWithDefault(msg, 2, "") }; if (includeInstance) { @@ -1688,23 +1557,23 @@ proto.nitric.queue.v1.NitricTask.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.queue.v1.NitricTask} + * @return {!proto.nitric.proto.queues.v1.FailedEnqueueMessage} */ -proto.nitric.queue.v1.NitricTask.deserializeBinary = function(bytes) { +proto.nitric.proto.queues.v1.FailedEnqueueMessage.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.queue.v1.NitricTask; - return proto.nitric.queue.v1.NitricTask.deserializeBinaryFromReader(msg, reader); + var msg = new proto.nitric.proto.queues.v1.FailedEnqueueMessage; + return proto.nitric.proto.queues.v1.FailedEnqueueMessage.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.nitric.queue.v1.NitricTask} msg The message object to deserialize into. + * @param {!proto.nitric.proto.queues.v1.FailedEnqueueMessage} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.queue.v1.NitricTask} + * @return {!proto.nitric.proto.queues.v1.FailedEnqueueMessage} */ -proto.nitric.queue.v1.NitricTask.deserializeBinaryFromReader = function(msg, reader) { +proto.nitric.proto.queues.v1.FailedEnqueueMessage.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1712,21 +1581,13 @@ proto.nitric.queue.v1.NitricTask.deserializeBinaryFromReader = function(msg, rea var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setId(value); + var value = new proto.nitric.proto.queues.v1.QueueMessage; + reader.readMessage(value,proto.nitric.proto.queues.v1.QueueMessage.deserializeBinaryFromReader); + msg.setMessage(value); break; case 2: var value = /** @type {string} */ (reader.readString()); - msg.setLeaseId(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setPayloadType(value); - break; - case 4: - var value = new google_protobuf_struct_pb.Struct; - reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); - msg.setPayload(value); + msg.setDetails(value); break; default: reader.skipField(); @@ -1741,9 +1602,9 @@ proto.nitric.queue.v1.NitricTask.deserializeBinaryFromReader = function(msg, rea * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.nitric.queue.v1.NitricTask.prototype.serializeBinary = function() { +proto.nitric.proto.queues.v1.FailedEnqueueMessage.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.nitric.queue.v1.NitricTask.serializeBinaryToWriter(this, writer); + proto.nitric.proto.queues.v1.FailedEnqueueMessage.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1751,133 +1612,83 @@ proto.nitric.queue.v1.NitricTask.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.nitric.queue.v1.NitricTask} message + * @param {!proto.nitric.proto.queues.v1.FailedEnqueueMessage} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.queue.v1.NitricTask.serializeBinaryToWriter = function(message, writer) { +proto.nitric.proto.queues.v1.FailedEnqueueMessage.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getId(); - if (f.length > 0) { - writer.writeString( + f = message.getMessage(); + if (f != null) { + writer.writeMessage( 1, - f + f, + proto.nitric.proto.queues.v1.QueueMessage.serializeBinaryToWriter ); } - f = message.getLeaseId(); + f = message.getDetails(); if (f.length > 0) { writer.writeString( 2, f ); } - f = message.getPayloadType(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } - f = message.getPayload(); - if (f != null) { - writer.writeMessage( - 4, - f, - google_protobuf_struct_pb.Struct.serializeBinaryToWriter - ); - } }; /** - * optional string id = 1; - * @return {string} + * optional QueueMessage message = 1; + * @return {?proto.nitric.proto.queues.v1.QueueMessage} */ -proto.nitric.queue.v1.NitricTask.prototype.getId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +proto.nitric.proto.queues.v1.FailedEnqueueMessage.prototype.getMessage = function() { + return /** @type{?proto.nitric.proto.queues.v1.QueueMessage} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.queues.v1.QueueMessage, 1)); }; /** - * @param {string} value - * @return {!proto.nitric.queue.v1.NitricTask} returns this - */ -proto.nitric.queue.v1.NitricTask.prototype.setId = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); + * @param {?proto.nitric.proto.queues.v1.QueueMessage|undefined} value + * @return {!proto.nitric.proto.queues.v1.FailedEnqueueMessage} returns this +*/ +proto.nitric.proto.queues.v1.FailedEnqueueMessage.prototype.setMessage = function(value) { + return jspb.Message.setWrapperField(this, 1, value); }; /** - * optional string lease_id = 2; - * @return {string} + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.queues.v1.FailedEnqueueMessage} returns this */ -proto.nitric.queue.v1.NitricTask.prototype.getLeaseId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +proto.nitric.proto.queues.v1.FailedEnqueueMessage.prototype.clearMessage = function() { + return this.setMessage(undefined); }; /** - * @param {string} value - * @return {!proto.nitric.queue.v1.NitricTask} returns this + * Returns whether this field is set. + * @return {boolean} */ -proto.nitric.queue.v1.NitricTask.prototype.setLeaseId = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); +proto.nitric.proto.queues.v1.FailedEnqueueMessage.prototype.hasMessage = function() { + return jspb.Message.getField(this, 1) != null; }; /** - * optional string payload_type = 3; + * optional string details = 2; * @return {string} */ -proto.nitric.queue.v1.NitricTask.prototype.getPayloadType = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +proto.nitric.proto.queues.v1.FailedEnqueueMessage.prototype.getDetails = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * @param {string} value - * @return {!proto.nitric.queue.v1.NitricTask} returns this - */ -proto.nitric.queue.v1.NitricTask.prototype.setPayloadType = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - -/** - * optional google.protobuf.Struct payload = 4; - * @return {?proto.google.protobuf.Struct} - */ -proto.nitric.queue.v1.NitricTask.prototype.getPayload = function() { - return /** @type{?proto.google.protobuf.Struct} */ ( - jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 4)); -}; - - -/** - * @param {?proto.google.protobuf.Struct|undefined} value - * @return {!proto.nitric.queue.v1.NitricTask} returns this -*/ -proto.nitric.queue.v1.NitricTask.prototype.setPayload = function(value) { - return jspb.Message.setWrapperField(this, 4, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.queue.v1.NitricTask} returns this - */ -proto.nitric.queue.v1.NitricTask.prototype.clearPayload = function() { - return this.setPayload(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} + * @return {!proto.nitric.proto.queues.v1.FailedEnqueueMessage} returns this */ -proto.nitric.queue.v1.NitricTask.prototype.hasPayload = function() { - return jspb.Message.getField(this, 4) != null; +proto.nitric.proto.queues.v1.FailedEnqueueMessage.prototype.setDetails = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); }; -goog.object.extend(exports, proto.nitric.queue.v1); +goog.object.extend(exports, proto.nitric.proto.queues.v1); diff --git a/src/gen/nitric/proto/resources/v1/resources_grpc_pb.d.ts b/src/gen/nitric/proto/resources/v1/resources_grpc_pb.d.ts new file mode 100644 index 00000000..f1097379 --- /dev/null +++ b/src/gen/nitric/proto/resources/v1/resources_grpc_pb.d.ts @@ -0,0 +1,24 @@ +// GENERATED CODE -- DO NOT EDIT! + +// package: nitric.proto.resources.v1 +// file: nitric/proto/resources/v1/resources.proto + +import * as nitric_proto_resources_v1_resources_pb from "../../../../nitric/proto/resources/v1/resources_pb"; +import * as grpc from "@grpc/grpc-js"; + +interface IResourcesService extends grpc.ServiceDefinition { + declare: grpc.MethodDefinition; +} + +export const ResourcesService: IResourcesService; + +export interface IResourcesServer extends grpc.UntypedServiceImplementation { + declare: grpc.handleUnaryCall; +} + +export class ResourcesClient extends grpc.Client { + constructor(address: string, credentials: grpc.ChannelCredentials, options?: object); + declare(argument: nitric_proto_resources_v1_resources_pb.ResourceDeclareRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + declare(argument: nitric_proto_resources_v1_resources_pb.ResourceDeclareRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + declare(argument: nitric_proto_resources_v1_resources_pb.ResourceDeclareRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; +} diff --git a/src/gen/nitric/proto/resources/v1/resources_grpc_pb.js b/src/gen/nitric/proto/resources/v1/resources_grpc_pb.js new file mode 100644 index 00000000..e5ef1e7e --- /dev/null +++ b/src/gen/nitric/proto/resources/v1/resources_grpc_pb.js @@ -0,0 +1,49 @@ +// GENERATED CODE -- DO NOT EDIT! + +'use strict'; +var grpc = require('@grpc/grpc-js'); +var nitric_proto_resources_v1_resources_pb = require('../../../../nitric/proto/resources/v1/resources_pb.js'); + +function serialize_nitric_proto_resources_v1_ResourceDeclareRequest(arg) { + if (!(arg instanceof nitric_proto_resources_v1_resources_pb.ResourceDeclareRequest)) { + throw new Error('Expected argument of type nitric.proto.resources.v1.ResourceDeclareRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_resources_v1_ResourceDeclareRequest(buffer_arg) { + return nitric_proto_resources_v1_resources_pb.ResourceDeclareRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_resources_v1_ResourceDeclareResponse(arg) { + if (!(arg instanceof nitric_proto_resources_v1_resources_pb.ResourceDeclareResponse)) { + throw new Error('Expected argument of type nitric.proto.resources.v1.ResourceDeclareResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_resources_v1_ResourceDeclareResponse(buffer_arg) { + return nitric_proto_resources_v1_resources_pb.ResourceDeclareResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + + +// Nitric Resource Service +// The service definition exists to allow a nitric application to declare peripheral dependencies +var ResourcesService = exports.ResourcesService = { + // Declare a resource for the nitric application +// At Deploy time this will create resources as part of the nitric stacks dependency graph +// At runtime +declare: { + path: '/nitric.proto.resources.v1.Resources/Declare', + requestStream: false, + responseStream: false, + requestType: nitric_proto_resources_v1_resources_pb.ResourceDeclareRequest, + responseType: nitric_proto_resources_v1_resources_pb.ResourceDeclareResponse, + requestSerialize: serialize_nitric_proto_resources_v1_ResourceDeclareRequest, + requestDeserialize: deserialize_nitric_proto_resources_v1_ResourceDeclareRequest, + responseSerialize: serialize_nitric_proto_resources_v1_ResourceDeclareResponse, + responseDeserialize: deserialize_nitric_proto_resources_v1_ResourceDeclareResponse, + }, +}; + +exports.ResourcesClient = grpc.makeGenericClientConstructor(ResourcesService); diff --git a/src/gen/proto/resource/v1/resource_pb.d.ts b/src/gen/nitric/proto/resources/v1/resources_pb.d.ts similarity index 56% rename from src/gen/proto/resource/v1/resource_pb.d.ts rename to src/gen/nitric/proto/resources/v1/resources_pb.d.ts index 8632bdb6..55effb7f 100644 --- a/src/gen/proto/resource/v1/resource_pb.d.ts +++ b/src/gen/nitric/proto/resources/v1/resources_pb.d.ts @@ -1,13 +1,13 @@ -// package: nitric.resource.v1 -// file: proto/resource/v1/resource.proto +// package: nitric.proto.resources.v1 +// file: nitric/proto/resources/v1/resources.proto import * as jspb from "google-protobuf"; export class PolicyResource extends jspb.Message { clearPrincipalsList(): void; - getPrincipalsList(): Array; - setPrincipalsList(value: Array): void; - addPrincipals(value?: Resource, index?: number): Resource; + getPrincipalsList(): Array; + setPrincipalsList(value: Array): void; + addPrincipals(value?: ResourceIdentifier, index?: number): ResourceIdentifier; clearActionsList(): void; getActionsList(): Array; @@ -15,9 +15,9 @@ export class PolicyResource extends jspb.Message { addActions(value: ActionMap[keyof ActionMap], index?: number): ActionMap[keyof ActionMap]; clearResourcesList(): void; - getResourcesList(): Array; - setResourcesList(value: Array): void; - addResources(value?: Resource, index?: number): Resource; + getResourcesList(): Array; + setResourcesList(value: Array): void; + addResources(value?: ResourceIdentifier, index?: number): ResourceIdentifier; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): PolicyResource.AsObject; @@ -31,13 +31,13 @@ export class PolicyResource extends jspb.Message { export namespace PolicyResource { export type AsObject = { - principalsList: Array, + principalsList: Array, actionsList: Array, - resourcesList: Array, + resourcesList: Array, } } -export class Resource extends jspb.Message { +export class ResourceIdentifier extends jspb.Message { getType(): ResourceTypeMap[keyof ResourceTypeMap]; setType(value: ResourceTypeMap[keyof ResourceTypeMap]): void; @@ -45,16 +45,16 @@ export class Resource extends jspb.Message { setName(value: string): void; serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Resource.AsObject; - static toObject(includeInstance: boolean, msg: Resource): Resource.AsObject; + toObject(includeInstance?: boolean): ResourceIdentifier.AsObject; + static toObject(includeInstance: boolean, msg: ResourceIdentifier): ResourceIdentifier.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo}; static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Resource, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Resource; - static deserializeBinaryFromReader(message: Resource, reader: jspb.BinaryReader): Resource; + static serializeBinaryToWriter(message: ResourceIdentifier, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ResourceIdentifier; + static deserializeBinaryFromReader(message: ResourceIdentifier, reader: jspb.BinaryReader): ResourceIdentifier; } -export namespace Resource { +export namespace ResourceIdentifier { export type AsObject = { type: ResourceTypeMap[keyof ResourceTypeMap], name: string, @@ -62,10 +62,10 @@ export namespace Resource { } export class ResourceDeclareRequest extends jspb.Message { - hasResource(): boolean; - clearResource(): void; - getResource(): Resource | undefined; - setResource(value?: Resource): void; + hasId(): boolean; + clearId(): void; + getId(): ResourceIdentifier | undefined; + setId(value?: ResourceIdentifier): void; hasPolicy(): boolean; clearPolicy(): void; @@ -77,20 +77,15 @@ export class ResourceDeclareRequest extends jspb.Message { getBucket(): BucketResource | undefined; setBucket(value?: BucketResource): void; - hasQueue(): boolean; - clearQueue(): void; - getQueue(): QueueResource | undefined; - setQueue(value?: QueueResource): void; - hasTopic(): boolean; clearTopic(): void; getTopic(): TopicResource | undefined; setTopic(value?: TopicResource): void; - hasCollection(): boolean; - clearCollection(): void; - getCollection(): CollectionResource | undefined; - setCollection(value?: CollectionResource): void; + hasKeyValueStore(): boolean; + clearKeyValueStore(): void; + getKeyValueStore(): KeyValueStoreResource | undefined; + setKeyValueStore(value?: KeyValueStoreResource): void; hasSecret(): boolean; clearSecret(): void; @@ -102,6 +97,16 @@ export class ResourceDeclareRequest extends jspb.Message { getApi(): ApiResource | undefined; setApi(value?: ApiResource): void; + hasApiSecurityDefinition(): boolean; + clearApiSecurityDefinition(): void; + getApiSecurityDefinition(): ApiSecurityDefinitionResource | undefined; + setApiSecurityDefinition(value?: ApiSecurityDefinitionResource): void; + + hasQueue(): boolean; + clearQueue(): void; + getQueue(): QueueResource | undefined; + setQueue(value?: QueueResource): void; + getConfigCase(): ResourceDeclareRequest.ConfigCase; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): ResourceDeclareRequest.AsObject; @@ -115,25 +120,27 @@ export class ResourceDeclareRequest extends jspb.Message { export namespace ResourceDeclareRequest { export type AsObject = { - resource?: Resource.AsObject, + id?: ResourceIdentifier.AsObject, policy?: PolicyResource.AsObject, bucket?: BucketResource.AsObject, - queue?: QueueResource.AsObject, topic?: TopicResource.AsObject, - collection?: CollectionResource.AsObject, + keyValueStore?: KeyValueStoreResource.AsObject, secret?: SecretResource.AsObject, api?: ApiResource.AsObject, + apiSecurityDefinition?: ApiSecurityDefinitionResource.AsObject, + queue?: QueueResource.AsObject, } export enum ConfigCase { CONFIG_NOT_SET = 0, POLICY = 10, BUCKET = 11, - QUEUE = 12, - TOPIC = 13, - COLLECTION = 14, - SECRET = 15, - API = 16, + TOPIC = 12, + KEY_VALUE_STORE = 13, + SECRET = 14, + API = 15, + API_SECURITY_DEFINITION = 16, + QUEUE = 17, } } @@ -153,50 +160,50 @@ export namespace BucketResource { } } -export class QueueResource extends jspb.Message { +export class TopicResource extends jspb.Message { serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): QueueResource.AsObject; - static toObject(includeInstance: boolean, msg: QueueResource): QueueResource.AsObject; + toObject(includeInstance?: boolean): TopicResource.AsObject; + static toObject(includeInstance: boolean, msg: TopicResource): TopicResource.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo}; static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: QueueResource, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): QueueResource; - static deserializeBinaryFromReader(message: QueueResource, reader: jspb.BinaryReader): QueueResource; + static serializeBinaryToWriter(message: TopicResource, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): TopicResource; + static deserializeBinaryFromReader(message: TopicResource, reader: jspb.BinaryReader): TopicResource; } -export namespace QueueResource { +export namespace TopicResource { export type AsObject = { } } -export class TopicResource extends jspb.Message { +export class QueueResource extends jspb.Message { serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): TopicResource.AsObject; - static toObject(includeInstance: boolean, msg: TopicResource): TopicResource.AsObject; + toObject(includeInstance?: boolean): QueueResource.AsObject; + static toObject(includeInstance: boolean, msg: QueueResource): QueueResource.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo}; static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: TopicResource, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): TopicResource; - static deserializeBinaryFromReader(message: TopicResource, reader: jspb.BinaryReader): TopicResource; + static serializeBinaryToWriter(message: QueueResource, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): QueueResource; + static deserializeBinaryFromReader(message: QueueResource, reader: jspb.BinaryReader): QueueResource; } -export namespace TopicResource { +export namespace QueueResource { export type AsObject = { } } -export class CollectionResource extends jspb.Message { +export class KeyValueStoreResource extends jspb.Message { serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): CollectionResource.AsObject; - static toObject(includeInstance: boolean, msg: CollectionResource): CollectionResource.AsObject; + toObject(includeInstance?: boolean): KeyValueStoreResource.AsObject; + static toObject(includeInstance: boolean, msg: KeyValueStoreResource): KeyValueStoreResource.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo}; static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: CollectionResource, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): CollectionResource; - static deserializeBinaryFromReader(message: CollectionResource, reader: jspb.BinaryReader): CollectionResource; + static serializeBinaryToWriter(message: KeyValueStoreResource, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): KeyValueStoreResource; + static deserializeBinaryFromReader(message: KeyValueStoreResource, reader: jspb.BinaryReader): KeyValueStoreResource; } -export namespace CollectionResource { +export namespace KeyValueStoreResource { export type AsObject = { } } @@ -217,7 +224,7 @@ export namespace SecretResource { } } -export class ApiSecurityDefinitionJwt extends jspb.Message { +export class ApiOpenIdConnectionDefinition extends jspb.Message { getIssuer(): string; setIssuer(value: string): void; @@ -227,47 +234,51 @@ export class ApiSecurityDefinitionJwt extends jspb.Message { addAudiences(value: string, index?: number): string; serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): ApiSecurityDefinitionJwt.AsObject; - static toObject(includeInstance: boolean, msg: ApiSecurityDefinitionJwt): ApiSecurityDefinitionJwt.AsObject; + toObject(includeInstance?: boolean): ApiOpenIdConnectionDefinition.AsObject; + static toObject(includeInstance: boolean, msg: ApiOpenIdConnectionDefinition): ApiOpenIdConnectionDefinition.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo}; static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: ApiSecurityDefinitionJwt, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): ApiSecurityDefinitionJwt; - static deserializeBinaryFromReader(message: ApiSecurityDefinitionJwt, reader: jspb.BinaryReader): ApiSecurityDefinitionJwt; + static serializeBinaryToWriter(message: ApiOpenIdConnectionDefinition, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ApiOpenIdConnectionDefinition; + static deserializeBinaryFromReader(message: ApiOpenIdConnectionDefinition, reader: jspb.BinaryReader): ApiOpenIdConnectionDefinition; } -export namespace ApiSecurityDefinitionJwt { +export namespace ApiOpenIdConnectionDefinition { export type AsObject = { issuer: string, audiencesList: Array, } } -export class ApiSecurityDefinition extends jspb.Message { - hasJwt(): boolean; - clearJwt(): void; - getJwt(): ApiSecurityDefinitionJwt | undefined; - setJwt(value?: ApiSecurityDefinitionJwt): void; +export class ApiSecurityDefinitionResource extends jspb.Message { + getApiName(): string; + setApiName(value: string): void; + + hasOidc(): boolean; + clearOidc(): void; + getOidc(): ApiOpenIdConnectionDefinition | undefined; + setOidc(value?: ApiOpenIdConnectionDefinition): void; - getDefinitionCase(): ApiSecurityDefinition.DefinitionCase; + getDefinitionCase(): ApiSecurityDefinitionResource.DefinitionCase; serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): ApiSecurityDefinition.AsObject; - static toObject(includeInstance: boolean, msg: ApiSecurityDefinition): ApiSecurityDefinition.AsObject; + toObject(includeInstance?: boolean): ApiSecurityDefinitionResource.AsObject; + static toObject(includeInstance: boolean, msg: ApiSecurityDefinitionResource): ApiSecurityDefinitionResource.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo}; static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: ApiSecurityDefinition, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): ApiSecurityDefinition; - static deserializeBinaryFromReader(message: ApiSecurityDefinition, reader: jspb.BinaryReader): ApiSecurityDefinition; + static serializeBinaryToWriter(message: ApiSecurityDefinitionResource, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ApiSecurityDefinitionResource; + static deserializeBinaryFromReader(message: ApiSecurityDefinitionResource, reader: jspb.BinaryReader): ApiSecurityDefinitionResource; } -export namespace ApiSecurityDefinition { +export namespace ApiSecurityDefinitionResource { export type AsObject = { - jwt?: ApiSecurityDefinitionJwt.AsObject, + apiName: string, + oidc?: ApiOpenIdConnectionDefinition.AsObject, } export enum DefinitionCase { DEFINITION_NOT_SET = 0, - JWT = 1, + OIDC = 2, } } @@ -294,8 +305,6 @@ export namespace ApiScopes { } export class ApiResource extends jspb.Message { - getSecurityDefinitionsMap(): jspb.Map; - clearSecurityDefinitionsMap(): void; getSecurityMap(): jspb.Map; clearSecurityMap(): void; serializeBinary(): Uint8Array; @@ -310,7 +319,6 @@ export class ApiResource extends jspb.Message { export namespace ApiResource { export type AsObject = { - securityDefinitionsMap: Array<[string, ApiSecurityDefinition.AsObject]>, securityMap: Array<[string, ApiScopes.AsObject]>, } } @@ -331,129 +339,21 @@ export namespace ResourceDeclareResponse { } } -export class ApiResourceDetails extends jspb.Message { - getUrl(): string; - setUrl(value: string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): ApiResourceDetails.AsObject; - static toObject(includeInstance: boolean, msg: ApiResourceDetails): ApiResourceDetails.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: ApiResourceDetails, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): ApiResourceDetails; - static deserializeBinaryFromReader(message: ApiResourceDetails, reader: jspb.BinaryReader): ApiResourceDetails; -} - -export namespace ApiResourceDetails { - export type AsObject = { - url: string, - } -} - -export class WebsocketResourceDetails extends jspb.Message { - getUrl(): string; - setUrl(value: string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): WebsocketResourceDetails.AsObject; - static toObject(includeInstance: boolean, msg: WebsocketResourceDetails): WebsocketResourceDetails.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: WebsocketResourceDetails, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): WebsocketResourceDetails; - static deserializeBinaryFromReader(message: WebsocketResourceDetails, reader: jspb.BinaryReader): WebsocketResourceDetails; -} - -export namespace WebsocketResourceDetails { - export type AsObject = { - url: string, - } -} - -export class ResourceDetailsRequest extends jspb.Message { - hasResource(): boolean; - clearResource(): void; - getResource(): Resource | undefined; - setResource(value?: Resource): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): ResourceDetailsRequest.AsObject; - static toObject(includeInstance: boolean, msg: ResourceDetailsRequest): ResourceDetailsRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: ResourceDetailsRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): ResourceDetailsRequest; - static deserializeBinaryFromReader(message: ResourceDetailsRequest, reader: jspb.BinaryReader): ResourceDetailsRequest; -} - -export namespace ResourceDetailsRequest { - export type AsObject = { - resource?: Resource.AsObject, - } -} - -export class ResourceDetailsResponse extends jspb.Message { - getId(): string; - setId(value: string): void; - - getProvider(): string; - setProvider(value: string): void; - - getService(): string; - setService(value: string): void; - - hasApi(): boolean; - clearApi(): void; - getApi(): ApiResourceDetails | undefined; - setApi(value?: ApiResourceDetails): void; - - hasWebsocket(): boolean; - clearWebsocket(): void; - getWebsocket(): WebsocketResourceDetails | undefined; - setWebsocket(value?: WebsocketResourceDetails): void; - - getDetailsCase(): ResourceDetailsResponse.DetailsCase; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): ResourceDetailsResponse.AsObject; - static toObject(includeInstance: boolean, msg: ResourceDetailsResponse): ResourceDetailsResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: ResourceDetailsResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): ResourceDetailsResponse; - static deserializeBinaryFromReader(message: ResourceDetailsResponse, reader: jspb.BinaryReader): ResourceDetailsResponse; -} - -export namespace ResourceDetailsResponse { - export type AsObject = { - id: string, - provider: string, - service: string, - api?: ApiResourceDetails.AsObject, - websocket?: WebsocketResourceDetails.AsObject, - } - - export enum DetailsCase { - DETAILS_NOT_SET = 0, - API = 10, - WEBSOCKET = 11, - } -} - export interface ResourceTypeMap { API: 0; - FUNCTION: 1; + SERVICE: 1; BUCKET: 2; - QUEUE: 3; - TOPIC: 4; - SCHEDULE: 5; - SUBSCRIPTION: 6; - COLLECTION: 7; - POLICY: 8; - SECRET: 9; - NOTIFICATION: 10; - WEBSOCKET: 11; - HTTP: 12; + TOPIC: 3; + SCHEDULE: 4; + SUBSCRIPTION: 5; + KEYVALUESTORE: 6; + POLICY: 7; + SECRET: 8; + BUCKETLISTENER: 9; + WEBSOCKET: 10; + HTTP: 11; + APISECURITYDEFINITION: 12; + QUEUE: 13; } export const ResourceType: ResourceTypeMap; @@ -463,21 +363,15 @@ export interface ActionMap { BUCKETFILEGET: 1; BUCKETFILEPUT: 2; BUCKETFILEDELETE: 3; - TOPICLIST: 200; - TOPICDETAIL: 201; - TOPICEVENTPUBLISH: 202; - QUEUESEND: 300; - QUEUERECEIVE: 301; - QUEUELIST: 302; - QUEUEDETAIL: 303; - COLLECTIONDOCUMENTREAD: 400; - COLLECTIONDOCUMENTWRITE: 401; - COLLECTIONDOCUMENTDELETE: 402; - COLLECTIONQUERY: 403; - COLLECTIONLIST: 404; - SECRETPUT: 500; - SECRETACCESS: 501; - WEBSOCKETMANAGE: 600; + TOPICPUBLISH: 200; + KEYVALUESTOREREAD: 300; + KEYVALUESTOREWRITE: 301; + KEYVALUESTOREDELETE: 302; + SECRETPUT: 400; + SECRETACCESS: 401; + WEBSOCKETMANAGE: 500; + QUEUEENQUEUE: 600; + QUEUEDEQUEUE: 601; } export const Action: ActionMap; diff --git a/src/gen/nitric/proto/resources/v1/resources_pb.js b/src/gen/nitric/proto/resources/v1/resources_pb.js new file mode 100644 index 00000000..5fc3b0cd --- /dev/null +++ b/src/gen/nitric/proto/resources/v1/resources_pb.js @@ -0,0 +1,2655 @@ +// source: nitric/proto/resources/v1/resources.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() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +goog.exportSymbol('proto.nitric.proto.resources.v1.Action', null, global); +goog.exportSymbol('proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition', null, global); +goog.exportSymbol('proto.nitric.proto.resources.v1.ApiResource', null, global); +goog.exportSymbol('proto.nitric.proto.resources.v1.ApiScopes', null, global); +goog.exportSymbol('proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource', null, global); +goog.exportSymbol('proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource.DefinitionCase', null, global); +goog.exportSymbol('proto.nitric.proto.resources.v1.BucketResource', null, global); +goog.exportSymbol('proto.nitric.proto.resources.v1.KeyValueStoreResource', null, global); +goog.exportSymbol('proto.nitric.proto.resources.v1.PolicyResource', null, global); +goog.exportSymbol('proto.nitric.proto.resources.v1.QueueResource', null, global); +goog.exportSymbol('proto.nitric.proto.resources.v1.ResourceDeclareRequest', null, global); +goog.exportSymbol('proto.nitric.proto.resources.v1.ResourceDeclareRequest.ConfigCase', null, global); +goog.exportSymbol('proto.nitric.proto.resources.v1.ResourceDeclareResponse', null, global); +goog.exportSymbol('proto.nitric.proto.resources.v1.ResourceIdentifier', null, global); +goog.exportSymbol('proto.nitric.proto.resources.v1.ResourceType', null, global); +goog.exportSymbol('proto.nitric.proto.resources.v1.SecretResource', null, global); +goog.exportSymbol('proto.nitric.proto.resources.v1.TopicResource', 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.nitric.proto.resources.v1.PolicyResource = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.proto.resources.v1.PolicyResource.repeatedFields_, null); +}; +goog.inherits(proto.nitric.proto.resources.v1.PolicyResource, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.resources.v1.PolicyResource.displayName = 'proto.nitric.proto.resources.v1.PolicyResource'; +} +/** + * 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.nitric.proto.resources.v1.ResourceIdentifier = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.resources.v1.ResourceIdentifier, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.resources.v1.ResourceIdentifier.displayName = 'proto.nitric.proto.resources.v1.ResourceIdentifier'; +} +/** + * 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.nitric.proto.resources.v1.ResourceDeclareRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.proto.resources.v1.ResourceDeclareRequest.oneofGroups_); +}; +goog.inherits(proto.nitric.proto.resources.v1.ResourceDeclareRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.resources.v1.ResourceDeclareRequest.displayName = 'proto.nitric.proto.resources.v1.ResourceDeclareRequest'; +} +/** + * 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.nitric.proto.resources.v1.BucketResource = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.resources.v1.BucketResource, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.resources.v1.BucketResource.displayName = 'proto.nitric.proto.resources.v1.BucketResource'; +} +/** + * 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.nitric.proto.resources.v1.TopicResource = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.resources.v1.TopicResource, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.resources.v1.TopicResource.displayName = 'proto.nitric.proto.resources.v1.TopicResource'; +} +/** + * 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.nitric.proto.resources.v1.QueueResource = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.resources.v1.QueueResource, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.resources.v1.QueueResource.displayName = 'proto.nitric.proto.resources.v1.QueueResource'; +} +/** + * 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.nitric.proto.resources.v1.KeyValueStoreResource = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.resources.v1.KeyValueStoreResource, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.resources.v1.KeyValueStoreResource.displayName = 'proto.nitric.proto.resources.v1.KeyValueStoreResource'; +} +/** + * 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.nitric.proto.resources.v1.SecretResource = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.resources.v1.SecretResource, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.resources.v1.SecretResource.displayName = 'proto.nitric.proto.resources.v1.SecretResource'; +} +/** + * 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.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition.repeatedFields_, null); +}; +goog.inherits(proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition.displayName = 'proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition'; +} +/** + * 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.nitric.proto.resources.v1.ApiSecurityDefinitionResource = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource.oneofGroups_); +}; +goog.inherits(proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource.displayName = 'proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource'; +} +/** + * 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.nitric.proto.resources.v1.ApiScopes = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.proto.resources.v1.ApiScopes.repeatedFields_, null); +}; +goog.inherits(proto.nitric.proto.resources.v1.ApiScopes, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.resources.v1.ApiScopes.displayName = 'proto.nitric.proto.resources.v1.ApiScopes'; +} +/** + * 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.nitric.proto.resources.v1.ApiResource = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.resources.v1.ApiResource, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.resources.v1.ApiResource.displayName = 'proto.nitric.proto.resources.v1.ApiResource'; +} +/** + * 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.nitric.proto.resources.v1.ResourceDeclareResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.resources.v1.ResourceDeclareResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.resources.v1.ResourceDeclareResponse.displayName = 'proto.nitric.proto.resources.v1.ResourceDeclareResponse'; +} + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.nitric.proto.resources.v1.PolicyResource.repeatedFields_ = [1,2,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.nitric.proto.resources.v1.PolicyResource.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.resources.v1.PolicyResource.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.nitric.proto.resources.v1.PolicyResource} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.resources.v1.PolicyResource.toObject = function(includeInstance, msg) { + var f, obj = { + principalsList: jspb.Message.toObjectList(msg.getPrincipalsList(), + proto.nitric.proto.resources.v1.ResourceIdentifier.toObject, includeInstance), + actionsList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f, + resourcesList: jspb.Message.toObjectList(msg.getResourcesList(), + proto.nitric.proto.resources.v1.ResourceIdentifier.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.nitric.proto.resources.v1.PolicyResource} + */ +proto.nitric.proto.resources.v1.PolicyResource.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.resources.v1.PolicyResource; + return proto.nitric.proto.resources.v1.PolicyResource.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.resources.v1.PolicyResource} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.resources.v1.PolicyResource} + */ +proto.nitric.proto.resources.v1.PolicyResource.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.nitric.proto.resources.v1.ResourceIdentifier; + reader.readMessage(value,proto.nitric.proto.resources.v1.ResourceIdentifier.deserializeBinaryFromReader); + msg.addPrincipals(value); + break; + case 2: + var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedEnum() : [reader.readEnum()]); + for (var i = 0; i < values.length; i++) { + msg.addActions(values[i]); + } + break; + case 3: + var value = new proto.nitric.proto.resources.v1.ResourceIdentifier; + reader.readMessage(value,proto.nitric.proto.resources.v1.ResourceIdentifier.deserializeBinaryFromReader); + msg.addResources(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.resources.v1.PolicyResource.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.resources.v1.PolicyResource.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.resources.v1.PolicyResource} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.resources.v1.PolicyResource.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPrincipalsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.nitric.proto.resources.v1.ResourceIdentifier.serializeBinaryToWriter + ); + } + f = message.getActionsList(); + if (f.length > 0) { + writer.writePackedEnum( + 2, + f + ); + } + f = message.getResourcesList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 3, + f, + proto.nitric.proto.resources.v1.ResourceIdentifier.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated ResourceIdentifier principals = 1; + * @return {!Array} + */ +proto.nitric.proto.resources.v1.PolicyResource.prototype.getPrincipalsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.nitric.proto.resources.v1.ResourceIdentifier, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.nitric.proto.resources.v1.PolicyResource} returns this +*/ +proto.nitric.proto.resources.v1.PolicyResource.prototype.setPrincipalsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.nitric.proto.resources.v1.ResourceIdentifier=} opt_value + * @param {number=} opt_index + * @return {!proto.nitric.proto.resources.v1.ResourceIdentifier} + */ +proto.nitric.proto.resources.v1.PolicyResource.prototype.addPrincipals = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.nitric.proto.resources.v1.ResourceIdentifier, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.nitric.proto.resources.v1.PolicyResource} returns this + */ +proto.nitric.proto.resources.v1.PolicyResource.prototype.clearPrincipalsList = function() { + return this.setPrincipalsList([]); +}; + + +/** + * repeated Action actions = 2; + * @return {!Array} + */ +proto.nitric.proto.resources.v1.PolicyResource.prototype.getActionsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.nitric.proto.resources.v1.PolicyResource} returns this + */ +proto.nitric.proto.resources.v1.PolicyResource.prototype.setActionsList = function(value) { + return jspb.Message.setField(this, 2, value || []); +}; + + +/** + * @param {!proto.nitric.proto.resources.v1.Action} value + * @param {number=} opt_index + * @return {!proto.nitric.proto.resources.v1.PolicyResource} returns this + */ +proto.nitric.proto.resources.v1.PolicyResource.prototype.addActions = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 2, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.nitric.proto.resources.v1.PolicyResource} returns this + */ +proto.nitric.proto.resources.v1.PolicyResource.prototype.clearActionsList = function() { + return this.setActionsList([]); +}; + + +/** + * repeated ResourceIdentifier resources = 3; + * @return {!Array} + */ +proto.nitric.proto.resources.v1.PolicyResource.prototype.getResourcesList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.nitric.proto.resources.v1.ResourceIdentifier, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.nitric.proto.resources.v1.PolicyResource} returns this +*/ +proto.nitric.proto.resources.v1.PolicyResource.prototype.setResourcesList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 3, value); +}; + + +/** + * @param {!proto.nitric.proto.resources.v1.ResourceIdentifier=} opt_value + * @param {number=} opt_index + * @return {!proto.nitric.proto.resources.v1.ResourceIdentifier} + */ +proto.nitric.proto.resources.v1.PolicyResource.prototype.addResources = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.nitric.proto.resources.v1.ResourceIdentifier, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.nitric.proto.resources.v1.PolicyResource} returns this + */ +proto.nitric.proto.resources.v1.PolicyResource.prototype.clearResourcesList = function() { + return this.setResourcesList([]); +}; + + + + + +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.nitric.proto.resources.v1.ResourceIdentifier.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.resources.v1.ResourceIdentifier.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.nitric.proto.resources.v1.ResourceIdentifier} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.resources.v1.ResourceIdentifier.toObject = function(includeInstance, msg) { + var f, obj = { + type: jspb.Message.getFieldWithDefault(msg, 1, 0), + name: 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.nitric.proto.resources.v1.ResourceIdentifier} + */ +proto.nitric.proto.resources.v1.ResourceIdentifier.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.resources.v1.ResourceIdentifier; + return proto.nitric.proto.resources.v1.ResourceIdentifier.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.resources.v1.ResourceIdentifier} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.resources.v1.ResourceIdentifier} + */ +proto.nitric.proto.resources.v1.ResourceIdentifier.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.nitric.proto.resources.v1.ResourceType} */ (reader.readEnum()); + msg.setType(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.resources.v1.ResourceIdentifier.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.resources.v1.ResourceIdentifier.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.resources.v1.ResourceIdentifier} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.resources.v1.ResourceIdentifier.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getType(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional ResourceType type = 1; + * @return {!proto.nitric.proto.resources.v1.ResourceType} + */ +proto.nitric.proto.resources.v1.ResourceIdentifier.prototype.getType = function() { + return /** @type {!proto.nitric.proto.resources.v1.ResourceType} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {!proto.nitric.proto.resources.v1.ResourceType} value + * @return {!proto.nitric.proto.resources.v1.ResourceIdentifier} returns this + */ +proto.nitric.proto.resources.v1.ResourceIdentifier.prototype.setType = function(value) { + return jspb.Message.setProto3EnumField(this, 1, value); +}; + + +/** + * optional string name = 2; + * @return {string} + */ +proto.nitric.proto.resources.v1.ResourceIdentifier.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.resources.v1.ResourceIdentifier} returns this + */ +proto.nitric.proto.resources.v1.ResourceIdentifier.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.oneofGroups_ = [[10,11,12,13,14,15,16,17]]; + +/** + * @enum {number} + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.ConfigCase = { + CONFIG_NOT_SET: 0, + POLICY: 10, + BUCKET: 11, + TOPIC: 12, + KEY_VALUE_STORE: 13, + SECRET: 14, + API: 15, + API_SECURITY_DEFINITION: 16, + QUEUE: 17 +}; + +/** + * @return {proto.nitric.proto.resources.v1.ResourceDeclareRequest.ConfigCase} + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.getConfigCase = function() { + return /** @type {proto.nitric.proto.resources.v1.ResourceDeclareRequest.ConfigCase} */(jspb.Message.computeOneofCase(this, proto.nitric.proto.resources.v1.ResourceDeclareRequest.oneofGroups_[0])); +}; + + + +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.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.resources.v1.ResourceDeclareRequest.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.nitric.proto.resources.v1.ResourceDeclareRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.toObject = function(includeInstance, msg) { + var f, obj = { + id: (f = msg.getId()) && proto.nitric.proto.resources.v1.ResourceIdentifier.toObject(includeInstance, f), + policy: (f = msg.getPolicy()) && proto.nitric.proto.resources.v1.PolicyResource.toObject(includeInstance, f), + bucket: (f = msg.getBucket()) && proto.nitric.proto.resources.v1.BucketResource.toObject(includeInstance, f), + topic: (f = msg.getTopic()) && proto.nitric.proto.resources.v1.TopicResource.toObject(includeInstance, f), + keyValueStore: (f = msg.getKeyValueStore()) && proto.nitric.proto.resources.v1.KeyValueStoreResource.toObject(includeInstance, f), + secret: (f = msg.getSecret()) && proto.nitric.proto.resources.v1.SecretResource.toObject(includeInstance, f), + api: (f = msg.getApi()) && proto.nitric.proto.resources.v1.ApiResource.toObject(includeInstance, f), + apiSecurityDefinition: (f = msg.getApiSecurityDefinition()) && proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource.toObject(includeInstance, f), + queue: (f = msg.getQueue()) && proto.nitric.proto.resources.v1.QueueResource.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.nitric.proto.resources.v1.ResourceDeclareRequest} + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.resources.v1.ResourceDeclareRequest; + return proto.nitric.proto.resources.v1.ResourceDeclareRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.resources.v1.ResourceDeclareRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.resources.v1.ResourceDeclareRequest} + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.nitric.proto.resources.v1.ResourceIdentifier; + reader.readMessage(value,proto.nitric.proto.resources.v1.ResourceIdentifier.deserializeBinaryFromReader); + msg.setId(value); + break; + case 10: + var value = new proto.nitric.proto.resources.v1.PolicyResource; + reader.readMessage(value,proto.nitric.proto.resources.v1.PolicyResource.deserializeBinaryFromReader); + msg.setPolicy(value); + break; + case 11: + var value = new proto.nitric.proto.resources.v1.BucketResource; + reader.readMessage(value,proto.nitric.proto.resources.v1.BucketResource.deserializeBinaryFromReader); + msg.setBucket(value); + break; + case 12: + var value = new proto.nitric.proto.resources.v1.TopicResource; + reader.readMessage(value,proto.nitric.proto.resources.v1.TopicResource.deserializeBinaryFromReader); + msg.setTopic(value); + break; + case 13: + var value = new proto.nitric.proto.resources.v1.KeyValueStoreResource; + reader.readMessage(value,proto.nitric.proto.resources.v1.KeyValueStoreResource.deserializeBinaryFromReader); + msg.setKeyValueStore(value); + break; + case 14: + var value = new proto.nitric.proto.resources.v1.SecretResource; + reader.readMessage(value,proto.nitric.proto.resources.v1.SecretResource.deserializeBinaryFromReader); + msg.setSecret(value); + break; + case 15: + var value = new proto.nitric.proto.resources.v1.ApiResource; + reader.readMessage(value,proto.nitric.proto.resources.v1.ApiResource.deserializeBinaryFromReader); + msg.setApi(value); + break; + case 16: + var value = new proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource; + reader.readMessage(value,proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource.deserializeBinaryFromReader); + msg.setApiSecurityDefinition(value); + break; + case 17: + var value = new proto.nitric.proto.resources.v1.QueueResource; + reader.readMessage(value,proto.nitric.proto.resources.v1.QueueResource.deserializeBinaryFromReader); + msg.setQueue(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.resources.v1.ResourceDeclareRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.resources.v1.ResourceDeclareRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.nitric.proto.resources.v1.ResourceIdentifier.serializeBinaryToWriter + ); + } + f = message.getPolicy(); + if (f != null) { + writer.writeMessage( + 10, + f, + proto.nitric.proto.resources.v1.PolicyResource.serializeBinaryToWriter + ); + } + f = message.getBucket(); + if (f != null) { + writer.writeMessage( + 11, + f, + proto.nitric.proto.resources.v1.BucketResource.serializeBinaryToWriter + ); + } + f = message.getTopic(); + if (f != null) { + writer.writeMessage( + 12, + f, + proto.nitric.proto.resources.v1.TopicResource.serializeBinaryToWriter + ); + } + f = message.getKeyValueStore(); + if (f != null) { + writer.writeMessage( + 13, + f, + proto.nitric.proto.resources.v1.KeyValueStoreResource.serializeBinaryToWriter + ); + } + f = message.getSecret(); + if (f != null) { + writer.writeMessage( + 14, + f, + proto.nitric.proto.resources.v1.SecretResource.serializeBinaryToWriter + ); + } + f = message.getApi(); + if (f != null) { + writer.writeMessage( + 15, + f, + proto.nitric.proto.resources.v1.ApiResource.serializeBinaryToWriter + ); + } + f = message.getApiSecurityDefinition(); + if (f != null) { + writer.writeMessage( + 16, + f, + proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource.serializeBinaryToWriter + ); + } + f = message.getQueue(); + if (f != null) { + writer.writeMessage( + 17, + f, + proto.nitric.proto.resources.v1.QueueResource.serializeBinaryToWriter + ); + } +}; + + +/** + * optional ResourceIdentifier id = 1; + * @return {?proto.nitric.proto.resources.v1.ResourceIdentifier} + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.getId = function() { + return /** @type{?proto.nitric.proto.resources.v1.ResourceIdentifier} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.resources.v1.ResourceIdentifier, 1)); +}; + + +/** + * @param {?proto.nitric.proto.resources.v1.ResourceIdentifier|undefined} value + * @return {!proto.nitric.proto.resources.v1.ResourceDeclareRequest} returns this +*/ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.setId = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.resources.v1.ResourceDeclareRequest} returns this + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.clearId = function() { + return this.setId(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.hasId = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional PolicyResource policy = 10; + * @return {?proto.nitric.proto.resources.v1.PolicyResource} + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.getPolicy = function() { + return /** @type{?proto.nitric.proto.resources.v1.PolicyResource} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.resources.v1.PolicyResource, 10)); +}; + + +/** + * @param {?proto.nitric.proto.resources.v1.PolicyResource|undefined} value + * @return {!proto.nitric.proto.resources.v1.ResourceDeclareRequest} returns this +*/ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.setPolicy = function(value) { + return jspb.Message.setOneofWrapperField(this, 10, proto.nitric.proto.resources.v1.ResourceDeclareRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.resources.v1.ResourceDeclareRequest} returns this + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.clearPolicy = function() { + return this.setPolicy(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.hasPolicy = function() { + return jspb.Message.getField(this, 10) != null; +}; + + +/** + * optional BucketResource bucket = 11; + * @return {?proto.nitric.proto.resources.v1.BucketResource} + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.getBucket = function() { + return /** @type{?proto.nitric.proto.resources.v1.BucketResource} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.resources.v1.BucketResource, 11)); +}; + + +/** + * @param {?proto.nitric.proto.resources.v1.BucketResource|undefined} value + * @return {!proto.nitric.proto.resources.v1.ResourceDeclareRequest} returns this +*/ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.setBucket = function(value) { + return jspb.Message.setOneofWrapperField(this, 11, proto.nitric.proto.resources.v1.ResourceDeclareRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.resources.v1.ResourceDeclareRequest} returns this + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.clearBucket = function() { + return this.setBucket(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.hasBucket = function() { + return jspb.Message.getField(this, 11) != null; +}; + + +/** + * optional TopicResource topic = 12; + * @return {?proto.nitric.proto.resources.v1.TopicResource} + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.getTopic = function() { + return /** @type{?proto.nitric.proto.resources.v1.TopicResource} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.resources.v1.TopicResource, 12)); +}; + + +/** + * @param {?proto.nitric.proto.resources.v1.TopicResource|undefined} value + * @return {!proto.nitric.proto.resources.v1.ResourceDeclareRequest} returns this +*/ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.setTopic = function(value) { + return jspb.Message.setOneofWrapperField(this, 12, proto.nitric.proto.resources.v1.ResourceDeclareRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.resources.v1.ResourceDeclareRequest} returns this + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.clearTopic = function() { + return this.setTopic(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.hasTopic = function() { + return jspb.Message.getField(this, 12) != null; +}; + + +/** + * optional KeyValueStoreResource key_value_store = 13; + * @return {?proto.nitric.proto.resources.v1.KeyValueStoreResource} + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.getKeyValueStore = function() { + return /** @type{?proto.nitric.proto.resources.v1.KeyValueStoreResource} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.resources.v1.KeyValueStoreResource, 13)); +}; + + +/** + * @param {?proto.nitric.proto.resources.v1.KeyValueStoreResource|undefined} value + * @return {!proto.nitric.proto.resources.v1.ResourceDeclareRequest} returns this +*/ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.setKeyValueStore = function(value) { + return jspb.Message.setOneofWrapperField(this, 13, proto.nitric.proto.resources.v1.ResourceDeclareRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.resources.v1.ResourceDeclareRequest} returns this + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.clearKeyValueStore = function() { + return this.setKeyValueStore(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.hasKeyValueStore = function() { + return jspb.Message.getField(this, 13) != null; +}; + + +/** + * optional SecretResource secret = 14; + * @return {?proto.nitric.proto.resources.v1.SecretResource} + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.getSecret = function() { + return /** @type{?proto.nitric.proto.resources.v1.SecretResource} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.resources.v1.SecretResource, 14)); +}; + + +/** + * @param {?proto.nitric.proto.resources.v1.SecretResource|undefined} value + * @return {!proto.nitric.proto.resources.v1.ResourceDeclareRequest} returns this +*/ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.setSecret = function(value) { + return jspb.Message.setOneofWrapperField(this, 14, proto.nitric.proto.resources.v1.ResourceDeclareRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.resources.v1.ResourceDeclareRequest} returns this + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.clearSecret = function() { + return this.setSecret(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.hasSecret = function() { + return jspb.Message.getField(this, 14) != null; +}; + + +/** + * optional ApiResource api = 15; + * @return {?proto.nitric.proto.resources.v1.ApiResource} + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.getApi = function() { + return /** @type{?proto.nitric.proto.resources.v1.ApiResource} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.resources.v1.ApiResource, 15)); +}; + + +/** + * @param {?proto.nitric.proto.resources.v1.ApiResource|undefined} value + * @return {!proto.nitric.proto.resources.v1.ResourceDeclareRequest} returns this +*/ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.setApi = function(value) { + return jspb.Message.setOneofWrapperField(this, 15, proto.nitric.proto.resources.v1.ResourceDeclareRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.resources.v1.ResourceDeclareRequest} returns this + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.clearApi = function() { + return this.setApi(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.hasApi = function() { + return jspb.Message.getField(this, 15) != null; +}; + + +/** + * optional ApiSecurityDefinitionResource api_security_definition = 16; + * @return {?proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource} + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.getApiSecurityDefinition = function() { + return /** @type{?proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource, 16)); +}; + + +/** + * @param {?proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource|undefined} value + * @return {!proto.nitric.proto.resources.v1.ResourceDeclareRequest} returns this +*/ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.setApiSecurityDefinition = function(value) { + return jspb.Message.setOneofWrapperField(this, 16, proto.nitric.proto.resources.v1.ResourceDeclareRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.resources.v1.ResourceDeclareRequest} returns this + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.clearApiSecurityDefinition = function() { + return this.setApiSecurityDefinition(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.hasApiSecurityDefinition = function() { + return jspb.Message.getField(this, 16) != null; +}; + + +/** + * optional QueueResource queue = 17; + * @return {?proto.nitric.proto.resources.v1.QueueResource} + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.getQueue = function() { + return /** @type{?proto.nitric.proto.resources.v1.QueueResource} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.resources.v1.QueueResource, 17)); +}; + + +/** + * @param {?proto.nitric.proto.resources.v1.QueueResource|undefined} value + * @return {!proto.nitric.proto.resources.v1.ResourceDeclareRequest} returns this +*/ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.setQueue = function(value) { + return jspb.Message.setOneofWrapperField(this, 17, proto.nitric.proto.resources.v1.ResourceDeclareRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.resources.v1.ResourceDeclareRequest} returns this + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.clearQueue = function() { + return this.setQueue(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.resources.v1.ResourceDeclareRequest.prototype.hasQueue = function() { + return jspb.Message.getField(this, 17) != 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.nitric.proto.resources.v1.BucketResource.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.resources.v1.BucketResource.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.nitric.proto.resources.v1.BucketResource} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.resources.v1.BucketResource.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.proto.resources.v1.BucketResource} + */ +proto.nitric.proto.resources.v1.BucketResource.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.resources.v1.BucketResource; + return proto.nitric.proto.resources.v1.BucketResource.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.resources.v1.BucketResource} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.resources.v1.BucketResource} + */ +proto.nitric.proto.resources.v1.BucketResource.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.resources.v1.BucketResource.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.resources.v1.BucketResource.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.resources.v1.BucketResource} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.resources.v1.BucketResource.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +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.nitric.proto.resources.v1.TopicResource.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.resources.v1.TopicResource.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.nitric.proto.resources.v1.TopicResource} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.resources.v1.TopicResource.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.proto.resources.v1.TopicResource} + */ +proto.nitric.proto.resources.v1.TopicResource.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.resources.v1.TopicResource; + return proto.nitric.proto.resources.v1.TopicResource.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.resources.v1.TopicResource} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.resources.v1.TopicResource} + */ +proto.nitric.proto.resources.v1.TopicResource.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.resources.v1.TopicResource.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.resources.v1.TopicResource.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.resources.v1.TopicResource} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.resources.v1.TopicResource.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +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.nitric.proto.resources.v1.QueueResource.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.resources.v1.QueueResource.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.nitric.proto.resources.v1.QueueResource} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.resources.v1.QueueResource.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.proto.resources.v1.QueueResource} + */ +proto.nitric.proto.resources.v1.QueueResource.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.resources.v1.QueueResource; + return proto.nitric.proto.resources.v1.QueueResource.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.resources.v1.QueueResource} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.resources.v1.QueueResource} + */ +proto.nitric.proto.resources.v1.QueueResource.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.resources.v1.QueueResource.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.resources.v1.QueueResource.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.resources.v1.QueueResource} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.resources.v1.QueueResource.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +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.nitric.proto.resources.v1.KeyValueStoreResource.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.resources.v1.KeyValueStoreResource.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.nitric.proto.resources.v1.KeyValueStoreResource} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.resources.v1.KeyValueStoreResource.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.proto.resources.v1.KeyValueStoreResource} + */ +proto.nitric.proto.resources.v1.KeyValueStoreResource.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.resources.v1.KeyValueStoreResource; + return proto.nitric.proto.resources.v1.KeyValueStoreResource.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.resources.v1.KeyValueStoreResource} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.resources.v1.KeyValueStoreResource} + */ +proto.nitric.proto.resources.v1.KeyValueStoreResource.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.resources.v1.KeyValueStoreResource.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.resources.v1.KeyValueStoreResource.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.resources.v1.KeyValueStoreResource} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.resources.v1.KeyValueStoreResource.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +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.nitric.proto.resources.v1.SecretResource.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.resources.v1.SecretResource.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.nitric.proto.resources.v1.SecretResource} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.resources.v1.SecretResource.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.proto.resources.v1.SecretResource} + */ +proto.nitric.proto.resources.v1.SecretResource.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.resources.v1.SecretResource; + return proto.nitric.proto.resources.v1.SecretResource.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.resources.v1.SecretResource} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.resources.v1.SecretResource} + */ +proto.nitric.proto.resources.v1.SecretResource.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.resources.v1.SecretResource.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.resources.v1.SecretResource.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.resources.v1.SecretResource} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.resources.v1.SecretResource.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition.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.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition.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.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition.toObject = function(includeInstance, msg) { + var f, obj = { + issuer: jspb.Message.getFieldWithDefault(msg, 1, ""), + audiencesList: (f = jspb.Message.getRepeatedField(msg, 2)) == 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.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition} + */ +proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition; + return proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition} + */ +proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition.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.setIssuer(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.addAudiences(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getIssuer(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getAudiencesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 2, + f + ); + } +}; + + +/** + * optional string issuer = 1; + * @return {string} + */ +proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition.prototype.getIssuer = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition} returns this + */ +proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition.prototype.setIssuer = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * repeated string audiences = 2; + * @return {!Array} + */ +proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition.prototype.getAudiencesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition} returns this + */ +proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition.prototype.setAudiencesList = function(value) { + return jspb.Message.setField(this, 2, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition} returns this + */ +proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition.prototype.addAudiences = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 2, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition} returns this + */ +proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition.prototype.clearAudiencesList = function() { + return this.setAudiencesList([]); +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource.oneofGroups_ = [[2]]; + +/** + * @enum {number} + */ +proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource.DefinitionCase = { + DEFINITION_NOT_SET: 0, + OIDC: 2 +}; + +/** + * @return {proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource.DefinitionCase} + */ +proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource.prototype.getDefinitionCase = function() { + return /** @type {proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource.DefinitionCase} */(jspb.Message.computeOneofCase(this, proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource.oneofGroups_[0])); +}; + + + +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.nitric.proto.resources.v1.ApiSecurityDefinitionResource.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource.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.nitric.proto.resources.v1.ApiSecurityDefinitionResource} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource.toObject = function(includeInstance, msg) { + var f, obj = { + apiName: jspb.Message.getFieldWithDefault(msg, 1, ""), + oidc: (f = msg.getOidc()) && proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition.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.nitric.proto.resources.v1.ApiSecurityDefinitionResource} + */ +proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource; + return proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource} + */ +proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource.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.setApiName(value); + break; + case 2: + var value = new proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition; + reader.readMessage(value,proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition.deserializeBinaryFromReader); + msg.setOidc(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getApiName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getOidc(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string api_name = 1; + * @return {string} + */ +proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource.prototype.getApiName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource} returns this + */ +proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource.prototype.setApiName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional ApiOpenIdConnectionDefinition oidc = 2; + * @return {?proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition} + */ +proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource.prototype.getOidc = function() { + return /** @type{?proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition, 2)); +}; + + +/** + * @param {?proto.nitric.proto.resources.v1.ApiOpenIdConnectionDefinition|undefined} value + * @return {!proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource} returns this +*/ +proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource.prototype.setOidc = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource} returns this + */ +proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource.prototype.clearOidc = function() { + return this.setOidc(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.resources.v1.ApiSecurityDefinitionResource.prototype.hasOidc = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.nitric.proto.resources.v1.ApiScopes.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.nitric.proto.resources.v1.ApiScopes.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.resources.v1.ApiScopes.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.nitric.proto.resources.v1.ApiScopes} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.resources.v1.ApiScopes.toObject = function(includeInstance, msg) { + var f, obj = { + scopesList: (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.nitric.proto.resources.v1.ApiScopes} + */ +proto.nitric.proto.resources.v1.ApiScopes.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.resources.v1.ApiScopes; + return proto.nitric.proto.resources.v1.ApiScopes.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.resources.v1.ApiScopes} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.resources.v1.ApiScopes} + */ +proto.nitric.proto.resources.v1.ApiScopes.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.addScopes(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.resources.v1.ApiScopes.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.resources.v1.ApiScopes.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.resources.v1.ApiScopes} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.resources.v1.ApiScopes.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getScopesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 1, + f + ); + } +}; + + +/** + * repeated string scopes = 1; + * @return {!Array} + */ +proto.nitric.proto.resources.v1.ApiScopes.prototype.getScopesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.nitric.proto.resources.v1.ApiScopes} returns this + */ +proto.nitric.proto.resources.v1.ApiScopes.prototype.setScopesList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.nitric.proto.resources.v1.ApiScopes} returns this + */ +proto.nitric.proto.resources.v1.ApiScopes.prototype.addScopes = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.nitric.proto.resources.v1.ApiScopes} returns this + */ +proto.nitric.proto.resources.v1.ApiScopes.prototype.clearScopesList = function() { + return this.setScopesList([]); +}; + + + + + +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.nitric.proto.resources.v1.ApiResource.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.resources.v1.ApiResource.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.nitric.proto.resources.v1.ApiResource} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.resources.v1.ApiResource.toObject = function(includeInstance, msg) { + var f, obj = { + securityMap: (f = msg.getSecurityMap()) ? f.toObject(includeInstance, proto.nitric.proto.resources.v1.ApiScopes.toObject) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.proto.resources.v1.ApiResource} + */ +proto.nitric.proto.resources.v1.ApiResource.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.resources.v1.ApiResource; + return proto.nitric.proto.resources.v1.ApiResource.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.resources.v1.ApiResource} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.resources.v1.ApiResource} + */ +proto.nitric.proto.resources.v1.ApiResource.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = msg.getSecurityMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.nitric.proto.resources.v1.ApiScopes.deserializeBinaryFromReader, "", new proto.nitric.proto.resources.v1.ApiScopes()); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.resources.v1.ApiResource.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.resources.v1.ApiResource.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.resources.v1.ApiResource} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.resources.v1.ApiResource.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSecurityMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.nitric.proto.resources.v1.ApiScopes.serializeBinaryToWriter); + } +}; + + +/** + * map security = 1; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.nitric.proto.resources.v1.ApiResource.prototype.getSecurityMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 1, opt_noLazyCreate, + proto.nitric.proto.resources.v1.ApiScopes)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.nitric.proto.resources.v1.ApiResource} returns this + */ +proto.nitric.proto.resources.v1.ApiResource.prototype.clearSecurityMap = function() { + this.getSecurityMap().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.nitric.proto.resources.v1.ResourceDeclareResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.resources.v1.ResourceDeclareResponse.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.nitric.proto.resources.v1.ResourceDeclareResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.resources.v1.ResourceDeclareResponse.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.proto.resources.v1.ResourceDeclareResponse} + */ +proto.nitric.proto.resources.v1.ResourceDeclareResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.resources.v1.ResourceDeclareResponse; + return proto.nitric.proto.resources.v1.ResourceDeclareResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.resources.v1.ResourceDeclareResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.resources.v1.ResourceDeclareResponse} + */ +proto.nitric.proto.resources.v1.ResourceDeclareResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.resources.v1.ResourceDeclareResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.resources.v1.ResourceDeclareResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.resources.v1.ResourceDeclareResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.resources.v1.ResourceDeclareResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + +/** + * @enum {number} + */ +proto.nitric.proto.resources.v1.ResourceType = { + API: 0, + SERVICE: 1, + BUCKET: 2, + TOPIC: 3, + SCHEDULE: 4, + SUBSCRIPTION: 5, + KEYVALUESTORE: 6, + POLICY: 7, + SECRET: 8, + BUCKETLISTENER: 9, + WEBSOCKET: 10, + HTTP: 11, + APISECURITYDEFINITION: 12, + QUEUE: 13 +}; + +/** + * @enum {number} + */ +proto.nitric.proto.resources.v1.Action = { + BUCKETFILELIST: 0, + BUCKETFILEGET: 1, + BUCKETFILEPUT: 2, + BUCKETFILEDELETE: 3, + TOPICPUBLISH: 200, + KEYVALUESTOREREAD: 300, + KEYVALUESTOREWRITE: 301, + KEYVALUESTOREDELETE: 302, + SECRETPUT: 400, + SECRETACCESS: 401, + WEBSOCKETMANAGE: 500, + QUEUEENQUEUE: 600, + QUEUEDEQUEUE: 601 +}; + +goog.object.extend(exports, proto.nitric.proto.resources.v1); diff --git a/src/gen/nitric/proto/schedules/v1/schedules_grpc_pb.d.ts b/src/gen/nitric/proto/schedules/v1/schedules_grpc_pb.d.ts new file mode 100644 index 00000000..ecfea38c --- /dev/null +++ b/src/gen/nitric/proto/schedules/v1/schedules_grpc_pb.d.ts @@ -0,0 +1,23 @@ +// GENERATED CODE -- DO NOT EDIT! + +// package: nitric.proto.schedules.v1 +// file: nitric/proto/schedules/v1/schedules.proto + +import * as nitric_proto_schedules_v1_schedules_pb from "../../../../nitric/proto/schedules/v1/schedules_pb"; +import * as grpc from "@grpc/grpc-js"; + +interface ISchedulesService extends grpc.ServiceDefinition { + schedule: grpc.MethodDefinition; +} + +export const SchedulesService: ISchedulesService; + +export interface ISchedulesServer extends grpc.UntypedServiceImplementation { + schedule: grpc.handleBidiStreamingCall; +} + +export class SchedulesClient extends grpc.Client { + constructor(address: string, credentials: grpc.ChannelCredentials, options?: object); + schedule(metadataOrOptions?: grpc.Metadata | grpc.CallOptions | null): grpc.ClientDuplexStream; + schedule(metadata?: grpc.Metadata | null, options?: grpc.CallOptions | null): grpc.ClientDuplexStream; +} diff --git a/src/gen/nitric/proto/schedules/v1/schedules_grpc_pb.js b/src/gen/nitric/proto/schedules/v1/schedules_grpc_pb.js new file mode 100644 index 00000000..3d3b7e46 --- /dev/null +++ b/src/gen/nitric/proto/schedules/v1/schedules_grpc_pb.js @@ -0,0 +1,45 @@ +// GENERATED CODE -- DO NOT EDIT! + +'use strict'; +var grpc = require('@grpc/grpc-js'); +var nitric_proto_schedules_v1_schedules_pb = require('../../../../nitric/proto/schedules/v1/schedules_pb.js'); + +function serialize_nitric_proto_schedules_v1_ClientMessage(arg) { + if (!(arg instanceof nitric_proto_schedules_v1_schedules_pb.ClientMessage)) { + throw new Error('Expected argument of type nitric.proto.schedules.v1.ClientMessage'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_schedules_v1_ClientMessage(buffer_arg) { + return nitric_proto_schedules_v1_schedules_pb.ClientMessage.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_schedules_v1_ServerMessage(arg) { + if (!(arg instanceof nitric_proto_schedules_v1_schedules_pb.ServerMessage)) { + throw new Error('Expected argument of type nitric.proto.schedules.v1.ServerMessage'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_schedules_v1_ServerMessage(buffer_arg) { + return nitric_proto_schedules_v1_schedules_pb.ServerMessage.deserializeBinary(new Uint8Array(buffer_arg)); +} + + +// Service for scheduling callbacks on a cadence +var SchedulesService = exports.SchedulesService = { + schedule: { + path: '/nitric.proto.schedules.v1.Schedules/Schedule', + requestStream: true, + responseStream: true, + requestType: nitric_proto_schedules_v1_schedules_pb.ClientMessage, + responseType: nitric_proto_schedules_v1_schedules_pb.ServerMessage, + requestSerialize: serialize_nitric_proto_schedules_v1_ClientMessage, + requestDeserialize: deserialize_nitric_proto_schedules_v1_ClientMessage, + responseSerialize: serialize_nitric_proto_schedules_v1_ServerMessage, + responseDeserialize: deserialize_nitric_proto_schedules_v1_ServerMessage, + }, +}; + +exports.SchedulesClient = grpc.makeGenericClientConstructor(SchedulesService); diff --git a/src/gen/nitric/proto/schedules/v1/schedules_pb.d.ts b/src/gen/nitric/proto/schedules/v1/schedules_pb.d.ts new file mode 100644 index 00000000..a7d33e33 --- /dev/null +++ b/src/gen/nitric/proto/schedules/v1/schedules_pb.d.ts @@ -0,0 +1,214 @@ +// package: nitric.proto.schedules.v1 +// file: nitric/proto/schedules/v1/schedules.proto + +import * as jspb from "google-protobuf"; + +export class ClientMessage extends jspb.Message { + getId(): string; + setId(value: string): void; + + hasRegistrationRequest(): boolean; + clearRegistrationRequest(): void; + getRegistrationRequest(): RegistrationRequest | undefined; + setRegistrationRequest(value?: RegistrationRequest): void; + + hasIntervalResponse(): boolean; + clearIntervalResponse(): void; + getIntervalResponse(): IntervalResponse | undefined; + setIntervalResponse(value?: IntervalResponse): void; + + getContentCase(): ClientMessage.ContentCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ClientMessage.AsObject; + static toObject(includeInstance: boolean, msg: ClientMessage): ClientMessage.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ClientMessage, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ClientMessage; + static deserializeBinaryFromReader(message: ClientMessage, reader: jspb.BinaryReader): ClientMessage; +} + +export namespace ClientMessage { + export type AsObject = { + id: string, + registrationRequest?: RegistrationRequest.AsObject, + intervalResponse?: IntervalResponse.AsObject, + } + + export enum ContentCase { + CONTENT_NOT_SET = 0, + REGISTRATION_REQUEST = 2, + INTERVAL_RESPONSE = 3, + } +} + +export class IntervalRequest extends jspb.Message { + getScheduleName(): string; + setScheduleName(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): IntervalRequest.AsObject; + static toObject(includeInstance: boolean, msg: IntervalRequest): IntervalRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: IntervalRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): IntervalRequest; + static deserializeBinaryFromReader(message: IntervalRequest, reader: jspb.BinaryReader): IntervalRequest; +} + +export namespace IntervalRequest { + export type AsObject = { + scheduleName: string, + } +} + +export class ServerMessage extends jspb.Message { + getId(): string; + setId(value: string): void; + + hasRegistrationResponse(): boolean; + clearRegistrationResponse(): void; + getRegistrationResponse(): RegistrationResponse | undefined; + setRegistrationResponse(value?: RegistrationResponse): void; + + hasIntervalRequest(): boolean; + clearIntervalRequest(): void; + getIntervalRequest(): IntervalRequest | undefined; + setIntervalRequest(value?: IntervalRequest): void; + + getContentCase(): ServerMessage.ContentCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ServerMessage.AsObject; + static toObject(includeInstance: boolean, msg: ServerMessage): ServerMessage.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ServerMessage, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ServerMessage; + static deserializeBinaryFromReader(message: ServerMessage, reader: jspb.BinaryReader): ServerMessage; +} + +export namespace ServerMessage { + export type AsObject = { + id: string, + registrationResponse?: RegistrationResponse.AsObject, + intervalRequest?: IntervalRequest.AsObject, + } + + export enum ContentCase { + CONTENT_NOT_SET = 0, + REGISTRATION_RESPONSE = 2, + INTERVAL_REQUEST = 3, + } +} + +export class RegistrationRequest extends jspb.Message { + getScheduleName(): string; + setScheduleName(value: string): void; + + hasEvery(): boolean; + clearEvery(): void; + getEvery(): ScheduleEvery | undefined; + setEvery(value?: ScheduleEvery): void; + + hasCron(): boolean; + clearCron(): void; + getCron(): ScheduleCron | undefined; + setCron(value?: ScheduleCron): void; + + getCadenceCase(): RegistrationRequest.CadenceCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): RegistrationRequest.AsObject; + static toObject(includeInstance: boolean, msg: RegistrationRequest): RegistrationRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: RegistrationRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): RegistrationRequest; + static deserializeBinaryFromReader(message: RegistrationRequest, reader: jspb.BinaryReader): RegistrationRequest; +} + +export namespace RegistrationRequest { + export type AsObject = { + scheduleName: string, + every?: ScheduleEvery.AsObject, + cron?: ScheduleCron.AsObject, + } + + export enum CadenceCase { + CADENCE_NOT_SET = 0, + EVERY = 10, + CRON = 11, + } +} + +export class ScheduleEvery extends jspb.Message { + getRate(): string; + setRate(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ScheduleEvery.AsObject; + static toObject(includeInstance: boolean, msg: ScheduleEvery): ScheduleEvery.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ScheduleEvery, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ScheduleEvery; + static deserializeBinaryFromReader(message: ScheduleEvery, reader: jspb.BinaryReader): ScheduleEvery; +} + +export namespace ScheduleEvery { + export type AsObject = { + rate: string, + } +} + +export class ScheduleCron extends jspb.Message { + getExpression(): string; + setExpression(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ScheduleCron.AsObject; + static toObject(includeInstance: boolean, msg: ScheduleCron): ScheduleCron.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ScheduleCron, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ScheduleCron; + static deserializeBinaryFromReader(message: ScheduleCron, reader: jspb.BinaryReader): ScheduleCron; +} + +export namespace ScheduleCron { + export type AsObject = { + expression: string, + } +} + +export class RegistrationResponse extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): RegistrationResponse.AsObject; + static toObject(includeInstance: boolean, msg: RegistrationResponse): RegistrationResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: RegistrationResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): RegistrationResponse; + static deserializeBinaryFromReader(message: RegistrationResponse, reader: jspb.BinaryReader): RegistrationResponse; +} + +export namespace RegistrationResponse { + export type AsObject = { + } +} + +export class IntervalResponse extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): IntervalResponse.AsObject; + static toObject(includeInstance: boolean, msg: IntervalResponse): IntervalResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: IntervalResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): IntervalResponse; + static deserializeBinaryFromReader(message: IntervalResponse, reader: jspb.BinaryReader): IntervalResponse; +} + +export namespace IntervalResponse { + export type AsObject = { + } +} + diff --git a/src/gen/nitric/proto/schedules/v1/schedules_pb.js b/src/gen/nitric/proto/schedules/v1/schedules_pb.js new file mode 100644 index 00000000..e6a23529 --- /dev/null +++ b/src/gen/nitric/proto/schedules/v1/schedules_pb.js @@ -0,0 +1,1569 @@ +// source: nitric/proto/schedules/v1/schedules.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() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +goog.exportSymbol('proto.nitric.proto.schedules.v1.ClientMessage', null, global); +goog.exportSymbol('proto.nitric.proto.schedules.v1.ClientMessage.ContentCase', null, global); +goog.exportSymbol('proto.nitric.proto.schedules.v1.IntervalRequest', null, global); +goog.exportSymbol('proto.nitric.proto.schedules.v1.IntervalResponse', null, global); +goog.exportSymbol('proto.nitric.proto.schedules.v1.RegistrationRequest', null, global); +goog.exportSymbol('proto.nitric.proto.schedules.v1.RegistrationRequest.CadenceCase', null, global); +goog.exportSymbol('proto.nitric.proto.schedules.v1.RegistrationResponse', null, global); +goog.exportSymbol('proto.nitric.proto.schedules.v1.ScheduleCron', null, global); +goog.exportSymbol('proto.nitric.proto.schedules.v1.ScheduleEvery', null, global); +goog.exportSymbol('proto.nitric.proto.schedules.v1.ServerMessage', null, global); +goog.exportSymbol('proto.nitric.proto.schedules.v1.ServerMessage.ContentCase', 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.nitric.proto.schedules.v1.ClientMessage = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.proto.schedules.v1.ClientMessage.oneofGroups_); +}; +goog.inherits(proto.nitric.proto.schedules.v1.ClientMessage, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.schedules.v1.ClientMessage.displayName = 'proto.nitric.proto.schedules.v1.ClientMessage'; +} +/** + * 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.nitric.proto.schedules.v1.IntervalRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.schedules.v1.IntervalRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.schedules.v1.IntervalRequest.displayName = 'proto.nitric.proto.schedules.v1.IntervalRequest'; +} +/** + * 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.nitric.proto.schedules.v1.ServerMessage = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.proto.schedules.v1.ServerMessage.oneofGroups_); +}; +goog.inherits(proto.nitric.proto.schedules.v1.ServerMessage, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.schedules.v1.ServerMessage.displayName = 'proto.nitric.proto.schedules.v1.ServerMessage'; +} +/** + * 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.nitric.proto.schedules.v1.RegistrationRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.proto.schedules.v1.RegistrationRequest.oneofGroups_); +}; +goog.inherits(proto.nitric.proto.schedules.v1.RegistrationRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.schedules.v1.RegistrationRequest.displayName = 'proto.nitric.proto.schedules.v1.RegistrationRequest'; +} +/** + * 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.nitric.proto.schedules.v1.ScheduleEvery = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.schedules.v1.ScheduleEvery, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.schedules.v1.ScheduleEvery.displayName = 'proto.nitric.proto.schedules.v1.ScheduleEvery'; +} +/** + * 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.nitric.proto.schedules.v1.ScheduleCron = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.schedules.v1.ScheduleCron, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.schedules.v1.ScheduleCron.displayName = 'proto.nitric.proto.schedules.v1.ScheduleCron'; +} +/** + * 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.nitric.proto.schedules.v1.RegistrationResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.schedules.v1.RegistrationResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.schedules.v1.RegistrationResponse.displayName = 'proto.nitric.proto.schedules.v1.RegistrationResponse'; +} +/** + * 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.nitric.proto.schedules.v1.IntervalResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.schedules.v1.IntervalResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.schedules.v1.IntervalResponse.displayName = 'proto.nitric.proto.schedules.v1.IntervalResponse'; +} + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.proto.schedules.v1.ClientMessage.oneofGroups_ = [[2,3]]; + +/** + * @enum {number} + */ +proto.nitric.proto.schedules.v1.ClientMessage.ContentCase = { + CONTENT_NOT_SET: 0, + REGISTRATION_REQUEST: 2, + INTERVAL_RESPONSE: 3 +}; + +/** + * @return {proto.nitric.proto.schedules.v1.ClientMessage.ContentCase} + */ +proto.nitric.proto.schedules.v1.ClientMessage.prototype.getContentCase = function() { + return /** @type {proto.nitric.proto.schedules.v1.ClientMessage.ContentCase} */(jspb.Message.computeOneofCase(this, proto.nitric.proto.schedules.v1.ClientMessage.oneofGroups_[0])); +}; + + + +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.nitric.proto.schedules.v1.ClientMessage.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.schedules.v1.ClientMessage.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.nitric.proto.schedules.v1.ClientMessage} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.schedules.v1.ClientMessage.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, ""), + registrationRequest: (f = msg.getRegistrationRequest()) && proto.nitric.proto.schedules.v1.RegistrationRequest.toObject(includeInstance, f), + intervalResponse: (f = msg.getIntervalResponse()) && proto.nitric.proto.schedules.v1.IntervalResponse.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.nitric.proto.schedules.v1.ClientMessage} + */ +proto.nitric.proto.schedules.v1.ClientMessage.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.schedules.v1.ClientMessage; + return proto.nitric.proto.schedules.v1.ClientMessage.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.schedules.v1.ClientMessage} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.schedules.v1.ClientMessage} + */ +proto.nitric.proto.schedules.v1.ClientMessage.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 = new proto.nitric.proto.schedules.v1.RegistrationRequest; + reader.readMessage(value,proto.nitric.proto.schedules.v1.RegistrationRequest.deserializeBinaryFromReader); + msg.setRegistrationRequest(value); + break; + case 3: + var value = new proto.nitric.proto.schedules.v1.IntervalResponse; + reader.readMessage(value,proto.nitric.proto.schedules.v1.IntervalResponse.deserializeBinaryFromReader); + msg.setIntervalResponse(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.schedules.v1.ClientMessage.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.schedules.v1.ClientMessage.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.schedules.v1.ClientMessage} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.schedules.v1.ClientMessage.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getRegistrationRequest(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.nitric.proto.schedules.v1.RegistrationRequest.serializeBinaryToWriter + ); + } + f = message.getIntervalResponse(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.nitric.proto.schedules.v1.IntervalResponse.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string id = 1; + * @return {string} + */ +proto.nitric.proto.schedules.v1.ClientMessage.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.schedules.v1.ClientMessage} returns this + */ +proto.nitric.proto.schedules.v1.ClientMessage.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional RegistrationRequest registration_request = 2; + * @return {?proto.nitric.proto.schedules.v1.RegistrationRequest} + */ +proto.nitric.proto.schedules.v1.ClientMessage.prototype.getRegistrationRequest = function() { + return /** @type{?proto.nitric.proto.schedules.v1.RegistrationRequest} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.schedules.v1.RegistrationRequest, 2)); +}; + + +/** + * @param {?proto.nitric.proto.schedules.v1.RegistrationRequest|undefined} value + * @return {!proto.nitric.proto.schedules.v1.ClientMessage} returns this +*/ +proto.nitric.proto.schedules.v1.ClientMessage.prototype.setRegistrationRequest = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.nitric.proto.schedules.v1.ClientMessage.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.schedules.v1.ClientMessage} returns this + */ +proto.nitric.proto.schedules.v1.ClientMessage.prototype.clearRegistrationRequest = function() { + return this.setRegistrationRequest(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.schedules.v1.ClientMessage.prototype.hasRegistrationRequest = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional IntervalResponse interval_response = 3; + * @return {?proto.nitric.proto.schedules.v1.IntervalResponse} + */ +proto.nitric.proto.schedules.v1.ClientMessage.prototype.getIntervalResponse = function() { + return /** @type{?proto.nitric.proto.schedules.v1.IntervalResponse} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.schedules.v1.IntervalResponse, 3)); +}; + + +/** + * @param {?proto.nitric.proto.schedules.v1.IntervalResponse|undefined} value + * @return {!proto.nitric.proto.schedules.v1.ClientMessage} returns this +*/ +proto.nitric.proto.schedules.v1.ClientMessage.prototype.setIntervalResponse = function(value) { + return jspb.Message.setOneofWrapperField(this, 3, proto.nitric.proto.schedules.v1.ClientMessage.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.schedules.v1.ClientMessage} returns this + */ +proto.nitric.proto.schedules.v1.ClientMessage.prototype.clearIntervalResponse = function() { + return this.setIntervalResponse(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.schedules.v1.ClientMessage.prototype.hasIntervalResponse = 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.nitric.proto.schedules.v1.IntervalRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.schedules.v1.IntervalRequest.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.nitric.proto.schedules.v1.IntervalRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.schedules.v1.IntervalRequest.toObject = function(includeInstance, msg) { + var f, obj = { + scheduleName: 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.nitric.proto.schedules.v1.IntervalRequest} + */ +proto.nitric.proto.schedules.v1.IntervalRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.schedules.v1.IntervalRequest; + return proto.nitric.proto.schedules.v1.IntervalRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.schedules.v1.IntervalRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.schedules.v1.IntervalRequest} + */ +proto.nitric.proto.schedules.v1.IntervalRequest.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.setScheduleName(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.schedules.v1.IntervalRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.schedules.v1.IntervalRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.schedules.v1.IntervalRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.schedules.v1.IntervalRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getScheduleName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string schedule_name = 1; + * @return {string} + */ +proto.nitric.proto.schedules.v1.IntervalRequest.prototype.getScheduleName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.schedules.v1.IntervalRequest} returns this + */ +proto.nitric.proto.schedules.v1.IntervalRequest.prototype.setScheduleName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.proto.schedules.v1.ServerMessage.oneofGroups_ = [[2,3]]; + +/** + * @enum {number} + */ +proto.nitric.proto.schedules.v1.ServerMessage.ContentCase = { + CONTENT_NOT_SET: 0, + REGISTRATION_RESPONSE: 2, + INTERVAL_REQUEST: 3 +}; + +/** + * @return {proto.nitric.proto.schedules.v1.ServerMessage.ContentCase} + */ +proto.nitric.proto.schedules.v1.ServerMessage.prototype.getContentCase = function() { + return /** @type {proto.nitric.proto.schedules.v1.ServerMessage.ContentCase} */(jspb.Message.computeOneofCase(this, proto.nitric.proto.schedules.v1.ServerMessage.oneofGroups_[0])); +}; + + + +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.nitric.proto.schedules.v1.ServerMessage.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.schedules.v1.ServerMessage.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.nitric.proto.schedules.v1.ServerMessage} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.schedules.v1.ServerMessage.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, ""), + registrationResponse: (f = msg.getRegistrationResponse()) && proto.nitric.proto.schedules.v1.RegistrationResponse.toObject(includeInstance, f), + intervalRequest: (f = msg.getIntervalRequest()) && proto.nitric.proto.schedules.v1.IntervalRequest.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.nitric.proto.schedules.v1.ServerMessage} + */ +proto.nitric.proto.schedules.v1.ServerMessage.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.schedules.v1.ServerMessage; + return proto.nitric.proto.schedules.v1.ServerMessage.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.schedules.v1.ServerMessage} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.schedules.v1.ServerMessage} + */ +proto.nitric.proto.schedules.v1.ServerMessage.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 = new proto.nitric.proto.schedules.v1.RegistrationResponse; + reader.readMessage(value,proto.nitric.proto.schedules.v1.RegistrationResponse.deserializeBinaryFromReader); + msg.setRegistrationResponse(value); + break; + case 3: + var value = new proto.nitric.proto.schedules.v1.IntervalRequest; + reader.readMessage(value,proto.nitric.proto.schedules.v1.IntervalRequest.deserializeBinaryFromReader); + msg.setIntervalRequest(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.schedules.v1.ServerMessage.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.schedules.v1.ServerMessage.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.schedules.v1.ServerMessage} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.schedules.v1.ServerMessage.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getRegistrationResponse(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.nitric.proto.schedules.v1.RegistrationResponse.serializeBinaryToWriter + ); + } + f = message.getIntervalRequest(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.nitric.proto.schedules.v1.IntervalRequest.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string id = 1; + * @return {string} + */ +proto.nitric.proto.schedules.v1.ServerMessage.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.schedules.v1.ServerMessage} returns this + */ +proto.nitric.proto.schedules.v1.ServerMessage.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional RegistrationResponse registration_response = 2; + * @return {?proto.nitric.proto.schedules.v1.RegistrationResponse} + */ +proto.nitric.proto.schedules.v1.ServerMessage.prototype.getRegistrationResponse = function() { + return /** @type{?proto.nitric.proto.schedules.v1.RegistrationResponse} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.schedules.v1.RegistrationResponse, 2)); +}; + + +/** + * @param {?proto.nitric.proto.schedules.v1.RegistrationResponse|undefined} value + * @return {!proto.nitric.proto.schedules.v1.ServerMessage} returns this +*/ +proto.nitric.proto.schedules.v1.ServerMessage.prototype.setRegistrationResponse = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.nitric.proto.schedules.v1.ServerMessage.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.schedules.v1.ServerMessage} returns this + */ +proto.nitric.proto.schedules.v1.ServerMessage.prototype.clearRegistrationResponse = function() { + return this.setRegistrationResponse(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.schedules.v1.ServerMessage.prototype.hasRegistrationResponse = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional IntervalRequest interval_request = 3; + * @return {?proto.nitric.proto.schedules.v1.IntervalRequest} + */ +proto.nitric.proto.schedules.v1.ServerMessage.prototype.getIntervalRequest = function() { + return /** @type{?proto.nitric.proto.schedules.v1.IntervalRequest} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.schedules.v1.IntervalRequest, 3)); +}; + + +/** + * @param {?proto.nitric.proto.schedules.v1.IntervalRequest|undefined} value + * @return {!proto.nitric.proto.schedules.v1.ServerMessage} returns this +*/ +proto.nitric.proto.schedules.v1.ServerMessage.prototype.setIntervalRequest = function(value) { + return jspb.Message.setOneofWrapperField(this, 3, proto.nitric.proto.schedules.v1.ServerMessage.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.schedules.v1.ServerMessage} returns this + */ +proto.nitric.proto.schedules.v1.ServerMessage.prototype.clearIntervalRequest = function() { + return this.setIntervalRequest(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.schedules.v1.ServerMessage.prototype.hasIntervalRequest = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.proto.schedules.v1.RegistrationRequest.oneofGroups_ = [[10,11]]; + +/** + * @enum {number} + */ +proto.nitric.proto.schedules.v1.RegistrationRequest.CadenceCase = { + CADENCE_NOT_SET: 0, + EVERY: 10, + CRON: 11 +}; + +/** + * @return {proto.nitric.proto.schedules.v1.RegistrationRequest.CadenceCase} + */ +proto.nitric.proto.schedules.v1.RegistrationRequest.prototype.getCadenceCase = function() { + return /** @type {proto.nitric.proto.schedules.v1.RegistrationRequest.CadenceCase} */(jspb.Message.computeOneofCase(this, proto.nitric.proto.schedules.v1.RegistrationRequest.oneofGroups_[0])); +}; + + + +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.nitric.proto.schedules.v1.RegistrationRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.schedules.v1.RegistrationRequest.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.nitric.proto.schedules.v1.RegistrationRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.schedules.v1.RegistrationRequest.toObject = function(includeInstance, msg) { + var f, obj = { + scheduleName: jspb.Message.getFieldWithDefault(msg, 1, ""), + every: (f = msg.getEvery()) && proto.nitric.proto.schedules.v1.ScheduleEvery.toObject(includeInstance, f), + cron: (f = msg.getCron()) && proto.nitric.proto.schedules.v1.ScheduleCron.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.nitric.proto.schedules.v1.RegistrationRequest} + */ +proto.nitric.proto.schedules.v1.RegistrationRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.schedules.v1.RegistrationRequest; + return proto.nitric.proto.schedules.v1.RegistrationRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.schedules.v1.RegistrationRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.schedules.v1.RegistrationRequest} + */ +proto.nitric.proto.schedules.v1.RegistrationRequest.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.setScheduleName(value); + break; + case 10: + var value = new proto.nitric.proto.schedules.v1.ScheduleEvery; + reader.readMessage(value,proto.nitric.proto.schedules.v1.ScheduleEvery.deserializeBinaryFromReader); + msg.setEvery(value); + break; + case 11: + var value = new proto.nitric.proto.schedules.v1.ScheduleCron; + reader.readMessage(value,proto.nitric.proto.schedules.v1.ScheduleCron.deserializeBinaryFromReader); + msg.setCron(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.schedules.v1.RegistrationRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.schedules.v1.RegistrationRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.schedules.v1.RegistrationRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.schedules.v1.RegistrationRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getScheduleName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getEvery(); + if (f != null) { + writer.writeMessage( + 10, + f, + proto.nitric.proto.schedules.v1.ScheduleEvery.serializeBinaryToWriter + ); + } + f = message.getCron(); + if (f != null) { + writer.writeMessage( + 11, + f, + proto.nitric.proto.schedules.v1.ScheduleCron.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string schedule_name = 1; + * @return {string} + */ +proto.nitric.proto.schedules.v1.RegistrationRequest.prototype.getScheduleName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.schedules.v1.RegistrationRequest} returns this + */ +proto.nitric.proto.schedules.v1.RegistrationRequest.prototype.setScheduleName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional ScheduleEvery every = 10; + * @return {?proto.nitric.proto.schedules.v1.ScheduleEvery} + */ +proto.nitric.proto.schedules.v1.RegistrationRequest.prototype.getEvery = function() { + return /** @type{?proto.nitric.proto.schedules.v1.ScheduleEvery} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.schedules.v1.ScheduleEvery, 10)); +}; + + +/** + * @param {?proto.nitric.proto.schedules.v1.ScheduleEvery|undefined} value + * @return {!proto.nitric.proto.schedules.v1.RegistrationRequest} returns this +*/ +proto.nitric.proto.schedules.v1.RegistrationRequest.prototype.setEvery = function(value) { + return jspb.Message.setOneofWrapperField(this, 10, proto.nitric.proto.schedules.v1.RegistrationRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.schedules.v1.RegistrationRequest} returns this + */ +proto.nitric.proto.schedules.v1.RegistrationRequest.prototype.clearEvery = function() { + return this.setEvery(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.schedules.v1.RegistrationRequest.prototype.hasEvery = function() { + return jspb.Message.getField(this, 10) != null; +}; + + +/** + * optional ScheduleCron cron = 11; + * @return {?proto.nitric.proto.schedules.v1.ScheduleCron} + */ +proto.nitric.proto.schedules.v1.RegistrationRequest.prototype.getCron = function() { + return /** @type{?proto.nitric.proto.schedules.v1.ScheduleCron} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.schedules.v1.ScheduleCron, 11)); +}; + + +/** + * @param {?proto.nitric.proto.schedules.v1.ScheduleCron|undefined} value + * @return {!proto.nitric.proto.schedules.v1.RegistrationRequest} returns this +*/ +proto.nitric.proto.schedules.v1.RegistrationRequest.prototype.setCron = function(value) { + return jspb.Message.setOneofWrapperField(this, 11, proto.nitric.proto.schedules.v1.RegistrationRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.schedules.v1.RegistrationRequest} returns this + */ +proto.nitric.proto.schedules.v1.RegistrationRequest.prototype.clearCron = function() { + return this.setCron(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.schedules.v1.RegistrationRequest.prototype.hasCron = function() { + return jspb.Message.getField(this, 11) != 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.nitric.proto.schedules.v1.ScheduleEvery.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.schedules.v1.ScheduleEvery.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.nitric.proto.schedules.v1.ScheduleEvery} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.schedules.v1.ScheduleEvery.toObject = function(includeInstance, msg) { + var f, obj = { + rate: 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.nitric.proto.schedules.v1.ScheduleEvery} + */ +proto.nitric.proto.schedules.v1.ScheduleEvery.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.schedules.v1.ScheduleEvery; + return proto.nitric.proto.schedules.v1.ScheduleEvery.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.schedules.v1.ScheduleEvery} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.schedules.v1.ScheduleEvery} + */ +proto.nitric.proto.schedules.v1.ScheduleEvery.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.setRate(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.schedules.v1.ScheduleEvery.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.schedules.v1.ScheduleEvery.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.schedules.v1.ScheduleEvery} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.schedules.v1.ScheduleEvery.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRate(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string rate = 1; + * @return {string} + */ +proto.nitric.proto.schedules.v1.ScheduleEvery.prototype.getRate = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.schedules.v1.ScheduleEvery} returns this + */ +proto.nitric.proto.schedules.v1.ScheduleEvery.prototype.setRate = 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.nitric.proto.schedules.v1.ScheduleCron.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.schedules.v1.ScheduleCron.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.nitric.proto.schedules.v1.ScheduleCron} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.schedules.v1.ScheduleCron.toObject = function(includeInstance, msg) { + var f, obj = { + expression: 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.nitric.proto.schedules.v1.ScheduleCron} + */ +proto.nitric.proto.schedules.v1.ScheduleCron.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.schedules.v1.ScheduleCron; + return proto.nitric.proto.schedules.v1.ScheduleCron.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.schedules.v1.ScheduleCron} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.schedules.v1.ScheduleCron} + */ +proto.nitric.proto.schedules.v1.ScheduleCron.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.setExpression(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.schedules.v1.ScheduleCron.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.schedules.v1.ScheduleCron.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.schedules.v1.ScheduleCron} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.schedules.v1.ScheduleCron.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getExpression(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string expression = 1; + * @return {string} + */ +proto.nitric.proto.schedules.v1.ScheduleCron.prototype.getExpression = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.schedules.v1.ScheduleCron} returns this + */ +proto.nitric.proto.schedules.v1.ScheduleCron.prototype.setExpression = 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.nitric.proto.schedules.v1.RegistrationResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.schedules.v1.RegistrationResponse.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.nitric.proto.schedules.v1.RegistrationResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.schedules.v1.RegistrationResponse.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.proto.schedules.v1.RegistrationResponse} + */ +proto.nitric.proto.schedules.v1.RegistrationResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.schedules.v1.RegistrationResponse; + return proto.nitric.proto.schedules.v1.RegistrationResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.schedules.v1.RegistrationResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.schedules.v1.RegistrationResponse} + */ +proto.nitric.proto.schedules.v1.RegistrationResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.schedules.v1.RegistrationResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.schedules.v1.RegistrationResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.schedules.v1.RegistrationResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.schedules.v1.RegistrationResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +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.nitric.proto.schedules.v1.IntervalResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.schedules.v1.IntervalResponse.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.nitric.proto.schedules.v1.IntervalResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.schedules.v1.IntervalResponse.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.proto.schedules.v1.IntervalResponse} + */ +proto.nitric.proto.schedules.v1.IntervalResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.schedules.v1.IntervalResponse; + return proto.nitric.proto.schedules.v1.IntervalResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.schedules.v1.IntervalResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.schedules.v1.IntervalResponse} + */ +proto.nitric.proto.schedules.v1.IntervalResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.schedules.v1.IntervalResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.schedules.v1.IntervalResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.schedules.v1.IntervalResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.schedules.v1.IntervalResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + +goog.object.extend(exports, proto.nitric.proto.schedules.v1); diff --git a/src/gen/nitric/proto/secrets/v1/secrets_grpc_pb.d.ts b/src/gen/nitric/proto/secrets/v1/secrets_grpc_pb.d.ts new file mode 100644 index 00000000..691e306b --- /dev/null +++ b/src/gen/nitric/proto/secrets/v1/secrets_grpc_pb.d.ts @@ -0,0 +1,29 @@ +// GENERATED CODE -- DO NOT EDIT! + +// package: nitric.proto.secrets.v1 +// file: nitric/proto/secrets/v1/secrets.proto + +import * as nitric_proto_secrets_v1_secrets_pb from "../../../../nitric/proto/secrets/v1/secrets_pb"; +import * as grpc from "@grpc/grpc-js"; + +interface ISecretManagerService extends grpc.ServiceDefinition { + put: grpc.MethodDefinition; + access: grpc.MethodDefinition; +} + +export const SecretManagerService: ISecretManagerService; + +export interface ISecretManagerServer extends grpc.UntypedServiceImplementation { + put: grpc.handleUnaryCall; + access: grpc.handleUnaryCall; +} + +export class SecretManagerClient extends grpc.Client { + constructor(address: string, credentials: grpc.ChannelCredentials, options?: object); + put(argument: nitric_proto_secrets_v1_secrets_pb.SecretPutRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + put(argument: nitric_proto_secrets_v1_secrets_pb.SecretPutRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + put(argument: nitric_proto_secrets_v1_secrets_pb.SecretPutRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + access(argument: nitric_proto_secrets_v1_secrets_pb.SecretAccessRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + access(argument: nitric_proto_secrets_v1_secrets_pb.SecretAccessRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + access(argument: nitric_proto_secrets_v1_secrets_pb.SecretAccessRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; +} diff --git a/src/gen/nitric/proto/secrets/v1/secrets_grpc_pb.js b/src/gen/nitric/proto/secrets/v1/secrets_grpc_pb.js new file mode 100644 index 00000000..c720b1a8 --- /dev/null +++ b/src/gen/nitric/proto/secrets/v1/secrets_grpc_pb.js @@ -0,0 +1,80 @@ +// GENERATED CODE -- DO NOT EDIT! + +'use strict'; +var grpc = require('@grpc/grpc-js'); +var nitric_proto_secrets_v1_secrets_pb = require('../../../../nitric/proto/secrets/v1/secrets_pb.js'); + +function serialize_nitric_proto_secrets_v1_SecretAccessRequest(arg) { + if (!(arg instanceof nitric_proto_secrets_v1_secrets_pb.SecretAccessRequest)) { + throw new Error('Expected argument of type nitric.proto.secrets.v1.SecretAccessRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_secrets_v1_SecretAccessRequest(buffer_arg) { + return nitric_proto_secrets_v1_secrets_pb.SecretAccessRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_secrets_v1_SecretAccessResponse(arg) { + if (!(arg instanceof nitric_proto_secrets_v1_secrets_pb.SecretAccessResponse)) { + throw new Error('Expected argument of type nitric.proto.secrets.v1.SecretAccessResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_secrets_v1_SecretAccessResponse(buffer_arg) { + return nitric_proto_secrets_v1_secrets_pb.SecretAccessResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_secrets_v1_SecretPutRequest(arg) { + if (!(arg instanceof nitric_proto_secrets_v1_secrets_pb.SecretPutRequest)) { + throw new Error('Expected argument of type nitric.proto.secrets.v1.SecretPutRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_secrets_v1_SecretPutRequest(buffer_arg) { + return nitric_proto_secrets_v1_secrets_pb.SecretPutRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_secrets_v1_SecretPutResponse(arg) { + if (!(arg instanceof nitric_proto_secrets_v1_secrets_pb.SecretPutResponse)) { + throw new Error('Expected argument of type nitric.proto.secrets.v1.SecretPutResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_secrets_v1_SecretPutResponse(buffer_arg) { + return nitric_proto_secrets_v1_secrets_pb.SecretPutResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + + +// The Nitric Secret Service +var SecretManagerService = exports.SecretManagerService = { + // Updates a secret, creating a new one if it doesn't already exist +put: { + path: '/nitric.proto.secrets.v1.SecretManager/Put', + requestStream: false, + responseStream: false, + requestType: nitric_proto_secrets_v1_secrets_pb.SecretPutRequest, + responseType: nitric_proto_secrets_v1_secrets_pb.SecretPutResponse, + requestSerialize: serialize_nitric_proto_secrets_v1_SecretPutRequest, + requestDeserialize: deserialize_nitric_proto_secrets_v1_SecretPutRequest, + responseSerialize: serialize_nitric_proto_secrets_v1_SecretPutResponse, + responseDeserialize: deserialize_nitric_proto_secrets_v1_SecretPutResponse, + }, + // Gets a secret from a Secret Store +access: { + path: '/nitric.proto.secrets.v1.SecretManager/Access', + requestStream: false, + responseStream: false, + requestType: nitric_proto_secrets_v1_secrets_pb.SecretAccessRequest, + responseType: nitric_proto_secrets_v1_secrets_pb.SecretAccessResponse, + requestSerialize: serialize_nitric_proto_secrets_v1_SecretAccessRequest, + requestDeserialize: deserialize_nitric_proto_secrets_v1_SecretAccessRequest, + responseSerialize: serialize_nitric_proto_secrets_v1_SecretAccessResponse, + responseDeserialize: deserialize_nitric_proto_secrets_v1_SecretAccessResponse, + }, +}; + +exports.SecretManagerClient = grpc.makeGenericClientConstructor(SecretManagerService); diff --git a/src/gen/proto/secret/v1/secret_pb.d.ts b/src/gen/nitric/proto/secrets/v1/secrets_pb.d.ts similarity index 97% rename from src/gen/proto/secret/v1/secret_pb.d.ts rename to src/gen/nitric/proto/secrets/v1/secrets_pb.d.ts index b9b6fa44..20eb6632 100644 --- a/src/gen/proto/secret/v1/secret_pb.d.ts +++ b/src/gen/nitric/proto/secrets/v1/secrets_pb.d.ts @@ -1,8 +1,7 @@ -// package: nitric.secret.v1 -// file: proto/secret/v1/secret.proto +// package: nitric.proto.secrets.v1 +// file: nitric/proto/secrets/v1/secrets.proto import * as jspb from "google-protobuf"; -import * as validate_validate_pb from "../../../validate/validate_pb"; export class SecretPutRequest extends jspb.Message { hasSecret(): boolean; diff --git a/src/gen/proto/secret/v1/secret_pb.js b/src/gen/nitric/proto/secrets/v1/secrets_pb.js similarity index 58% rename from src/gen/proto/secret/v1/secret_pb.js rename to src/gen/nitric/proto/secrets/v1/secrets_pb.js index 60c7d465..754b3e17 100644 --- a/src/gen/proto/secret/v1/secret_pb.js +++ b/src/gen/nitric/proto/secrets/v1/secrets_pb.js @@ -1,4 +1,4 @@ -// source: proto/secret/v1/secret.proto +// source: nitric/proto/secrets/v1/secrets.proto /** * @fileoverview * @enhanceable @@ -21,14 +21,12 @@ var global = (function() { return Function('return this')(); }.call(null)); -var validate_validate_pb = require('../../../validate/validate_pb.js'); -goog.object.extend(proto, validate_validate_pb); -goog.exportSymbol('proto.nitric.secret.v1.Secret', null, global); -goog.exportSymbol('proto.nitric.secret.v1.SecretAccessRequest', null, global); -goog.exportSymbol('proto.nitric.secret.v1.SecretAccessResponse', null, global); -goog.exportSymbol('proto.nitric.secret.v1.SecretPutRequest', null, global); -goog.exportSymbol('proto.nitric.secret.v1.SecretPutResponse', null, global); -goog.exportSymbol('proto.nitric.secret.v1.SecretVersion', null, global); +goog.exportSymbol('proto.nitric.proto.secrets.v1.Secret', null, global); +goog.exportSymbol('proto.nitric.proto.secrets.v1.SecretAccessRequest', null, global); +goog.exportSymbol('proto.nitric.proto.secrets.v1.SecretAccessResponse', null, global); +goog.exportSymbol('proto.nitric.proto.secrets.v1.SecretPutRequest', null, global); +goog.exportSymbol('proto.nitric.proto.secrets.v1.SecretPutResponse', null, global); +goog.exportSymbol('proto.nitric.proto.secrets.v1.SecretVersion', null, global); /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -39,16 +37,16 @@ goog.exportSymbol('proto.nitric.secret.v1.SecretVersion', null, global); * @extends {jspb.Message} * @constructor */ -proto.nitric.secret.v1.SecretPutRequest = function(opt_data) { +proto.nitric.proto.secrets.v1.SecretPutRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.nitric.secret.v1.SecretPutRequest, jspb.Message); +goog.inherits(proto.nitric.proto.secrets.v1.SecretPutRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.nitric.secret.v1.SecretPutRequest.displayName = 'proto.nitric.secret.v1.SecretPutRequest'; + proto.nitric.proto.secrets.v1.SecretPutRequest.displayName = 'proto.nitric.proto.secrets.v1.SecretPutRequest'; } /** * Generated by JsPbCodeGenerator. @@ -60,16 +58,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.nitric.secret.v1.SecretPutResponse = function(opt_data) { +proto.nitric.proto.secrets.v1.SecretPutResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.nitric.secret.v1.SecretPutResponse, jspb.Message); +goog.inherits(proto.nitric.proto.secrets.v1.SecretPutResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.nitric.secret.v1.SecretPutResponse.displayName = 'proto.nitric.secret.v1.SecretPutResponse'; + proto.nitric.proto.secrets.v1.SecretPutResponse.displayName = 'proto.nitric.proto.secrets.v1.SecretPutResponse'; } /** * Generated by JsPbCodeGenerator. @@ -81,16 +79,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.nitric.secret.v1.SecretAccessRequest = function(opt_data) { +proto.nitric.proto.secrets.v1.SecretAccessRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.nitric.secret.v1.SecretAccessRequest, jspb.Message); +goog.inherits(proto.nitric.proto.secrets.v1.SecretAccessRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.nitric.secret.v1.SecretAccessRequest.displayName = 'proto.nitric.secret.v1.SecretAccessRequest'; + proto.nitric.proto.secrets.v1.SecretAccessRequest.displayName = 'proto.nitric.proto.secrets.v1.SecretAccessRequest'; } /** * Generated by JsPbCodeGenerator. @@ -102,16 +100,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.nitric.secret.v1.SecretAccessResponse = function(opt_data) { +proto.nitric.proto.secrets.v1.SecretAccessResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.nitric.secret.v1.SecretAccessResponse, jspb.Message); +goog.inherits(proto.nitric.proto.secrets.v1.SecretAccessResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.nitric.secret.v1.SecretAccessResponse.displayName = 'proto.nitric.secret.v1.SecretAccessResponse'; + proto.nitric.proto.secrets.v1.SecretAccessResponse.displayName = 'proto.nitric.proto.secrets.v1.SecretAccessResponse'; } /** * Generated by JsPbCodeGenerator. @@ -123,16 +121,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.nitric.secret.v1.Secret = function(opt_data) { +proto.nitric.proto.secrets.v1.Secret = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.nitric.secret.v1.Secret, jspb.Message); +goog.inherits(proto.nitric.proto.secrets.v1.Secret, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.nitric.secret.v1.Secret.displayName = 'proto.nitric.secret.v1.Secret'; + proto.nitric.proto.secrets.v1.Secret.displayName = 'proto.nitric.proto.secrets.v1.Secret'; } /** * Generated by JsPbCodeGenerator. @@ -144,16 +142,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.nitric.secret.v1.SecretVersion = function(opt_data) { +proto.nitric.proto.secrets.v1.SecretVersion = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.nitric.secret.v1.SecretVersion, jspb.Message); +goog.inherits(proto.nitric.proto.secrets.v1.SecretVersion, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.nitric.secret.v1.SecretVersion.displayName = 'proto.nitric.secret.v1.SecretVersion'; + proto.nitric.proto.secrets.v1.SecretVersion.displayName = 'proto.nitric.proto.secrets.v1.SecretVersion'; } @@ -171,8 +169,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.nitric.secret.v1.SecretPutRequest.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.secret.v1.SecretPutRequest.toObject(opt_includeInstance, this); +proto.nitric.proto.secrets.v1.SecretPutRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.secrets.v1.SecretPutRequest.toObject(opt_includeInstance, this); }; @@ -181,13 +179,13 @@ proto.nitric.secret.v1.SecretPutRequest.prototype.toObject = function(opt_includ * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.nitric.secret.v1.SecretPutRequest} msg The msg instance to transform. + * @param {!proto.nitric.proto.secrets.v1.SecretPutRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.secret.v1.SecretPutRequest.toObject = function(includeInstance, msg) { +proto.nitric.proto.secrets.v1.SecretPutRequest.toObject = function(includeInstance, msg) { var f, obj = { - secret: (f = msg.getSecret()) && proto.nitric.secret.v1.Secret.toObject(includeInstance, f), + secret: (f = msg.getSecret()) && proto.nitric.proto.secrets.v1.Secret.toObject(includeInstance, f), value: msg.getValue_asB64() }; @@ -202,23 +200,23 @@ proto.nitric.secret.v1.SecretPutRequest.toObject = function(includeInstance, msg /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.secret.v1.SecretPutRequest} + * @return {!proto.nitric.proto.secrets.v1.SecretPutRequest} */ -proto.nitric.secret.v1.SecretPutRequest.deserializeBinary = function(bytes) { +proto.nitric.proto.secrets.v1.SecretPutRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.secret.v1.SecretPutRequest; - return proto.nitric.secret.v1.SecretPutRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.nitric.proto.secrets.v1.SecretPutRequest; + return proto.nitric.proto.secrets.v1.SecretPutRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.nitric.secret.v1.SecretPutRequest} msg The message object to deserialize into. + * @param {!proto.nitric.proto.secrets.v1.SecretPutRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.secret.v1.SecretPutRequest} + * @return {!proto.nitric.proto.secrets.v1.SecretPutRequest} */ -proto.nitric.secret.v1.SecretPutRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.nitric.proto.secrets.v1.SecretPutRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -226,8 +224,8 @@ proto.nitric.secret.v1.SecretPutRequest.deserializeBinaryFromReader = function(m var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.nitric.secret.v1.Secret; - reader.readMessage(value,proto.nitric.secret.v1.Secret.deserializeBinaryFromReader); + var value = new proto.nitric.proto.secrets.v1.Secret; + reader.readMessage(value,proto.nitric.proto.secrets.v1.Secret.deserializeBinaryFromReader); msg.setSecret(value); break; case 2: @@ -247,9 +245,9 @@ proto.nitric.secret.v1.SecretPutRequest.deserializeBinaryFromReader = function(m * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.nitric.secret.v1.SecretPutRequest.prototype.serializeBinary = function() { +proto.nitric.proto.secrets.v1.SecretPutRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.nitric.secret.v1.SecretPutRequest.serializeBinaryToWriter(this, writer); + proto.nitric.proto.secrets.v1.SecretPutRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -257,18 +255,18 @@ proto.nitric.secret.v1.SecretPutRequest.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.nitric.secret.v1.SecretPutRequest} message + * @param {!proto.nitric.proto.secrets.v1.SecretPutRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.secret.v1.SecretPutRequest.serializeBinaryToWriter = function(message, writer) { +proto.nitric.proto.secrets.v1.SecretPutRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getSecret(); if (f != null) { writer.writeMessage( 1, f, - proto.nitric.secret.v1.Secret.serializeBinaryToWriter + proto.nitric.proto.secrets.v1.Secret.serializeBinaryToWriter ); } f = message.getValue_asU8(); @@ -283,28 +281,28 @@ proto.nitric.secret.v1.SecretPutRequest.serializeBinaryToWriter = function(messa /** * optional Secret secret = 1; - * @return {?proto.nitric.secret.v1.Secret} + * @return {?proto.nitric.proto.secrets.v1.Secret} */ -proto.nitric.secret.v1.SecretPutRequest.prototype.getSecret = function() { - return /** @type{?proto.nitric.secret.v1.Secret} */ ( - jspb.Message.getWrapperField(this, proto.nitric.secret.v1.Secret, 1)); +proto.nitric.proto.secrets.v1.SecretPutRequest.prototype.getSecret = function() { + return /** @type{?proto.nitric.proto.secrets.v1.Secret} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.secrets.v1.Secret, 1)); }; /** - * @param {?proto.nitric.secret.v1.Secret|undefined} value - * @return {!proto.nitric.secret.v1.SecretPutRequest} returns this + * @param {?proto.nitric.proto.secrets.v1.Secret|undefined} value + * @return {!proto.nitric.proto.secrets.v1.SecretPutRequest} returns this */ -proto.nitric.secret.v1.SecretPutRequest.prototype.setSecret = function(value) { +proto.nitric.proto.secrets.v1.SecretPutRequest.prototype.setSecret = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. - * @return {!proto.nitric.secret.v1.SecretPutRequest} returns this + * @return {!proto.nitric.proto.secrets.v1.SecretPutRequest} returns this */ -proto.nitric.secret.v1.SecretPutRequest.prototype.clearSecret = function() { +proto.nitric.proto.secrets.v1.SecretPutRequest.prototype.clearSecret = function() { return this.setSecret(undefined); }; @@ -313,7 +311,7 @@ proto.nitric.secret.v1.SecretPutRequest.prototype.clearSecret = function() { * Returns whether this field is set. * @return {boolean} */ -proto.nitric.secret.v1.SecretPutRequest.prototype.hasSecret = function() { +proto.nitric.proto.secrets.v1.SecretPutRequest.prototype.hasSecret = function() { return jspb.Message.getField(this, 1) != null; }; @@ -322,7 +320,7 @@ proto.nitric.secret.v1.SecretPutRequest.prototype.hasSecret = function() { * optional bytes value = 2; * @return {!(string|Uint8Array)} */ -proto.nitric.secret.v1.SecretPutRequest.prototype.getValue = function() { +proto.nitric.proto.secrets.v1.SecretPutRequest.prototype.getValue = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; @@ -332,7 +330,7 @@ proto.nitric.secret.v1.SecretPutRequest.prototype.getValue = function() { * This is a type-conversion wrapper around `getValue()` * @return {string} */ -proto.nitric.secret.v1.SecretPutRequest.prototype.getValue_asB64 = function() { +proto.nitric.proto.secrets.v1.SecretPutRequest.prototype.getValue_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getValue())); }; @@ -345,7 +343,7 @@ proto.nitric.secret.v1.SecretPutRequest.prototype.getValue_asB64 = function() { * This is a type-conversion wrapper around `getValue()` * @return {!Uint8Array} */ -proto.nitric.secret.v1.SecretPutRequest.prototype.getValue_asU8 = function() { +proto.nitric.proto.secrets.v1.SecretPutRequest.prototype.getValue_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getValue())); }; @@ -353,9 +351,9 @@ proto.nitric.secret.v1.SecretPutRequest.prototype.getValue_asU8 = function() { /** * @param {!(string|Uint8Array)} value - * @return {!proto.nitric.secret.v1.SecretPutRequest} returns this + * @return {!proto.nitric.proto.secrets.v1.SecretPutRequest} returns this */ -proto.nitric.secret.v1.SecretPutRequest.prototype.setValue = function(value) { +proto.nitric.proto.secrets.v1.SecretPutRequest.prototype.setValue = function(value) { return jspb.Message.setProto3BytesField(this, 2, value); }; @@ -376,8 +374,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.nitric.secret.v1.SecretPutResponse.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.secret.v1.SecretPutResponse.toObject(opt_includeInstance, this); +proto.nitric.proto.secrets.v1.SecretPutResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.secrets.v1.SecretPutResponse.toObject(opt_includeInstance, this); }; @@ -386,13 +384,13 @@ proto.nitric.secret.v1.SecretPutResponse.prototype.toObject = function(opt_inclu * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.nitric.secret.v1.SecretPutResponse} msg The msg instance to transform. + * @param {!proto.nitric.proto.secrets.v1.SecretPutResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.secret.v1.SecretPutResponse.toObject = function(includeInstance, msg) { +proto.nitric.proto.secrets.v1.SecretPutResponse.toObject = function(includeInstance, msg) { var f, obj = { - secretVersion: (f = msg.getSecretVersion()) && proto.nitric.secret.v1.SecretVersion.toObject(includeInstance, f) + secretVersion: (f = msg.getSecretVersion()) && proto.nitric.proto.secrets.v1.SecretVersion.toObject(includeInstance, f) }; if (includeInstance) { @@ -406,23 +404,23 @@ proto.nitric.secret.v1.SecretPutResponse.toObject = function(includeInstance, ms /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.secret.v1.SecretPutResponse} + * @return {!proto.nitric.proto.secrets.v1.SecretPutResponse} */ -proto.nitric.secret.v1.SecretPutResponse.deserializeBinary = function(bytes) { +proto.nitric.proto.secrets.v1.SecretPutResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.secret.v1.SecretPutResponse; - return proto.nitric.secret.v1.SecretPutResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.nitric.proto.secrets.v1.SecretPutResponse; + return proto.nitric.proto.secrets.v1.SecretPutResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.nitric.secret.v1.SecretPutResponse} msg The message object to deserialize into. + * @param {!proto.nitric.proto.secrets.v1.SecretPutResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.secret.v1.SecretPutResponse} + * @return {!proto.nitric.proto.secrets.v1.SecretPutResponse} */ -proto.nitric.secret.v1.SecretPutResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.nitric.proto.secrets.v1.SecretPutResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -430,8 +428,8 @@ proto.nitric.secret.v1.SecretPutResponse.deserializeBinaryFromReader = function( var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.nitric.secret.v1.SecretVersion; - reader.readMessage(value,proto.nitric.secret.v1.SecretVersion.deserializeBinaryFromReader); + var value = new proto.nitric.proto.secrets.v1.SecretVersion; + reader.readMessage(value,proto.nitric.proto.secrets.v1.SecretVersion.deserializeBinaryFromReader); msg.setSecretVersion(value); break; default: @@ -447,9 +445,9 @@ proto.nitric.secret.v1.SecretPutResponse.deserializeBinaryFromReader = function( * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.nitric.secret.v1.SecretPutResponse.prototype.serializeBinary = function() { +proto.nitric.proto.secrets.v1.SecretPutResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.nitric.secret.v1.SecretPutResponse.serializeBinaryToWriter(this, writer); + proto.nitric.proto.secrets.v1.SecretPutResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -457,18 +455,18 @@ proto.nitric.secret.v1.SecretPutResponse.prototype.serializeBinary = function() /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.nitric.secret.v1.SecretPutResponse} message + * @param {!proto.nitric.proto.secrets.v1.SecretPutResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.secret.v1.SecretPutResponse.serializeBinaryToWriter = function(message, writer) { +proto.nitric.proto.secrets.v1.SecretPutResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getSecretVersion(); if (f != null) { writer.writeMessage( 1, f, - proto.nitric.secret.v1.SecretVersion.serializeBinaryToWriter + proto.nitric.proto.secrets.v1.SecretVersion.serializeBinaryToWriter ); } }; @@ -476,28 +474,28 @@ proto.nitric.secret.v1.SecretPutResponse.serializeBinaryToWriter = function(mess /** * optional SecretVersion secret_version = 1; - * @return {?proto.nitric.secret.v1.SecretVersion} + * @return {?proto.nitric.proto.secrets.v1.SecretVersion} */ -proto.nitric.secret.v1.SecretPutResponse.prototype.getSecretVersion = function() { - return /** @type{?proto.nitric.secret.v1.SecretVersion} */ ( - jspb.Message.getWrapperField(this, proto.nitric.secret.v1.SecretVersion, 1)); +proto.nitric.proto.secrets.v1.SecretPutResponse.prototype.getSecretVersion = function() { + return /** @type{?proto.nitric.proto.secrets.v1.SecretVersion} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.secrets.v1.SecretVersion, 1)); }; /** - * @param {?proto.nitric.secret.v1.SecretVersion|undefined} value - * @return {!proto.nitric.secret.v1.SecretPutResponse} returns this + * @param {?proto.nitric.proto.secrets.v1.SecretVersion|undefined} value + * @return {!proto.nitric.proto.secrets.v1.SecretPutResponse} returns this */ -proto.nitric.secret.v1.SecretPutResponse.prototype.setSecretVersion = function(value) { +proto.nitric.proto.secrets.v1.SecretPutResponse.prototype.setSecretVersion = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. - * @return {!proto.nitric.secret.v1.SecretPutResponse} returns this + * @return {!proto.nitric.proto.secrets.v1.SecretPutResponse} returns this */ -proto.nitric.secret.v1.SecretPutResponse.prototype.clearSecretVersion = function() { +proto.nitric.proto.secrets.v1.SecretPutResponse.prototype.clearSecretVersion = function() { return this.setSecretVersion(undefined); }; @@ -506,7 +504,7 @@ proto.nitric.secret.v1.SecretPutResponse.prototype.clearSecretVersion = function * Returns whether this field is set. * @return {boolean} */ -proto.nitric.secret.v1.SecretPutResponse.prototype.hasSecretVersion = function() { +proto.nitric.proto.secrets.v1.SecretPutResponse.prototype.hasSecretVersion = function() { return jspb.Message.getField(this, 1) != null; }; @@ -527,8 +525,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.nitric.secret.v1.SecretAccessRequest.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.secret.v1.SecretAccessRequest.toObject(opt_includeInstance, this); +proto.nitric.proto.secrets.v1.SecretAccessRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.secrets.v1.SecretAccessRequest.toObject(opt_includeInstance, this); }; @@ -537,13 +535,13 @@ proto.nitric.secret.v1.SecretAccessRequest.prototype.toObject = function(opt_inc * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.nitric.secret.v1.SecretAccessRequest} msg The msg instance to transform. + * @param {!proto.nitric.proto.secrets.v1.SecretAccessRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.secret.v1.SecretAccessRequest.toObject = function(includeInstance, msg) { +proto.nitric.proto.secrets.v1.SecretAccessRequest.toObject = function(includeInstance, msg) { var f, obj = { - secretVersion: (f = msg.getSecretVersion()) && proto.nitric.secret.v1.SecretVersion.toObject(includeInstance, f) + secretVersion: (f = msg.getSecretVersion()) && proto.nitric.proto.secrets.v1.SecretVersion.toObject(includeInstance, f) }; if (includeInstance) { @@ -557,23 +555,23 @@ proto.nitric.secret.v1.SecretAccessRequest.toObject = function(includeInstance, /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.secret.v1.SecretAccessRequest} + * @return {!proto.nitric.proto.secrets.v1.SecretAccessRequest} */ -proto.nitric.secret.v1.SecretAccessRequest.deserializeBinary = function(bytes) { +proto.nitric.proto.secrets.v1.SecretAccessRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.secret.v1.SecretAccessRequest; - return proto.nitric.secret.v1.SecretAccessRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.nitric.proto.secrets.v1.SecretAccessRequest; + return proto.nitric.proto.secrets.v1.SecretAccessRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.nitric.secret.v1.SecretAccessRequest} msg The message object to deserialize into. + * @param {!proto.nitric.proto.secrets.v1.SecretAccessRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.secret.v1.SecretAccessRequest} + * @return {!proto.nitric.proto.secrets.v1.SecretAccessRequest} */ -proto.nitric.secret.v1.SecretAccessRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.nitric.proto.secrets.v1.SecretAccessRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -581,8 +579,8 @@ proto.nitric.secret.v1.SecretAccessRequest.deserializeBinaryFromReader = functio var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.nitric.secret.v1.SecretVersion; - reader.readMessage(value,proto.nitric.secret.v1.SecretVersion.deserializeBinaryFromReader); + var value = new proto.nitric.proto.secrets.v1.SecretVersion; + reader.readMessage(value,proto.nitric.proto.secrets.v1.SecretVersion.deserializeBinaryFromReader); msg.setSecretVersion(value); break; default: @@ -598,9 +596,9 @@ proto.nitric.secret.v1.SecretAccessRequest.deserializeBinaryFromReader = functio * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.nitric.secret.v1.SecretAccessRequest.prototype.serializeBinary = function() { +proto.nitric.proto.secrets.v1.SecretAccessRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.nitric.secret.v1.SecretAccessRequest.serializeBinaryToWriter(this, writer); + proto.nitric.proto.secrets.v1.SecretAccessRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -608,18 +606,18 @@ proto.nitric.secret.v1.SecretAccessRequest.prototype.serializeBinary = function( /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.nitric.secret.v1.SecretAccessRequest} message + * @param {!proto.nitric.proto.secrets.v1.SecretAccessRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.secret.v1.SecretAccessRequest.serializeBinaryToWriter = function(message, writer) { +proto.nitric.proto.secrets.v1.SecretAccessRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getSecretVersion(); if (f != null) { writer.writeMessage( 1, f, - proto.nitric.secret.v1.SecretVersion.serializeBinaryToWriter + proto.nitric.proto.secrets.v1.SecretVersion.serializeBinaryToWriter ); } }; @@ -627,28 +625,28 @@ proto.nitric.secret.v1.SecretAccessRequest.serializeBinaryToWriter = function(me /** * optional SecretVersion secret_version = 1; - * @return {?proto.nitric.secret.v1.SecretVersion} + * @return {?proto.nitric.proto.secrets.v1.SecretVersion} */ -proto.nitric.secret.v1.SecretAccessRequest.prototype.getSecretVersion = function() { - return /** @type{?proto.nitric.secret.v1.SecretVersion} */ ( - jspb.Message.getWrapperField(this, proto.nitric.secret.v1.SecretVersion, 1)); +proto.nitric.proto.secrets.v1.SecretAccessRequest.prototype.getSecretVersion = function() { + return /** @type{?proto.nitric.proto.secrets.v1.SecretVersion} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.secrets.v1.SecretVersion, 1)); }; /** - * @param {?proto.nitric.secret.v1.SecretVersion|undefined} value - * @return {!proto.nitric.secret.v1.SecretAccessRequest} returns this + * @param {?proto.nitric.proto.secrets.v1.SecretVersion|undefined} value + * @return {!proto.nitric.proto.secrets.v1.SecretAccessRequest} returns this */ -proto.nitric.secret.v1.SecretAccessRequest.prototype.setSecretVersion = function(value) { +proto.nitric.proto.secrets.v1.SecretAccessRequest.prototype.setSecretVersion = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. - * @return {!proto.nitric.secret.v1.SecretAccessRequest} returns this + * @return {!proto.nitric.proto.secrets.v1.SecretAccessRequest} returns this */ -proto.nitric.secret.v1.SecretAccessRequest.prototype.clearSecretVersion = function() { +proto.nitric.proto.secrets.v1.SecretAccessRequest.prototype.clearSecretVersion = function() { return this.setSecretVersion(undefined); }; @@ -657,7 +655,7 @@ proto.nitric.secret.v1.SecretAccessRequest.prototype.clearSecretVersion = functi * Returns whether this field is set. * @return {boolean} */ -proto.nitric.secret.v1.SecretAccessRequest.prototype.hasSecretVersion = function() { +proto.nitric.proto.secrets.v1.SecretAccessRequest.prototype.hasSecretVersion = function() { return jspb.Message.getField(this, 1) != null; }; @@ -678,8 +676,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.nitric.secret.v1.SecretAccessResponse.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.secret.v1.SecretAccessResponse.toObject(opt_includeInstance, this); +proto.nitric.proto.secrets.v1.SecretAccessResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.secrets.v1.SecretAccessResponse.toObject(opt_includeInstance, this); }; @@ -688,13 +686,13 @@ proto.nitric.secret.v1.SecretAccessResponse.prototype.toObject = function(opt_in * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.nitric.secret.v1.SecretAccessResponse} msg The msg instance to transform. + * @param {!proto.nitric.proto.secrets.v1.SecretAccessResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.secret.v1.SecretAccessResponse.toObject = function(includeInstance, msg) { +proto.nitric.proto.secrets.v1.SecretAccessResponse.toObject = function(includeInstance, msg) { var f, obj = { - secretVersion: (f = msg.getSecretVersion()) && proto.nitric.secret.v1.SecretVersion.toObject(includeInstance, f), + secretVersion: (f = msg.getSecretVersion()) && proto.nitric.proto.secrets.v1.SecretVersion.toObject(includeInstance, f), value: msg.getValue_asB64() }; @@ -709,23 +707,23 @@ proto.nitric.secret.v1.SecretAccessResponse.toObject = function(includeInstance, /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.secret.v1.SecretAccessResponse} + * @return {!proto.nitric.proto.secrets.v1.SecretAccessResponse} */ -proto.nitric.secret.v1.SecretAccessResponse.deserializeBinary = function(bytes) { +proto.nitric.proto.secrets.v1.SecretAccessResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.secret.v1.SecretAccessResponse; - return proto.nitric.secret.v1.SecretAccessResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.nitric.proto.secrets.v1.SecretAccessResponse; + return proto.nitric.proto.secrets.v1.SecretAccessResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.nitric.secret.v1.SecretAccessResponse} msg The message object to deserialize into. + * @param {!proto.nitric.proto.secrets.v1.SecretAccessResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.secret.v1.SecretAccessResponse} + * @return {!proto.nitric.proto.secrets.v1.SecretAccessResponse} */ -proto.nitric.secret.v1.SecretAccessResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.nitric.proto.secrets.v1.SecretAccessResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -733,8 +731,8 @@ proto.nitric.secret.v1.SecretAccessResponse.deserializeBinaryFromReader = functi var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.nitric.secret.v1.SecretVersion; - reader.readMessage(value,proto.nitric.secret.v1.SecretVersion.deserializeBinaryFromReader); + var value = new proto.nitric.proto.secrets.v1.SecretVersion; + reader.readMessage(value,proto.nitric.proto.secrets.v1.SecretVersion.deserializeBinaryFromReader); msg.setSecretVersion(value); break; case 2: @@ -754,9 +752,9 @@ proto.nitric.secret.v1.SecretAccessResponse.deserializeBinaryFromReader = functi * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.nitric.secret.v1.SecretAccessResponse.prototype.serializeBinary = function() { +proto.nitric.proto.secrets.v1.SecretAccessResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.nitric.secret.v1.SecretAccessResponse.serializeBinaryToWriter(this, writer); + proto.nitric.proto.secrets.v1.SecretAccessResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -764,18 +762,18 @@ proto.nitric.secret.v1.SecretAccessResponse.prototype.serializeBinary = function /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.nitric.secret.v1.SecretAccessResponse} message + * @param {!proto.nitric.proto.secrets.v1.SecretAccessResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.secret.v1.SecretAccessResponse.serializeBinaryToWriter = function(message, writer) { +proto.nitric.proto.secrets.v1.SecretAccessResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getSecretVersion(); if (f != null) { writer.writeMessage( 1, f, - proto.nitric.secret.v1.SecretVersion.serializeBinaryToWriter + proto.nitric.proto.secrets.v1.SecretVersion.serializeBinaryToWriter ); } f = message.getValue_asU8(); @@ -790,28 +788,28 @@ proto.nitric.secret.v1.SecretAccessResponse.serializeBinaryToWriter = function(m /** * optional SecretVersion secret_version = 1; - * @return {?proto.nitric.secret.v1.SecretVersion} + * @return {?proto.nitric.proto.secrets.v1.SecretVersion} */ -proto.nitric.secret.v1.SecretAccessResponse.prototype.getSecretVersion = function() { - return /** @type{?proto.nitric.secret.v1.SecretVersion} */ ( - jspb.Message.getWrapperField(this, proto.nitric.secret.v1.SecretVersion, 1)); +proto.nitric.proto.secrets.v1.SecretAccessResponse.prototype.getSecretVersion = function() { + return /** @type{?proto.nitric.proto.secrets.v1.SecretVersion} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.secrets.v1.SecretVersion, 1)); }; /** - * @param {?proto.nitric.secret.v1.SecretVersion|undefined} value - * @return {!proto.nitric.secret.v1.SecretAccessResponse} returns this + * @param {?proto.nitric.proto.secrets.v1.SecretVersion|undefined} value + * @return {!proto.nitric.proto.secrets.v1.SecretAccessResponse} returns this */ -proto.nitric.secret.v1.SecretAccessResponse.prototype.setSecretVersion = function(value) { +proto.nitric.proto.secrets.v1.SecretAccessResponse.prototype.setSecretVersion = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. - * @return {!proto.nitric.secret.v1.SecretAccessResponse} returns this + * @return {!proto.nitric.proto.secrets.v1.SecretAccessResponse} returns this */ -proto.nitric.secret.v1.SecretAccessResponse.prototype.clearSecretVersion = function() { +proto.nitric.proto.secrets.v1.SecretAccessResponse.prototype.clearSecretVersion = function() { return this.setSecretVersion(undefined); }; @@ -820,7 +818,7 @@ proto.nitric.secret.v1.SecretAccessResponse.prototype.clearSecretVersion = funct * Returns whether this field is set. * @return {boolean} */ -proto.nitric.secret.v1.SecretAccessResponse.prototype.hasSecretVersion = function() { +proto.nitric.proto.secrets.v1.SecretAccessResponse.prototype.hasSecretVersion = function() { return jspb.Message.getField(this, 1) != null; }; @@ -829,7 +827,7 @@ proto.nitric.secret.v1.SecretAccessResponse.prototype.hasSecretVersion = functio * optional bytes value = 2; * @return {!(string|Uint8Array)} */ -proto.nitric.secret.v1.SecretAccessResponse.prototype.getValue = function() { +proto.nitric.proto.secrets.v1.SecretAccessResponse.prototype.getValue = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; @@ -839,7 +837,7 @@ proto.nitric.secret.v1.SecretAccessResponse.prototype.getValue = function() { * This is a type-conversion wrapper around `getValue()` * @return {string} */ -proto.nitric.secret.v1.SecretAccessResponse.prototype.getValue_asB64 = function() { +proto.nitric.proto.secrets.v1.SecretAccessResponse.prototype.getValue_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getValue())); }; @@ -852,7 +850,7 @@ proto.nitric.secret.v1.SecretAccessResponse.prototype.getValue_asB64 = function( * This is a type-conversion wrapper around `getValue()` * @return {!Uint8Array} */ -proto.nitric.secret.v1.SecretAccessResponse.prototype.getValue_asU8 = function() { +proto.nitric.proto.secrets.v1.SecretAccessResponse.prototype.getValue_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getValue())); }; @@ -860,9 +858,9 @@ proto.nitric.secret.v1.SecretAccessResponse.prototype.getValue_asU8 = function() /** * @param {!(string|Uint8Array)} value - * @return {!proto.nitric.secret.v1.SecretAccessResponse} returns this + * @return {!proto.nitric.proto.secrets.v1.SecretAccessResponse} returns this */ -proto.nitric.secret.v1.SecretAccessResponse.prototype.setValue = function(value) { +proto.nitric.proto.secrets.v1.SecretAccessResponse.prototype.setValue = function(value) { return jspb.Message.setProto3BytesField(this, 2, value); }; @@ -883,8 +881,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.nitric.secret.v1.Secret.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.secret.v1.Secret.toObject(opt_includeInstance, this); +proto.nitric.proto.secrets.v1.Secret.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.secrets.v1.Secret.toObject(opt_includeInstance, this); }; @@ -893,11 +891,11 @@ proto.nitric.secret.v1.Secret.prototype.toObject = function(opt_includeInstance) * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.nitric.secret.v1.Secret} msg The msg instance to transform. + * @param {!proto.nitric.proto.secrets.v1.Secret} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.secret.v1.Secret.toObject = function(includeInstance, msg) { +proto.nitric.proto.secrets.v1.Secret.toObject = function(includeInstance, msg) { var f, obj = { name: jspb.Message.getFieldWithDefault(msg, 1, "") }; @@ -913,23 +911,23 @@ proto.nitric.secret.v1.Secret.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.secret.v1.Secret} + * @return {!proto.nitric.proto.secrets.v1.Secret} */ -proto.nitric.secret.v1.Secret.deserializeBinary = function(bytes) { +proto.nitric.proto.secrets.v1.Secret.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.secret.v1.Secret; - return proto.nitric.secret.v1.Secret.deserializeBinaryFromReader(msg, reader); + var msg = new proto.nitric.proto.secrets.v1.Secret; + return proto.nitric.proto.secrets.v1.Secret.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.nitric.secret.v1.Secret} msg The message object to deserialize into. + * @param {!proto.nitric.proto.secrets.v1.Secret} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.secret.v1.Secret} + * @return {!proto.nitric.proto.secrets.v1.Secret} */ -proto.nitric.secret.v1.Secret.deserializeBinaryFromReader = function(msg, reader) { +proto.nitric.proto.secrets.v1.Secret.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -953,9 +951,9 @@ proto.nitric.secret.v1.Secret.deserializeBinaryFromReader = function(msg, reader * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.nitric.secret.v1.Secret.prototype.serializeBinary = function() { +proto.nitric.proto.secrets.v1.Secret.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.nitric.secret.v1.Secret.serializeBinaryToWriter(this, writer); + proto.nitric.proto.secrets.v1.Secret.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -963,11 +961,11 @@ proto.nitric.secret.v1.Secret.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.nitric.secret.v1.Secret} message + * @param {!proto.nitric.proto.secrets.v1.Secret} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.secret.v1.Secret.serializeBinaryToWriter = function(message, writer) { +proto.nitric.proto.secrets.v1.Secret.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getName(); if (f.length > 0) { @@ -983,16 +981,16 @@ proto.nitric.secret.v1.Secret.serializeBinaryToWriter = function(message, writer * optional string name = 1; * @return {string} */ -proto.nitric.secret.v1.Secret.prototype.getName = function() { +proto.nitric.proto.secrets.v1.Secret.prototype.getName = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value - * @return {!proto.nitric.secret.v1.Secret} returns this + * @return {!proto.nitric.proto.secrets.v1.Secret} returns this */ -proto.nitric.secret.v1.Secret.prototype.setName = function(value) { +proto.nitric.proto.secrets.v1.Secret.prototype.setName = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; @@ -1013,8 +1011,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.nitric.secret.v1.SecretVersion.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.secret.v1.SecretVersion.toObject(opt_includeInstance, this); +proto.nitric.proto.secrets.v1.SecretVersion.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.secrets.v1.SecretVersion.toObject(opt_includeInstance, this); }; @@ -1023,13 +1021,13 @@ proto.nitric.secret.v1.SecretVersion.prototype.toObject = function(opt_includeIn * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.nitric.secret.v1.SecretVersion} msg The msg instance to transform. + * @param {!proto.nitric.proto.secrets.v1.SecretVersion} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.secret.v1.SecretVersion.toObject = function(includeInstance, msg) { +proto.nitric.proto.secrets.v1.SecretVersion.toObject = function(includeInstance, msg) { var f, obj = { - secret: (f = msg.getSecret()) && proto.nitric.secret.v1.Secret.toObject(includeInstance, f), + secret: (f = msg.getSecret()) && proto.nitric.proto.secrets.v1.Secret.toObject(includeInstance, f), version: jspb.Message.getFieldWithDefault(msg, 2, "") }; @@ -1044,23 +1042,23 @@ proto.nitric.secret.v1.SecretVersion.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.secret.v1.SecretVersion} + * @return {!proto.nitric.proto.secrets.v1.SecretVersion} */ -proto.nitric.secret.v1.SecretVersion.deserializeBinary = function(bytes) { +proto.nitric.proto.secrets.v1.SecretVersion.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.secret.v1.SecretVersion; - return proto.nitric.secret.v1.SecretVersion.deserializeBinaryFromReader(msg, reader); + var msg = new proto.nitric.proto.secrets.v1.SecretVersion; + return proto.nitric.proto.secrets.v1.SecretVersion.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.nitric.secret.v1.SecretVersion} msg The message object to deserialize into. + * @param {!proto.nitric.proto.secrets.v1.SecretVersion} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.secret.v1.SecretVersion} + * @return {!proto.nitric.proto.secrets.v1.SecretVersion} */ -proto.nitric.secret.v1.SecretVersion.deserializeBinaryFromReader = function(msg, reader) { +proto.nitric.proto.secrets.v1.SecretVersion.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1068,8 +1066,8 @@ proto.nitric.secret.v1.SecretVersion.deserializeBinaryFromReader = function(msg, var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.nitric.secret.v1.Secret; - reader.readMessage(value,proto.nitric.secret.v1.Secret.deserializeBinaryFromReader); + var value = new proto.nitric.proto.secrets.v1.Secret; + reader.readMessage(value,proto.nitric.proto.secrets.v1.Secret.deserializeBinaryFromReader); msg.setSecret(value); break; case 2: @@ -1089,9 +1087,9 @@ proto.nitric.secret.v1.SecretVersion.deserializeBinaryFromReader = function(msg, * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.nitric.secret.v1.SecretVersion.prototype.serializeBinary = function() { +proto.nitric.proto.secrets.v1.SecretVersion.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.nitric.secret.v1.SecretVersion.serializeBinaryToWriter(this, writer); + proto.nitric.proto.secrets.v1.SecretVersion.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1099,18 +1097,18 @@ proto.nitric.secret.v1.SecretVersion.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.nitric.secret.v1.SecretVersion} message + * @param {!proto.nitric.proto.secrets.v1.SecretVersion} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.secret.v1.SecretVersion.serializeBinaryToWriter = function(message, writer) { +proto.nitric.proto.secrets.v1.SecretVersion.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getSecret(); if (f != null) { writer.writeMessage( 1, f, - proto.nitric.secret.v1.Secret.serializeBinaryToWriter + proto.nitric.proto.secrets.v1.Secret.serializeBinaryToWriter ); } f = message.getVersion(); @@ -1125,28 +1123,28 @@ proto.nitric.secret.v1.SecretVersion.serializeBinaryToWriter = function(message, /** * optional Secret secret = 1; - * @return {?proto.nitric.secret.v1.Secret} + * @return {?proto.nitric.proto.secrets.v1.Secret} */ -proto.nitric.secret.v1.SecretVersion.prototype.getSecret = function() { - return /** @type{?proto.nitric.secret.v1.Secret} */ ( - jspb.Message.getWrapperField(this, proto.nitric.secret.v1.Secret, 1)); +proto.nitric.proto.secrets.v1.SecretVersion.prototype.getSecret = function() { + return /** @type{?proto.nitric.proto.secrets.v1.Secret} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.secrets.v1.Secret, 1)); }; /** - * @param {?proto.nitric.secret.v1.Secret|undefined} value - * @return {!proto.nitric.secret.v1.SecretVersion} returns this + * @param {?proto.nitric.proto.secrets.v1.Secret|undefined} value + * @return {!proto.nitric.proto.secrets.v1.SecretVersion} returns this */ -proto.nitric.secret.v1.SecretVersion.prototype.setSecret = function(value) { +proto.nitric.proto.secrets.v1.SecretVersion.prototype.setSecret = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. - * @return {!proto.nitric.secret.v1.SecretVersion} returns this + * @return {!proto.nitric.proto.secrets.v1.SecretVersion} returns this */ -proto.nitric.secret.v1.SecretVersion.prototype.clearSecret = function() { +proto.nitric.proto.secrets.v1.SecretVersion.prototype.clearSecret = function() { return this.setSecret(undefined); }; @@ -1155,7 +1153,7 @@ proto.nitric.secret.v1.SecretVersion.prototype.clearSecret = function() { * Returns whether this field is set. * @return {boolean} */ -proto.nitric.secret.v1.SecretVersion.prototype.hasSecret = function() { +proto.nitric.proto.secrets.v1.SecretVersion.prototype.hasSecret = function() { return jspb.Message.getField(this, 1) != null; }; @@ -1164,18 +1162,18 @@ proto.nitric.secret.v1.SecretVersion.prototype.hasSecret = function() { * optional string version = 2; * @return {string} */ -proto.nitric.secret.v1.SecretVersion.prototype.getVersion = function() { +proto.nitric.proto.secrets.v1.SecretVersion.prototype.getVersion = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * @param {string} value - * @return {!proto.nitric.secret.v1.SecretVersion} returns this + * @return {!proto.nitric.proto.secrets.v1.SecretVersion} returns this */ -proto.nitric.secret.v1.SecretVersion.prototype.setVersion = function(value) { +proto.nitric.proto.secrets.v1.SecretVersion.prototype.setVersion = function(value) { return jspb.Message.setProto3StringField(this, 2, value); }; -goog.object.extend(exports, proto.nitric.secret.v1); +goog.object.extend(exports, proto.nitric.proto.secrets.v1); diff --git a/src/gen/nitric/proto/storage/v1/storage_grpc_pb.d.ts b/src/gen/nitric/proto/storage/v1/storage_grpc_pb.d.ts new file mode 100644 index 00000000..8d01bc15 --- /dev/null +++ b/src/gen/nitric/proto/storage/v1/storage_grpc_pb.d.ts @@ -0,0 +1,65 @@ +// GENERATED CODE -- DO NOT EDIT! + +// package: nitric.proto.storage.v1 +// file: nitric/proto/storage/v1/storage.proto + +import * as nitric_proto_storage_v1_storage_pb from "../../../../nitric/proto/storage/v1/storage_pb"; +import * as grpc from "@grpc/grpc-js"; + +interface IStorageService extends grpc.ServiceDefinition { + read: grpc.MethodDefinition; + write: grpc.MethodDefinition; + delete: grpc.MethodDefinition; + preSignUrl: grpc.MethodDefinition; + listBlobs: grpc.MethodDefinition; + exists: grpc.MethodDefinition; +} + +export const StorageService: IStorageService; + +export interface IStorageServer extends grpc.UntypedServiceImplementation { + read: grpc.handleUnaryCall; + write: grpc.handleUnaryCall; + delete: grpc.handleUnaryCall; + preSignUrl: grpc.handleUnaryCall; + listBlobs: grpc.handleUnaryCall; + exists: grpc.handleUnaryCall; +} + +export class StorageClient extends grpc.Client { + constructor(address: string, credentials: grpc.ChannelCredentials, options?: object); + read(argument: nitric_proto_storage_v1_storage_pb.StorageReadRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + read(argument: nitric_proto_storage_v1_storage_pb.StorageReadRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + read(argument: nitric_proto_storage_v1_storage_pb.StorageReadRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + write(argument: nitric_proto_storage_v1_storage_pb.StorageWriteRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + write(argument: nitric_proto_storage_v1_storage_pb.StorageWriteRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + write(argument: nitric_proto_storage_v1_storage_pb.StorageWriteRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + delete(argument: nitric_proto_storage_v1_storage_pb.StorageDeleteRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + delete(argument: nitric_proto_storage_v1_storage_pb.StorageDeleteRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + delete(argument: nitric_proto_storage_v1_storage_pb.StorageDeleteRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + preSignUrl(argument: nitric_proto_storage_v1_storage_pb.StoragePreSignUrlRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + preSignUrl(argument: nitric_proto_storage_v1_storage_pb.StoragePreSignUrlRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + preSignUrl(argument: nitric_proto_storage_v1_storage_pb.StoragePreSignUrlRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + listBlobs(argument: nitric_proto_storage_v1_storage_pb.StorageListBlobsRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + listBlobs(argument: nitric_proto_storage_v1_storage_pb.StorageListBlobsRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + listBlobs(argument: nitric_proto_storage_v1_storage_pb.StorageListBlobsRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + exists(argument: nitric_proto_storage_v1_storage_pb.StorageExistsRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + exists(argument: nitric_proto_storage_v1_storage_pb.StorageExistsRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + exists(argument: nitric_proto_storage_v1_storage_pb.StorageExistsRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; +} + +interface IStorageListenerService extends grpc.ServiceDefinition { + listen: grpc.MethodDefinition; +} + +export const StorageListenerService: IStorageListenerService; + +export interface IStorageListenerServer extends grpc.UntypedServiceImplementation { + listen: grpc.handleBidiStreamingCall; +} + +export class StorageListenerClient extends grpc.Client { + constructor(address: string, credentials: grpc.ChannelCredentials, options?: object); + listen(metadataOrOptions?: grpc.Metadata | grpc.CallOptions | null): grpc.ClientDuplexStream; + listen(metadata?: grpc.Metadata | null, options?: grpc.CallOptions | null): grpc.ClientDuplexStream; +} diff --git a/src/gen/nitric/proto/storage/v1/storage_grpc_pb.js b/src/gen/nitric/proto/storage/v1/storage_grpc_pb.js new file mode 100644 index 00000000..9da6692d --- /dev/null +++ b/src/gen/nitric/proto/storage/v1/storage_grpc_pb.js @@ -0,0 +1,255 @@ +// GENERATED CODE -- DO NOT EDIT! + +'use strict'; +var grpc = require('@grpc/grpc-js'); +var nitric_proto_storage_v1_storage_pb = require('../../../../nitric/proto/storage/v1/storage_pb.js'); +var google_protobuf_duration_pb = require('google-protobuf/google/protobuf/duration_pb.js'); + +function serialize_nitric_proto_storage_v1_ClientMessage(arg) { + if (!(arg instanceof nitric_proto_storage_v1_storage_pb.ClientMessage)) { + throw new Error('Expected argument of type nitric.proto.storage.v1.ClientMessage'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_storage_v1_ClientMessage(buffer_arg) { + return nitric_proto_storage_v1_storage_pb.ClientMessage.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_storage_v1_ServerMessage(arg) { + if (!(arg instanceof nitric_proto_storage_v1_storage_pb.ServerMessage)) { + throw new Error('Expected argument of type nitric.proto.storage.v1.ServerMessage'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_storage_v1_ServerMessage(buffer_arg) { + return nitric_proto_storage_v1_storage_pb.ServerMessage.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_storage_v1_StorageDeleteRequest(arg) { + if (!(arg instanceof nitric_proto_storage_v1_storage_pb.StorageDeleteRequest)) { + throw new Error('Expected argument of type nitric.proto.storage.v1.StorageDeleteRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_storage_v1_StorageDeleteRequest(buffer_arg) { + return nitric_proto_storage_v1_storage_pb.StorageDeleteRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_storage_v1_StorageDeleteResponse(arg) { + if (!(arg instanceof nitric_proto_storage_v1_storage_pb.StorageDeleteResponse)) { + throw new Error('Expected argument of type nitric.proto.storage.v1.StorageDeleteResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_storage_v1_StorageDeleteResponse(buffer_arg) { + return nitric_proto_storage_v1_storage_pb.StorageDeleteResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_storage_v1_StorageExistsRequest(arg) { + if (!(arg instanceof nitric_proto_storage_v1_storage_pb.StorageExistsRequest)) { + throw new Error('Expected argument of type nitric.proto.storage.v1.StorageExistsRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_storage_v1_StorageExistsRequest(buffer_arg) { + return nitric_proto_storage_v1_storage_pb.StorageExistsRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_storage_v1_StorageExistsResponse(arg) { + if (!(arg instanceof nitric_proto_storage_v1_storage_pb.StorageExistsResponse)) { + throw new Error('Expected argument of type nitric.proto.storage.v1.StorageExistsResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_storage_v1_StorageExistsResponse(buffer_arg) { + return nitric_proto_storage_v1_storage_pb.StorageExistsResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_storage_v1_StorageListBlobsRequest(arg) { + if (!(arg instanceof nitric_proto_storage_v1_storage_pb.StorageListBlobsRequest)) { + throw new Error('Expected argument of type nitric.proto.storage.v1.StorageListBlobsRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_storage_v1_StorageListBlobsRequest(buffer_arg) { + return nitric_proto_storage_v1_storage_pb.StorageListBlobsRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_storage_v1_StorageListBlobsResponse(arg) { + if (!(arg instanceof nitric_proto_storage_v1_storage_pb.StorageListBlobsResponse)) { + throw new Error('Expected argument of type nitric.proto.storage.v1.StorageListBlobsResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_storage_v1_StorageListBlobsResponse(buffer_arg) { + return nitric_proto_storage_v1_storage_pb.StorageListBlobsResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_storage_v1_StoragePreSignUrlRequest(arg) { + if (!(arg instanceof nitric_proto_storage_v1_storage_pb.StoragePreSignUrlRequest)) { + throw new Error('Expected argument of type nitric.proto.storage.v1.StoragePreSignUrlRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_storage_v1_StoragePreSignUrlRequest(buffer_arg) { + return nitric_proto_storage_v1_storage_pb.StoragePreSignUrlRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_storage_v1_StoragePreSignUrlResponse(arg) { + if (!(arg instanceof nitric_proto_storage_v1_storage_pb.StoragePreSignUrlResponse)) { + throw new Error('Expected argument of type nitric.proto.storage.v1.StoragePreSignUrlResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_storage_v1_StoragePreSignUrlResponse(buffer_arg) { + return nitric_proto_storage_v1_storage_pb.StoragePreSignUrlResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_storage_v1_StorageReadRequest(arg) { + if (!(arg instanceof nitric_proto_storage_v1_storage_pb.StorageReadRequest)) { + throw new Error('Expected argument of type nitric.proto.storage.v1.StorageReadRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_storage_v1_StorageReadRequest(buffer_arg) { + return nitric_proto_storage_v1_storage_pb.StorageReadRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_storage_v1_StorageReadResponse(arg) { + if (!(arg instanceof nitric_proto_storage_v1_storage_pb.StorageReadResponse)) { + throw new Error('Expected argument of type nitric.proto.storage.v1.StorageReadResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_storage_v1_StorageReadResponse(buffer_arg) { + return nitric_proto_storage_v1_storage_pb.StorageReadResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_storage_v1_StorageWriteRequest(arg) { + if (!(arg instanceof nitric_proto_storage_v1_storage_pb.StorageWriteRequest)) { + throw new Error('Expected argument of type nitric.proto.storage.v1.StorageWriteRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_storage_v1_StorageWriteRequest(buffer_arg) { + return nitric_proto_storage_v1_storage_pb.StorageWriteRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_storage_v1_StorageWriteResponse(arg) { + if (!(arg instanceof nitric_proto_storage_v1_storage_pb.StorageWriteResponse)) { + throw new Error('Expected argument of type nitric.proto.storage.v1.StorageWriteResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_storage_v1_StorageWriteResponse(buffer_arg) { + return nitric_proto_storage_v1_storage_pb.StorageWriteResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + + +// Services for storage and retrieval of blobs in the form of byte arrays, such as text and binary blobs. +var StorageService = exports.StorageService = { + // Retrieve an item from a bucket +read: { + path: '/nitric.proto.storage.v1.Storage/Read', + requestStream: false, + responseStream: false, + requestType: nitric_proto_storage_v1_storage_pb.StorageReadRequest, + responseType: nitric_proto_storage_v1_storage_pb.StorageReadResponse, + requestSerialize: serialize_nitric_proto_storage_v1_StorageReadRequest, + requestDeserialize: deserialize_nitric_proto_storage_v1_StorageReadRequest, + responseSerialize: serialize_nitric_proto_storage_v1_StorageReadResponse, + responseDeserialize: deserialize_nitric_proto_storage_v1_StorageReadResponse, + }, + // Store an item to a bucket +write: { + path: '/nitric.proto.storage.v1.Storage/Write', + requestStream: false, + responseStream: false, + requestType: nitric_proto_storage_v1_storage_pb.StorageWriteRequest, + responseType: nitric_proto_storage_v1_storage_pb.StorageWriteResponse, + requestSerialize: serialize_nitric_proto_storage_v1_StorageWriteRequest, + requestDeserialize: deserialize_nitric_proto_storage_v1_StorageWriteRequest, + responseSerialize: serialize_nitric_proto_storage_v1_StorageWriteResponse, + responseDeserialize: deserialize_nitric_proto_storage_v1_StorageWriteResponse, + }, + // Delete an item from a bucket +delete: { + path: '/nitric.proto.storage.v1.Storage/Delete', + requestStream: false, + responseStream: false, + requestType: nitric_proto_storage_v1_storage_pb.StorageDeleteRequest, + responseType: nitric_proto_storage_v1_storage_pb.StorageDeleteResponse, + requestSerialize: serialize_nitric_proto_storage_v1_StorageDeleteRequest, + requestDeserialize: deserialize_nitric_proto_storage_v1_StorageDeleteRequest, + responseSerialize: serialize_nitric_proto_storage_v1_StorageDeleteResponse, + responseDeserialize: deserialize_nitric_proto_storage_v1_StorageDeleteResponse, + }, + // Generate a pre-signed URL for direct operations on an item +preSignUrl: { + path: '/nitric.proto.storage.v1.Storage/PreSignUrl', + requestStream: false, + responseStream: false, + requestType: nitric_proto_storage_v1_storage_pb.StoragePreSignUrlRequest, + responseType: nitric_proto_storage_v1_storage_pb.StoragePreSignUrlResponse, + requestSerialize: serialize_nitric_proto_storage_v1_StoragePreSignUrlRequest, + requestDeserialize: deserialize_nitric_proto_storage_v1_StoragePreSignUrlRequest, + responseSerialize: serialize_nitric_proto_storage_v1_StoragePreSignUrlResponse, + responseDeserialize: deserialize_nitric_proto_storage_v1_StoragePreSignUrlResponse, + }, + // List blobs currently in the bucket +listBlobs: { + path: '/nitric.proto.storage.v1.Storage/ListBlobs', + requestStream: false, + responseStream: false, + requestType: nitric_proto_storage_v1_storage_pb.StorageListBlobsRequest, + responseType: nitric_proto_storage_v1_storage_pb.StorageListBlobsResponse, + requestSerialize: serialize_nitric_proto_storage_v1_StorageListBlobsRequest, + requestDeserialize: deserialize_nitric_proto_storage_v1_StorageListBlobsRequest, + responseSerialize: serialize_nitric_proto_storage_v1_StorageListBlobsResponse, + responseDeserialize: deserialize_nitric_proto_storage_v1_StorageListBlobsResponse, + }, + // Determine is an object exists in a bucket +exists: { + path: '/nitric.proto.storage.v1.Storage/Exists', + requestStream: false, + responseStream: false, + requestType: nitric_proto_storage_v1_storage_pb.StorageExistsRequest, + responseType: nitric_proto_storage_v1_storage_pb.StorageExistsResponse, + requestSerialize: serialize_nitric_proto_storage_v1_StorageExistsRequest, + requestDeserialize: deserialize_nitric_proto_storage_v1_StorageExistsRequest, + responseSerialize: serialize_nitric_proto_storage_v1_StorageExistsResponse, + responseDeserialize: deserialize_nitric_proto_storage_v1_StorageExistsResponse, + }, +}; + +exports.StorageClient = grpc.makeGenericClientConstructor(StorageService); +var StorageListenerService = exports.StorageListenerService = { + // Listen for changes on a bucket +listen: { + path: '/nitric.proto.storage.v1.StorageListener/Listen', + requestStream: true, + responseStream: true, + requestType: nitric_proto_storage_v1_storage_pb.ClientMessage, + responseType: nitric_proto_storage_v1_storage_pb.ServerMessage, + requestSerialize: serialize_nitric_proto_storage_v1_ClientMessage, + requestDeserialize: deserialize_nitric_proto_storage_v1_ClientMessage, + responseSerialize: serialize_nitric_proto_storage_v1_ServerMessage, + responseDeserialize: deserialize_nitric_proto_storage_v1_ServerMessage, + }, +}; + +exports.StorageListenerClient = grpc.makeGenericClientConstructor(StorageListenerService); diff --git a/src/gen/proto/storage/v1/storage_pb.d.ts b/src/gen/nitric/proto/storage/v1/storage_pb.d.ts similarity index 51% rename from src/gen/proto/storage/v1/storage_pb.d.ts rename to src/gen/nitric/proto/storage/v1/storage_pb.d.ts index d28a4531..a00481a0 100644 --- a/src/gen/proto/storage/v1/storage_pb.d.ts +++ b/src/gen/nitric/proto/storage/v1/storage_pb.d.ts @@ -1,8 +1,210 @@ -// package: nitric.storage.v1 -// file: proto/storage/v1/storage.proto +// package: nitric.proto.storage.v1 +// file: nitric/proto/storage/v1/storage.proto import * as jspb from "google-protobuf"; -import * as validate_validate_pb from "../../../validate/validate_pb"; +import * as google_protobuf_duration_pb from "google-protobuf/google/protobuf/duration_pb"; + +export class ClientMessage extends jspb.Message { + getId(): string; + setId(value: string): void; + + hasRegistrationRequest(): boolean; + clearRegistrationRequest(): void; + getRegistrationRequest(): RegistrationRequest | undefined; + setRegistrationRequest(value?: RegistrationRequest): void; + + hasBlobEventResponse(): boolean; + clearBlobEventResponse(): void; + getBlobEventResponse(): BlobEventResponse | undefined; + setBlobEventResponse(value?: BlobEventResponse): void; + + getContentCase(): ClientMessage.ContentCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ClientMessage.AsObject; + static toObject(includeInstance: boolean, msg: ClientMessage): ClientMessage.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ClientMessage, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ClientMessage; + static deserializeBinaryFromReader(message: ClientMessage, reader: jspb.BinaryReader): ClientMessage; +} + +export namespace ClientMessage { + export type AsObject = { + id: string, + registrationRequest?: RegistrationRequest.AsObject, + blobEventResponse?: BlobEventResponse.AsObject, + } + + export enum ContentCase { + CONTENT_NOT_SET = 0, + REGISTRATION_REQUEST = 2, + BLOB_EVENT_RESPONSE = 3, + } +} + +export class ServerMessage extends jspb.Message { + getId(): string; + setId(value: string): void; + + hasRegistrationResponse(): boolean; + clearRegistrationResponse(): void; + getRegistrationResponse(): RegistrationResponse | undefined; + setRegistrationResponse(value?: RegistrationResponse): void; + + hasBlobEventRequest(): boolean; + clearBlobEventRequest(): void; + getBlobEventRequest(): BlobEventRequest | undefined; + setBlobEventRequest(value?: BlobEventRequest): void; + + getContentCase(): ServerMessage.ContentCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ServerMessage.AsObject; + static toObject(includeInstance: boolean, msg: ServerMessage): ServerMessage.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ServerMessage, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ServerMessage; + static deserializeBinaryFromReader(message: ServerMessage, reader: jspb.BinaryReader): ServerMessage; +} + +export namespace ServerMessage { + export type AsObject = { + id: string, + registrationResponse?: RegistrationResponse.AsObject, + blobEventRequest?: BlobEventRequest.AsObject, + } + + export enum ContentCase { + CONTENT_NOT_SET = 0, + REGISTRATION_RESPONSE = 2, + BLOB_EVENT_REQUEST = 3, + } +} + +export class BlobEventRequest extends jspb.Message { + getBucketName(): string; + setBucketName(value: string): void; + + hasBlobEvent(): boolean; + clearBlobEvent(): void; + getBlobEvent(): BlobEvent | undefined; + setBlobEvent(value?: BlobEvent): void; + + getEventCase(): BlobEventRequest.EventCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): BlobEventRequest.AsObject; + static toObject(includeInstance: boolean, msg: BlobEventRequest): BlobEventRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: BlobEventRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): BlobEventRequest; + static deserializeBinaryFromReader(message: BlobEventRequest, reader: jspb.BinaryReader): BlobEventRequest; +} + +export namespace BlobEventRequest { + export type AsObject = { + bucketName: string, + blobEvent?: BlobEvent.AsObject, + } + + export enum EventCase { + EVENT_NOT_SET = 0, + BLOB_EVENT = 10, + } +} + +export class BlobEvent extends jspb.Message { + getKey(): string; + setKey(value: string): void; + + getType(): BlobEventTypeMap[keyof BlobEventTypeMap]; + setType(value: BlobEventTypeMap[keyof BlobEventTypeMap]): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): BlobEvent.AsObject; + static toObject(includeInstance: boolean, msg: BlobEvent): BlobEvent.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: BlobEvent, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): BlobEvent; + static deserializeBinaryFromReader(message: BlobEvent, reader: jspb.BinaryReader): BlobEvent; +} + +export namespace BlobEvent { + export type AsObject = { + key: string, + type: BlobEventTypeMap[keyof BlobEventTypeMap], + } +} + +export class BlobEventResponse extends jspb.Message { + getSuccess(): boolean; + setSuccess(value: boolean): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): BlobEventResponse.AsObject; + static toObject(includeInstance: boolean, msg: BlobEventResponse): BlobEventResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: BlobEventResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): BlobEventResponse; + static deserializeBinaryFromReader(message: BlobEventResponse, reader: jspb.BinaryReader): BlobEventResponse; +} + +export namespace BlobEventResponse { + export type AsObject = { + success: boolean, + } +} + +export class RegistrationRequest extends jspb.Message { + getBucketName(): string; + setBucketName(value: string): void; + + getBlobEventType(): BlobEventTypeMap[keyof BlobEventTypeMap]; + setBlobEventType(value: BlobEventTypeMap[keyof BlobEventTypeMap]): void; + + getKeyPrefixFilter(): string; + setKeyPrefixFilter(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): RegistrationRequest.AsObject; + static toObject(includeInstance: boolean, msg: RegistrationRequest): RegistrationRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: RegistrationRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): RegistrationRequest; + static deserializeBinaryFromReader(message: RegistrationRequest, reader: jspb.BinaryReader): RegistrationRequest; +} + +export namespace RegistrationRequest { + export type AsObject = { + bucketName: string, + blobEventType: BlobEventTypeMap[keyof BlobEventTypeMap], + keyPrefixFilter: string, + } +} + +export class RegistrationResponse extends jspb.Message { + getId(): string; + setId(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): RegistrationResponse.AsObject; + static toObject(includeInstance: boolean, msg: RegistrationResponse): RegistrationResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: RegistrationResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): RegistrationResponse; + static deserializeBinaryFromReader(message: RegistrationResponse, reader: jspb.BinaryReader): RegistrationResponse; +} + +export namespace RegistrationResponse { + export type AsObject = { + id: string, + } +} export class StorageWriteRequest extends jspb.Message { getBucketName(): string; @@ -146,8 +348,10 @@ export class StoragePreSignUrlRequest extends jspb.Message { getOperation(): StoragePreSignUrlRequest.OperationMap[keyof StoragePreSignUrlRequest.OperationMap]; setOperation(value: StoragePreSignUrlRequest.OperationMap[keyof StoragePreSignUrlRequest.OperationMap]): void; - getExpiry(): number; - setExpiry(value: number): void; + hasExpiry(): boolean; + clearExpiry(): void; + getExpiry(): google_protobuf_duration_pb.Duration | undefined; + setExpiry(value?: google_protobuf_duration_pb.Duration): void; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): StoragePreSignUrlRequest.AsObject; @@ -164,7 +368,7 @@ export namespace StoragePreSignUrlRequest { bucketName: string, key: string, operation: StoragePreSignUrlRequest.OperationMap[keyof StoragePreSignUrlRequest.OperationMap], - expiry: number, + expiry?: google_protobuf_duration_pb.Duration.AsObject, } export interface OperationMap { @@ -195,7 +399,7 @@ export namespace StoragePreSignUrlResponse { } } -export class StorageListFilesRequest extends jspb.Message { +export class StorageListBlobsRequest extends jspb.Message { getBucketName(): string; setBucketName(value: string): void; @@ -203,67 +407,67 @@ export class StorageListFilesRequest extends jspb.Message { setPrefix(value: string): void; serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): StorageListFilesRequest.AsObject; - static toObject(includeInstance: boolean, msg: StorageListFilesRequest): StorageListFilesRequest.AsObject; + toObject(includeInstance?: boolean): StorageListBlobsRequest.AsObject; + static toObject(includeInstance: boolean, msg: StorageListBlobsRequest): StorageListBlobsRequest.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo}; static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: StorageListFilesRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): StorageListFilesRequest; - static deserializeBinaryFromReader(message: StorageListFilesRequest, reader: jspb.BinaryReader): StorageListFilesRequest; + static serializeBinaryToWriter(message: StorageListBlobsRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): StorageListBlobsRequest; + static deserializeBinaryFromReader(message: StorageListBlobsRequest, reader: jspb.BinaryReader): StorageListBlobsRequest; } -export namespace StorageListFilesRequest { +export namespace StorageListBlobsRequest { export type AsObject = { bucketName: string, prefix: string, } } -export class File extends jspb.Message { +export class Blob extends jspb.Message { getKey(): string; setKey(value: string): void; serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): File.AsObject; - static toObject(includeInstance: boolean, msg: File): File.AsObject; + toObject(includeInstance?: boolean): Blob.AsObject; + static toObject(includeInstance: boolean, msg: Blob): Blob.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo}; static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: File, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): File; - static deserializeBinaryFromReader(message: File, reader: jspb.BinaryReader): File; + static serializeBinaryToWriter(message: Blob, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Blob; + static deserializeBinaryFromReader(message: Blob, reader: jspb.BinaryReader): Blob; } -export namespace File { +export namespace Blob { export type AsObject = { key: string, } } -export class StorageListFilesResponse extends jspb.Message { - clearFilesList(): void; - getFilesList(): Array; - setFilesList(value: Array): void; - addFiles(value?: File, index?: number): File; +export class StorageListBlobsResponse extends jspb.Message { + clearBlobsList(): void; + getBlobsList(): Array; + setBlobsList(value: Array): void; + addBlobs(value?: Blob, index?: number): Blob; serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): StorageListFilesResponse.AsObject; - static toObject(includeInstance: boolean, msg: StorageListFilesResponse): StorageListFilesResponse.AsObject; + toObject(includeInstance?: boolean): StorageListBlobsResponse.AsObject; + static toObject(includeInstance: boolean, msg: StorageListBlobsResponse): StorageListBlobsResponse.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo}; static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: StorageListFilesResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): StorageListFilesResponse; - static deserializeBinaryFromReader(message: StorageListFilesResponse, reader: jspb.BinaryReader): StorageListFilesResponse; + static serializeBinaryToWriter(message: StorageListBlobsResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): StorageListBlobsResponse; + static deserializeBinaryFromReader(message: StorageListBlobsResponse, reader: jspb.BinaryReader): StorageListBlobsResponse; } -export namespace StorageListFilesResponse { +export namespace StorageListBlobsResponse { export type AsObject = { - filesList: Array, + blobsList: Array, } } export class StorageExistsRequest extends jspb.Message { - getBucket(): string; - setBucket(value: string): void; + getBucketName(): string; + setBucketName(value: string): void; getKey(): string; setKey(value: string): void; @@ -280,7 +484,7 @@ export class StorageExistsRequest extends jspb.Message { export namespace StorageExistsRequest { export type AsObject = { - bucket: string, + bucketName: string, key: string, } } @@ -305,3 +509,10 @@ export namespace StorageExistsResponse { } } +export interface BlobEventTypeMap { + CREATED: 0; + DELETED: 1; +} + +export const BlobEventType: BlobEventTypeMap; + diff --git a/src/gen/nitric/proto/storage/v1/storage_pb.js b/src/gen/nitric/proto/storage/v1/storage_pb.js new file mode 100644 index 00000000..a11755b4 --- /dev/null +++ b/src/gen/nitric/proto/storage/v1/storage_pb.js @@ -0,0 +1,3820 @@ +// source: nitric/proto/storage/v1/storage.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() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +var google_protobuf_duration_pb = require('google-protobuf/google/protobuf/duration_pb.js'); +goog.object.extend(proto, google_protobuf_duration_pb); +goog.exportSymbol('proto.nitric.proto.storage.v1.Blob', null, global); +goog.exportSymbol('proto.nitric.proto.storage.v1.BlobEvent', null, global); +goog.exportSymbol('proto.nitric.proto.storage.v1.BlobEventRequest', null, global); +goog.exportSymbol('proto.nitric.proto.storage.v1.BlobEventRequest.EventCase', null, global); +goog.exportSymbol('proto.nitric.proto.storage.v1.BlobEventResponse', null, global); +goog.exportSymbol('proto.nitric.proto.storage.v1.BlobEventType', null, global); +goog.exportSymbol('proto.nitric.proto.storage.v1.ClientMessage', null, global); +goog.exportSymbol('proto.nitric.proto.storage.v1.ClientMessage.ContentCase', null, global); +goog.exportSymbol('proto.nitric.proto.storage.v1.RegistrationRequest', null, global); +goog.exportSymbol('proto.nitric.proto.storage.v1.RegistrationResponse', null, global); +goog.exportSymbol('proto.nitric.proto.storage.v1.ServerMessage', null, global); +goog.exportSymbol('proto.nitric.proto.storage.v1.ServerMessage.ContentCase', null, global); +goog.exportSymbol('proto.nitric.proto.storage.v1.StorageDeleteRequest', null, global); +goog.exportSymbol('proto.nitric.proto.storage.v1.StorageDeleteResponse', null, global); +goog.exportSymbol('proto.nitric.proto.storage.v1.StorageExistsRequest', null, global); +goog.exportSymbol('proto.nitric.proto.storage.v1.StorageExistsResponse', null, global); +goog.exportSymbol('proto.nitric.proto.storage.v1.StorageListBlobsRequest', null, global); +goog.exportSymbol('proto.nitric.proto.storage.v1.StorageListBlobsResponse', null, global); +goog.exportSymbol('proto.nitric.proto.storage.v1.StoragePreSignUrlRequest', null, global); +goog.exportSymbol('proto.nitric.proto.storage.v1.StoragePreSignUrlRequest.Operation', null, global); +goog.exportSymbol('proto.nitric.proto.storage.v1.StoragePreSignUrlResponse', null, global); +goog.exportSymbol('proto.nitric.proto.storage.v1.StorageReadRequest', null, global); +goog.exportSymbol('proto.nitric.proto.storage.v1.StorageReadResponse', null, global); +goog.exportSymbol('proto.nitric.proto.storage.v1.StorageWriteRequest', null, global); +goog.exportSymbol('proto.nitric.proto.storage.v1.StorageWriteResponse', 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.nitric.proto.storage.v1.ClientMessage = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.proto.storage.v1.ClientMessage.oneofGroups_); +}; +goog.inherits(proto.nitric.proto.storage.v1.ClientMessage, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.storage.v1.ClientMessage.displayName = 'proto.nitric.proto.storage.v1.ClientMessage'; +} +/** + * 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.nitric.proto.storage.v1.ServerMessage = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.proto.storage.v1.ServerMessage.oneofGroups_); +}; +goog.inherits(proto.nitric.proto.storage.v1.ServerMessage, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.storage.v1.ServerMessage.displayName = 'proto.nitric.proto.storage.v1.ServerMessage'; +} +/** + * 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.nitric.proto.storage.v1.BlobEventRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.proto.storage.v1.BlobEventRequest.oneofGroups_); +}; +goog.inherits(proto.nitric.proto.storage.v1.BlobEventRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.storage.v1.BlobEventRequest.displayName = 'proto.nitric.proto.storage.v1.BlobEventRequest'; +} +/** + * 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.nitric.proto.storage.v1.BlobEvent = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.storage.v1.BlobEvent, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.storage.v1.BlobEvent.displayName = 'proto.nitric.proto.storage.v1.BlobEvent'; +} +/** + * 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.nitric.proto.storage.v1.BlobEventResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.storage.v1.BlobEventResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.storage.v1.BlobEventResponse.displayName = 'proto.nitric.proto.storage.v1.BlobEventResponse'; +} +/** + * 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.nitric.proto.storage.v1.RegistrationRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.storage.v1.RegistrationRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.storage.v1.RegistrationRequest.displayName = 'proto.nitric.proto.storage.v1.RegistrationRequest'; +} +/** + * 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.nitric.proto.storage.v1.RegistrationResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.storage.v1.RegistrationResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.storage.v1.RegistrationResponse.displayName = 'proto.nitric.proto.storage.v1.RegistrationResponse'; +} +/** + * 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.nitric.proto.storage.v1.StorageWriteRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.storage.v1.StorageWriteRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.storage.v1.StorageWriteRequest.displayName = 'proto.nitric.proto.storage.v1.StorageWriteRequest'; +} +/** + * 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.nitric.proto.storage.v1.StorageWriteResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.storage.v1.StorageWriteResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.storage.v1.StorageWriteResponse.displayName = 'proto.nitric.proto.storage.v1.StorageWriteResponse'; +} +/** + * 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.nitric.proto.storage.v1.StorageReadRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.storage.v1.StorageReadRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.storage.v1.StorageReadRequest.displayName = 'proto.nitric.proto.storage.v1.StorageReadRequest'; +} +/** + * 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.nitric.proto.storage.v1.StorageReadResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.storage.v1.StorageReadResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.storage.v1.StorageReadResponse.displayName = 'proto.nitric.proto.storage.v1.StorageReadResponse'; +} +/** + * 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.nitric.proto.storage.v1.StorageDeleteRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.storage.v1.StorageDeleteRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.storage.v1.StorageDeleteRequest.displayName = 'proto.nitric.proto.storage.v1.StorageDeleteRequest'; +} +/** + * 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.nitric.proto.storage.v1.StorageDeleteResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.storage.v1.StorageDeleteResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.storage.v1.StorageDeleteResponse.displayName = 'proto.nitric.proto.storage.v1.StorageDeleteResponse'; +} +/** + * 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.nitric.proto.storage.v1.StoragePreSignUrlRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.storage.v1.StoragePreSignUrlRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.storage.v1.StoragePreSignUrlRequest.displayName = 'proto.nitric.proto.storage.v1.StoragePreSignUrlRequest'; +} +/** + * 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.nitric.proto.storage.v1.StoragePreSignUrlResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.storage.v1.StoragePreSignUrlResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.storage.v1.StoragePreSignUrlResponse.displayName = 'proto.nitric.proto.storage.v1.StoragePreSignUrlResponse'; +} +/** + * 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.nitric.proto.storage.v1.StorageListBlobsRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.storage.v1.StorageListBlobsRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.storage.v1.StorageListBlobsRequest.displayName = 'proto.nitric.proto.storage.v1.StorageListBlobsRequest'; +} +/** + * 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.nitric.proto.storage.v1.Blob = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.storage.v1.Blob, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.storage.v1.Blob.displayName = 'proto.nitric.proto.storage.v1.Blob'; +} +/** + * 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.nitric.proto.storage.v1.StorageListBlobsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.proto.storage.v1.StorageListBlobsResponse.repeatedFields_, null); +}; +goog.inherits(proto.nitric.proto.storage.v1.StorageListBlobsResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.storage.v1.StorageListBlobsResponse.displayName = 'proto.nitric.proto.storage.v1.StorageListBlobsResponse'; +} +/** + * 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.nitric.proto.storage.v1.StorageExistsRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.storage.v1.StorageExistsRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.storage.v1.StorageExistsRequest.displayName = 'proto.nitric.proto.storage.v1.StorageExistsRequest'; +} +/** + * 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.nitric.proto.storage.v1.StorageExistsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.storage.v1.StorageExistsResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.storage.v1.StorageExistsResponse.displayName = 'proto.nitric.proto.storage.v1.StorageExistsResponse'; +} + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.proto.storage.v1.ClientMessage.oneofGroups_ = [[2,3]]; + +/** + * @enum {number} + */ +proto.nitric.proto.storage.v1.ClientMessage.ContentCase = { + CONTENT_NOT_SET: 0, + REGISTRATION_REQUEST: 2, + BLOB_EVENT_RESPONSE: 3 +}; + +/** + * @return {proto.nitric.proto.storage.v1.ClientMessage.ContentCase} + */ +proto.nitric.proto.storage.v1.ClientMessage.prototype.getContentCase = function() { + return /** @type {proto.nitric.proto.storage.v1.ClientMessage.ContentCase} */(jspb.Message.computeOneofCase(this, proto.nitric.proto.storage.v1.ClientMessage.oneofGroups_[0])); +}; + + + +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.nitric.proto.storage.v1.ClientMessage.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.storage.v1.ClientMessage.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.nitric.proto.storage.v1.ClientMessage} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.ClientMessage.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, ""), + registrationRequest: (f = msg.getRegistrationRequest()) && proto.nitric.proto.storage.v1.RegistrationRequest.toObject(includeInstance, f), + blobEventResponse: (f = msg.getBlobEventResponse()) && proto.nitric.proto.storage.v1.BlobEventResponse.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.nitric.proto.storage.v1.ClientMessage} + */ +proto.nitric.proto.storage.v1.ClientMessage.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.storage.v1.ClientMessage; + return proto.nitric.proto.storage.v1.ClientMessage.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.storage.v1.ClientMessage} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.storage.v1.ClientMessage} + */ +proto.nitric.proto.storage.v1.ClientMessage.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 = new proto.nitric.proto.storage.v1.RegistrationRequest; + reader.readMessage(value,proto.nitric.proto.storage.v1.RegistrationRequest.deserializeBinaryFromReader); + msg.setRegistrationRequest(value); + break; + case 3: + var value = new proto.nitric.proto.storage.v1.BlobEventResponse; + reader.readMessage(value,proto.nitric.proto.storage.v1.BlobEventResponse.deserializeBinaryFromReader); + msg.setBlobEventResponse(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.storage.v1.ClientMessage.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.storage.v1.ClientMessage.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.storage.v1.ClientMessage} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.ClientMessage.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getRegistrationRequest(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.nitric.proto.storage.v1.RegistrationRequest.serializeBinaryToWriter + ); + } + f = message.getBlobEventResponse(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.nitric.proto.storage.v1.BlobEventResponse.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string id = 1; + * @return {string} + */ +proto.nitric.proto.storage.v1.ClientMessage.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.storage.v1.ClientMessage} returns this + */ +proto.nitric.proto.storage.v1.ClientMessage.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional RegistrationRequest registration_request = 2; + * @return {?proto.nitric.proto.storage.v1.RegistrationRequest} + */ +proto.nitric.proto.storage.v1.ClientMessage.prototype.getRegistrationRequest = function() { + return /** @type{?proto.nitric.proto.storage.v1.RegistrationRequest} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.storage.v1.RegistrationRequest, 2)); +}; + + +/** + * @param {?proto.nitric.proto.storage.v1.RegistrationRequest|undefined} value + * @return {!proto.nitric.proto.storage.v1.ClientMessage} returns this +*/ +proto.nitric.proto.storage.v1.ClientMessage.prototype.setRegistrationRequest = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.nitric.proto.storage.v1.ClientMessage.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.storage.v1.ClientMessage} returns this + */ +proto.nitric.proto.storage.v1.ClientMessage.prototype.clearRegistrationRequest = function() { + return this.setRegistrationRequest(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.storage.v1.ClientMessage.prototype.hasRegistrationRequest = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional BlobEventResponse blob_event_response = 3; + * @return {?proto.nitric.proto.storage.v1.BlobEventResponse} + */ +proto.nitric.proto.storage.v1.ClientMessage.prototype.getBlobEventResponse = function() { + return /** @type{?proto.nitric.proto.storage.v1.BlobEventResponse} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.storage.v1.BlobEventResponse, 3)); +}; + + +/** + * @param {?proto.nitric.proto.storage.v1.BlobEventResponse|undefined} value + * @return {!proto.nitric.proto.storage.v1.ClientMessage} returns this +*/ +proto.nitric.proto.storage.v1.ClientMessage.prototype.setBlobEventResponse = function(value) { + return jspb.Message.setOneofWrapperField(this, 3, proto.nitric.proto.storage.v1.ClientMessage.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.storage.v1.ClientMessage} returns this + */ +proto.nitric.proto.storage.v1.ClientMessage.prototype.clearBlobEventResponse = function() { + return this.setBlobEventResponse(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.storage.v1.ClientMessage.prototype.hasBlobEventResponse = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.proto.storage.v1.ServerMessage.oneofGroups_ = [[2,3]]; + +/** + * @enum {number} + */ +proto.nitric.proto.storage.v1.ServerMessage.ContentCase = { + CONTENT_NOT_SET: 0, + REGISTRATION_RESPONSE: 2, + BLOB_EVENT_REQUEST: 3 +}; + +/** + * @return {proto.nitric.proto.storage.v1.ServerMessage.ContentCase} + */ +proto.nitric.proto.storage.v1.ServerMessage.prototype.getContentCase = function() { + return /** @type {proto.nitric.proto.storage.v1.ServerMessage.ContentCase} */(jspb.Message.computeOneofCase(this, proto.nitric.proto.storage.v1.ServerMessage.oneofGroups_[0])); +}; + + + +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.nitric.proto.storage.v1.ServerMessage.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.storage.v1.ServerMessage.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.nitric.proto.storage.v1.ServerMessage} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.ServerMessage.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, ""), + registrationResponse: (f = msg.getRegistrationResponse()) && proto.nitric.proto.storage.v1.RegistrationResponse.toObject(includeInstance, f), + blobEventRequest: (f = msg.getBlobEventRequest()) && proto.nitric.proto.storage.v1.BlobEventRequest.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.nitric.proto.storage.v1.ServerMessage} + */ +proto.nitric.proto.storage.v1.ServerMessage.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.storage.v1.ServerMessage; + return proto.nitric.proto.storage.v1.ServerMessage.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.storage.v1.ServerMessage} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.storage.v1.ServerMessage} + */ +proto.nitric.proto.storage.v1.ServerMessage.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 = new proto.nitric.proto.storage.v1.RegistrationResponse; + reader.readMessage(value,proto.nitric.proto.storage.v1.RegistrationResponse.deserializeBinaryFromReader); + msg.setRegistrationResponse(value); + break; + case 3: + var value = new proto.nitric.proto.storage.v1.BlobEventRequest; + reader.readMessage(value,proto.nitric.proto.storage.v1.BlobEventRequest.deserializeBinaryFromReader); + msg.setBlobEventRequest(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.storage.v1.ServerMessage.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.storage.v1.ServerMessage.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.storage.v1.ServerMessage} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.ServerMessage.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getRegistrationResponse(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.nitric.proto.storage.v1.RegistrationResponse.serializeBinaryToWriter + ); + } + f = message.getBlobEventRequest(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.nitric.proto.storage.v1.BlobEventRequest.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string id = 1; + * @return {string} + */ +proto.nitric.proto.storage.v1.ServerMessage.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.storage.v1.ServerMessage} returns this + */ +proto.nitric.proto.storage.v1.ServerMessage.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional RegistrationResponse registration_response = 2; + * @return {?proto.nitric.proto.storage.v1.RegistrationResponse} + */ +proto.nitric.proto.storage.v1.ServerMessage.prototype.getRegistrationResponse = function() { + return /** @type{?proto.nitric.proto.storage.v1.RegistrationResponse} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.storage.v1.RegistrationResponse, 2)); +}; + + +/** + * @param {?proto.nitric.proto.storage.v1.RegistrationResponse|undefined} value + * @return {!proto.nitric.proto.storage.v1.ServerMessage} returns this +*/ +proto.nitric.proto.storage.v1.ServerMessage.prototype.setRegistrationResponse = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.nitric.proto.storage.v1.ServerMessage.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.storage.v1.ServerMessage} returns this + */ +proto.nitric.proto.storage.v1.ServerMessage.prototype.clearRegistrationResponse = function() { + return this.setRegistrationResponse(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.storage.v1.ServerMessage.prototype.hasRegistrationResponse = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional BlobEventRequest blob_event_request = 3; + * @return {?proto.nitric.proto.storage.v1.BlobEventRequest} + */ +proto.nitric.proto.storage.v1.ServerMessage.prototype.getBlobEventRequest = function() { + return /** @type{?proto.nitric.proto.storage.v1.BlobEventRequest} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.storage.v1.BlobEventRequest, 3)); +}; + + +/** + * @param {?proto.nitric.proto.storage.v1.BlobEventRequest|undefined} value + * @return {!proto.nitric.proto.storage.v1.ServerMessage} returns this +*/ +proto.nitric.proto.storage.v1.ServerMessage.prototype.setBlobEventRequest = function(value) { + return jspb.Message.setOneofWrapperField(this, 3, proto.nitric.proto.storage.v1.ServerMessage.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.storage.v1.ServerMessage} returns this + */ +proto.nitric.proto.storage.v1.ServerMessage.prototype.clearBlobEventRequest = function() { + return this.setBlobEventRequest(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.storage.v1.ServerMessage.prototype.hasBlobEventRequest = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.proto.storage.v1.BlobEventRequest.oneofGroups_ = [[10]]; + +/** + * @enum {number} + */ +proto.nitric.proto.storage.v1.BlobEventRequest.EventCase = { + EVENT_NOT_SET: 0, + BLOB_EVENT: 10 +}; + +/** + * @return {proto.nitric.proto.storage.v1.BlobEventRequest.EventCase} + */ +proto.nitric.proto.storage.v1.BlobEventRequest.prototype.getEventCase = function() { + return /** @type {proto.nitric.proto.storage.v1.BlobEventRequest.EventCase} */(jspb.Message.computeOneofCase(this, proto.nitric.proto.storage.v1.BlobEventRequest.oneofGroups_[0])); +}; + + + +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.nitric.proto.storage.v1.BlobEventRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.storage.v1.BlobEventRequest.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.nitric.proto.storage.v1.BlobEventRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.BlobEventRequest.toObject = function(includeInstance, msg) { + var f, obj = { + bucketName: jspb.Message.getFieldWithDefault(msg, 1, ""), + blobEvent: (f = msg.getBlobEvent()) && proto.nitric.proto.storage.v1.BlobEvent.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.nitric.proto.storage.v1.BlobEventRequest} + */ +proto.nitric.proto.storage.v1.BlobEventRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.storage.v1.BlobEventRequest; + return proto.nitric.proto.storage.v1.BlobEventRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.storage.v1.BlobEventRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.storage.v1.BlobEventRequest} + */ +proto.nitric.proto.storage.v1.BlobEventRequest.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.setBucketName(value); + break; + case 10: + var value = new proto.nitric.proto.storage.v1.BlobEvent; + reader.readMessage(value,proto.nitric.proto.storage.v1.BlobEvent.deserializeBinaryFromReader); + msg.setBlobEvent(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.storage.v1.BlobEventRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.storage.v1.BlobEventRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.storage.v1.BlobEventRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.BlobEventRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getBucketName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getBlobEvent(); + if (f != null) { + writer.writeMessage( + 10, + f, + proto.nitric.proto.storage.v1.BlobEvent.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string bucket_name = 1; + * @return {string} + */ +proto.nitric.proto.storage.v1.BlobEventRequest.prototype.getBucketName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.storage.v1.BlobEventRequest} returns this + */ +proto.nitric.proto.storage.v1.BlobEventRequest.prototype.setBucketName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional BlobEvent blob_event = 10; + * @return {?proto.nitric.proto.storage.v1.BlobEvent} + */ +proto.nitric.proto.storage.v1.BlobEventRequest.prototype.getBlobEvent = function() { + return /** @type{?proto.nitric.proto.storage.v1.BlobEvent} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.storage.v1.BlobEvent, 10)); +}; + + +/** + * @param {?proto.nitric.proto.storage.v1.BlobEvent|undefined} value + * @return {!proto.nitric.proto.storage.v1.BlobEventRequest} returns this +*/ +proto.nitric.proto.storage.v1.BlobEventRequest.prototype.setBlobEvent = function(value) { + return jspb.Message.setOneofWrapperField(this, 10, proto.nitric.proto.storage.v1.BlobEventRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.storage.v1.BlobEventRequest} returns this + */ +proto.nitric.proto.storage.v1.BlobEventRequest.prototype.clearBlobEvent = function() { + return this.setBlobEvent(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.storage.v1.BlobEventRequest.prototype.hasBlobEvent = function() { + return jspb.Message.getField(this, 10) != 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.nitric.proto.storage.v1.BlobEvent.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.storage.v1.BlobEvent.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.nitric.proto.storage.v1.BlobEvent} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.BlobEvent.toObject = function(includeInstance, msg) { + var f, obj = { + key: jspb.Message.getFieldWithDefault(msg, 1, ""), + type: 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.nitric.proto.storage.v1.BlobEvent} + */ +proto.nitric.proto.storage.v1.BlobEvent.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.storage.v1.BlobEvent; + return proto.nitric.proto.storage.v1.BlobEvent.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.storage.v1.BlobEvent} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.storage.v1.BlobEvent} + */ +proto.nitric.proto.storage.v1.BlobEvent.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 {!proto.nitric.proto.storage.v1.BlobEventType} */ (reader.readEnum()); + msg.setType(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.storage.v1.BlobEvent.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.storage.v1.BlobEvent.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.storage.v1.BlobEvent} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.BlobEvent.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getKey(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getType(); + if (f !== 0.0) { + writer.writeEnum( + 2, + f + ); + } +}; + + +/** + * optional string key = 1; + * @return {string} + */ +proto.nitric.proto.storage.v1.BlobEvent.prototype.getKey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.storage.v1.BlobEvent} returns this + */ +proto.nitric.proto.storage.v1.BlobEvent.prototype.setKey = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional BlobEventType type = 2; + * @return {!proto.nitric.proto.storage.v1.BlobEventType} + */ +proto.nitric.proto.storage.v1.BlobEvent.prototype.getType = function() { + return /** @type {!proto.nitric.proto.storage.v1.BlobEventType} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {!proto.nitric.proto.storage.v1.BlobEventType} value + * @return {!proto.nitric.proto.storage.v1.BlobEvent} returns this + */ +proto.nitric.proto.storage.v1.BlobEvent.prototype.setType = 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.nitric.proto.storage.v1.BlobEventResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.storage.v1.BlobEventResponse.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.nitric.proto.storage.v1.BlobEventResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.BlobEventResponse.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.nitric.proto.storage.v1.BlobEventResponse} + */ +proto.nitric.proto.storage.v1.BlobEventResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.storage.v1.BlobEventResponse; + return proto.nitric.proto.storage.v1.BlobEventResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.storage.v1.BlobEventResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.storage.v1.BlobEventResponse} + */ +proto.nitric.proto.storage.v1.BlobEventResponse.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.nitric.proto.storage.v1.BlobEventResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.storage.v1.BlobEventResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.storage.v1.BlobEventResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.BlobEventResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSuccess(); + if (f) { + writer.writeBool( + 1, + f + ); + } +}; + + +/** + * optional bool success = 1; + * @return {boolean} + */ +proto.nitric.proto.storage.v1.BlobEventResponse.prototype.getSuccess = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.nitric.proto.storage.v1.BlobEventResponse} returns this + */ +proto.nitric.proto.storage.v1.BlobEventResponse.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.nitric.proto.storage.v1.RegistrationRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.storage.v1.RegistrationRequest.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.nitric.proto.storage.v1.RegistrationRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.RegistrationRequest.toObject = function(includeInstance, msg) { + var f, obj = { + bucketName: jspb.Message.getFieldWithDefault(msg, 1, ""), + blobEventType: jspb.Message.getFieldWithDefault(msg, 2, 0), + keyPrefixFilter: 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.nitric.proto.storage.v1.RegistrationRequest} + */ +proto.nitric.proto.storage.v1.RegistrationRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.storage.v1.RegistrationRequest; + return proto.nitric.proto.storage.v1.RegistrationRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.storage.v1.RegistrationRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.storage.v1.RegistrationRequest} + */ +proto.nitric.proto.storage.v1.RegistrationRequest.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.setBucketName(value); + break; + case 2: + var value = /** @type {!proto.nitric.proto.storage.v1.BlobEventType} */ (reader.readEnum()); + msg.setBlobEventType(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setKeyPrefixFilter(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.storage.v1.RegistrationRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.storage.v1.RegistrationRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.storage.v1.RegistrationRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.RegistrationRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getBucketName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getBlobEventType(); + if (f !== 0.0) { + writer.writeEnum( + 2, + f + ); + } + f = message.getKeyPrefixFilter(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } +}; + + +/** + * optional string bucket_name = 1; + * @return {string} + */ +proto.nitric.proto.storage.v1.RegistrationRequest.prototype.getBucketName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.storage.v1.RegistrationRequest} returns this + */ +proto.nitric.proto.storage.v1.RegistrationRequest.prototype.setBucketName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional BlobEventType blob_event_type = 2; + * @return {!proto.nitric.proto.storage.v1.BlobEventType} + */ +proto.nitric.proto.storage.v1.RegistrationRequest.prototype.getBlobEventType = function() { + return /** @type {!proto.nitric.proto.storage.v1.BlobEventType} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {!proto.nitric.proto.storage.v1.BlobEventType} value + * @return {!proto.nitric.proto.storage.v1.RegistrationRequest} returns this + */ +proto.nitric.proto.storage.v1.RegistrationRequest.prototype.setBlobEventType = function(value) { + return jspb.Message.setProto3EnumField(this, 2, value); +}; + + +/** + * optional string key_prefix_filter = 3; + * @return {string} + */ +proto.nitric.proto.storage.v1.RegistrationRequest.prototype.getKeyPrefixFilter = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.storage.v1.RegistrationRequest} returns this + */ +proto.nitric.proto.storage.v1.RegistrationRequest.prototype.setKeyPrefixFilter = 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.nitric.proto.storage.v1.RegistrationResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.storage.v1.RegistrationResponse.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.nitric.proto.storage.v1.RegistrationResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.RegistrationResponse.toObject = function(includeInstance, msg) { + var f, obj = { + id: 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.nitric.proto.storage.v1.RegistrationResponse} + */ +proto.nitric.proto.storage.v1.RegistrationResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.storage.v1.RegistrationResponse; + return proto.nitric.proto.storage.v1.RegistrationResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.storage.v1.RegistrationResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.storage.v1.RegistrationResponse} + */ +proto.nitric.proto.storage.v1.RegistrationResponse.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; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.storage.v1.RegistrationResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.storage.v1.RegistrationResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.storage.v1.RegistrationResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.RegistrationResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string id = 1; + * @return {string} + */ +proto.nitric.proto.storage.v1.RegistrationResponse.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.storage.v1.RegistrationResponse} returns this + */ +proto.nitric.proto.storage.v1.RegistrationResponse.prototype.setId = 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.nitric.proto.storage.v1.StorageWriteRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.storage.v1.StorageWriteRequest.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.nitric.proto.storage.v1.StorageWriteRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.StorageWriteRequest.toObject = function(includeInstance, msg) { + var f, obj = { + bucketName: jspb.Message.getFieldWithDefault(msg, 1, ""), + key: jspb.Message.getFieldWithDefault(msg, 2, ""), + body: msg.getBody_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.nitric.proto.storage.v1.StorageWriteRequest} + */ +proto.nitric.proto.storage.v1.StorageWriteRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.storage.v1.StorageWriteRequest; + return proto.nitric.proto.storage.v1.StorageWriteRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.storage.v1.StorageWriteRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.storage.v1.StorageWriteRequest} + */ +proto.nitric.proto.storage.v1.StorageWriteRequest.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.setBucketName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setKey(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setBody(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.storage.v1.StorageWriteRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.storage.v1.StorageWriteRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.storage.v1.StorageWriteRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.StorageWriteRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getBucketName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getKey(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getBody_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } +}; + + +/** + * optional string bucket_name = 1; + * @return {string} + */ +proto.nitric.proto.storage.v1.StorageWriteRequest.prototype.getBucketName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.storage.v1.StorageWriteRequest} returns this + */ +proto.nitric.proto.storage.v1.StorageWriteRequest.prototype.setBucketName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string key = 2; + * @return {string} + */ +proto.nitric.proto.storage.v1.StorageWriteRequest.prototype.getKey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.storage.v1.StorageWriteRequest} returns this + */ +proto.nitric.proto.storage.v1.StorageWriteRequest.prototype.setKey = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional bytes body = 3; + * @return {!(string|Uint8Array)} + */ +proto.nitric.proto.storage.v1.StorageWriteRequest.prototype.getBody = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes body = 3; + * This is a type-conversion wrapper around `getBody()` + * @return {string} + */ +proto.nitric.proto.storage.v1.StorageWriteRequest.prototype.getBody_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getBody())); +}; + + +/** + * optional bytes body = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getBody()` + * @return {!Uint8Array} + */ +proto.nitric.proto.storage.v1.StorageWriteRequest.prototype.getBody_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getBody())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.nitric.proto.storage.v1.StorageWriteRequest} returns this + */ +proto.nitric.proto.storage.v1.StorageWriteRequest.prototype.setBody = function(value) { + return jspb.Message.setProto3BytesField(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.nitric.proto.storage.v1.StorageWriteResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.storage.v1.StorageWriteResponse.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.nitric.proto.storage.v1.StorageWriteResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.StorageWriteResponse.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.proto.storage.v1.StorageWriteResponse} + */ +proto.nitric.proto.storage.v1.StorageWriteResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.storage.v1.StorageWriteResponse; + return proto.nitric.proto.storage.v1.StorageWriteResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.storage.v1.StorageWriteResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.storage.v1.StorageWriteResponse} + */ +proto.nitric.proto.storage.v1.StorageWriteResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.storage.v1.StorageWriteResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.storage.v1.StorageWriteResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.storage.v1.StorageWriteResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.StorageWriteResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +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.nitric.proto.storage.v1.StorageReadRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.storage.v1.StorageReadRequest.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.nitric.proto.storage.v1.StorageReadRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.StorageReadRequest.toObject = function(includeInstance, msg) { + var f, obj = { + bucketName: jspb.Message.getFieldWithDefault(msg, 1, ""), + key: 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.nitric.proto.storage.v1.StorageReadRequest} + */ +proto.nitric.proto.storage.v1.StorageReadRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.storage.v1.StorageReadRequest; + return proto.nitric.proto.storage.v1.StorageReadRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.storage.v1.StorageReadRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.storage.v1.StorageReadRequest} + */ +proto.nitric.proto.storage.v1.StorageReadRequest.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.setBucketName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setKey(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.storage.v1.StorageReadRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.storage.v1.StorageReadRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.storage.v1.StorageReadRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.StorageReadRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getBucketName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getKey(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional string bucket_name = 1; + * @return {string} + */ +proto.nitric.proto.storage.v1.StorageReadRequest.prototype.getBucketName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.storage.v1.StorageReadRequest} returns this + */ +proto.nitric.proto.storage.v1.StorageReadRequest.prototype.setBucketName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string key = 2; + * @return {string} + */ +proto.nitric.proto.storage.v1.StorageReadRequest.prototype.getKey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.storage.v1.StorageReadRequest} returns this + */ +proto.nitric.proto.storage.v1.StorageReadRequest.prototype.setKey = 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.nitric.proto.storage.v1.StorageReadResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.storage.v1.StorageReadResponse.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.nitric.proto.storage.v1.StorageReadResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.StorageReadResponse.toObject = function(includeInstance, msg) { + var f, obj = { + body: msg.getBody_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.nitric.proto.storage.v1.StorageReadResponse} + */ +proto.nitric.proto.storage.v1.StorageReadResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.storage.v1.StorageReadResponse; + return proto.nitric.proto.storage.v1.StorageReadResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.storage.v1.StorageReadResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.storage.v1.StorageReadResponse} + */ +proto.nitric.proto.storage.v1.StorageReadResponse.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.setBody(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.storage.v1.StorageReadResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.storage.v1.StorageReadResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.storage.v1.StorageReadResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.StorageReadResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getBody_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } +}; + + +/** + * optional bytes body = 1; + * @return {!(string|Uint8Array)} + */ +proto.nitric.proto.storage.v1.StorageReadResponse.prototype.getBody = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes body = 1; + * This is a type-conversion wrapper around `getBody()` + * @return {string} + */ +proto.nitric.proto.storage.v1.StorageReadResponse.prototype.getBody_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getBody())); +}; + + +/** + * optional bytes body = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getBody()` + * @return {!Uint8Array} + */ +proto.nitric.proto.storage.v1.StorageReadResponse.prototype.getBody_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getBody())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.nitric.proto.storage.v1.StorageReadResponse} returns this + */ +proto.nitric.proto.storage.v1.StorageReadResponse.prototype.setBody = 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.nitric.proto.storage.v1.StorageDeleteRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.storage.v1.StorageDeleteRequest.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.nitric.proto.storage.v1.StorageDeleteRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.StorageDeleteRequest.toObject = function(includeInstance, msg) { + var f, obj = { + bucketName: jspb.Message.getFieldWithDefault(msg, 1, ""), + key: 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.nitric.proto.storage.v1.StorageDeleteRequest} + */ +proto.nitric.proto.storage.v1.StorageDeleteRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.storage.v1.StorageDeleteRequest; + return proto.nitric.proto.storage.v1.StorageDeleteRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.storage.v1.StorageDeleteRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.storage.v1.StorageDeleteRequest} + */ +proto.nitric.proto.storage.v1.StorageDeleteRequest.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.setBucketName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setKey(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.storage.v1.StorageDeleteRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.storage.v1.StorageDeleteRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.storage.v1.StorageDeleteRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.StorageDeleteRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getBucketName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getKey(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional string bucket_name = 1; + * @return {string} + */ +proto.nitric.proto.storage.v1.StorageDeleteRequest.prototype.getBucketName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.storage.v1.StorageDeleteRequest} returns this + */ +proto.nitric.proto.storage.v1.StorageDeleteRequest.prototype.setBucketName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string key = 2; + * @return {string} + */ +proto.nitric.proto.storage.v1.StorageDeleteRequest.prototype.getKey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.storage.v1.StorageDeleteRequest} returns this + */ +proto.nitric.proto.storage.v1.StorageDeleteRequest.prototype.setKey = 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.nitric.proto.storage.v1.StorageDeleteResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.storage.v1.StorageDeleteResponse.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.nitric.proto.storage.v1.StorageDeleteResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.StorageDeleteResponse.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.proto.storage.v1.StorageDeleteResponse} + */ +proto.nitric.proto.storage.v1.StorageDeleteResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.storage.v1.StorageDeleteResponse; + return proto.nitric.proto.storage.v1.StorageDeleteResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.storage.v1.StorageDeleteResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.storage.v1.StorageDeleteResponse} + */ +proto.nitric.proto.storage.v1.StorageDeleteResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.storage.v1.StorageDeleteResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.storage.v1.StorageDeleteResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.storage.v1.StorageDeleteResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.StorageDeleteResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +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.nitric.proto.storage.v1.StoragePreSignUrlRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.storage.v1.StoragePreSignUrlRequest.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.nitric.proto.storage.v1.StoragePreSignUrlRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.StoragePreSignUrlRequest.toObject = function(includeInstance, msg) { + var f, obj = { + bucketName: jspb.Message.getFieldWithDefault(msg, 1, ""), + key: jspb.Message.getFieldWithDefault(msg, 2, ""), + operation: jspb.Message.getFieldWithDefault(msg, 3, 0), + expiry: (f = msg.getExpiry()) && google_protobuf_duration_pb.Duration.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.nitric.proto.storage.v1.StoragePreSignUrlRequest} + */ +proto.nitric.proto.storage.v1.StoragePreSignUrlRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.storage.v1.StoragePreSignUrlRequest; + return proto.nitric.proto.storage.v1.StoragePreSignUrlRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.storage.v1.StoragePreSignUrlRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.storage.v1.StoragePreSignUrlRequest} + */ +proto.nitric.proto.storage.v1.StoragePreSignUrlRequest.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.setBucketName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setKey(value); + break; + case 3: + var value = /** @type {!proto.nitric.proto.storage.v1.StoragePreSignUrlRequest.Operation} */ (reader.readEnum()); + msg.setOperation(value); + break; + case 4: + var value = new google_protobuf_duration_pb.Duration; + reader.readMessage(value,google_protobuf_duration_pb.Duration.deserializeBinaryFromReader); + msg.setExpiry(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.storage.v1.StoragePreSignUrlRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.storage.v1.StoragePreSignUrlRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.storage.v1.StoragePreSignUrlRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.StoragePreSignUrlRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getBucketName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getKey(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getOperation(); + if (f !== 0.0) { + writer.writeEnum( + 3, + f + ); + } + f = message.getExpiry(); + if (f != null) { + writer.writeMessage( + 4, + f, + google_protobuf_duration_pb.Duration.serializeBinaryToWriter + ); + } +}; + + +/** + * @enum {number} + */ +proto.nitric.proto.storage.v1.StoragePreSignUrlRequest.Operation = { + READ: 0, + WRITE: 1 +}; + +/** + * optional string bucket_name = 1; + * @return {string} + */ +proto.nitric.proto.storage.v1.StoragePreSignUrlRequest.prototype.getBucketName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.storage.v1.StoragePreSignUrlRequest} returns this + */ +proto.nitric.proto.storage.v1.StoragePreSignUrlRequest.prototype.setBucketName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string key = 2; + * @return {string} + */ +proto.nitric.proto.storage.v1.StoragePreSignUrlRequest.prototype.getKey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.storage.v1.StoragePreSignUrlRequest} returns this + */ +proto.nitric.proto.storage.v1.StoragePreSignUrlRequest.prototype.setKey = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional Operation operation = 3; + * @return {!proto.nitric.proto.storage.v1.StoragePreSignUrlRequest.Operation} + */ +proto.nitric.proto.storage.v1.StoragePreSignUrlRequest.prototype.getOperation = function() { + return /** @type {!proto.nitric.proto.storage.v1.StoragePreSignUrlRequest.Operation} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {!proto.nitric.proto.storage.v1.StoragePreSignUrlRequest.Operation} value + * @return {!proto.nitric.proto.storage.v1.StoragePreSignUrlRequest} returns this + */ +proto.nitric.proto.storage.v1.StoragePreSignUrlRequest.prototype.setOperation = function(value) { + return jspb.Message.setProto3EnumField(this, 3, value); +}; + + +/** + * optional google.protobuf.Duration expiry = 4; + * @return {?proto.google.protobuf.Duration} + */ +proto.nitric.proto.storage.v1.StoragePreSignUrlRequest.prototype.getExpiry = function() { + return /** @type{?proto.google.protobuf.Duration} */ ( + jspb.Message.getWrapperField(this, google_protobuf_duration_pb.Duration, 4)); +}; + + +/** + * @param {?proto.google.protobuf.Duration|undefined} value + * @return {!proto.nitric.proto.storage.v1.StoragePreSignUrlRequest} returns this +*/ +proto.nitric.proto.storage.v1.StoragePreSignUrlRequest.prototype.setExpiry = function(value) { + return jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.storage.v1.StoragePreSignUrlRequest} returns this + */ +proto.nitric.proto.storage.v1.StoragePreSignUrlRequest.prototype.clearExpiry = function() { + return this.setExpiry(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.storage.v1.StoragePreSignUrlRequest.prototype.hasExpiry = 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.nitric.proto.storage.v1.StoragePreSignUrlResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.storage.v1.StoragePreSignUrlResponse.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.nitric.proto.storage.v1.StoragePreSignUrlResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.StoragePreSignUrlResponse.toObject = function(includeInstance, msg) { + var f, obj = { + url: 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.nitric.proto.storage.v1.StoragePreSignUrlResponse} + */ +proto.nitric.proto.storage.v1.StoragePreSignUrlResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.storage.v1.StoragePreSignUrlResponse; + return proto.nitric.proto.storage.v1.StoragePreSignUrlResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.storage.v1.StoragePreSignUrlResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.storage.v1.StoragePreSignUrlResponse} + */ +proto.nitric.proto.storage.v1.StoragePreSignUrlResponse.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.setUrl(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.storage.v1.StoragePreSignUrlResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.storage.v1.StoragePreSignUrlResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.storage.v1.StoragePreSignUrlResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.StoragePreSignUrlResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUrl(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string url = 1; + * @return {string} + */ +proto.nitric.proto.storage.v1.StoragePreSignUrlResponse.prototype.getUrl = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.storage.v1.StoragePreSignUrlResponse} returns this + */ +proto.nitric.proto.storage.v1.StoragePreSignUrlResponse.prototype.setUrl = 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.nitric.proto.storage.v1.StorageListBlobsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.storage.v1.StorageListBlobsRequest.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.nitric.proto.storage.v1.StorageListBlobsRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.StorageListBlobsRequest.toObject = function(includeInstance, msg) { + var f, obj = { + bucketName: jspb.Message.getFieldWithDefault(msg, 1, ""), + prefix: 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.nitric.proto.storage.v1.StorageListBlobsRequest} + */ +proto.nitric.proto.storage.v1.StorageListBlobsRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.storage.v1.StorageListBlobsRequest; + return proto.nitric.proto.storage.v1.StorageListBlobsRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.storage.v1.StorageListBlobsRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.storage.v1.StorageListBlobsRequest} + */ +proto.nitric.proto.storage.v1.StorageListBlobsRequest.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.setBucketName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setPrefix(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.storage.v1.StorageListBlobsRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.storage.v1.StorageListBlobsRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.storage.v1.StorageListBlobsRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.StorageListBlobsRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getBucketName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getPrefix(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional string bucket_name = 1; + * @return {string} + */ +proto.nitric.proto.storage.v1.StorageListBlobsRequest.prototype.getBucketName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.storage.v1.StorageListBlobsRequest} returns this + */ +proto.nitric.proto.storage.v1.StorageListBlobsRequest.prototype.setBucketName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string prefix = 2; + * @return {string} + */ +proto.nitric.proto.storage.v1.StorageListBlobsRequest.prototype.getPrefix = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.storage.v1.StorageListBlobsRequest} returns this + */ +proto.nitric.proto.storage.v1.StorageListBlobsRequest.prototype.setPrefix = 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.nitric.proto.storage.v1.Blob.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.storage.v1.Blob.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.nitric.proto.storage.v1.Blob} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.Blob.toObject = function(includeInstance, msg) { + var f, obj = { + key: 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.nitric.proto.storage.v1.Blob} + */ +proto.nitric.proto.storage.v1.Blob.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.storage.v1.Blob; + return proto.nitric.proto.storage.v1.Blob.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.storage.v1.Blob} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.storage.v1.Blob} + */ +proto.nitric.proto.storage.v1.Blob.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; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.storage.v1.Blob.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.storage.v1.Blob.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.storage.v1.Blob} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.Blob.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getKey(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string key = 1; + * @return {string} + */ +proto.nitric.proto.storage.v1.Blob.prototype.getKey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.storage.v1.Blob} returns this + */ +proto.nitric.proto.storage.v1.Blob.prototype.setKey = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.nitric.proto.storage.v1.StorageListBlobsResponse.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.nitric.proto.storage.v1.StorageListBlobsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.storage.v1.StorageListBlobsResponse.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.nitric.proto.storage.v1.StorageListBlobsResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.StorageListBlobsResponse.toObject = function(includeInstance, msg) { + var f, obj = { + blobsList: jspb.Message.toObjectList(msg.getBlobsList(), + proto.nitric.proto.storage.v1.Blob.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.nitric.proto.storage.v1.StorageListBlobsResponse} + */ +proto.nitric.proto.storage.v1.StorageListBlobsResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.storage.v1.StorageListBlobsResponse; + return proto.nitric.proto.storage.v1.StorageListBlobsResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.storage.v1.StorageListBlobsResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.storage.v1.StorageListBlobsResponse} + */ +proto.nitric.proto.storage.v1.StorageListBlobsResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.nitric.proto.storage.v1.Blob; + reader.readMessage(value,proto.nitric.proto.storage.v1.Blob.deserializeBinaryFromReader); + msg.addBlobs(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.storage.v1.StorageListBlobsResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.storage.v1.StorageListBlobsResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.storage.v1.StorageListBlobsResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.StorageListBlobsResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getBlobsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.nitric.proto.storage.v1.Blob.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated Blob blobs = 1; + * @return {!Array} + */ +proto.nitric.proto.storage.v1.StorageListBlobsResponse.prototype.getBlobsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.nitric.proto.storage.v1.Blob, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.nitric.proto.storage.v1.StorageListBlobsResponse} returns this +*/ +proto.nitric.proto.storage.v1.StorageListBlobsResponse.prototype.setBlobsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.nitric.proto.storage.v1.Blob=} opt_value + * @param {number=} opt_index + * @return {!proto.nitric.proto.storage.v1.Blob} + */ +proto.nitric.proto.storage.v1.StorageListBlobsResponse.prototype.addBlobs = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.nitric.proto.storage.v1.Blob, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.nitric.proto.storage.v1.StorageListBlobsResponse} returns this + */ +proto.nitric.proto.storage.v1.StorageListBlobsResponse.prototype.clearBlobsList = function() { + return this.setBlobsList([]); +}; + + + + + +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.nitric.proto.storage.v1.StorageExistsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.storage.v1.StorageExistsRequest.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.nitric.proto.storage.v1.StorageExistsRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.StorageExistsRequest.toObject = function(includeInstance, msg) { + var f, obj = { + bucketName: jspb.Message.getFieldWithDefault(msg, 1, ""), + key: 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.nitric.proto.storage.v1.StorageExistsRequest} + */ +proto.nitric.proto.storage.v1.StorageExistsRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.storage.v1.StorageExistsRequest; + return proto.nitric.proto.storage.v1.StorageExistsRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.storage.v1.StorageExistsRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.storage.v1.StorageExistsRequest} + */ +proto.nitric.proto.storage.v1.StorageExistsRequest.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.setBucketName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setKey(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.storage.v1.StorageExistsRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.storage.v1.StorageExistsRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.storage.v1.StorageExistsRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.StorageExistsRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getBucketName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getKey(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional string bucket_name = 1; + * @return {string} + */ +proto.nitric.proto.storage.v1.StorageExistsRequest.prototype.getBucketName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.storage.v1.StorageExistsRequest} returns this + */ +proto.nitric.proto.storage.v1.StorageExistsRequest.prototype.setBucketName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string key = 2; + * @return {string} + */ +proto.nitric.proto.storage.v1.StorageExistsRequest.prototype.getKey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.storage.v1.StorageExistsRequest} returns this + */ +proto.nitric.proto.storage.v1.StorageExistsRequest.prototype.setKey = 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.nitric.proto.storage.v1.StorageExistsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.storage.v1.StorageExistsResponse.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.nitric.proto.storage.v1.StorageExistsResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.StorageExistsResponse.toObject = function(includeInstance, msg) { + var f, obj = { + exists: 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.nitric.proto.storage.v1.StorageExistsResponse} + */ +proto.nitric.proto.storage.v1.StorageExistsResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.storage.v1.StorageExistsResponse; + return proto.nitric.proto.storage.v1.StorageExistsResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.storage.v1.StorageExistsResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.storage.v1.StorageExistsResponse} + */ +proto.nitric.proto.storage.v1.StorageExistsResponse.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.setExists(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.storage.v1.StorageExistsResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.storage.v1.StorageExistsResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.storage.v1.StorageExistsResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.storage.v1.StorageExistsResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getExists(); + if (f) { + writer.writeBool( + 1, + f + ); + } +}; + + +/** + * optional bool exists = 1; + * @return {boolean} + */ +proto.nitric.proto.storage.v1.StorageExistsResponse.prototype.getExists = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.nitric.proto.storage.v1.StorageExistsResponse} returns this + */ +proto.nitric.proto.storage.v1.StorageExistsResponse.prototype.setExists = function(value) { + return jspb.Message.setProto3BooleanField(this, 1, value); +}; + + +/** + * @enum {number} + */ +proto.nitric.proto.storage.v1.BlobEventType = { + CREATED: 0, + DELETED: 1 +}; + +goog.object.extend(exports, proto.nitric.proto.storage.v1); diff --git a/src/gen/nitric/proto/topics/v1/topics_grpc_pb.d.ts b/src/gen/nitric/proto/topics/v1/topics_grpc_pb.d.ts new file mode 100644 index 00000000..882f837b --- /dev/null +++ b/src/gen/nitric/proto/topics/v1/topics_grpc_pb.d.ts @@ -0,0 +1,40 @@ +// GENERATED CODE -- DO NOT EDIT! + +// package: nitric.proto.topics.v1 +// file: nitric/proto/topics/v1/topics.proto + +import * as nitric_proto_topics_v1_topics_pb from "../../../../nitric/proto/topics/v1/topics_pb"; +import * as grpc from "@grpc/grpc-js"; + +interface ITopicsService extends grpc.ServiceDefinition { + publish: grpc.MethodDefinition; +} + +export const TopicsService: ITopicsService; + +export interface ITopicsServer extends grpc.UntypedServiceImplementation { + publish: grpc.handleUnaryCall; +} + +export class TopicsClient extends grpc.Client { + constructor(address: string, credentials: grpc.ChannelCredentials, options?: object); + publish(argument: nitric_proto_topics_v1_topics_pb.TopicPublishRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + publish(argument: nitric_proto_topics_v1_topics_pb.TopicPublishRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + publish(argument: nitric_proto_topics_v1_topics_pb.TopicPublishRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; +} + +interface ISubscriberService extends grpc.ServiceDefinition { + subscribe: grpc.MethodDefinition; +} + +export const SubscriberService: ISubscriberService; + +export interface ISubscriberServer extends grpc.UntypedServiceImplementation { + subscribe: grpc.handleBidiStreamingCall; +} + +export class SubscriberClient extends grpc.Client { + constructor(address: string, credentials: grpc.ChannelCredentials, options?: object); + subscribe(metadataOrOptions?: grpc.Metadata | grpc.CallOptions | null): grpc.ClientDuplexStream; + subscribe(metadata?: grpc.Metadata | null, options?: grpc.CallOptions | null): grpc.ClientDuplexStream; +} diff --git a/src/gen/nitric/proto/topics/v1/topics_grpc_pb.js b/src/gen/nitric/proto/topics/v1/topics_grpc_pb.js new file mode 100644 index 00000000..87056cad --- /dev/null +++ b/src/gen/nitric/proto/topics/v1/topics_grpc_pb.js @@ -0,0 +1,87 @@ +// GENERATED CODE -- DO NOT EDIT! + +'use strict'; +var grpc = require('@grpc/grpc-js'); +var nitric_proto_topics_v1_topics_pb = require('../../../../nitric/proto/topics/v1/topics_pb.js'); +var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js'); +var google_protobuf_duration_pb = require('google-protobuf/google/protobuf/duration_pb.js'); + +function serialize_nitric_proto_topics_v1_ClientMessage(arg) { + if (!(arg instanceof nitric_proto_topics_v1_topics_pb.ClientMessage)) { + throw new Error('Expected argument of type nitric.proto.topics.v1.ClientMessage'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_topics_v1_ClientMessage(buffer_arg) { + return nitric_proto_topics_v1_topics_pb.ClientMessage.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_topics_v1_ServerMessage(arg) { + if (!(arg instanceof nitric_proto_topics_v1_topics_pb.ServerMessage)) { + throw new Error('Expected argument of type nitric.proto.topics.v1.ServerMessage'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_topics_v1_ServerMessage(buffer_arg) { + return nitric_proto_topics_v1_topics_pb.ServerMessage.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_topics_v1_TopicPublishRequest(arg) { + if (!(arg instanceof nitric_proto_topics_v1_topics_pb.TopicPublishRequest)) { + throw new Error('Expected argument of type nitric.proto.topics.v1.TopicPublishRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_topics_v1_TopicPublishRequest(buffer_arg) { + return nitric_proto_topics_v1_topics_pb.TopicPublishRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_topics_v1_TopicPublishResponse(arg) { + if (!(arg instanceof nitric_proto_topics_v1_topics_pb.TopicPublishResponse)) { + throw new Error('Expected argument of type nitric.proto.topics.v1.TopicPublishResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_topics_v1_TopicPublishResponse(buffer_arg) { + return nitric_proto_topics_v1_topics_pb.TopicPublishResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + + +// Service for publishing asynchronous messages +var TopicsService = exports.TopicsService = { + // Publishes a message to a given topic +publish: { + path: '/nitric.proto.topics.v1.Topics/Publish', + requestStream: false, + responseStream: false, + requestType: nitric_proto_topics_v1_topics_pb.TopicPublishRequest, + responseType: nitric_proto_topics_v1_topics_pb.TopicPublishResponse, + requestSerialize: serialize_nitric_proto_topics_v1_TopicPublishRequest, + requestDeserialize: deserialize_nitric_proto_topics_v1_TopicPublishRequest, + responseSerialize: serialize_nitric_proto_topics_v1_TopicPublishResponse, + responseDeserialize: deserialize_nitric_proto_topics_v1_TopicPublishResponse, + }, +}; + +exports.TopicsClient = grpc.makeGenericClientConstructor(TopicsService); +// Service for subscribing to asynchronous messages +var SubscriberService = exports.SubscriberService = { + // Subscribe to a topic and handle incoming messages +subscribe: { + path: '/nitric.proto.topics.v1.Subscriber/Subscribe', + requestStream: true, + responseStream: true, + requestType: nitric_proto_topics_v1_topics_pb.ClientMessage, + responseType: nitric_proto_topics_v1_topics_pb.ServerMessage, + requestSerialize: serialize_nitric_proto_topics_v1_ClientMessage, + requestDeserialize: deserialize_nitric_proto_topics_v1_ClientMessage, + responseSerialize: serialize_nitric_proto_topics_v1_ServerMessage, + responseDeserialize: deserialize_nitric_proto_topics_v1_ServerMessage, + }, +}; + +exports.SubscriberClient = grpc.makeGenericClientConstructor(SubscriberService); diff --git a/src/gen/nitric/proto/topics/v1/topics_pb.d.ts b/src/gen/nitric/proto/topics/v1/topics_pb.d.ts new file mode 100644 index 00000000..3e88edc0 --- /dev/null +++ b/src/gen/nitric/proto/topics/v1/topics_pb.d.ts @@ -0,0 +1,243 @@ +// package: nitric.proto.topics.v1 +// file: nitric/proto/topics/v1/topics.proto + +import * as jspb from "google-protobuf"; +import * as google_protobuf_struct_pb from "google-protobuf/google/protobuf/struct_pb"; +import * as google_protobuf_duration_pb from "google-protobuf/google/protobuf/duration_pb"; + +export class ClientMessage extends jspb.Message { + getId(): string; + setId(value: string): void; + + hasRegistrationRequest(): boolean; + clearRegistrationRequest(): void; + getRegistrationRequest(): RegistrationRequest | undefined; + setRegistrationRequest(value?: RegistrationRequest): void; + + hasMessageResponse(): boolean; + clearMessageResponse(): void; + getMessageResponse(): MessageResponse | undefined; + setMessageResponse(value?: MessageResponse): void; + + getContentCase(): ClientMessage.ContentCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ClientMessage.AsObject; + static toObject(includeInstance: boolean, msg: ClientMessage): ClientMessage.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ClientMessage, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ClientMessage; + static deserializeBinaryFromReader(message: ClientMessage, reader: jspb.BinaryReader): ClientMessage; +} + +export namespace ClientMessage { + export type AsObject = { + id: string, + registrationRequest?: RegistrationRequest.AsObject, + messageResponse?: MessageResponse.AsObject, + } + + export enum ContentCase { + CONTENT_NOT_SET = 0, + REGISTRATION_REQUEST = 2, + MESSAGE_RESPONSE = 3, + } +} + +export class MessageRequest extends jspb.Message { + getTopicName(): string; + setTopicName(value: string): void; + + hasMessage(): boolean; + clearMessage(): void; + getMessage(): TopicMessage | undefined; + setMessage(value?: TopicMessage): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): MessageRequest.AsObject; + static toObject(includeInstance: boolean, msg: MessageRequest): MessageRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: MessageRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): MessageRequest; + static deserializeBinaryFromReader(message: MessageRequest, reader: jspb.BinaryReader): MessageRequest; +} + +export namespace MessageRequest { + export type AsObject = { + topicName: string, + message?: TopicMessage.AsObject, + } +} + +export class MessageResponse extends jspb.Message { + getSuccess(): boolean; + setSuccess(value: boolean): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): MessageResponse.AsObject; + static toObject(includeInstance: boolean, msg: MessageResponse): MessageResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: MessageResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): MessageResponse; + static deserializeBinaryFromReader(message: MessageResponse, reader: jspb.BinaryReader): MessageResponse; +} + +export namespace MessageResponse { + export type AsObject = { + success: boolean, + } +} + +export class ServerMessage extends jspb.Message { + getId(): string; + setId(value: string): void; + + hasRegistrationResponse(): boolean; + clearRegistrationResponse(): void; + getRegistrationResponse(): RegistrationResponse | undefined; + setRegistrationResponse(value?: RegistrationResponse): void; + + hasMessageRequest(): boolean; + clearMessageRequest(): void; + getMessageRequest(): MessageRequest | undefined; + setMessageRequest(value?: MessageRequest): void; + + getContentCase(): ServerMessage.ContentCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ServerMessage.AsObject; + static toObject(includeInstance: boolean, msg: ServerMessage): ServerMessage.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ServerMessage, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ServerMessage; + static deserializeBinaryFromReader(message: ServerMessage, reader: jspb.BinaryReader): ServerMessage; +} + +export namespace ServerMessage { + export type AsObject = { + id: string, + registrationResponse?: RegistrationResponse.AsObject, + messageRequest?: MessageRequest.AsObject, + } + + export enum ContentCase { + CONTENT_NOT_SET = 0, + REGISTRATION_RESPONSE = 2, + MESSAGE_REQUEST = 3, + } +} + +export class RegistrationRequest extends jspb.Message { + getTopicName(): string; + setTopicName(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): RegistrationRequest.AsObject; + static toObject(includeInstance: boolean, msg: RegistrationRequest): RegistrationRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: RegistrationRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): RegistrationRequest; + static deserializeBinaryFromReader(message: RegistrationRequest, reader: jspb.BinaryReader): RegistrationRequest; +} + +export namespace RegistrationRequest { + export type AsObject = { + topicName: string, + } +} + +export class RegistrationResponse extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): RegistrationResponse.AsObject; + static toObject(includeInstance: boolean, msg: RegistrationResponse): RegistrationResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: RegistrationResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): RegistrationResponse; + static deserializeBinaryFromReader(message: RegistrationResponse, reader: jspb.BinaryReader): RegistrationResponse; +} + +export namespace RegistrationResponse { + export type AsObject = { + } +} + +export class TopicMessage extends jspb.Message { + hasStructPayload(): boolean; + clearStructPayload(): void; + getStructPayload(): google_protobuf_struct_pb.Struct | undefined; + setStructPayload(value?: google_protobuf_struct_pb.Struct): void; + + getContentCase(): TopicMessage.ContentCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): TopicMessage.AsObject; + static toObject(includeInstance: boolean, msg: TopicMessage): TopicMessage.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: TopicMessage, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): TopicMessage; + static deserializeBinaryFromReader(message: TopicMessage, reader: jspb.BinaryReader): TopicMessage; +} + +export namespace TopicMessage { + export type AsObject = { + structPayload?: google_protobuf_struct_pb.Struct.AsObject, + } + + export enum ContentCase { + CONTENT_NOT_SET = 0, + STRUCT_PAYLOAD = 1, + } +} + +export class TopicPublishRequest extends jspb.Message { + getTopicName(): string; + setTopicName(value: string): void; + + hasMessage(): boolean; + clearMessage(): void; + getMessage(): TopicMessage | undefined; + setMessage(value?: TopicMessage): void; + + hasDelay(): boolean; + clearDelay(): void; + getDelay(): google_protobuf_duration_pb.Duration | undefined; + setDelay(value?: google_protobuf_duration_pb.Duration): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): TopicPublishRequest.AsObject; + static toObject(includeInstance: boolean, msg: TopicPublishRequest): TopicPublishRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: TopicPublishRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): TopicPublishRequest; + static deserializeBinaryFromReader(message: TopicPublishRequest, reader: jspb.BinaryReader): TopicPublishRequest; +} + +export namespace TopicPublishRequest { + export type AsObject = { + topicName: string, + message?: TopicMessage.AsObject, + delay?: google_protobuf_duration_pb.Duration.AsObject, + } +} + +export class TopicPublishResponse extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): TopicPublishResponse.AsObject; + static toObject(includeInstance: boolean, msg: TopicPublishResponse): TopicPublishResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: TopicPublishResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): TopicPublishResponse; + static deserializeBinaryFromReader(message: TopicPublishResponse, reader: jspb.BinaryReader): TopicPublishResponse; +} + +export namespace TopicPublishResponse { + export type AsObject = { + } +} + diff --git a/src/gen/nitric/proto/topics/v1/topics_pb.js b/src/gen/nitric/proto/topics/v1/topics_pb.js new file mode 100644 index 00000000..6c83a295 --- /dev/null +++ b/src/gen/nitric/proto/topics/v1/topics_pb.js @@ -0,0 +1,1796 @@ +// source: nitric/proto/topics/v1/topics.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() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js'); +goog.object.extend(proto, google_protobuf_struct_pb); +var google_protobuf_duration_pb = require('google-protobuf/google/protobuf/duration_pb.js'); +goog.object.extend(proto, google_protobuf_duration_pb); +goog.exportSymbol('proto.nitric.proto.topics.v1.ClientMessage', null, global); +goog.exportSymbol('proto.nitric.proto.topics.v1.ClientMessage.ContentCase', null, global); +goog.exportSymbol('proto.nitric.proto.topics.v1.MessageRequest', null, global); +goog.exportSymbol('proto.nitric.proto.topics.v1.MessageResponse', null, global); +goog.exportSymbol('proto.nitric.proto.topics.v1.RegistrationRequest', null, global); +goog.exportSymbol('proto.nitric.proto.topics.v1.RegistrationResponse', null, global); +goog.exportSymbol('proto.nitric.proto.topics.v1.ServerMessage', null, global); +goog.exportSymbol('proto.nitric.proto.topics.v1.ServerMessage.ContentCase', null, global); +goog.exportSymbol('proto.nitric.proto.topics.v1.TopicMessage', null, global); +goog.exportSymbol('proto.nitric.proto.topics.v1.TopicMessage.ContentCase', null, global); +goog.exportSymbol('proto.nitric.proto.topics.v1.TopicPublishRequest', null, global); +goog.exportSymbol('proto.nitric.proto.topics.v1.TopicPublishResponse', 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.nitric.proto.topics.v1.ClientMessage = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.proto.topics.v1.ClientMessage.oneofGroups_); +}; +goog.inherits(proto.nitric.proto.topics.v1.ClientMessage, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.topics.v1.ClientMessage.displayName = 'proto.nitric.proto.topics.v1.ClientMessage'; +} +/** + * 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.nitric.proto.topics.v1.MessageRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.topics.v1.MessageRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.topics.v1.MessageRequest.displayName = 'proto.nitric.proto.topics.v1.MessageRequest'; +} +/** + * 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.nitric.proto.topics.v1.MessageResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.topics.v1.MessageResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.topics.v1.MessageResponse.displayName = 'proto.nitric.proto.topics.v1.MessageResponse'; +} +/** + * 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.nitric.proto.topics.v1.ServerMessage = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.proto.topics.v1.ServerMessage.oneofGroups_); +}; +goog.inherits(proto.nitric.proto.topics.v1.ServerMessage, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.topics.v1.ServerMessage.displayName = 'proto.nitric.proto.topics.v1.ServerMessage'; +} +/** + * 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.nitric.proto.topics.v1.RegistrationRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.topics.v1.RegistrationRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.topics.v1.RegistrationRequest.displayName = 'proto.nitric.proto.topics.v1.RegistrationRequest'; +} +/** + * 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.nitric.proto.topics.v1.RegistrationResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.topics.v1.RegistrationResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.topics.v1.RegistrationResponse.displayName = 'proto.nitric.proto.topics.v1.RegistrationResponse'; +} +/** + * 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.nitric.proto.topics.v1.TopicMessage = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.proto.topics.v1.TopicMessage.oneofGroups_); +}; +goog.inherits(proto.nitric.proto.topics.v1.TopicMessage, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.topics.v1.TopicMessage.displayName = 'proto.nitric.proto.topics.v1.TopicMessage'; +} +/** + * 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.nitric.proto.topics.v1.TopicPublishRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.topics.v1.TopicPublishRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.topics.v1.TopicPublishRequest.displayName = 'proto.nitric.proto.topics.v1.TopicPublishRequest'; +} +/** + * 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.nitric.proto.topics.v1.TopicPublishResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.topics.v1.TopicPublishResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.topics.v1.TopicPublishResponse.displayName = 'proto.nitric.proto.topics.v1.TopicPublishResponse'; +} + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.proto.topics.v1.ClientMessage.oneofGroups_ = [[2,3]]; + +/** + * @enum {number} + */ +proto.nitric.proto.topics.v1.ClientMessage.ContentCase = { + CONTENT_NOT_SET: 0, + REGISTRATION_REQUEST: 2, + MESSAGE_RESPONSE: 3 +}; + +/** + * @return {proto.nitric.proto.topics.v1.ClientMessage.ContentCase} + */ +proto.nitric.proto.topics.v1.ClientMessage.prototype.getContentCase = function() { + return /** @type {proto.nitric.proto.topics.v1.ClientMessage.ContentCase} */(jspb.Message.computeOneofCase(this, proto.nitric.proto.topics.v1.ClientMessage.oneofGroups_[0])); +}; + + + +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.nitric.proto.topics.v1.ClientMessage.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.topics.v1.ClientMessage.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.nitric.proto.topics.v1.ClientMessage} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.topics.v1.ClientMessage.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, ""), + registrationRequest: (f = msg.getRegistrationRequest()) && proto.nitric.proto.topics.v1.RegistrationRequest.toObject(includeInstance, f), + messageResponse: (f = msg.getMessageResponse()) && proto.nitric.proto.topics.v1.MessageResponse.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.nitric.proto.topics.v1.ClientMessage} + */ +proto.nitric.proto.topics.v1.ClientMessage.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.topics.v1.ClientMessage; + return proto.nitric.proto.topics.v1.ClientMessage.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.topics.v1.ClientMessage} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.topics.v1.ClientMessage} + */ +proto.nitric.proto.topics.v1.ClientMessage.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 = new proto.nitric.proto.topics.v1.RegistrationRequest; + reader.readMessage(value,proto.nitric.proto.topics.v1.RegistrationRequest.deserializeBinaryFromReader); + msg.setRegistrationRequest(value); + break; + case 3: + var value = new proto.nitric.proto.topics.v1.MessageResponse; + reader.readMessage(value,proto.nitric.proto.topics.v1.MessageResponse.deserializeBinaryFromReader); + msg.setMessageResponse(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.topics.v1.ClientMessage.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.topics.v1.ClientMessage.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.topics.v1.ClientMessage} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.topics.v1.ClientMessage.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getRegistrationRequest(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.nitric.proto.topics.v1.RegistrationRequest.serializeBinaryToWriter + ); + } + f = message.getMessageResponse(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.nitric.proto.topics.v1.MessageResponse.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string id = 1; + * @return {string} + */ +proto.nitric.proto.topics.v1.ClientMessage.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.topics.v1.ClientMessage} returns this + */ +proto.nitric.proto.topics.v1.ClientMessage.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional RegistrationRequest registration_request = 2; + * @return {?proto.nitric.proto.topics.v1.RegistrationRequest} + */ +proto.nitric.proto.topics.v1.ClientMessage.prototype.getRegistrationRequest = function() { + return /** @type{?proto.nitric.proto.topics.v1.RegistrationRequest} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.topics.v1.RegistrationRequest, 2)); +}; + + +/** + * @param {?proto.nitric.proto.topics.v1.RegistrationRequest|undefined} value + * @return {!proto.nitric.proto.topics.v1.ClientMessage} returns this +*/ +proto.nitric.proto.topics.v1.ClientMessage.prototype.setRegistrationRequest = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.nitric.proto.topics.v1.ClientMessage.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.topics.v1.ClientMessage} returns this + */ +proto.nitric.proto.topics.v1.ClientMessage.prototype.clearRegistrationRequest = function() { + return this.setRegistrationRequest(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.topics.v1.ClientMessage.prototype.hasRegistrationRequest = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional MessageResponse message_response = 3; + * @return {?proto.nitric.proto.topics.v1.MessageResponse} + */ +proto.nitric.proto.topics.v1.ClientMessage.prototype.getMessageResponse = function() { + return /** @type{?proto.nitric.proto.topics.v1.MessageResponse} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.topics.v1.MessageResponse, 3)); +}; + + +/** + * @param {?proto.nitric.proto.topics.v1.MessageResponse|undefined} value + * @return {!proto.nitric.proto.topics.v1.ClientMessage} returns this +*/ +proto.nitric.proto.topics.v1.ClientMessage.prototype.setMessageResponse = function(value) { + return jspb.Message.setOneofWrapperField(this, 3, proto.nitric.proto.topics.v1.ClientMessage.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.topics.v1.ClientMessage} returns this + */ +proto.nitric.proto.topics.v1.ClientMessage.prototype.clearMessageResponse = function() { + return this.setMessageResponse(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.topics.v1.ClientMessage.prototype.hasMessageResponse = 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.nitric.proto.topics.v1.MessageRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.topics.v1.MessageRequest.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.nitric.proto.topics.v1.MessageRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.topics.v1.MessageRequest.toObject = function(includeInstance, msg) { + var f, obj = { + topicName: jspb.Message.getFieldWithDefault(msg, 1, ""), + message: (f = msg.getMessage()) && proto.nitric.proto.topics.v1.TopicMessage.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.nitric.proto.topics.v1.MessageRequest} + */ +proto.nitric.proto.topics.v1.MessageRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.topics.v1.MessageRequest; + return proto.nitric.proto.topics.v1.MessageRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.topics.v1.MessageRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.topics.v1.MessageRequest} + */ +proto.nitric.proto.topics.v1.MessageRequest.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.setTopicName(value); + break; + case 2: + var value = new proto.nitric.proto.topics.v1.TopicMessage; + reader.readMessage(value,proto.nitric.proto.topics.v1.TopicMessage.deserializeBinaryFromReader); + msg.setMessage(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.topics.v1.MessageRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.topics.v1.MessageRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.topics.v1.MessageRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.topics.v1.MessageRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTopicName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getMessage(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.nitric.proto.topics.v1.TopicMessage.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string topic_name = 1; + * @return {string} + */ +proto.nitric.proto.topics.v1.MessageRequest.prototype.getTopicName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.topics.v1.MessageRequest} returns this + */ +proto.nitric.proto.topics.v1.MessageRequest.prototype.setTopicName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional TopicMessage message = 2; + * @return {?proto.nitric.proto.topics.v1.TopicMessage} + */ +proto.nitric.proto.topics.v1.MessageRequest.prototype.getMessage = function() { + return /** @type{?proto.nitric.proto.topics.v1.TopicMessage} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.topics.v1.TopicMessage, 2)); +}; + + +/** + * @param {?proto.nitric.proto.topics.v1.TopicMessage|undefined} value + * @return {!proto.nitric.proto.topics.v1.MessageRequest} returns this +*/ +proto.nitric.proto.topics.v1.MessageRequest.prototype.setMessage = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.topics.v1.MessageRequest} returns this + */ +proto.nitric.proto.topics.v1.MessageRequest.prototype.clearMessage = function() { + return this.setMessage(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.topics.v1.MessageRequest.prototype.hasMessage = 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.nitric.proto.topics.v1.MessageResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.topics.v1.MessageResponse.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.nitric.proto.topics.v1.MessageResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.topics.v1.MessageResponse.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.nitric.proto.topics.v1.MessageResponse} + */ +proto.nitric.proto.topics.v1.MessageResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.topics.v1.MessageResponse; + return proto.nitric.proto.topics.v1.MessageResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.topics.v1.MessageResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.topics.v1.MessageResponse} + */ +proto.nitric.proto.topics.v1.MessageResponse.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.nitric.proto.topics.v1.MessageResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.topics.v1.MessageResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.topics.v1.MessageResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.topics.v1.MessageResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSuccess(); + if (f) { + writer.writeBool( + 1, + f + ); + } +}; + + +/** + * optional bool success = 1; + * @return {boolean} + */ +proto.nitric.proto.topics.v1.MessageResponse.prototype.getSuccess = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.nitric.proto.topics.v1.MessageResponse} returns this + */ +proto.nitric.proto.topics.v1.MessageResponse.prototype.setSuccess = function(value) { + return jspb.Message.setProto3BooleanField(this, 1, value); +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.proto.topics.v1.ServerMessage.oneofGroups_ = [[2,3]]; + +/** + * @enum {number} + */ +proto.nitric.proto.topics.v1.ServerMessage.ContentCase = { + CONTENT_NOT_SET: 0, + REGISTRATION_RESPONSE: 2, + MESSAGE_REQUEST: 3 +}; + +/** + * @return {proto.nitric.proto.topics.v1.ServerMessage.ContentCase} + */ +proto.nitric.proto.topics.v1.ServerMessage.prototype.getContentCase = function() { + return /** @type {proto.nitric.proto.topics.v1.ServerMessage.ContentCase} */(jspb.Message.computeOneofCase(this, proto.nitric.proto.topics.v1.ServerMessage.oneofGroups_[0])); +}; + + + +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.nitric.proto.topics.v1.ServerMessage.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.topics.v1.ServerMessage.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.nitric.proto.topics.v1.ServerMessage} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.topics.v1.ServerMessage.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, ""), + registrationResponse: (f = msg.getRegistrationResponse()) && proto.nitric.proto.topics.v1.RegistrationResponse.toObject(includeInstance, f), + messageRequest: (f = msg.getMessageRequest()) && proto.nitric.proto.topics.v1.MessageRequest.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.nitric.proto.topics.v1.ServerMessage} + */ +proto.nitric.proto.topics.v1.ServerMessage.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.topics.v1.ServerMessage; + return proto.nitric.proto.topics.v1.ServerMessage.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.topics.v1.ServerMessage} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.topics.v1.ServerMessage} + */ +proto.nitric.proto.topics.v1.ServerMessage.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 = new proto.nitric.proto.topics.v1.RegistrationResponse; + reader.readMessage(value,proto.nitric.proto.topics.v1.RegistrationResponse.deserializeBinaryFromReader); + msg.setRegistrationResponse(value); + break; + case 3: + var value = new proto.nitric.proto.topics.v1.MessageRequest; + reader.readMessage(value,proto.nitric.proto.topics.v1.MessageRequest.deserializeBinaryFromReader); + msg.setMessageRequest(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.topics.v1.ServerMessage.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.topics.v1.ServerMessage.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.topics.v1.ServerMessage} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.topics.v1.ServerMessage.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getRegistrationResponse(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.nitric.proto.topics.v1.RegistrationResponse.serializeBinaryToWriter + ); + } + f = message.getMessageRequest(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.nitric.proto.topics.v1.MessageRequest.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string id = 1; + * @return {string} + */ +proto.nitric.proto.topics.v1.ServerMessage.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.topics.v1.ServerMessage} returns this + */ +proto.nitric.proto.topics.v1.ServerMessage.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional RegistrationResponse registration_response = 2; + * @return {?proto.nitric.proto.topics.v1.RegistrationResponse} + */ +proto.nitric.proto.topics.v1.ServerMessage.prototype.getRegistrationResponse = function() { + return /** @type{?proto.nitric.proto.topics.v1.RegistrationResponse} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.topics.v1.RegistrationResponse, 2)); +}; + + +/** + * @param {?proto.nitric.proto.topics.v1.RegistrationResponse|undefined} value + * @return {!proto.nitric.proto.topics.v1.ServerMessage} returns this +*/ +proto.nitric.proto.topics.v1.ServerMessage.prototype.setRegistrationResponse = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.nitric.proto.topics.v1.ServerMessage.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.topics.v1.ServerMessage} returns this + */ +proto.nitric.proto.topics.v1.ServerMessage.prototype.clearRegistrationResponse = function() { + return this.setRegistrationResponse(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.topics.v1.ServerMessage.prototype.hasRegistrationResponse = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional MessageRequest message_request = 3; + * @return {?proto.nitric.proto.topics.v1.MessageRequest} + */ +proto.nitric.proto.topics.v1.ServerMessage.prototype.getMessageRequest = function() { + return /** @type{?proto.nitric.proto.topics.v1.MessageRequest} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.topics.v1.MessageRequest, 3)); +}; + + +/** + * @param {?proto.nitric.proto.topics.v1.MessageRequest|undefined} value + * @return {!proto.nitric.proto.topics.v1.ServerMessage} returns this +*/ +proto.nitric.proto.topics.v1.ServerMessage.prototype.setMessageRequest = function(value) { + return jspb.Message.setOneofWrapperField(this, 3, proto.nitric.proto.topics.v1.ServerMessage.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.topics.v1.ServerMessage} returns this + */ +proto.nitric.proto.topics.v1.ServerMessage.prototype.clearMessageRequest = function() { + return this.setMessageRequest(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.topics.v1.ServerMessage.prototype.hasMessageRequest = 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.nitric.proto.topics.v1.RegistrationRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.topics.v1.RegistrationRequest.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.nitric.proto.topics.v1.RegistrationRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.topics.v1.RegistrationRequest.toObject = function(includeInstance, msg) { + var f, obj = { + topicName: 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.nitric.proto.topics.v1.RegistrationRequest} + */ +proto.nitric.proto.topics.v1.RegistrationRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.topics.v1.RegistrationRequest; + return proto.nitric.proto.topics.v1.RegistrationRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.topics.v1.RegistrationRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.topics.v1.RegistrationRequest} + */ +proto.nitric.proto.topics.v1.RegistrationRequest.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.setTopicName(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.topics.v1.RegistrationRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.topics.v1.RegistrationRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.topics.v1.RegistrationRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.topics.v1.RegistrationRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTopicName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string topic_name = 1; + * @return {string} + */ +proto.nitric.proto.topics.v1.RegistrationRequest.prototype.getTopicName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.topics.v1.RegistrationRequest} returns this + */ +proto.nitric.proto.topics.v1.RegistrationRequest.prototype.setTopicName = 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.nitric.proto.topics.v1.RegistrationResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.topics.v1.RegistrationResponse.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.nitric.proto.topics.v1.RegistrationResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.topics.v1.RegistrationResponse.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.proto.topics.v1.RegistrationResponse} + */ +proto.nitric.proto.topics.v1.RegistrationResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.topics.v1.RegistrationResponse; + return proto.nitric.proto.topics.v1.RegistrationResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.topics.v1.RegistrationResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.topics.v1.RegistrationResponse} + */ +proto.nitric.proto.topics.v1.RegistrationResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.topics.v1.RegistrationResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.topics.v1.RegistrationResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.topics.v1.RegistrationResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.topics.v1.RegistrationResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.proto.topics.v1.TopicMessage.oneofGroups_ = [[1]]; + +/** + * @enum {number} + */ +proto.nitric.proto.topics.v1.TopicMessage.ContentCase = { + CONTENT_NOT_SET: 0, + STRUCT_PAYLOAD: 1 +}; + +/** + * @return {proto.nitric.proto.topics.v1.TopicMessage.ContentCase} + */ +proto.nitric.proto.topics.v1.TopicMessage.prototype.getContentCase = function() { + return /** @type {proto.nitric.proto.topics.v1.TopicMessage.ContentCase} */(jspb.Message.computeOneofCase(this, proto.nitric.proto.topics.v1.TopicMessage.oneofGroups_[0])); +}; + + + +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.nitric.proto.topics.v1.TopicMessage.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.topics.v1.TopicMessage.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.nitric.proto.topics.v1.TopicMessage} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.topics.v1.TopicMessage.toObject = function(includeInstance, msg) { + var f, obj = { + structPayload: (f = msg.getStructPayload()) && google_protobuf_struct_pb.Struct.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.nitric.proto.topics.v1.TopicMessage} + */ +proto.nitric.proto.topics.v1.TopicMessage.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.topics.v1.TopicMessage; + return proto.nitric.proto.topics.v1.TopicMessage.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.topics.v1.TopicMessage} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.topics.v1.TopicMessage} + */ +proto.nitric.proto.topics.v1.TopicMessage.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setStructPayload(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.topics.v1.TopicMessage.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.topics.v1.TopicMessage.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.topics.v1.TopicMessage} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.topics.v1.TopicMessage.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStructPayload(); + if (f != null) { + writer.writeMessage( + 1, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } +}; + + +/** + * optional google.protobuf.Struct struct_payload = 1; + * @return {?proto.google.protobuf.Struct} + */ +proto.nitric.proto.topics.v1.TopicMessage.prototype.getStructPayload = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 1)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.nitric.proto.topics.v1.TopicMessage} returns this +*/ +proto.nitric.proto.topics.v1.TopicMessage.prototype.setStructPayload = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.nitric.proto.topics.v1.TopicMessage.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.topics.v1.TopicMessage} returns this + */ +proto.nitric.proto.topics.v1.TopicMessage.prototype.clearStructPayload = function() { + return this.setStructPayload(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.topics.v1.TopicMessage.prototype.hasStructPayload = 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.nitric.proto.topics.v1.TopicPublishRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.topics.v1.TopicPublishRequest.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.nitric.proto.topics.v1.TopicPublishRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.topics.v1.TopicPublishRequest.toObject = function(includeInstance, msg) { + var f, obj = { + topicName: jspb.Message.getFieldWithDefault(msg, 1, ""), + message: (f = msg.getMessage()) && proto.nitric.proto.topics.v1.TopicMessage.toObject(includeInstance, f), + delay: (f = msg.getDelay()) && google_protobuf_duration_pb.Duration.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.nitric.proto.topics.v1.TopicPublishRequest} + */ +proto.nitric.proto.topics.v1.TopicPublishRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.topics.v1.TopicPublishRequest; + return proto.nitric.proto.topics.v1.TopicPublishRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.topics.v1.TopicPublishRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.topics.v1.TopicPublishRequest} + */ +proto.nitric.proto.topics.v1.TopicPublishRequest.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.setTopicName(value); + break; + case 2: + var value = new proto.nitric.proto.topics.v1.TopicMessage; + reader.readMessage(value,proto.nitric.proto.topics.v1.TopicMessage.deserializeBinaryFromReader); + msg.setMessage(value); + break; + case 3: + var value = new google_protobuf_duration_pb.Duration; + reader.readMessage(value,google_protobuf_duration_pb.Duration.deserializeBinaryFromReader); + msg.setDelay(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.topics.v1.TopicPublishRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.topics.v1.TopicPublishRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.topics.v1.TopicPublishRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.topics.v1.TopicPublishRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTopicName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getMessage(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.nitric.proto.topics.v1.TopicMessage.serializeBinaryToWriter + ); + } + f = message.getDelay(); + if (f != null) { + writer.writeMessage( + 3, + f, + google_protobuf_duration_pb.Duration.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string topic_name = 1; + * @return {string} + */ +proto.nitric.proto.topics.v1.TopicPublishRequest.prototype.getTopicName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.topics.v1.TopicPublishRequest} returns this + */ +proto.nitric.proto.topics.v1.TopicPublishRequest.prototype.setTopicName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional TopicMessage message = 2; + * @return {?proto.nitric.proto.topics.v1.TopicMessage} + */ +proto.nitric.proto.topics.v1.TopicPublishRequest.prototype.getMessage = function() { + return /** @type{?proto.nitric.proto.topics.v1.TopicMessage} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.topics.v1.TopicMessage, 2)); +}; + + +/** + * @param {?proto.nitric.proto.topics.v1.TopicMessage|undefined} value + * @return {!proto.nitric.proto.topics.v1.TopicPublishRequest} returns this +*/ +proto.nitric.proto.topics.v1.TopicPublishRequest.prototype.setMessage = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.topics.v1.TopicPublishRequest} returns this + */ +proto.nitric.proto.topics.v1.TopicPublishRequest.prototype.clearMessage = function() { + return this.setMessage(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.topics.v1.TopicPublishRequest.prototype.hasMessage = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional google.protobuf.Duration delay = 3; + * @return {?proto.google.protobuf.Duration} + */ +proto.nitric.proto.topics.v1.TopicPublishRequest.prototype.getDelay = function() { + return /** @type{?proto.google.protobuf.Duration} */ ( + jspb.Message.getWrapperField(this, google_protobuf_duration_pb.Duration, 3)); +}; + + +/** + * @param {?proto.google.protobuf.Duration|undefined} value + * @return {!proto.nitric.proto.topics.v1.TopicPublishRequest} returns this +*/ +proto.nitric.proto.topics.v1.TopicPublishRequest.prototype.setDelay = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.topics.v1.TopicPublishRequest} returns this + */ +proto.nitric.proto.topics.v1.TopicPublishRequest.prototype.clearDelay = function() { + return this.setDelay(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.topics.v1.TopicPublishRequest.prototype.hasDelay = 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.nitric.proto.topics.v1.TopicPublishResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.topics.v1.TopicPublishResponse.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.nitric.proto.topics.v1.TopicPublishResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.topics.v1.TopicPublishResponse.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.proto.topics.v1.TopicPublishResponse} + */ +proto.nitric.proto.topics.v1.TopicPublishResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.topics.v1.TopicPublishResponse; + return proto.nitric.proto.topics.v1.TopicPublishResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.topics.v1.TopicPublishResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.topics.v1.TopicPublishResponse} + */ +proto.nitric.proto.topics.v1.TopicPublishResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.topics.v1.TopicPublishResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.topics.v1.TopicPublishResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.topics.v1.TopicPublishResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.topics.v1.TopicPublishResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + +goog.object.extend(exports, proto.nitric.proto.topics.v1); diff --git a/src/gen/nitric/proto/websockets/v1/websockets_grpc_pb.d.ts b/src/gen/nitric/proto/websockets/v1/websockets_grpc_pb.d.ts new file mode 100644 index 00000000..39fae4fd --- /dev/null +++ b/src/gen/nitric/proto/websockets/v1/websockets_grpc_pb.d.ts @@ -0,0 +1,50 @@ +// GENERATED CODE -- DO NOT EDIT! + +// package: nitric.proto.websockets.v1 +// file: nitric/proto/websockets/v1/websockets.proto + +import * as nitric_proto_websockets_v1_websockets_pb from "../../../../nitric/proto/websockets/v1/websockets_pb"; +import * as grpc from "@grpc/grpc-js"; + +interface IWebsocketService extends grpc.ServiceDefinition { + sendMessage: grpc.MethodDefinition; + closeConnection: grpc.MethodDefinition; + socketDetails: grpc.MethodDefinition; +} + +export const WebsocketService: IWebsocketService; + +export interface IWebsocketServer extends grpc.UntypedServiceImplementation { + sendMessage: grpc.handleUnaryCall; + closeConnection: grpc.handleUnaryCall; + socketDetails: grpc.handleUnaryCall; +} + +export class WebsocketClient extends grpc.Client { + constructor(address: string, credentials: grpc.ChannelCredentials, options?: object); + sendMessage(argument: nitric_proto_websockets_v1_websockets_pb.WebsocketSendRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + sendMessage(argument: nitric_proto_websockets_v1_websockets_pb.WebsocketSendRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + sendMessage(argument: nitric_proto_websockets_v1_websockets_pb.WebsocketSendRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + closeConnection(argument: nitric_proto_websockets_v1_websockets_pb.WebsocketCloseConnectionRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + closeConnection(argument: nitric_proto_websockets_v1_websockets_pb.WebsocketCloseConnectionRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + closeConnection(argument: nitric_proto_websockets_v1_websockets_pb.WebsocketCloseConnectionRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + socketDetails(argument: nitric_proto_websockets_v1_websockets_pb.WebsocketDetailsRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + socketDetails(argument: nitric_proto_websockets_v1_websockets_pb.WebsocketDetailsRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + socketDetails(argument: nitric_proto_websockets_v1_websockets_pb.WebsocketDetailsRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; +} + +interface IWebsocketHandlerService extends grpc.ServiceDefinition { + handleEvents: grpc.MethodDefinition; +} + +export const WebsocketHandlerService: IWebsocketHandlerService; + +export interface IWebsocketHandlerServer extends grpc.UntypedServiceImplementation { + handleEvents: grpc.handleBidiStreamingCall; +} + +export class WebsocketHandlerClient extends grpc.Client { + constructor(address: string, credentials: grpc.ChannelCredentials, options?: object); + handleEvents(metadataOrOptions?: grpc.Metadata | grpc.CallOptions | null): grpc.ClientDuplexStream; + handleEvents(metadata?: grpc.Metadata | null, options?: grpc.CallOptions | null): grpc.ClientDuplexStream; +} diff --git a/src/gen/nitric/proto/websockets/v1/websockets_grpc_pb.js b/src/gen/nitric/proto/websockets/v1/websockets_grpc_pb.js new file mode 100644 index 00000000..6c1bb005 --- /dev/null +++ b/src/gen/nitric/proto/websockets/v1/websockets_grpc_pb.js @@ -0,0 +1,152 @@ +// GENERATED CODE -- DO NOT EDIT! + +'use strict'; +var grpc = require('@grpc/grpc-js'); +var nitric_proto_websockets_v1_websockets_pb = require('../../../../nitric/proto/websockets/v1/websockets_pb.js'); + +function serialize_nitric_proto_websockets_v1_ClientMessage(arg) { + if (!(arg instanceof nitric_proto_websockets_v1_websockets_pb.ClientMessage)) { + throw new Error('Expected argument of type nitric.proto.websockets.v1.ClientMessage'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_websockets_v1_ClientMessage(buffer_arg) { + return nitric_proto_websockets_v1_websockets_pb.ClientMessage.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_websockets_v1_ServerMessage(arg) { + if (!(arg instanceof nitric_proto_websockets_v1_websockets_pb.ServerMessage)) { + throw new Error('Expected argument of type nitric.proto.websockets.v1.ServerMessage'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_websockets_v1_ServerMessage(buffer_arg) { + return nitric_proto_websockets_v1_websockets_pb.ServerMessage.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_websockets_v1_WebsocketCloseConnectionRequest(arg) { + if (!(arg instanceof nitric_proto_websockets_v1_websockets_pb.WebsocketCloseConnectionRequest)) { + throw new Error('Expected argument of type nitric.proto.websockets.v1.WebsocketCloseConnectionRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_websockets_v1_WebsocketCloseConnectionRequest(buffer_arg) { + return nitric_proto_websockets_v1_websockets_pb.WebsocketCloseConnectionRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_websockets_v1_WebsocketCloseConnectionResponse(arg) { + if (!(arg instanceof nitric_proto_websockets_v1_websockets_pb.WebsocketCloseConnectionResponse)) { + throw new Error('Expected argument of type nitric.proto.websockets.v1.WebsocketCloseConnectionResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_websockets_v1_WebsocketCloseConnectionResponse(buffer_arg) { + return nitric_proto_websockets_v1_websockets_pb.WebsocketCloseConnectionResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_websockets_v1_WebsocketDetailsRequest(arg) { + if (!(arg instanceof nitric_proto_websockets_v1_websockets_pb.WebsocketDetailsRequest)) { + throw new Error('Expected argument of type nitric.proto.websockets.v1.WebsocketDetailsRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_websockets_v1_WebsocketDetailsRequest(buffer_arg) { + return nitric_proto_websockets_v1_websockets_pb.WebsocketDetailsRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_websockets_v1_WebsocketDetailsResponse(arg) { + if (!(arg instanceof nitric_proto_websockets_v1_websockets_pb.WebsocketDetailsResponse)) { + throw new Error('Expected argument of type nitric.proto.websockets.v1.WebsocketDetailsResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_websockets_v1_WebsocketDetailsResponse(buffer_arg) { + return nitric_proto_websockets_v1_websockets_pb.WebsocketDetailsResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_websockets_v1_WebsocketSendRequest(arg) { + if (!(arg instanceof nitric_proto_websockets_v1_websockets_pb.WebsocketSendRequest)) { + throw new Error('Expected argument of type nitric.proto.websockets.v1.WebsocketSendRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_websockets_v1_WebsocketSendRequest(buffer_arg) { + return nitric_proto_websockets_v1_websockets_pb.WebsocketSendRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_websockets_v1_WebsocketSendResponse(arg) { + if (!(arg instanceof nitric_proto_websockets_v1_websockets_pb.WebsocketSendResponse)) { + throw new Error('Expected argument of type nitric.proto.websockets.v1.WebsocketSendResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_websockets_v1_WebsocketSendResponse(buffer_arg) { + return nitric_proto_websockets_v1_websockets_pb.WebsocketSendResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + + +var WebsocketService = exports.WebsocketService = { + // Send a messages to a websocket +sendMessage: { + path: '/nitric.proto.websockets.v1.Websocket/SendMessage', + requestStream: false, + responseStream: false, + requestType: nitric_proto_websockets_v1_websockets_pb.WebsocketSendRequest, + responseType: nitric_proto_websockets_v1_websockets_pb.WebsocketSendResponse, + requestSerialize: serialize_nitric_proto_websockets_v1_WebsocketSendRequest, + requestDeserialize: deserialize_nitric_proto_websockets_v1_WebsocketSendRequest, + responseSerialize: serialize_nitric_proto_websockets_v1_WebsocketSendResponse, + responseDeserialize: deserialize_nitric_proto_websockets_v1_WebsocketSendResponse, + }, + // Close a websocket connection +// This can be used to force a client to disconnect +closeConnection: { + path: '/nitric.proto.websockets.v1.Websocket/CloseConnection', + requestStream: false, + responseStream: false, + requestType: nitric_proto_websockets_v1_websockets_pb.WebsocketCloseConnectionRequest, + responseType: nitric_proto_websockets_v1_websockets_pb.WebsocketCloseConnectionResponse, + requestSerialize: serialize_nitric_proto_websockets_v1_WebsocketCloseConnectionRequest, + requestDeserialize: deserialize_nitric_proto_websockets_v1_WebsocketCloseConnectionRequest, + responseSerialize: serialize_nitric_proto_websockets_v1_WebsocketCloseConnectionResponse, + responseDeserialize: deserialize_nitric_proto_websockets_v1_WebsocketCloseConnectionResponse, + }, + // Retrieve details about an API +socketDetails: { + path: '/nitric.proto.websockets.v1.Websocket/SocketDetails', + requestStream: false, + responseStream: false, + requestType: nitric_proto_websockets_v1_websockets_pb.WebsocketDetailsRequest, + responseType: nitric_proto_websockets_v1_websockets_pb.WebsocketDetailsResponse, + requestSerialize: serialize_nitric_proto_websockets_v1_WebsocketDetailsRequest, + requestDeserialize: deserialize_nitric_proto_websockets_v1_WebsocketDetailsRequest, + responseSerialize: serialize_nitric_proto_websockets_v1_WebsocketDetailsResponse, + responseDeserialize: deserialize_nitric_proto_websockets_v1_WebsocketDetailsResponse, + }, +}; + +exports.WebsocketClient = grpc.makeGenericClientConstructor(WebsocketService); +var WebsocketHandlerService = exports.WebsocketHandlerService = { + // Handle incoming websocket events +handleEvents: { + path: '/nitric.proto.websockets.v1.WebsocketHandler/HandleEvents', + requestStream: true, + responseStream: true, + requestType: nitric_proto_websockets_v1_websockets_pb.ClientMessage, + responseType: nitric_proto_websockets_v1_websockets_pb.ServerMessage, + requestSerialize: serialize_nitric_proto_websockets_v1_ClientMessage, + requestDeserialize: deserialize_nitric_proto_websockets_v1_ClientMessage, + responseSerialize: serialize_nitric_proto_websockets_v1_ServerMessage, + responseDeserialize: deserialize_nitric_proto_websockets_v1_ServerMessage, + }, +}; + +exports.WebsocketHandlerClient = grpc.makeGenericClientConstructor(WebsocketHandlerService); diff --git a/src/gen/nitric/proto/websockets/v1/websockets_pb.d.ts b/src/gen/nitric/proto/websockets/v1/websockets_pb.d.ts new file mode 100644 index 00000000..3d8a4ecf --- /dev/null +++ b/src/gen/nitric/proto/websockets/v1/websockets_pb.d.ts @@ -0,0 +1,434 @@ +// package: nitric.proto.websockets.v1 +// file: nitric/proto/websockets/v1/websockets.proto + +import * as jspb from "google-protobuf"; + +export class WebsocketDetailsRequest extends jspb.Message { + getSocketName(): string; + setSocketName(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): WebsocketDetailsRequest.AsObject; + static toObject(includeInstance: boolean, msg: WebsocketDetailsRequest): WebsocketDetailsRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: WebsocketDetailsRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): WebsocketDetailsRequest; + static deserializeBinaryFromReader(message: WebsocketDetailsRequest, reader: jspb.BinaryReader): WebsocketDetailsRequest; +} + +export namespace WebsocketDetailsRequest { + export type AsObject = { + socketName: string, + } +} + +export class WebsocketDetailsResponse extends jspb.Message { + getUrl(): string; + setUrl(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): WebsocketDetailsResponse.AsObject; + static toObject(includeInstance: boolean, msg: WebsocketDetailsResponse): WebsocketDetailsResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: WebsocketDetailsResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): WebsocketDetailsResponse; + static deserializeBinaryFromReader(message: WebsocketDetailsResponse, reader: jspb.BinaryReader): WebsocketDetailsResponse; +} + +export namespace WebsocketDetailsResponse { + export type AsObject = { + url: string, + } +} + +export class WebsocketSendRequest extends jspb.Message { + getSocketName(): string; + setSocketName(value: string): void; + + getConnectionId(): string; + setConnectionId(value: string): void; + + getData(): Uint8Array | string; + getData_asU8(): Uint8Array; + getData_asB64(): string; + setData(value: Uint8Array | string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): WebsocketSendRequest.AsObject; + static toObject(includeInstance: boolean, msg: WebsocketSendRequest): WebsocketSendRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: WebsocketSendRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): WebsocketSendRequest; + static deserializeBinaryFromReader(message: WebsocketSendRequest, reader: jspb.BinaryReader): WebsocketSendRequest; +} + +export namespace WebsocketSendRequest { + export type AsObject = { + socketName: string, + connectionId: string, + data: Uint8Array | string, + } +} + +export class WebsocketSendResponse extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): WebsocketSendResponse.AsObject; + static toObject(includeInstance: boolean, msg: WebsocketSendResponse): WebsocketSendResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: WebsocketSendResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): WebsocketSendResponse; + static deserializeBinaryFromReader(message: WebsocketSendResponse, reader: jspb.BinaryReader): WebsocketSendResponse; +} + +export namespace WebsocketSendResponse { + export type AsObject = { + } +} + +export class WebsocketCloseConnectionRequest extends jspb.Message { + getSocketName(): string; + setSocketName(value: string): void; + + getConnectionId(): string; + setConnectionId(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): WebsocketCloseConnectionRequest.AsObject; + static toObject(includeInstance: boolean, msg: WebsocketCloseConnectionRequest): WebsocketCloseConnectionRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: WebsocketCloseConnectionRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): WebsocketCloseConnectionRequest; + static deserializeBinaryFromReader(message: WebsocketCloseConnectionRequest, reader: jspb.BinaryReader): WebsocketCloseConnectionRequest; +} + +export namespace WebsocketCloseConnectionRequest { + export type AsObject = { + socketName: string, + connectionId: string, + } +} + +export class WebsocketCloseConnectionResponse extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): WebsocketCloseConnectionResponse.AsObject; + static toObject(includeInstance: boolean, msg: WebsocketCloseConnectionResponse): WebsocketCloseConnectionResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: WebsocketCloseConnectionResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): WebsocketCloseConnectionResponse; + static deserializeBinaryFromReader(message: WebsocketCloseConnectionResponse, reader: jspb.BinaryReader): WebsocketCloseConnectionResponse; +} + +export namespace WebsocketCloseConnectionResponse { + export type AsObject = { + } +} + +export class ClientMessage extends jspb.Message { + getId(): string; + setId(value: string): void; + + hasRegistrationRequest(): boolean; + clearRegistrationRequest(): void; + getRegistrationRequest(): RegistrationRequest | undefined; + setRegistrationRequest(value?: RegistrationRequest): void; + + hasWebsocketEventResponse(): boolean; + clearWebsocketEventResponse(): void; + getWebsocketEventResponse(): WebsocketEventResponse | undefined; + setWebsocketEventResponse(value?: WebsocketEventResponse): void; + + getContentCase(): ClientMessage.ContentCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ClientMessage.AsObject; + static toObject(includeInstance: boolean, msg: ClientMessage): ClientMessage.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ClientMessage, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ClientMessage; + static deserializeBinaryFromReader(message: ClientMessage, reader: jspb.BinaryReader): ClientMessage; +} + +export namespace ClientMessage { + export type AsObject = { + id: string, + registrationRequest?: RegistrationRequest.AsObject, + websocketEventResponse?: WebsocketEventResponse.AsObject, + } + + export enum ContentCase { + CONTENT_NOT_SET = 0, + REGISTRATION_REQUEST = 2, + WEBSOCKET_EVENT_RESPONSE = 3, + } +} + +export class RegistrationResponse extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): RegistrationResponse.AsObject; + static toObject(includeInstance: boolean, msg: RegistrationResponse): RegistrationResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: RegistrationResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): RegistrationResponse; + static deserializeBinaryFromReader(message: RegistrationResponse, reader: jspb.BinaryReader): RegistrationResponse; +} + +export namespace RegistrationResponse { + export type AsObject = { + } +} + +export class RegistrationRequest extends jspb.Message { + getSocketName(): string; + setSocketName(value: string): void; + + getEventType(): WebsocketEventTypeMap[keyof WebsocketEventTypeMap]; + setEventType(value: WebsocketEventTypeMap[keyof WebsocketEventTypeMap]): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): RegistrationRequest.AsObject; + static toObject(includeInstance: boolean, msg: RegistrationRequest): RegistrationRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: RegistrationRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): RegistrationRequest; + static deserializeBinaryFromReader(message: RegistrationRequest, reader: jspb.BinaryReader): RegistrationRequest; +} + +export namespace RegistrationRequest { + export type AsObject = { + socketName: string, + eventType: WebsocketEventTypeMap[keyof WebsocketEventTypeMap], + } +} + +export class WebsocketEventRequest extends jspb.Message { + getSocketName(): string; + setSocketName(value: string): void; + + getConnectionid(): string; + setConnectionid(value: string): void; + + hasConnection(): boolean; + clearConnection(): void; + getConnection(): WebsocketConnectionEvent | undefined; + setConnection(value?: WebsocketConnectionEvent): void; + + hasDisconnection(): boolean; + clearDisconnection(): void; + getDisconnection(): WebsocketDisconnectionEvent | undefined; + setDisconnection(value?: WebsocketDisconnectionEvent): void; + + hasMessage(): boolean; + clearMessage(): void; + getMessage(): WebsocketMessageEvent | undefined; + setMessage(value?: WebsocketMessageEvent): void; + + getWebsocketEventCase(): WebsocketEventRequest.WebsocketEventCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): WebsocketEventRequest.AsObject; + static toObject(includeInstance: boolean, msg: WebsocketEventRequest): WebsocketEventRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: WebsocketEventRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): WebsocketEventRequest; + static deserializeBinaryFromReader(message: WebsocketEventRequest, reader: jspb.BinaryReader): WebsocketEventRequest; +} + +export namespace WebsocketEventRequest { + export type AsObject = { + socketName: string, + connectionid: string, + connection?: WebsocketConnectionEvent.AsObject, + disconnection?: WebsocketDisconnectionEvent.AsObject, + message?: WebsocketMessageEvent.AsObject, + } + + export enum WebsocketEventCase { + WEBSOCKET_EVENT_NOT_SET = 0, + CONNECTION = 10, + DISCONNECTION = 11, + MESSAGE = 12, + } +} + +export class QueryValue extends jspb.Message { + clearValueList(): void; + getValueList(): Array; + setValueList(value: Array): void; + addValue(value: string, index?: number): string; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): QueryValue.AsObject; + static toObject(includeInstance: boolean, msg: QueryValue): QueryValue.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: QueryValue, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): QueryValue; + static deserializeBinaryFromReader(message: QueryValue, reader: jspb.BinaryReader): QueryValue; +} + +export namespace QueryValue { + export type AsObject = { + valueList: Array, + } +} + +export class ServerMessage extends jspb.Message { + getId(): string; + setId(value: string): void; + + hasRegistrationResponse(): boolean; + clearRegistrationResponse(): void; + getRegistrationResponse(): RegistrationResponse | undefined; + setRegistrationResponse(value?: RegistrationResponse): void; + + hasWebsocketEventRequest(): boolean; + clearWebsocketEventRequest(): void; + getWebsocketEventRequest(): WebsocketEventRequest | undefined; + setWebsocketEventRequest(value?: WebsocketEventRequest): void; + + getContentCase(): ServerMessage.ContentCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ServerMessage.AsObject; + static toObject(includeInstance: boolean, msg: ServerMessage): ServerMessage.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ServerMessage, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ServerMessage; + static deserializeBinaryFromReader(message: ServerMessage, reader: jspb.BinaryReader): ServerMessage; +} + +export namespace ServerMessage { + export type AsObject = { + id: string, + registrationResponse?: RegistrationResponse.AsObject, + websocketEventRequest?: WebsocketEventRequest.AsObject, + } + + export enum ContentCase { + CONTENT_NOT_SET = 0, + REGISTRATION_RESPONSE = 2, + WEBSOCKET_EVENT_REQUEST = 3, + } +} + +export class WebsocketEventResponse extends jspb.Message { + hasConnectionResponse(): boolean; + clearConnectionResponse(): void; + getConnectionResponse(): WebsocketConnectionResponse | undefined; + setConnectionResponse(value?: WebsocketConnectionResponse): void; + + getWebsocketResponseCase(): WebsocketEventResponse.WebsocketResponseCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): WebsocketEventResponse.AsObject; + static toObject(includeInstance: boolean, msg: WebsocketEventResponse): WebsocketEventResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: WebsocketEventResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): WebsocketEventResponse; + static deserializeBinaryFromReader(message: WebsocketEventResponse, reader: jspb.BinaryReader): WebsocketEventResponse; +} + +export namespace WebsocketEventResponse { + export type AsObject = { + connectionResponse?: WebsocketConnectionResponse.AsObject, + } + + export enum WebsocketResponseCase { + WEBSOCKET_RESPONSE_NOT_SET = 0, + CONNECTION_RESPONSE = 10, + } +} + +export class WebsocketConnectionEvent extends jspb.Message { + getQueryParamsMap(): jspb.Map; + clearQueryParamsMap(): void; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): WebsocketConnectionEvent.AsObject; + static toObject(includeInstance: boolean, msg: WebsocketConnectionEvent): WebsocketConnectionEvent.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: WebsocketConnectionEvent, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): WebsocketConnectionEvent; + static deserializeBinaryFromReader(message: WebsocketConnectionEvent, reader: jspb.BinaryReader): WebsocketConnectionEvent; +} + +export namespace WebsocketConnectionEvent { + export type AsObject = { + queryParamsMap: Array<[string, QueryValue.AsObject]>, + } +} + +export class WebsocketConnectionResponse extends jspb.Message { + getReject(): boolean; + setReject(value: boolean): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): WebsocketConnectionResponse.AsObject; + static toObject(includeInstance: boolean, msg: WebsocketConnectionResponse): WebsocketConnectionResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: WebsocketConnectionResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): WebsocketConnectionResponse; + static deserializeBinaryFromReader(message: WebsocketConnectionResponse, reader: jspb.BinaryReader): WebsocketConnectionResponse; +} + +export namespace WebsocketConnectionResponse { + export type AsObject = { + reject: boolean, + } +} + +export class WebsocketDisconnectionEvent extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): WebsocketDisconnectionEvent.AsObject; + static toObject(includeInstance: boolean, msg: WebsocketDisconnectionEvent): WebsocketDisconnectionEvent.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: WebsocketDisconnectionEvent, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): WebsocketDisconnectionEvent; + static deserializeBinaryFromReader(message: WebsocketDisconnectionEvent, reader: jspb.BinaryReader): WebsocketDisconnectionEvent; +} + +export namespace WebsocketDisconnectionEvent { + export type AsObject = { + } +} + +export class WebsocketMessageEvent extends jspb.Message { + getBody(): Uint8Array | string; + getBody_asU8(): Uint8Array; + getBody_asB64(): string; + setBody(value: Uint8Array | string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): WebsocketMessageEvent.AsObject; + static toObject(includeInstance: boolean, msg: WebsocketMessageEvent): WebsocketMessageEvent.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: WebsocketMessageEvent, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): WebsocketMessageEvent; + static deserializeBinaryFromReader(message: WebsocketMessageEvent, reader: jspb.BinaryReader): WebsocketMessageEvent; +} + +export namespace WebsocketMessageEvent { + export type AsObject = { + body: Uint8Array | string, + } +} + +export interface WebsocketEventTypeMap { + CONNECT: 0; + DISCONNECT: 1; + MESSAGE: 2; +} + +export const WebsocketEventType: WebsocketEventTypeMap; + diff --git a/src/gen/nitric/proto/websockets/v1/websockets_pb.js b/src/gen/nitric/proto/websockets/v1/websockets_pb.js new file mode 100644 index 00000000..2b390843 --- /dev/null +++ b/src/gen/nitric/proto/websockets/v1/websockets_pb.js @@ -0,0 +1,3215 @@ +// source: nitric/proto/websockets/v1/websockets.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() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +goog.exportSymbol('proto.nitric.proto.websockets.v1.ClientMessage', null, global); +goog.exportSymbol('proto.nitric.proto.websockets.v1.ClientMessage.ContentCase', null, global); +goog.exportSymbol('proto.nitric.proto.websockets.v1.QueryValue', null, global); +goog.exportSymbol('proto.nitric.proto.websockets.v1.RegistrationRequest', null, global); +goog.exportSymbol('proto.nitric.proto.websockets.v1.RegistrationResponse', null, global); +goog.exportSymbol('proto.nitric.proto.websockets.v1.ServerMessage', null, global); +goog.exportSymbol('proto.nitric.proto.websockets.v1.ServerMessage.ContentCase', null, global); +goog.exportSymbol('proto.nitric.proto.websockets.v1.WebsocketCloseConnectionRequest', null, global); +goog.exportSymbol('proto.nitric.proto.websockets.v1.WebsocketCloseConnectionResponse', null, global); +goog.exportSymbol('proto.nitric.proto.websockets.v1.WebsocketConnectionEvent', null, global); +goog.exportSymbol('proto.nitric.proto.websockets.v1.WebsocketConnectionResponse', null, global); +goog.exportSymbol('proto.nitric.proto.websockets.v1.WebsocketDetailsRequest', null, global); +goog.exportSymbol('proto.nitric.proto.websockets.v1.WebsocketDetailsResponse', null, global); +goog.exportSymbol('proto.nitric.proto.websockets.v1.WebsocketDisconnectionEvent', null, global); +goog.exportSymbol('proto.nitric.proto.websockets.v1.WebsocketEventRequest', null, global); +goog.exportSymbol('proto.nitric.proto.websockets.v1.WebsocketEventRequest.WebsocketEventCase', null, global); +goog.exportSymbol('proto.nitric.proto.websockets.v1.WebsocketEventResponse', null, global); +goog.exportSymbol('proto.nitric.proto.websockets.v1.WebsocketEventResponse.WebsocketResponseCase', null, global); +goog.exportSymbol('proto.nitric.proto.websockets.v1.WebsocketEventType', null, global); +goog.exportSymbol('proto.nitric.proto.websockets.v1.WebsocketMessageEvent', null, global); +goog.exportSymbol('proto.nitric.proto.websockets.v1.WebsocketSendRequest', null, global); +goog.exportSymbol('proto.nitric.proto.websockets.v1.WebsocketSendResponse', 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.nitric.proto.websockets.v1.WebsocketDetailsRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.websockets.v1.WebsocketDetailsRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.websockets.v1.WebsocketDetailsRequest.displayName = 'proto.nitric.proto.websockets.v1.WebsocketDetailsRequest'; +} +/** + * 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.nitric.proto.websockets.v1.WebsocketDetailsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.websockets.v1.WebsocketDetailsResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.websockets.v1.WebsocketDetailsResponse.displayName = 'proto.nitric.proto.websockets.v1.WebsocketDetailsResponse'; +} +/** + * 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.nitric.proto.websockets.v1.WebsocketSendRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.websockets.v1.WebsocketSendRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.websockets.v1.WebsocketSendRequest.displayName = 'proto.nitric.proto.websockets.v1.WebsocketSendRequest'; +} +/** + * 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.nitric.proto.websockets.v1.WebsocketSendResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.websockets.v1.WebsocketSendResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.websockets.v1.WebsocketSendResponse.displayName = 'proto.nitric.proto.websockets.v1.WebsocketSendResponse'; +} +/** + * 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.nitric.proto.websockets.v1.WebsocketCloseConnectionRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.websockets.v1.WebsocketCloseConnectionRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.websockets.v1.WebsocketCloseConnectionRequest.displayName = 'proto.nitric.proto.websockets.v1.WebsocketCloseConnectionRequest'; +} +/** + * 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.nitric.proto.websockets.v1.WebsocketCloseConnectionResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.websockets.v1.WebsocketCloseConnectionResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.websockets.v1.WebsocketCloseConnectionResponse.displayName = 'proto.nitric.proto.websockets.v1.WebsocketCloseConnectionResponse'; +} +/** + * 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.nitric.proto.websockets.v1.ClientMessage = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.proto.websockets.v1.ClientMessage.oneofGroups_); +}; +goog.inherits(proto.nitric.proto.websockets.v1.ClientMessage, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.websockets.v1.ClientMessage.displayName = 'proto.nitric.proto.websockets.v1.ClientMessage'; +} +/** + * 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.nitric.proto.websockets.v1.RegistrationResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.websockets.v1.RegistrationResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.websockets.v1.RegistrationResponse.displayName = 'proto.nitric.proto.websockets.v1.RegistrationResponse'; +} +/** + * 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.nitric.proto.websockets.v1.RegistrationRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.websockets.v1.RegistrationRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.websockets.v1.RegistrationRequest.displayName = 'proto.nitric.proto.websockets.v1.RegistrationRequest'; +} +/** + * 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.nitric.proto.websockets.v1.WebsocketEventRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.proto.websockets.v1.WebsocketEventRequest.oneofGroups_); +}; +goog.inherits(proto.nitric.proto.websockets.v1.WebsocketEventRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.websockets.v1.WebsocketEventRequest.displayName = 'proto.nitric.proto.websockets.v1.WebsocketEventRequest'; +} +/** + * 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.nitric.proto.websockets.v1.QueryValue = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.proto.websockets.v1.QueryValue.repeatedFields_, null); +}; +goog.inherits(proto.nitric.proto.websockets.v1.QueryValue, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.websockets.v1.QueryValue.displayName = 'proto.nitric.proto.websockets.v1.QueryValue'; +} +/** + * 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.nitric.proto.websockets.v1.ServerMessage = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.proto.websockets.v1.ServerMessage.oneofGroups_); +}; +goog.inherits(proto.nitric.proto.websockets.v1.ServerMessage, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.websockets.v1.ServerMessage.displayName = 'proto.nitric.proto.websockets.v1.ServerMessage'; +} +/** + * 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.nitric.proto.websockets.v1.WebsocketEventResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.proto.websockets.v1.WebsocketEventResponse.oneofGroups_); +}; +goog.inherits(proto.nitric.proto.websockets.v1.WebsocketEventResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.websockets.v1.WebsocketEventResponse.displayName = 'proto.nitric.proto.websockets.v1.WebsocketEventResponse'; +} +/** + * 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.nitric.proto.websockets.v1.WebsocketConnectionEvent = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.websockets.v1.WebsocketConnectionEvent, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.websockets.v1.WebsocketConnectionEvent.displayName = 'proto.nitric.proto.websockets.v1.WebsocketConnectionEvent'; +} +/** + * 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.nitric.proto.websockets.v1.WebsocketConnectionResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.websockets.v1.WebsocketConnectionResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.websockets.v1.WebsocketConnectionResponse.displayName = 'proto.nitric.proto.websockets.v1.WebsocketConnectionResponse'; +} +/** + * 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.nitric.proto.websockets.v1.WebsocketDisconnectionEvent = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.websockets.v1.WebsocketDisconnectionEvent, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.websockets.v1.WebsocketDisconnectionEvent.displayName = 'proto.nitric.proto.websockets.v1.WebsocketDisconnectionEvent'; +} +/** + * 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.nitric.proto.websockets.v1.WebsocketMessageEvent = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.websockets.v1.WebsocketMessageEvent, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.websockets.v1.WebsocketMessageEvent.displayName = 'proto.nitric.proto.websockets.v1.WebsocketMessageEvent'; +} + + + +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.nitric.proto.websockets.v1.WebsocketDetailsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.websockets.v1.WebsocketDetailsRequest.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.nitric.proto.websockets.v1.WebsocketDetailsRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.websockets.v1.WebsocketDetailsRequest.toObject = function(includeInstance, msg) { + var f, obj = { + socketName: 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.nitric.proto.websockets.v1.WebsocketDetailsRequest} + */ +proto.nitric.proto.websockets.v1.WebsocketDetailsRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.websockets.v1.WebsocketDetailsRequest; + return proto.nitric.proto.websockets.v1.WebsocketDetailsRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.websockets.v1.WebsocketDetailsRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.websockets.v1.WebsocketDetailsRequest} + */ +proto.nitric.proto.websockets.v1.WebsocketDetailsRequest.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.setSocketName(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.websockets.v1.WebsocketDetailsRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.websockets.v1.WebsocketDetailsRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.websockets.v1.WebsocketDetailsRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.websockets.v1.WebsocketDetailsRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSocketName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string socket_name = 1; + * @return {string} + */ +proto.nitric.proto.websockets.v1.WebsocketDetailsRequest.prototype.getSocketName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.websockets.v1.WebsocketDetailsRequest} returns this + */ +proto.nitric.proto.websockets.v1.WebsocketDetailsRequest.prototype.setSocketName = 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.nitric.proto.websockets.v1.WebsocketDetailsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.websockets.v1.WebsocketDetailsResponse.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.nitric.proto.websockets.v1.WebsocketDetailsResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.websockets.v1.WebsocketDetailsResponse.toObject = function(includeInstance, msg) { + var f, obj = { + url: 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.nitric.proto.websockets.v1.WebsocketDetailsResponse} + */ +proto.nitric.proto.websockets.v1.WebsocketDetailsResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.websockets.v1.WebsocketDetailsResponse; + return proto.nitric.proto.websockets.v1.WebsocketDetailsResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.websockets.v1.WebsocketDetailsResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.websockets.v1.WebsocketDetailsResponse} + */ +proto.nitric.proto.websockets.v1.WebsocketDetailsResponse.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.setUrl(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.websockets.v1.WebsocketDetailsResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.websockets.v1.WebsocketDetailsResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.websockets.v1.WebsocketDetailsResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.websockets.v1.WebsocketDetailsResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUrl(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string url = 1; + * @return {string} + */ +proto.nitric.proto.websockets.v1.WebsocketDetailsResponse.prototype.getUrl = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.websockets.v1.WebsocketDetailsResponse} returns this + */ +proto.nitric.proto.websockets.v1.WebsocketDetailsResponse.prototype.setUrl = 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.nitric.proto.websockets.v1.WebsocketSendRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.websockets.v1.WebsocketSendRequest.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.nitric.proto.websockets.v1.WebsocketSendRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.websockets.v1.WebsocketSendRequest.toObject = function(includeInstance, msg) { + var f, obj = { + socketName: jspb.Message.getFieldWithDefault(msg, 1, ""), + connectionId: jspb.Message.getFieldWithDefault(msg, 2, ""), + 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.nitric.proto.websockets.v1.WebsocketSendRequest} + */ +proto.nitric.proto.websockets.v1.WebsocketSendRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.websockets.v1.WebsocketSendRequest; + return proto.nitric.proto.websockets.v1.WebsocketSendRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.websockets.v1.WebsocketSendRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.websockets.v1.WebsocketSendRequest} + */ +proto.nitric.proto.websockets.v1.WebsocketSendRequest.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.setSocketName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setConnectionId(value); + break; + case 3: + 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.nitric.proto.websockets.v1.WebsocketSendRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.websockets.v1.WebsocketSendRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.websockets.v1.WebsocketSendRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.websockets.v1.WebsocketSendRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSocketName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getConnectionId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getData_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } +}; + + +/** + * optional string socket_name = 1; + * @return {string} + */ +proto.nitric.proto.websockets.v1.WebsocketSendRequest.prototype.getSocketName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.websockets.v1.WebsocketSendRequest} returns this + */ +proto.nitric.proto.websockets.v1.WebsocketSendRequest.prototype.setSocketName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string connection_id = 2; + * @return {string} + */ +proto.nitric.proto.websockets.v1.WebsocketSendRequest.prototype.getConnectionId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.websockets.v1.WebsocketSendRequest} returns this + */ +proto.nitric.proto.websockets.v1.WebsocketSendRequest.prototype.setConnectionId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional bytes data = 3; + * @return {!(string|Uint8Array)} + */ +proto.nitric.proto.websockets.v1.WebsocketSendRequest.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.nitric.proto.websockets.v1.WebsocketSendRequest.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.nitric.proto.websockets.v1.WebsocketSendRequest.prototype.getData_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getData())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.nitric.proto.websockets.v1.WebsocketSendRequest} returns this + */ +proto.nitric.proto.websockets.v1.WebsocketSendRequest.prototype.setData = function(value) { + return jspb.Message.setProto3BytesField(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.nitric.proto.websockets.v1.WebsocketSendResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.websockets.v1.WebsocketSendResponse.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.nitric.proto.websockets.v1.WebsocketSendResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.websockets.v1.WebsocketSendResponse.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.proto.websockets.v1.WebsocketSendResponse} + */ +proto.nitric.proto.websockets.v1.WebsocketSendResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.websockets.v1.WebsocketSendResponse; + return proto.nitric.proto.websockets.v1.WebsocketSendResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.websockets.v1.WebsocketSendResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.websockets.v1.WebsocketSendResponse} + */ +proto.nitric.proto.websockets.v1.WebsocketSendResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.websockets.v1.WebsocketSendResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.websockets.v1.WebsocketSendResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.websockets.v1.WebsocketSendResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.websockets.v1.WebsocketSendResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +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.nitric.proto.websockets.v1.WebsocketCloseConnectionRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.websockets.v1.WebsocketCloseConnectionRequest.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.nitric.proto.websockets.v1.WebsocketCloseConnectionRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.websockets.v1.WebsocketCloseConnectionRequest.toObject = function(includeInstance, msg) { + var f, obj = { + socketName: jspb.Message.getFieldWithDefault(msg, 1, ""), + connectionId: 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.nitric.proto.websockets.v1.WebsocketCloseConnectionRequest} + */ +proto.nitric.proto.websockets.v1.WebsocketCloseConnectionRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.websockets.v1.WebsocketCloseConnectionRequest; + return proto.nitric.proto.websockets.v1.WebsocketCloseConnectionRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.websockets.v1.WebsocketCloseConnectionRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.websockets.v1.WebsocketCloseConnectionRequest} + */ +proto.nitric.proto.websockets.v1.WebsocketCloseConnectionRequest.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.setSocketName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setConnectionId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.websockets.v1.WebsocketCloseConnectionRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.websockets.v1.WebsocketCloseConnectionRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.websockets.v1.WebsocketCloseConnectionRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.websockets.v1.WebsocketCloseConnectionRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSocketName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getConnectionId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional string socket_name = 1; + * @return {string} + */ +proto.nitric.proto.websockets.v1.WebsocketCloseConnectionRequest.prototype.getSocketName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.websockets.v1.WebsocketCloseConnectionRequest} returns this + */ +proto.nitric.proto.websockets.v1.WebsocketCloseConnectionRequest.prototype.setSocketName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string connection_id = 2; + * @return {string} + */ +proto.nitric.proto.websockets.v1.WebsocketCloseConnectionRequest.prototype.getConnectionId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.websockets.v1.WebsocketCloseConnectionRequest} returns this + */ +proto.nitric.proto.websockets.v1.WebsocketCloseConnectionRequest.prototype.setConnectionId = 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.nitric.proto.websockets.v1.WebsocketCloseConnectionResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.websockets.v1.WebsocketCloseConnectionResponse.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.nitric.proto.websockets.v1.WebsocketCloseConnectionResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.websockets.v1.WebsocketCloseConnectionResponse.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.proto.websockets.v1.WebsocketCloseConnectionResponse} + */ +proto.nitric.proto.websockets.v1.WebsocketCloseConnectionResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.websockets.v1.WebsocketCloseConnectionResponse; + return proto.nitric.proto.websockets.v1.WebsocketCloseConnectionResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.websockets.v1.WebsocketCloseConnectionResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.websockets.v1.WebsocketCloseConnectionResponse} + */ +proto.nitric.proto.websockets.v1.WebsocketCloseConnectionResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.websockets.v1.WebsocketCloseConnectionResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.websockets.v1.WebsocketCloseConnectionResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.websockets.v1.WebsocketCloseConnectionResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.websockets.v1.WebsocketCloseConnectionResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.proto.websockets.v1.ClientMessage.oneofGroups_ = [[2,3]]; + +/** + * @enum {number} + */ +proto.nitric.proto.websockets.v1.ClientMessage.ContentCase = { + CONTENT_NOT_SET: 0, + REGISTRATION_REQUEST: 2, + WEBSOCKET_EVENT_RESPONSE: 3 +}; + +/** + * @return {proto.nitric.proto.websockets.v1.ClientMessage.ContentCase} + */ +proto.nitric.proto.websockets.v1.ClientMessage.prototype.getContentCase = function() { + return /** @type {proto.nitric.proto.websockets.v1.ClientMessage.ContentCase} */(jspb.Message.computeOneofCase(this, proto.nitric.proto.websockets.v1.ClientMessage.oneofGroups_[0])); +}; + + + +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.nitric.proto.websockets.v1.ClientMessage.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.websockets.v1.ClientMessage.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.nitric.proto.websockets.v1.ClientMessage} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.websockets.v1.ClientMessage.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, ""), + registrationRequest: (f = msg.getRegistrationRequest()) && proto.nitric.proto.websockets.v1.RegistrationRequest.toObject(includeInstance, f), + websocketEventResponse: (f = msg.getWebsocketEventResponse()) && proto.nitric.proto.websockets.v1.WebsocketEventResponse.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.nitric.proto.websockets.v1.ClientMessage} + */ +proto.nitric.proto.websockets.v1.ClientMessage.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.websockets.v1.ClientMessage; + return proto.nitric.proto.websockets.v1.ClientMessage.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.websockets.v1.ClientMessage} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.websockets.v1.ClientMessage} + */ +proto.nitric.proto.websockets.v1.ClientMessage.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 = new proto.nitric.proto.websockets.v1.RegistrationRequest; + reader.readMessage(value,proto.nitric.proto.websockets.v1.RegistrationRequest.deserializeBinaryFromReader); + msg.setRegistrationRequest(value); + break; + case 3: + var value = new proto.nitric.proto.websockets.v1.WebsocketEventResponse; + reader.readMessage(value,proto.nitric.proto.websockets.v1.WebsocketEventResponse.deserializeBinaryFromReader); + msg.setWebsocketEventResponse(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.websockets.v1.ClientMessage.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.websockets.v1.ClientMessage.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.websockets.v1.ClientMessage} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.websockets.v1.ClientMessage.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getRegistrationRequest(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.nitric.proto.websockets.v1.RegistrationRequest.serializeBinaryToWriter + ); + } + f = message.getWebsocketEventResponse(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.nitric.proto.websockets.v1.WebsocketEventResponse.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string id = 1; + * @return {string} + */ +proto.nitric.proto.websockets.v1.ClientMessage.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.websockets.v1.ClientMessage} returns this + */ +proto.nitric.proto.websockets.v1.ClientMessage.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional RegistrationRequest registration_request = 2; + * @return {?proto.nitric.proto.websockets.v1.RegistrationRequest} + */ +proto.nitric.proto.websockets.v1.ClientMessage.prototype.getRegistrationRequest = function() { + return /** @type{?proto.nitric.proto.websockets.v1.RegistrationRequest} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.websockets.v1.RegistrationRequest, 2)); +}; + + +/** + * @param {?proto.nitric.proto.websockets.v1.RegistrationRequest|undefined} value + * @return {!proto.nitric.proto.websockets.v1.ClientMessage} returns this +*/ +proto.nitric.proto.websockets.v1.ClientMessage.prototype.setRegistrationRequest = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.nitric.proto.websockets.v1.ClientMessage.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.websockets.v1.ClientMessage} returns this + */ +proto.nitric.proto.websockets.v1.ClientMessage.prototype.clearRegistrationRequest = function() { + return this.setRegistrationRequest(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.websockets.v1.ClientMessage.prototype.hasRegistrationRequest = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional WebsocketEventResponse websocket_event_response = 3; + * @return {?proto.nitric.proto.websockets.v1.WebsocketEventResponse} + */ +proto.nitric.proto.websockets.v1.ClientMessage.prototype.getWebsocketEventResponse = function() { + return /** @type{?proto.nitric.proto.websockets.v1.WebsocketEventResponse} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.websockets.v1.WebsocketEventResponse, 3)); +}; + + +/** + * @param {?proto.nitric.proto.websockets.v1.WebsocketEventResponse|undefined} value + * @return {!proto.nitric.proto.websockets.v1.ClientMessage} returns this +*/ +proto.nitric.proto.websockets.v1.ClientMessage.prototype.setWebsocketEventResponse = function(value) { + return jspb.Message.setOneofWrapperField(this, 3, proto.nitric.proto.websockets.v1.ClientMessage.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.websockets.v1.ClientMessage} returns this + */ +proto.nitric.proto.websockets.v1.ClientMessage.prototype.clearWebsocketEventResponse = function() { + return this.setWebsocketEventResponse(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.websockets.v1.ClientMessage.prototype.hasWebsocketEventResponse = 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.nitric.proto.websockets.v1.RegistrationResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.websockets.v1.RegistrationResponse.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.nitric.proto.websockets.v1.RegistrationResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.websockets.v1.RegistrationResponse.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.proto.websockets.v1.RegistrationResponse} + */ +proto.nitric.proto.websockets.v1.RegistrationResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.websockets.v1.RegistrationResponse; + return proto.nitric.proto.websockets.v1.RegistrationResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.websockets.v1.RegistrationResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.websockets.v1.RegistrationResponse} + */ +proto.nitric.proto.websockets.v1.RegistrationResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.websockets.v1.RegistrationResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.websockets.v1.RegistrationResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.websockets.v1.RegistrationResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.websockets.v1.RegistrationResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +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.nitric.proto.websockets.v1.RegistrationRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.websockets.v1.RegistrationRequest.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.nitric.proto.websockets.v1.RegistrationRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.websockets.v1.RegistrationRequest.toObject = function(includeInstance, msg) { + var f, obj = { + socketName: jspb.Message.getFieldWithDefault(msg, 1, ""), + eventType: 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.nitric.proto.websockets.v1.RegistrationRequest} + */ +proto.nitric.proto.websockets.v1.RegistrationRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.websockets.v1.RegistrationRequest; + return proto.nitric.proto.websockets.v1.RegistrationRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.websockets.v1.RegistrationRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.websockets.v1.RegistrationRequest} + */ +proto.nitric.proto.websockets.v1.RegistrationRequest.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.setSocketName(value); + break; + case 2: + var value = /** @type {!proto.nitric.proto.websockets.v1.WebsocketEventType} */ (reader.readEnum()); + msg.setEventType(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.websockets.v1.RegistrationRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.websockets.v1.RegistrationRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.websockets.v1.RegistrationRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.websockets.v1.RegistrationRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSocketName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getEventType(); + if (f !== 0.0) { + writer.writeEnum( + 2, + f + ); + } +}; + + +/** + * optional string socket_name = 1; + * @return {string} + */ +proto.nitric.proto.websockets.v1.RegistrationRequest.prototype.getSocketName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.websockets.v1.RegistrationRequest} returns this + */ +proto.nitric.proto.websockets.v1.RegistrationRequest.prototype.setSocketName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional WebsocketEventType event_type = 2; + * @return {!proto.nitric.proto.websockets.v1.WebsocketEventType} + */ +proto.nitric.proto.websockets.v1.RegistrationRequest.prototype.getEventType = function() { + return /** @type {!proto.nitric.proto.websockets.v1.WebsocketEventType} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {!proto.nitric.proto.websockets.v1.WebsocketEventType} value + * @return {!proto.nitric.proto.websockets.v1.RegistrationRequest} returns this + */ +proto.nitric.proto.websockets.v1.RegistrationRequest.prototype.setEventType = function(value) { + return jspb.Message.setProto3EnumField(this, 2, value); +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.proto.websockets.v1.WebsocketEventRequest.oneofGroups_ = [[10,11,12]]; + +/** + * @enum {number} + */ +proto.nitric.proto.websockets.v1.WebsocketEventRequest.WebsocketEventCase = { + WEBSOCKET_EVENT_NOT_SET: 0, + CONNECTION: 10, + DISCONNECTION: 11, + MESSAGE: 12 +}; + +/** + * @return {proto.nitric.proto.websockets.v1.WebsocketEventRequest.WebsocketEventCase} + */ +proto.nitric.proto.websockets.v1.WebsocketEventRequest.prototype.getWebsocketEventCase = function() { + return /** @type {proto.nitric.proto.websockets.v1.WebsocketEventRequest.WebsocketEventCase} */(jspb.Message.computeOneofCase(this, proto.nitric.proto.websockets.v1.WebsocketEventRequest.oneofGroups_[0])); +}; + + + +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.nitric.proto.websockets.v1.WebsocketEventRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.websockets.v1.WebsocketEventRequest.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.nitric.proto.websockets.v1.WebsocketEventRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.websockets.v1.WebsocketEventRequest.toObject = function(includeInstance, msg) { + var f, obj = { + socketName: jspb.Message.getFieldWithDefault(msg, 1, ""), + connectionid: jspb.Message.getFieldWithDefault(msg, 2, ""), + connection: (f = msg.getConnection()) && proto.nitric.proto.websockets.v1.WebsocketConnectionEvent.toObject(includeInstance, f), + disconnection: (f = msg.getDisconnection()) && proto.nitric.proto.websockets.v1.WebsocketDisconnectionEvent.toObject(includeInstance, f), + message: (f = msg.getMessage()) && proto.nitric.proto.websockets.v1.WebsocketMessageEvent.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.nitric.proto.websockets.v1.WebsocketEventRequest} + */ +proto.nitric.proto.websockets.v1.WebsocketEventRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.websockets.v1.WebsocketEventRequest; + return proto.nitric.proto.websockets.v1.WebsocketEventRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.websockets.v1.WebsocketEventRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.websockets.v1.WebsocketEventRequest} + */ +proto.nitric.proto.websockets.v1.WebsocketEventRequest.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.setSocketName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setConnectionid(value); + break; + case 10: + var value = new proto.nitric.proto.websockets.v1.WebsocketConnectionEvent; + reader.readMessage(value,proto.nitric.proto.websockets.v1.WebsocketConnectionEvent.deserializeBinaryFromReader); + msg.setConnection(value); + break; + case 11: + var value = new proto.nitric.proto.websockets.v1.WebsocketDisconnectionEvent; + reader.readMessage(value,proto.nitric.proto.websockets.v1.WebsocketDisconnectionEvent.deserializeBinaryFromReader); + msg.setDisconnection(value); + break; + case 12: + var value = new proto.nitric.proto.websockets.v1.WebsocketMessageEvent; + reader.readMessage(value,proto.nitric.proto.websockets.v1.WebsocketMessageEvent.deserializeBinaryFromReader); + msg.setMessage(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.websockets.v1.WebsocketEventRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.websockets.v1.WebsocketEventRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.websockets.v1.WebsocketEventRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.websockets.v1.WebsocketEventRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSocketName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getConnectionid(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getConnection(); + if (f != null) { + writer.writeMessage( + 10, + f, + proto.nitric.proto.websockets.v1.WebsocketConnectionEvent.serializeBinaryToWriter + ); + } + f = message.getDisconnection(); + if (f != null) { + writer.writeMessage( + 11, + f, + proto.nitric.proto.websockets.v1.WebsocketDisconnectionEvent.serializeBinaryToWriter + ); + } + f = message.getMessage(); + if (f != null) { + writer.writeMessage( + 12, + f, + proto.nitric.proto.websockets.v1.WebsocketMessageEvent.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string socket_name = 1; + * @return {string} + */ +proto.nitric.proto.websockets.v1.WebsocketEventRequest.prototype.getSocketName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.websockets.v1.WebsocketEventRequest} returns this + */ +proto.nitric.proto.websockets.v1.WebsocketEventRequest.prototype.setSocketName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string connectionId = 2; + * @return {string} + */ +proto.nitric.proto.websockets.v1.WebsocketEventRequest.prototype.getConnectionid = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.websockets.v1.WebsocketEventRequest} returns this + */ +proto.nitric.proto.websockets.v1.WebsocketEventRequest.prototype.setConnectionid = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional WebsocketConnectionEvent connection = 10; + * @return {?proto.nitric.proto.websockets.v1.WebsocketConnectionEvent} + */ +proto.nitric.proto.websockets.v1.WebsocketEventRequest.prototype.getConnection = function() { + return /** @type{?proto.nitric.proto.websockets.v1.WebsocketConnectionEvent} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.websockets.v1.WebsocketConnectionEvent, 10)); +}; + + +/** + * @param {?proto.nitric.proto.websockets.v1.WebsocketConnectionEvent|undefined} value + * @return {!proto.nitric.proto.websockets.v1.WebsocketEventRequest} returns this +*/ +proto.nitric.proto.websockets.v1.WebsocketEventRequest.prototype.setConnection = function(value) { + return jspb.Message.setOneofWrapperField(this, 10, proto.nitric.proto.websockets.v1.WebsocketEventRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.websockets.v1.WebsocketEventRequest} returns this + */ +proto.nitric.proto.websockets.v1.WebsocketEventRequest.prototype.clearConnection = function() { + return this.setConnection(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.websockets.v1.WebsocketEventRequest.prototype.hasConnection = function() { + return jspb.Message.getField(this, 10) != null; +}; + + +/** + * optional WebsocketDisconnectionEvent disconnection = 11; + * @return {?proto.nitric.proto.websockets.v1.WebsocketDisconnectionEvent} + */ +proto.nitric.proto.websockets.v1.WebsocketEventRequest.prototype.getDisconnection = function() { + return /** @type{?proto.nitric.proto.websockets.v1.WebsocketDisconnectionEvent} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.websockets.v1.WebsocketDisconnectionEvent, 11)); +}; + + +/** + * @param {?proto.nitric.proto.websockets.v1.WebsocketDisconnectionEvent|undefined} value + * @return {!proto.nitric.proto.websockets.v1.WebsocketEventRequest} returns this +*/ +proto.nitric.proto.websockets.v1.WebsocketEventRequest.prototype.setDisconnection = function(value) { + return jspb.Message.setOneofWrapperField(this, 11, proto.nitric.proto.websockets.v1.WebsocketEventRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.websockets.v1.WebsocketEventRequest} returns this + */ +proto.nitric.proto.websockets.v1.WebsocketEventRequest.prototype.clearDisconnection = function() { + return this.setDisconnection(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.websockets.v1.WebsocketEventRequest.prototype.hasDisconnection = function() { + return jspb.Message.getField(this, 11) != null; +}; + + +/** + * optional WebsocketMessageEvent message = 12; + * @return {?proto.nitric.proto.websockets.v1.WebsocketMessageEvent} + */ +proto.nitric.proto.websockets.v1.WebsocketEventRequest.prototype.getMessage = function() { + return /** @type{?proto.nitric.proto.websockets.v1.WebsocketMessageEvent} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.websockets.v1.WebsocketMessageEvent, 12)); +}; + + +/** + * @param {?proto.nitric.proto.websockets.v1.WebsocketMessageEvent|undefined} value + * @return {!proto.nitric.proto.websockets.v1.WebsocketEventRequest} returns this +*/ +proto.nitric.proto.websockets.v1.WebsocketEventRequest.prototype.setMessage = function(value) { + return jspb.Message.setOneofWrapperField(this, 12, proto.nitric.proto.websockets.v1.WebsocketEventRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.websockets.v1.WebsocketEventRequest} returns this + */ +proto.nitric.proto.websockets.v1.WebsocketEventRequest.prototype.clearMessage = function() { + return this.setMessage(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.websockets.v1.WebsocketEventRequest.prototype.hasMessage = function() { + return jspb.Message.getField(this, 12) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.nitric.proto.websockets.v1.QueryValue.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.nitric.proto.websockets.v1.QueryValue.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.websockets.v1.QueryValue.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.nitric.proto.websockets.v1.QueryValue} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.websockets.v1.QueryValue.toObject = function(includeInstance, msg) { + var f, obj = { + valueList: (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.nitric.proto.websockets.v1.QueryValue} + */ +proto.nitric.proto.websockets.v1.QueryValue.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.websockets.v1.QueryValue; + return proto.nitric.proto.websockets.v1.QueryValue.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.websockets.v1.QueryValue} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.websockets.v1.QueryValue} + */ +proto.nitric.proto.websockets.v1.QueryValue.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.addValue(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.websockets.v1.QueryValue.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.websockets.v1.QueryValue.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.websockets.v1.QueryValue} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.websockets.v1.QueryValue.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getValueList(); + if (f.length > 0) { + writer.writeRepeatedString( + 1, + f + ); + } +}; + + +/** + * repeated string value = 1; + * @return {!Array} + */ +proto.nitric.proto.websockets.v1.QueryValue.prototype.getValueList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.nitric.proto.websockets.v1.QueryValue} returns this + */ +proto.nitric.proto.websockets.v1.QueryValue.prototype.setValueList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.nitric.proto.websockets.v1.QueryValue} returns this + */ +proto.nitric.proto.websockets.v1.QueryValue.prototype.addValue = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.nitric.proto.websockets.v1.QueryValue} returns this + */ +proto.nitric.proto.websockets.v1.QueryValue.prototype.clearValueList = function() { + return this.setValueList([]); +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.proto.websockets.v1.ServerMessage.oneofGroups_ = [[2,3]]; + +/** + * @enum {number} + */ +proto.nitric.proto.websockets.v1.ServerMessage.ContentCase = { + CONTENT_NOT_SET: 0, + REGISTRATION_RESPONSE: 2, + WEBSOCKET_EVENT_REQUEST: 3 +}; + +/** + * @return {proto.nitric.proto.websockets.v1.ServerMessage.ContentCase} + */ +proto.nitric.proto.websockets.v1.ServerMessage.prototype.getContentCase = function() { + return /** @type {proto.nitric.proto.websockets.v1.ServerMessage.ContentCase} */(jspb.Message.computeOneofCase(this, proto.nitric.proto.websockets.v1.ServerMessage.oneofGroups_[0])); +}; + + + +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.nitric.proto.websockets.v1.ServerMessage.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.websockets.v1.ServerMessage.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.nitric.proto.websockets.v1.ServerMessage} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.websockets.v1.ServerMessage.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, ""), + registrationResponse: (f = msg.getRegistrationResponse()) && proto.nitric.proto.websockets.v1.RegistrationResponse.toObject(includeInstance, f), + websocketEventRequest: (f = msg.getWebsocketEventRequest()) && proto.nitric.proto.websockets.v1.WebsocketEventRequest.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.nitric.proto.websockets.v1.ServerMessage} + */ +proto.nitric.proto.websockets.v1.ServerMessage.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.websockets.v1.ServerMessage; + return proto.nitric.proto.websockets.v1.ServerMessage.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.websockets.v1.ServerMessage} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.websockets.v1.ServerMessage} + */ +proto.nitric.proto.websockets.v1.ServerMessage.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 = new proto.nitric.proto.websockets.v1.RegistrationResponse; + reader.readMessage(value,proto.nitric.proto.websockets.v1.RegistrationResponse.deserializeBinaryFromReader); + msg.setRegistrationResponse(value); + break; + case 3: + var value = new proto.nitric.proto.websockets.v1.WebsocketEventRequest; + reader.readMessage(value,proto.nitric.proto.websockets.v1.WebsocketEventRequest.deserializeBinaryFromReader); + msg.setWebsocketEventRequest(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.websockets.v1.ServerMessage.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.websockets.v1.ServerMessage.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.websockets.v1.ServerMessage} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.websockets.v1.ServerMessage.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getRegistrationResponse(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.nitric.proto.websockets.v1.RegistrationResponse.serializeBinaryToWriter + ); + } + f = message.getWebsocketEventRequest(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.nitric.proto.websockets.v1.WebsocketEventRequest.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string id = 1; + * @return {string} + */ +proto.nitric.proto.websockets.v1.ServerMessage.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.websockets.v1.ServerMessage} returns this + */ +proto.nitric.proto.websockets.v1.ServerMessage.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional RegistrationResponse registration_response = 2; + * @return {?proto.nitric.proto.websockets.v1.RegistrationResponse} + */ +proto.nitric.proto.websockets.v1.ServerMessage.prototype.getRegistrationResponse = function() { + return /** @type{?proto.nitric.proto.websockets.v1.RegistrationResponse} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.websockets.v1.RegistrationResponse, 2)); +}; + + +/** + * @param {?proto.nitric.proto.websockets.v1.RegistrationResponse|undefined} value + * @return {!proto.nitric.proto.websockets.v1.ServerMessage} returns this +*/ +proto.nitric.proto.websockets.v1.ServerMessage.prototype.setRegistrationResponse = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.nitric.proto.websockets.v1.ServerMessage.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.websockets.v1.ServerMessage} returns this + */ +proto.nitric.proto.websockets.v1.ServerMessage.prototype.clearRegistrationResponse = function() { + return this.setRegistrationResponse(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.websockets.v1.ServerMessage.prototype.hasRegistrationResponse = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional WebsocketEventRequest websocket_event_request = 3; + * @return {?proto.nitric.proto.websockets.v1.WebsocketEventRequest} + */ +proto.nitric.proto.websockets.v1.ServerMessage.prototype.getWebsocketEventRequest = function() { + return /** @type{?proto.nitric.proto.websockets.v1.WebsocketEventRequest} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.websockets.v1.WebsocketEventRequest, 3)); +}; + + +/** + * @param {?proto.nitric.proto.websockets.v1.WebsocketEventRequest|undefined} value + * @return {!proto.nitric.proto.websockets.v1.ServerMessage} returns this +*/ +proto.nitric.proto.websockets.v1.ServerMessage.prototype.setWebsocketEventRequest = function(value) { + return jspb.Message.setOneofWrapperField(this, 3, proto.nitric.proto.websockets.v1.ServerMessage.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.websockets.v1.ServerMessage} returns this + */ +proto.nitric.proto.websockets.v1.ServerMessage.prototype.clearWebsocketEventRequest = function() { + return this.setWebsocketEventRequest(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.websockets.v1.ServerMessage.prototype.hasWebsocketEventRequest = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.proto.websockets.v1.WebsocketEventResponse.oneofGroups_ = [[10]]; + +/** + * @enum {number} + */ +proto.nitric.proto.websockets.v1.WebsocketEventResponse.WebsocketResponseCase = { + WEBSOCKET_RESPONSE_NOT_SET: 0, + CONNECTION_RESPONSE: 10 +}; + +/** + * @return {proto.nitric.proto.websockets.v1.WebsocketEventResponse.WebsocketResponseCase} + */ +proto.nitric.proto.websockets.v1.WebsocketEventResponse.prototype.getWebsocketResponseCase = function() { + return /** @type {proto.nitric.proto.websockets.v1.WebsocketEventResponse.WebsocketResponseCase} */(jspb.Message.computeOneofCase(this, proto.nitric.proto.websockets.v1.WebsocketEventResponse.oneofGroups_[0])); +}; + + + +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.nitric.proto.websockets.v1.WebsocketEventResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.websockets.v1.WebsocketEventResponse.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.nitric.proto.websockets.v1.WebsocketEventResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.websockets.v1.WebsocketEventResponse.toObject = function(includeInstance, msg) { + var f, obj = { + connectionResponse: (f = msg.getConnectionResponse()) && proto.nitric.proto.websockets.v1.WebsocketConnectionResponse.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.nitric.proto.websockets.v1.WebsocketEventResponse} + */ +proto.nitric.proto.websockets.v1.WebsocketEventResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.websockets.v1.WebsocketEventResponse; + return proto.nitric.proto.websockets.v1.WebsocketEventResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.websockets.v1.WebsocketEventResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.websockets.v1.WebsocketEventResponse} + */ +proto.nitric.proto.websockets.v1.WebsocketEventResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 10: + var value = new proto.nitric.proto.websockets.v1.WebsocketConnectionResponse; + reader.readMessage(value,proto.nitric.proto.websockets.v1.WebsocketConnectionResponse.deserializeBinaryFromReader); + msg.setConnectionResponse(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.websockets.v1.WebsocketEventResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.websockets.v1.WebsocketEventResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.websockets.v1.WebsocketEventResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.websockets.v1.WebsocketEventResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getConnectionResponse(); + if (f != null) { + writer.writeMessage( + 10, + f, + proto.nitric.proto.websockets.v1.WebsocketConnectionResponse.serializeBinaryToWriter + ); + } +}; + + +/** + * optional WebsocketConnectionResponse connection_response = 10; + * @return {?proto.nitric.proto.websockets.v1.WebsocketConnectionResponse} + */ +proto.nitric.proto.websockets.v1.WebsocketEventResponse.prototype.getConnectionResponse = function() { + return /** @type{?proto.nitric.proto.websockets.v1.WebsocketConnectionResponse} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.websockets.v1.WebsocketConnectionResponse, 10)); +}; + + +/** + * @param {?proto.nitric.proto.websockets.v1.WebsocketConnectionResponse|undefined} value + * @return {!proto.nitric.proto.websockets.v1.WebsocketEventResponse} returns this +*/ +proto.nitric.proto.websockets.v1.WebsocketEventResponse.prototype.setConnectionResponse = function(value) { + return jspb.Message.setOneofWrapperField(this, 10, proto.nitric.proto.websockets.v1.WebsocketEventResponse.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.websockets.v1.WebsocketEventResponse} returns this + */ +proto.nitric.proto.websockets.v1.WebsocketEventResponse.prototype.clearConnectionResponse = function() { + return this.setConnectionResponse(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.websockets.v1.WebsocketEventResponse.prototype.hasConnectionResponse = function() { + return jspb.Message.getField(this, 10) != 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.nitric.proto.websockets.v1.WebsocketConnectionEvent.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.websockets.v1.WebsocketConnectionEvent.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.nitric.proto.websockets.v1.WebsocketConnectionEvent} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.websockets.v1.WebsocketConnectionEvent.toObject = function(includeInstance, msg) { + var f, obj = { + queryParamsMap: (f = msg.getQueryParamsMap()) ? f.toObject(includeInstance, proto.nitric.proto.websockets.v1.QueryValue.toObject) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.proto.websockets.v1.WebsocketConnectionEvent} + */ +proto.nitric.proto.websockets.v1.WebsocketConnectionEvent.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.websockets.v1.WebsocketConnectionEvent; + return proto.nitric.proto.websockets.v1.WebsocketConnectionEvent.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.websockets.v1.WebsocketConnectionEvent} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.websockets.v1.WebsocketConnectionEvent} + */ +proto.nitric.proto.websockets.v1.WebsocketConnectionEvent.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = msg.getQueryParamsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.nitric.proto.websockets.v1.QueryValue.deserializeBinaryFromReader, "", new proto.nitric.proto.websockets.v1.QueryValue()); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.websockets.v1.WebsocketConnectionEvent.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.websockets.v1.WebsocketConnectionEvent.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.websockets.v1.WebsocketConnectionEvent} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.websockets.v1.WebsocketConnectionEvent.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getQueryParamsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.nitric.proto.websockets.v1.QueryValue.serializeBinaryToWriter); + } +}; + + +/** + * map query_params = 1; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.nitric.proto.websockets.v1.WebsocketConnectionEvent.prototype.getQueryParamsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 1, opt_noLazyCreate, + proto.nitric.proto.websockets.v1.QueryValue)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.nitric.proto.websockets.v1.WebsocketConnectionEvent} returns this + */ +proto.nitric.proto.websockets.v1.WebsocketConnectionEvent.prototype.clearQueryParamsMap = function() { + this.getQueryParamsMap().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.nitric.proto.websockets.v1.WebsocketConnectionResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.websockets.v1.WebsocketConnectionResponse.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.nitric.proto.websockets.v1.WebsocketConnectionResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.websockets.v1.WebsocketConnectionResponse.toObject = function(includeInstance, msg) { + var f, obj = { + reject: 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.nitric.proto.websockets.v1.WebsocketConnectionResponse} + */ +proto.nitric.proto.websockets.v1.WebsocketConnectionResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.websockets.v1.WebsocketConnectionResponse; + return proto.nitric.proto.websockets.v1.WebsocketConnectionResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.websockets.v1.WebsocketConnectionResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.websockets.v1.WebsocketConnectionResponse} + */ +proto.nitric.proto.websockets.v1.WebsocketConnectionResponse.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.setReject(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.websockets.v1.WebsocketConnectionResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.websockets.v1.WebsocketConnectionResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.websockets.v1.WebsocketConnectionResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.websockets.v1.WebsocketConnectionResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getReject(); + if (f) { + writer.writeBool( + 1, + f + ); + } +}; + + +/** + * optional bool reject = 1; + * @return {boolean} + */ +proto.nitric.proto.websockets.v1.WebsocketConnectionResponse.prototype.getReject = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.nitric.proto.websockets.v1.WebsocketConnectionResponse} returns this + */ +proto.nitric.proto.websockets.v1.WebsocketConnectionResponse.prototype.setReject = 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.nitric.proto.websockets.v1.WebsocketDisconnectionEvent.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.websockets.v1.WebsocketDisconnectionEvent.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.nitric.proto.websockets.v1.WebsocketDisconnectionEvent} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.websockets.v1.WebsocketDisconnectionEvent.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.proto.websockets.v1.WebsocketDisconnectionEvent} + */ +proto.nitric.proto.websockets.v1.WebsocketDisconnectionEvent.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.websockets.v1.WebsocketDisconnectionEvent; + return proto.nitric.proto.websockets.v1.WebsocketDisconnectionEvent.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.websockets.v1.WebsocketDisconnectionEvent} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.websockets.v1.WebsocketDisconnectionEvent} + */ +proto.nitric.proto.websockets.v1.WebsocketDisconnectionEvent.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.websockets.v1.WebsocketDisconnectionEvent.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.websockets.v1.WebsocketDisconnectionEvent.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.websockets.v1.WebsocketDisconnectionEvent} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.websockets.v1.WebsocketDisconnectionEvent.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +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.nitric.proto.websockets.v1.WebsocketMessageEvent.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.websockets.v1.WebsocketMessageEvent.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.nitric.proto.websockets.v1.WebsocketMessageEvent} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.websockets.v1.WebsocketMessageEvent.toObject = function(includeInstance, msg) { + var f, obj = { + body: msg.getBody_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.nitric.proto.websockets.v1.WebsocketMessageEvent} + */ +proto.nitric.proto.websockets.v1.WebsocketMessageEvent.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.websockets.v1.WebsocketMessageEvent; + return proto.nitric.proto.websockets.v1.WebsocketMessageEvent.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.websockets.v1.WebsocketMessageEvent} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.websockets.v1.WebsocketMessageEvent} + */ +proto.nitric.proto.websockets.v1.WebsocketMessageEvent.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.setBody(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.websockets.v1.WebsocketMessageEvent.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.websockets.v1.WebsocketMessageEvent.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.websockets.v1.WebsocketMessageEvent} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.websockets.v1.WebsocketMessageEvent.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getBody_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } +}; + + +/** + * optional bytes body = 1; + * @return {!(string|Uint8Array)} + */ +proto.nitric.proto.websockets.v1.WebsocketMessageEvent.prototype.getBody = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes body = 1; + * This is a type-conversion wrapper around `getBody()` + * @return {string} + */ +proto.nitric.proto.websockets.v1.WebsocketMessageEvent.prototype.getBody_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getBody())); +}; + + +/** + * optional bytes body = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getBody()` + * @return {!Uint8Array} + */ +proto.nitric.proto.websockets.v1.WebsocketMessageEvent.prototype.getBody_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getBody())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.nitric.proto.websockets.v1.WebsocketMessageEvent} returns this + */ +proto.nitric.proto.websockets.v1.WebsocketMessageEvent.prototype.setBody = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * @enum {number} + */ +proto.nitric.proto.websockets.v1.WebsocketEventType = { + CONNECT: 0, + DISCONNECT: 1, + MESSAGE: 2 +}; + +goog.object.extend(exports, proto.nitric.proto.websockets.v1); diff --git a/src/gen/proto/deploy/v1/deploy_grpc_pb.d.ts b/src/gen/proto/deploy/v1/deploy_grpc_pb.d.ts deleted file mode 100644 index 89fc326c..00000000 --- a/src/gen/proto/deploy/v1/deploy_grpc_pb.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -// GENERATED CODE -- DO NOT EDIT! - -// package: nitric.deploy.v1 -// file: proto/deploy/v1/deploy.proto - -import * as proto_deploy_v1_deploy_pb from "../../../proto/deploy/v1/deploy_pb"; -import * as grpc from "@grpc/grpc-js"; - -interface IDeployServiceService extends grpc.ServiceDefinition { - up: grpc.MethodDefinition; - down: grpc.MethodDefinition; -} - -export const DeployServiceService: IDeployServiceService; - -export interface IDeployServiceServer extends grpc.UntypedServiceImplementation { - up: grpc.handleServerStreamingCall; - down: grpc.handleServerStreamingCall; -} - -export class DeployServiceClient extends grpc.Client { - constructor(address: string, credentials: grpc.ChannelCredentials, options?: object); - up(argument: proto_deploy_v1_deploy_pb.DeployUpRequest, metadataOrOptions?: grpc.Metadata | grpc.CallOptions | null): grpc.ClientReadableStream; - up(argument: proto_deploy_v1_deploy_pb.DeployUpRequest, metadata?: grpc.Metadata | null, options?: grpc.CallOptions | null): grpc.ClientReadableStream; - down(argument: proto_deploy_v1_deploy_pb.DeployDownRequest, metadataOrOptions?: grpc.Metadata | grpc.CallOptions | null): grpc.ClientReadableStream; - down(argument: proto_deploy_v1_deploy_pb.DeployDownRequest, metadata?: grpc.Metadata | null, options?: grpc.CallOptions | null): grpc.ClientReadableStream; -} diff --git a/src/gen/proto/deploy/v1/deploy_grpc_pb.js b/src/gen/proto/deploy/v1/deploy_grpc_pb.js deleted file mode 100644 index aa3a30ab..00000000 --- a/src/gen/proto/deploy/v1/deploy_grpc_pb.js +++ /dev/null @@ -1,87 +0,0 @@ -// GENERATED CODE -- DO NOT EDIT! - -'use strict'; -var grpc = require('@grpc/grpc-js'); -var proto_deploy_v1_deploy_pb = require('../../../proto/deploy/v1/deploy_pb.js'); -var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js'); -var proto_resource_v1_resource_pb = require('../../../proto/resource/v1/resource_pb.js'); -var proto_faas_v1_faas_pb = require('../../../proto/faas/v1/faas_pb.js'); - -function serialize_nitric_deploy_v1_DeployDownEvent(arg) { - if (!(arg instanceof proto_deploy_v1_deploy_pb.DeployDownEvent)) { - throw new Error('Expected argument of type nitric.deploy.v1.DeployDownEvent'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_deploy_v1_DeployDownEvent(buffer_arg) { - return proto_deploy_v1_deploy_pb.DeployDownEvent.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_deploy_v1_DeployDownRequest(arg) { - if (!(arg instanceof proto_deploy_v1_deploy_pb.DeployDownRequest)) { - throw new Error('Expected argument of type nitric.deploy.v1.DeployDownRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_deploy_v1_DeployDownRequest(buffer_arg) { - return proto_deploy_v1_deploy_pb.DeployDownRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_deploy_v1_DeployUpEvent(arg) { - if (!(arg instanceof proto_deploy_v1_deploy_pb.DeployUpEvent)) { - throw new Error('Expected argument of type nitric.deploy.v1.DeployUpEvent'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_deploy_v1_DeployUpEvent(buffer_arg) { - return proto_deploy_v1_deploy_pb.DeployUpEvent.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_deploy_v1_DeployUpRequest(arg) { - if (!(arg instanceof proto_deploy_v1_deploy_pb.DeployUpRequest)) { - throw new Error('Expected argument of type nitric.deploy.v1.DeployUpRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_deploy_v1_DeployUpRequest(buffer_arg) { - return proto_deploy_v1_deploy_pb.DeployUpRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - - -// The Nitric Deloyment Service contract -var DeployServiceService = exports.DeployServiceService = { - // Begins a new deployment -// Server will stream updates back to the connected client -// on the status of the deployment -up: { - path: '/nitric.deploy.v1.DeployService/Up', - requestStream: false, - responseStream: true, - requestType: proto_deploy_v1_deploy_pb.DeployUpRequest, - responseType: proto_deploy_v1_deploy_pb.DeployUpEvent, - requestSerialize: serialize_nitric_deploy_v1_DeployUpRequest, - requestDeserialize: deserialize_nitric_deploy_v1_DeployUpRequest, - responseSerialize: serialize_nitric_deploy_v1_DeployUpEvent, - responseDeserialize: deserialize_nitric_deploy_v1_DeployUpEvent, - }, - // Tears down an existing deployment -// Server will stream updates back to the connected client -// on the status of the teardown -down: { - path: '/nitric.deploy.v1.DeployService/Down', - requestStream: false, - responseStream: true, - requestType: proto_deploy_v1_deploy_pb.DeployDownRequest, - responseType: proto_deploy_v1_deploy_pb.DeployDownEvent, - requestSerialize: serialize_nitric_deploy_v1_DeployDownRequest, - requestDeserialize: deserialize_nitric_deploy_v1_DeployDownRequest, - responseSerialize: serialize_nitric_deploy_v1_DeployDownEvent, - responseDeserialize: deserialize_nitric_deploy_v1_DeployDownEvent, - }, -}; - -exports.DeployServiceClient = grpc.makeGenericClientConstructor(DeployServiceService); diff --git a/src/gen/proto/deploy/v1/deploy_pb.js b/src/gen/proto/deploy/v1/deploy_pb.js deleted file mode 100644 index acda8668..00000000 --- a/src/gen/proto/deploy/v1/deploy_pb.js +++ /dev/null @@ -1,6138 +0,0 @@ -// source: proto/deploy/v1/deploy.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() { - if (this) { return this; } - if (typeof window !== 'undefined') { return window; } - if (typeof global !== 'undefined') { return global; } - if (typeof self !== 'undefined') { return self; } - return Function('return this')(); -}.call(null)); - -var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js'); -goog.object.extend(proto, google_protobuf_struct_pb); -var proto_resource_v1_resource_pb = require('../../../proto/resource/v1/resource_pb.js'); -goog.object.extend(proto, proto_resource_v1_resource_pb); -var proto_faas_v1_faas_pb = require('../../../proto/faas/v1/faas_pb.js'); -goog.object.extend(proto, proto_faas_v1_faas_pb); -goog.exportSymbol('proto.nitric.deploy.v1.Api', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.Api.DocumentCase', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.Bucket', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.BucketNotificationTarget', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.BucketNotificationTarget.TargetCase', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.Collection', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.DeployDownEvent', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.DeployDownEvent.ContentCase', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.DeployDownEventResult', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.DeployDownRequest', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.DeployEventMessage', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.DeployUpEvent', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.DeployUpEvent.ContentCase', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.DeployUpEventResult', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.DeployUpRequest', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.ExecutionUnit', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.ExecutionUnit.SourceCase', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.Http', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.HttpTarget', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.HttpTarget.TargetCase', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.ImageSource', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.Policy', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.Queue', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.Resource', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.Resource.ConfigCase', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.Schedule', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.ScheduleTarget', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.ScheduleTarget.TargetCase', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.Secret', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.Spec', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.SubscriptionTarget', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.SubscriptionTarget.TargetCase', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.Topic', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.TopicSubscription', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.UpResult', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.UpResult.ContentCase', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.Websocket', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.WebsocketTarget', null, global); -goog.exportSymbol('proto.nitric.deploy.v1.WebsocketTarget.TargetCase', 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.nitric.deploy.v1.DeployUpRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.deploy.v1.DeployUpRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.deploy.v1.DeployUpRequest.displayName = 'proto.nitric.deploy.v1.DeployUpRequest'; -} -/** - * 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.nitric.deploy.v1.DeployUpEvent = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.deploy.v1.DeployUpEvent.oneofGroups_); -}; -goog.inherits(proto.nitric.deploy.v1.DeployUpEvent, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.deploy.v1.DeployUpEvent.displayName = 'proto.nitric.deploy.v1.DeployUpEvent'; -} -/** - * 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.nitric.deploy.v1.DeployEventMessage = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.deploy.v1.DeployEventMessage, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.deploy.v1.DeployEventMessage.displayName = 'proto.nitric.deploy.v1.DeployEventMessage'; -} -/** - * 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.nitric.deploy.v1.UpResult = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.deploy.v1.UpResult.oneofGroups_); -}; -goog.inherits(proto.nitric.deploy.v1.UpResult, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.deploy.v1.UpResult.displayName = 'proto.nitric.deploy.v1.UpResult'; -} -/** - * 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.nitric.deploy.v1.DeployUpEventResult = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.deploy.v1.DeployUpEventResult, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.deploy.v1.DeployUpEventResult.displayName = 'proto.nitric.deploy.v1.DeployUpEventResult'; -} -/** - * 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.nitric.deploy.v1.DeployDownRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.deploy.v1.DeployDownRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.deploy.v1.DeployDownRequest.displayName = 'proto.nitric.deploy.v1.DeployDownRequest'; -} -/** - * 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.nitric.deploy.v1.DeployDownEvent = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.deploy.v1.DeployDownEvent.oneofGroups_); -}; -goog.inherits(proto.nitric.deploy.v1.DeployDownEvent, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.deploy.v1.DeployDownEvent.displayName = 'proto.nitric.deploy.v1.DeployDownEvent'; -} -/** - * 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.nitric.deploy.v1.DeployDownEventResult = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.deploy.v1.DeployDownEventResult, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.deploy.v1.DeployDownEventResult.displayName = 'proto.nitric.deploy.v1.DeployDownEventResult'; -} -/** - * 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.nitric.deploy.v1.ImageSource = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.deploy.v1.ImageSource, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.deploy.v1.ImageSource.displayName = 'proto.nitric.deploy.v1.ImageSource'; -} -/** - * 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.nitric.deploy.v1.ExecutionUnit = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.deploy.v1.ExecutionUnit.oneofGroups_); -}; -goog.inherits(proto.nitric.deploy.v1.ExecutionUnit, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.deploy.v1.ExecutionUnit.displayName = 'proto.nitric.deploy.v1.ExecutionUnit'; -} -/** - * 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.nitric.deploy.v1.Bucket = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.deploy.v1.Bucket.repeatedFields_, null); -}; -goog.inherits(proto.nitric.deploy.v1.Bucket, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.deploy.v1.Bucket.displayName = 'proto.nitric.deploy.v1.Bucket'; -} -/** - * 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.nitric.deploy.v1.BucketNotificationTarget = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.deploy.v1.BucketNotificationTarget.oneofGroups_); -}; -goog.inherits(proto.nitric.deploy.v1.BucketNotificationTarget, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.deploy.v1.BucketNotificationTarget.displayName = 'proto.nitric.deploy.v1.BucketNotificationTarget'; -} -/** - * 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.nitric.deploy.v1.Topic = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.deploy.v1.Topic.repeatedFields_, null); -}; -goog.inherits(proto.nitric.deploy.v1.Topic, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.deploy.v1.Topic.displayName = 'proto.nitric.deploy.v1.Topic'; -} -/** - * 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.nitric.deploy.v1.Queue = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.deploy.v1.Queue, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.deploy.v1.Queue.displayName = 'proto.nitric.deploy.v1.Queue'; -} -/** - * 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.nitric.deploy.v1.Collection = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.deploy.v1.Collection, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.deploy.v1.Collection.displayName = 'proto.nitric.deploy.v1.Collection'; -} -/** - * 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.nitric.deploy.v1.Secret = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.deploy.v1.Secret, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.deploy.v1.Secret.displayName = 'proto.nitric.deploy.v1.Secret'; -} -/** - * 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.nitric.deploy.v1.SubscriptionTarget = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.deploy.v1.SubscriptionTarget.oneofGroups_); -}; -goog.inherits(proto.nitric.deploy.v1.SubscriptionTarget, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.deploy.v1.SubscriptionTarget.displayName = 'proto.nitric.deploy.v1.SubscriptionTarget'; -} -/** - * 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.nitric.deploy.v1.TopicSubscription = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.deploy.v1.TopicSubscription, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.deploy.v1.TopicSubscription.displayName = 'proto.nitric.deploy.v1.TopicSubscription'; -} -/** - * 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.nitric.deploy.v1.HttpTarget = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.deploy.v1.HttpTarget.oneofGroups_); -}; -goog.inherits(proto.nitric.deploy.v1.HttpTarget, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.deploy.v1.HttpTarget.displayName = 'proto.nitric.deploy.v1.HttpTarget'; -} -/** - * 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.nitric.deploy.v1.Http = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.deploy.v1.Http, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.deploy.v1.Http.displayName = 'proto.nitric.deploy.v1.Http'; -} -/** - * 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.nitric.deploy.v1.Api = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.deploy.v1.Api.oneofGroups_); -}; -goog.inherits(proto.nitric.deploy.v1.Api, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.deploy.v1.Api.displayName = 'proto.nitric.deploy.v1.Api'; -} -/** - * 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.nitric.deploy.v1.Websocket = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.deploy.v1.Websocket, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.deploy.v1.Websocket.displayName = 'proto.nitric.deploy.v1.Websocket'; -} -/** - * 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.nitric.deploy.v1.WebsocketTarget = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.deploy.v1.WebsocketTarget.oneofGroups_); -}; -goog.inherits(proto.nitric.deploy.v1.WebsocketTarget, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.deploy.v1.WebsocketTarget.displayName = 'proto.nitric.deploy.v1.WebsocketTarget'; -} -/** - * 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.nitric.deploy.v1.ScheduleTarget = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.deploy.v1.ScheduleTarget.oneofGroups_); -}; -goog.inherits(proto.nitric.deploy.v1.ScheduleTarget, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.deploy.v1.ScheduleTarget.displayName = 'proto.nitric.deploy.v1.ScheduleTarget'; -} -/** - * 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.nitric.deploy.v1.Schedule = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.deploy.v1.Schedule, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.deploy.v1.Schedule.displayName = 'proto.nitric.deploy.v1.Schedule'; -} -/** - * 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.nitric.deploy.v1.Resource = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.deploy.v1.Resource.oneofGroups_); -}; -goog.inherits(proto.nitric.deploy.v1.Resource, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.deploy.v1.Resource.displayName = 'proto.nitric.deploy.v1.Resource'; -} -/** - * 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.nitric.deploy.v1.Policy = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.deploy.v1.Policy.repeatedFields_, null); -}; -goog.inherits(proto.nitric.deploy.v1.Policy, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.deploy.v1.Policy.displayName = 'proto.nitric.deploy.v1.Policy'; -} -/** - * 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.nitric.deploy.v1.Spec = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.deploy.v1.Spec.repeatedFields_, null); -}; -goog.inherits(proto.nitric.deploy.v1.Spec, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.deploy.v1.Spec.displayName = 'proto.nitric.deploy.v1.Spec'; -} - - - -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.nitric.deploy.v1.DeployUpRequest.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.deploy.v1.DeployUpRequest.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.nitric.deploy.v1.DeployUpRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.DeployUpRequest.toObject = function(includeInstance, msg) { - var f, obj = { - spec: (f = msg.getSpec()) && proto.nitric.deploy.v1.Spec.toObject(includeInstance, f), - attributes: (f = msg.getAttributes()) && google_protobuf_struct_pb.Struct.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.nitric.deploy.v1.DeployUpRequest} - */ -proto.nitric.deploy.v1.DeployUpRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.deploy.v1.DeployUpRequest; - return proto.nitric.deploy.v1.DeployUpRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.deploy.v1.DeployUpRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.deploy.v1.DeployUpRequest} - */ -proto.nitric.deploy.v1.DeployUpRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nitric.deploy.v1.Spec; - reader.readMessage(value,proto.nitric.deploy.v1.Spec.deserializeBinaryFromReader); - msg.setSpec(value); - break; - case 2: - var value = new google_protobuf_struct_pb.Struct; - reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); - msg.setAttributes(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.deploy.v1.DeployUpRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.deploy.v1.DeployUpRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.deploy.v1.DeployUpRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.DeployUpRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getSpec(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.nitric.deploy.v1.Spec.serializeBinaryToWriter - ); - } - f = message.getAttributes(); - if (f != null) { - writer.writeMessage( - 2, - f, - google_protobuf_struct_pb.Struct.serializeBinaryToWriter - ); - } -}; - - -/** - * optional Spec spec = 1; - * @return {?proto.nitric.deploy.v1.Spec} - */ -proto.nitric.deploy.v1.DeployUpRequest.prototype.getSpec = function() { - return /** @type{?proto.nitric.deploy.v1.Spec} */ ( - jspb.Message.getWrapperField(this, proto.nitric.deploy.v1.Spec, 1)); -}; - - -/** - * @param {?proto.nitric.deploy.v1.Spec|undefined} value - * @return {!proto.nitric.deploy.v1.DeployUpRequest} returns this -*/ -proto.nitric.deploy.v1.DeployUpRequest.prototype.setSpec = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.deploy.v1.DeployUpRequest} returns this - */ -proto.nitric.deploy.v1.DeployUpRequest.prototype.clearSpec = function() { - return this.setSpec(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.deploy.v1.DeployUpRequest.prototype.hasSpec = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional google.protobuf.Struct attributes = 2; - * @return {?proto.google.protobuf.Struct} - */ -proto.nitric.deploy.v1.DeployUpRequest.prototype.getAttributes = function() { - return /** @type{?proto.google.protobuf.Struct} */ ( - jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 2)); -}; - - -/** - * @param {?proto.google.protobuf.Struct|undefined} value - * @return {!proto.nitric.deploy.v1.DeployUpRequest} returns this -*/ -proto.nitric.deploy.v1.DeployUpRequest.prototype.setAttributes = function(value) { - return jspb.Message.setWrapperField(this, 2, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.deploy.v1.DeployUpRequest} returns this - */ -proto.nitric.deploy.v1.DeployUpRequest.prototype.clearAttributes = function() { - return this.setAttributes(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.deploy.v1.DeployUpRequest.prototype.hasAttributes = function() { - return jspb.Message.getField(this, 2) != null; -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.nitric.deploy.v1.DeployUpEvent.oneofGroups_ = [[1,2]]; - -/** - * @enum {number} - */ -proto.nitric.deploy.v1.DeployUpEvent.ContentCase = { - CONTENT_NOT_SET: 0, - MESSAGE: 1, - RESULT: 2 -}; - -/** - * @return {proto.nitric.deploy.v1.DeployUpEvent.ContentCase} - */ -proto.nitric.deploy.v1.DeployUpEvent.prototype.getContentCase = function() { - return /** @type {proto.nitric.deploy.v1.DeployUpEvent.ContentCase} */(jspb.Message.computeOneofCase(this, proto.nitric.deploy.v1.DeployUpEvent.oneofGroups_[0])); -}; - - - -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.nitric.deploy.v1.DeployUpEvent.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.deploy.v1.DeployUpEvent.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.nitric.deploy.v1.DeployUpEvent} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.DeployUpEvent.toObject = function(includeInstance, msg) { - var f, obj = { - message: (f = msg.getMessage()) && proto.nitric.deploy.v1.DeployEventMessage.toObject(includeInstance, f), - result: (f = msg.getResult()) && proto.nitric.deploy.v1.DeployUpEventResult.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.nitric.deploy.v1.DeployUpEvent} - */ -proto.nitric.deploy.v1.DeployUpEvent.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.deploy.v1.DeployUpEvent; - return proto.nitric.deploy.v1.DeployUpEvent.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.deploy.v1.DeployUpEvent} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.deploy.v1.DeployUpEvent} - */ -proto.nitric.deploy.v1.DeployUpEvent.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nitric.deploy.v1.DeployEventMessage; - reader.readMessage(value,proto.nitric.deploy.v1.DeployEventMessage.deserializeBinaryFromReader); - msg.setMessage(value); - break; - case 2: - var value = new proto.nitric.deploy.v1.DeployUpEventResult; - reader.readMessage(value,proto.nitric.deploy.v1.DeployUpEventResult.deserializeBinaryFromReader); - msg.setResult(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.deploy.v1.DeployUpEvent.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.deploy.v1.DeployUpEvent.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.deploy.v1.DeployUpEvent} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.DeployUpEvent.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getMessage(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.nitric.deploy.v1.DeployEventMessage.serializeBinaryToWriter - ); - } - f = message.getResult(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.nitric.deploy.v1.DeployUpEventResult.serializeBinaryToWriter - ); - } -}; - - -/** - * optional DeployEventMessage message = 1; - * @return {?proto.nitric.deploy.v1.DeployEventMessage} - */ -proto.nitric.deploy.v1.DeployUpEvent.prototype.getMessage = function() { - return /** @type{?proto.nitric.deploy.v1.DeployEventMessage} */ ( - jspb.Message.getWrapperField(this, proto.nitric.deploy.v1.DeployEventMessage, 1)); -}; - - -/** - * @param {?proto.nitric.deploy.v1.DeployEventMessage|undefined} value - * @return {!proto.nitric.deploy.v1.DeployUpEvent} returns this -*/ -proto.nitric.deploy.v1.DeployUpEvent.prototype.setMessage = function(value) { - return jspb.Message.setOneofWrapperField(this, 1, proto.nitric.deploy.v1.DeployUpEvent.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.deploy.v1.DeployUpEvent} returns this - */ -proto.nitric.deploy.v1.DeployUpEvent.prototype.clearMessage = function() { - return this.setMessage(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.deploy.v1.DeployUpEvent.prototype.hasMessage = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional DeployUpEventResult result = 2; - * @return {?proto.nitric.deploy.v1.DeployUpEventResult} - */ -proto.nitric.deploy.v1.DeployUpEvent.prototype.getResult = function() { - return /** @type{?proto.nitric.deploy.v1.DeployUpEventResult} */ ( - jspb.Message.getWrapperField(this, proto.nitric.deploy.v1.DeployUpEventResult, 2)); -}; - - -/** - * @param {?proto.nitric.deploy.v1.DeployUpEventResult|undefined} value - * @return {!proto.nitric.deploy.v1.DeployUpEvent} returns this -*/ -proto.nitric.deploy.v1.DeployUpEvent.prototype.setResult = function(value) { - return jspb.Message.setOneofWrapperField(this, 2, proto.nitric.deploy.v1.DeployUpEvent.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.deploy.v1.DeployUpEvent} returns this - */ -proto.nitric.deploy.v1.DeployUpEvent.prototype.clearResult = function() { - return this.setResult(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.deploy.v1.DeployUpEvent.prototype.hasResult = 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.nitric.deploy.v1.DeployEventMessage.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.deploy.v1.DeployEventMessage.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.nitric.deploy.v1.DeployEventMessage} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.DeployEventMessage.toObject = function(includeInstance, msg) { - var f, obj = { - message: 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.nitric.deploy.v1.DeployEventMessage} - */ -proto.nitric.deploy.v1.DeployEventMessage.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.deploy.v1.DeployEventMessage; - return proto.nitric.deploy.v1.DeployEventMessage.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.deploy.v1.DeployEventMessage} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.deploy.v1.DeployEventMessage} - */ -proto.nitric.deploy.v1.DeployEventMessage.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.setMessage(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.deploy.v1.DeployEventMessage.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.deploy.v1.DeployEventMessage.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.deploy.v1.DeployEventMessage} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.DeployEventMessage.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getMessage(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string message = 1; - * @return {string} - */ -proto.nitric.deploy.v1.DeployEventMessage.prototype.getMessage = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.deploy.v1.DeployEventMessage} returns this - */ -proto.nitric.deploy.v1.DeployEventMessage.prototype.setMessage = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.nitric.deploy.v1.UpResult.oneofGroups_ = [[1]]; - -/** - * @enum {number} - */ -proto.nitric.deploy.v1.UpResult.ContentCase = { - CONTENT_NOT_SET: 0, - STRING_RESULT: 1 -}; - -/** - * @return {proto.nitric.deploy.v1.UpResult.ContentCase} - */ -proto.nitric.deploy.v1.UpResult.prototype.getContentCase = function() { - return /** @type {proto.nitric.deploy.v1.UpResult.ContentCase} */(jspb.Message.computeOneofCase(this, proto.nitric.deploy.v1.UpResult.oneofGroups_[0])); -}; - - - -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.nitric.deploy.v1.UpResult.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.deploy.v1.UpResult.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.nitric.deploy.v1.UpResult} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.UpResult.toObject = function(includeInstance, msg) { - var f, obj = { - stringResult: 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.nitric.deploy.v1.UpResult} - */ -proto.nitric.deploy.v1.UpResult.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.deploy.v1.UpResult; - return proto.nitric.deploy.v1.UpResult.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.deploy.v1.UpResult} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.deploy.v1.UpResult} - */ -proto.nitric.deploy.v1.UpResult.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.setStringResult(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.deploy.v1.UpResult.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.deploy.v1.UpResult.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.deploy.v1.UpResult} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.UpResult.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {string} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string string_result = 1; - * @return {string} - */ -proto.nitric.deploy.v1.UpResult.prototype.getStringResult = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.deploy.v1.UpResult} returns this - */ -proto.nitric.deploy.v1.UpResult.prototype.setStringResult = function(value) { - return jspb.Message.setOneofField(this, 1, proto.nitric.deploy.v1.UpResult.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.nitric.deploy.v1.UpResult} returns this - */ -proto.nitric.deploy.v1.UpResult.prototype.clearStringResult = function() { - return jspb.Message.setOneofField(this, 1, proto.nitric.deploy.v1.UpResult.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.deploy.v1.UpResult.prototype.hasStringResult = 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.nitric.deploy.v1.DeployUpEventResult.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.deploy.v1.DeployUpEventResult.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.nitric.deploy.v1.DeployUpEventResult} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.DeployUpEventResult.toObject = function(includeInstance, msg) { - var f, obj = { - success: jspb.Message.getBooleanFieldWithDefault(msg, 1, false), - result: (f = msg.getResult()) && proto.nitric.deploy.v1.UpResult.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.nitric.deploy.v1.DeployUpEventResult} - */ -proto.nitric.deploy.v1.DeployUpEventResult.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.deploy.v1.DeployUpEventResult; - return proto.nitric.deploy.v1.DeployUpEventResult.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.deploy.v1.DeployUpEventResult} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.deploy.v1.DeployUpEventResult} - */ -proto.nitric.deploy.v1.DeployUpEventResult.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; - case 2: - var value = new proto.nitric.deploy.v1.UpResult; - reader.readMessage(value,proto.nitric.deploy.v1.UpResult.deserializeBinaryFromReader); - msg.setResult(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.deploy.v1.DeployUpEventResult.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.deploy.v1.DeployUpEventResult.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.deploy.v1.DeployUpEventResult} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.DeployUpEventResult.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getSuccess(); - if (f) { - writer.writeBool( - 1, - f - ); - } - f = message.getResult(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.nitric.deploy.v1.UpResult.serializeBinaryToWriter - ); - } -}; - - -/** - * optional bool success = 1; - * @return {boolean} - */ -proto.nitric.deploy.v1.DeployUpEventResult.prototype.getSuccess = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.nitric.deploy.v1.DeployUpEventResult} returns this - */ -proto.nitric.deploy.v1.DeployUpEventResult.prototype.setSuccess = function(value) { - return jspb.Message.setProto3BooleanField(this, 1, value); -}; - - -/** - * optional UpResult result = 2; - * @return {?proto.nitric.deploy.v1.UpResult} - */ -proto.nitric.deploy.v1.DeployUpEventResult.prototype.getResult = function() { - return /** @type{?proto.nitric.deploy.v1.UpResult} */ ( - jspb.Message.getWrapperField(this, proto.nitric.deploy.v1.UpResult, 2)); -}; - - -/** - * @param {?proto.nitric.deploy.v1.UpResult|undefined} value - * @return {!proto.nitric.deploy.v1.DeployUpEventResult} returns this -*/ -proto.nitric.deploy.v1.DeployUpEventResult.prototype.setResult = function(value) { - return jspb.Message.setWrapperField(this, 2, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.deploy.v1.DeployUpEventResult} returns this - */ -proto.nitric.deploy.v1.DeployUpEventResult.prototype.clearResult = function() { - return this.setResult(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.deploy.v1.DeployUpEventResult.prototype.hasResult = 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.nitric.deploy.v1.DeployDownRequest.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.deploy.v1.DeployDownRequest.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.nitric.deploy.v1.DeployDownRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.DeployDownRequest.toObject = function(includeInstance, msg) { - var f, obj = { - attributes: (f = msg.getAttributes()) && google_protobuf_struct_pb.Struct.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.nitric.deploy.v1.DeployDownRequest} - */ -proto.nitric.deploy.v1.DeployDownRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.deploy.v1.DeployDownRequest; - return proto.nitric.deploy.v1.DeployDownRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.deploy.v1.DeployDownRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.deploy.v1.DeployDownRequest} - */ -proto.nitric.deploy.v1.DeployDownRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new google_protobuf_struct_pb.Struct; - reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); - msg.setAttributes(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.deploy.v1.DeployDownRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.deploy.v1.DeployDownRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.deploy.v1.DeployDownRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.DeployDownRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getAttributes(); - if (f != null) { - writer.writeMessage( - 1, - f, - google_protobuf_struct_pb.Struct.serializeBinaryToWriter - ); - } -}; - - -/** - * optional google.protobuf.Struct attributes = 1; - * @return {?proto.google.protobuf.Struct} - */ -proto.nitric.deploy.v1.DeployDownRequest.prototype.getAttributes = function() { - return /** @type{?proto.google.protobuf.Struct} */ ( - jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 1)); -}; - - -/** - * @param {?proto.google.protobuf.Struct|undefined} value - * @return {!proto.nitric.deploy.v1.DeployDownRequest} returns this -*/ -proto.nitric.deploy.v1.DeployDownRequest.prototype.setAttributes = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.deploy.v1.DeployDownRequest} returns this - */ -proto.nitric.deploy.v1.DeployDownRequest.prototype.clearAttributes = function() { - return this.setAttributes(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.deploy.v1.DeployDownRequest.prototype.hasAttributes = function() { - return jspb.Message.getField(this, 1) != null; -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.nitric.deploy.v1.DeployDownEvent.oneofGroups_ = [[1,2]]; - -/** - * @enum {number} - */ -proto.nitric.deploy.v1.DeployDownEvent.ContentCase = { - CONTENT_NOT_SET: 0, - MESSAGE: 1, - RESULT: 2 -}; - -/** - * @return {proto.nitric.deploy.v1.DeployDownEvent.ContentCase} - */ -proto.nitric.deploy.v1.DeployDownEvent.prototype.getContentCase = function() { - return /** @type {proto.nitric.deploy.v1.DeployDownEvent.ContentCase} */(jspb.Message.computeOneofCase(this, proto.nitric.deploy.v1.DeployDownEvent.oneofGroups_[0])); -}; - - - -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.nitric.deploy.v1.DeployDownEvent.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.deploy.v1.DeployDownEvent.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.nitric.deploy.v1.DeployDownEvent} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.DeployDownEvent.toObject = function(includeInstance, msg) { - var f, obj = { - message: (f = msg.getMessage()) && proto.nitric.deploy.v1.DeployEventMessage.toObject(includeInstance, f), - result: (f = msg.getResult()) && proto.nitric.deploy.v1.DeployDownEventResult.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.nitric.deploy.v1.DeployDownEvent} - */ -proto.nitric.deploy.v1.DeployDownEvent.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.deploy.v1.DeployDownEvent; - return proto.nitric.deploy.v1.DeployDownEvent.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.deploy.v1.DeployDownEvent} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.deploy.v1.DeployDownEvent} - */ -proto.nitric.deploy.v1.DeployDownEvent.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nitric.deploy.v1.DeployEventMessage; - reader.readMessage(value,proto.nitric.deploy.v1.DeployEventMessage.deserializeBinaryFromReader); - msg.setMessage(value); - break; - case 2: - var value = new proto.nitric.deploy.v1.DeployDownEventResult; - reader.readMessage(value,proto.nitric.deploy.v1.DeployDownEventResult.deserializeBinaryFromReader); - msg.setResult(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.deploy.v1.DeployDownEvent.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.deploy.v1.DeployDownEvent.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.deploy.v1.DeployDownEvent} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.DeployDownEvent.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getMessage(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.nitric.deploy.v1.DeployEventMessage.serializeBinaryToWriter - ); - } - f = message.getResult(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.nitric.deploy.v1.DeployDownEventResult.serializeBinaryToWriter - ); - } -}; - - -/** - * optional DeployEventMessage message = 1; - * @return {?proto.nitric.deploy.v1.DeployEventMessage} - */ -proto.nitric.deploy.v1.DeployDownEvent.prototype.getMessage = function() { - return /** @type{?proto.nitric.deploy.v1.DeployEventMessage} */ ( - jspb.Message.getWrapperField(this, proto.nitric.deploy.v1.DeployEventMessage, 1)); -}; - - -/** - * @param {?proto.nitric.deploy.v1.DeployEventMessage|undefined} value - * @return {!proto.nitric.deploy.v1.DeployDownEvent} returns this -*/ -proto.nitric.deploy.v1.DeployDownEvent.prototype.setMessage = function(value) { - return jspb.Message.setOneofWrapperField(this, 1, proto.nitric.deploy.v1.DeployDownEvent.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.deploy.v1.DeployDownEvent} returns this - */ -proto.nitric.deploy.v1.DeployDownEvent.prototype.clearMessage = function() { - return this.setMessage(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.deploy.v1.DeployDownEvent.prototype.hasMessage = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional DeployDownEventResult result = 2; - * @return {?proto.nitric.deploy.v1.DeployDownEventResult} - */ -proto.nitric.deploy.v1.DeployDownEvent.prototype.getResult = function() { - return /** @type{?proto.nitric.deploy.v1.DeployDownEventResult} */ ( - jspb.Message.getWrapperField(this, proto.nitric.deploy.v1.DeployDownEventResult, 2)); -}; - - -/** - * @param {?proto.nitric.deploy.v1.DeployDownEventResult|undefined} value - * @return {!proto.nitric.deploy.v1.DeployDownEvent} returns this -*/ -proto.nitric.deploy.v1.DeployDownEvent.prototype.setResult = function(value) { - return jspb.Message.setOneofWrapperField(this, 2, proto.nitric.deploy.v1.DeployDownEvent.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.deploy.v1.DeployDownEvent} returns this - */ -proto.nitric.deploy.v1.DeployDownEvent.prototype.clearResult = function() { - return this.setResult(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.deploy.v1.DeployDownEvent.prototype.hasResult = 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.nitric.deploy.v1.DeployDownEventResult.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.deploy.v1.DeployDownEventResult.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.nitric.deploy.v1.DeployDownEventResult} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.DeployDownEventResult.toObject = function(includeInstance, msg) { - var f, obj = { - - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.deploy.v1.DeployDownEventResult} - */ -proto.nitric.deploy.v1.DeployDownEventResult.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.deploy.v1.DeployDownEventResult; - return proto.nitric.deploy.v1.DeployDownEventResult.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.deploy.v1.DeployDownEventResult} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.deploy.v1.DeployDownEventResult} - */ -proto.nitric.deploy.v1.DeployDownEventResult.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.deploy.v1.DeployDownEventResult.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.deploy.v1.DeployDownEventResult.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.deploy.v1.DeployDownEventResult} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.DeployDownEventResult.serializeBinaryToWriter = function(message, writer) { - var f = undefined; -}; - - - - - -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.nitric.deploy.v1.ImageSource.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.deploy.v1.ImageSource.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.nitric.deploy.v1.ImageSource} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.ImageSource.toObject = function(includeInstance, msg) { - var f, obj = { - uri: 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.nitric.deploy.v1.ImageSource} - */ -proto.nitric.deploy.v1.ImageSource.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.deploy.v1.ImageSource; - return proto.nitric.deploy.v1.ImageSource.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.deploy.v1.ImageSource} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.deploy.v1.ImageSource} - */ -proto.nitric.deploy.v1.ImageSource.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.setUri(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.deploy.v1.ImageSource.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.deploy.v1.ImageSource.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.deploy.v1.ImageSource} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.ImageSource.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getUri(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string uri = 1; - * @return {string} - */ -proto.nitric.deploy.v1.ImageSource.prototype.getUri = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.deploy.v1.ImageSource} returns this - */ -proto.nitric.deploy.v1.ImageSource.prototype.setUri = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.nitric.deploy.v1.ExecutionUnit.oneofGroups_ = [[1]]; - -/** - * @enum {number} - */ -proto.nitric.deploy.v1.ExecutionUnit.SourceCase = { - SOURCE_NOT_SET: 0, - IMAGE: 1 -}; - -/** - * @return {proto.nitric.deploy.v1.ExecutionUnit.SourceCase} - */ -proto.nitric.deploy.v1.ExecutionUnit.prototype.getSourceCase = function() { - return /** @type {proto.nitric.deploy.v1.ExecutionUnit.SourceCase} */(jspb.Message.computeOneofCase(this, proto.nitric.deploy.v1.ExecutionUnit.oneofGroups_[0])); -}; - - - -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.nitric.deploy.v1.ExecutionUnit.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.deploy.v1.ExecutionUnit.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.nitric.deploy.v1.ExecutionUnit} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.ExecutionUnit.toObject = function(includeInstance, msg) { - var f, obj = { - image: (f = msg.getImage()) && proto.nitric.deploy.v1.ImageSource.toObject(includeInstance, f), - workers: jspb.Message.getFieldWithDefault(msg, 10, 0), - timeout: jspb.Message.getFieldWithDefault(msg, 11, 0), - memory: jspb.Message.getFieldWithDefault(msg, 12, 0), - type: jspb.Message.getFieldWithDefault(msg, 13, ""), - envMap: (f = msg.getEnvMap()) ? 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.nitric.deploy.v1.ExecutionUnit} - */ -proto.nitric.deploy.v1.ExecutionUnit.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.deploy.v1.ExecutionUnit; - return proto.nitric.deploy.v1.ExecutionUnit.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.deploy.v1.ExecutionUnit} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.deploy.v1.ExecutionUnit} - */ -proto.nitric.deploy.v1.ExecutionUnit.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nitric.deploy.v1.ImageSource; - reader.readMessage(value,proto.nitric.deploy.v1.ImageSource.deserializeBinaryFromReader); - msg.setImage(value); - break; - case 10: - var value = /** @type {number} */ (reader.readInt32()); - msg.setWorkers(value); - break; - case 11: - var value = /** @type {number} */ (reader.readInt32()); - msg.setTimeout(value); - break; - case 12: - var value = /** @type {number} */ (reader.readInt32()); - msg.setMemory(value); - break; - case 13: - var value = /** @type {string} */ (reader.readString()); - msg.setType(value); - break; - case 14: - var value = msg.getEnvMap(); - 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.nitric.deploy.v1.ExecutionUnit.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.deploy.v1.ExecutionUnit.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.deploy.v1.ExecutionUnit} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.ExecutionUnit.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getImage(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.nitric.deploy.v1.ImageSource.serializeBinaryToWriter - ); - } - f = message.getWorkers(); - if (f !== 0) { - writer.writeInt32( - 10, - f - ); - } - f = message.getTimeout(); - if (f !== 0) { - writer.writeInt32( - 11, - f - ); - } - f = message.getMemory(); - if (f !== 0) { - writer.writeInt32( - 12, - f - ); - } - f = message.getType(); - if (f.length > 0) { - writer.writeString( - 13, - f - ); - } - f = message.getEnvMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(14, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); - } -}; - - -/** - * optional ImageSource image = 1; - * @return {?proto.nitric.deploy.v1.ImageSource} - */ -proto.nitric.deploy.v1.ExecutionUnit.prototype.getImage = function() { - return /** @type{?proto.nitric.deploy.v1.ImageSource} */ ( - jspb.Message.getWrapperField(this, proto.nitric.deploy.v1.ImageSource, 1)); -}; - - -/** - * @param {?proto.nitric.deploy.v1.ImageSource|undefined} value - * @return {!proto.nitric.deploy.v1.ExecutionUnit} returns this -*/ -proto.nitric.deploy.v1.ExecutionUnit.prototype.setImage = function(value) { - return jspb.Message.setOneofWrapperField(this, 1, proto.nitric.deploy.v1.ExecutionUnit.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.deploy.v1.ExecutionUnit} returns this - */ -proto.nitric.deploy.v1.ExecutionUnit.prototype.clearImage = function() { - return this.setImage(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.deploy.v1.ExecutionUnit.prototype.hasImage = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional int32 workers = 10; - * @return {number} - */ -proto.nitric.deploy.v1.ExecutionUnit.prototype.getWorkers = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 10, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.nitric.deploy.v1.ExecutionUnit} returns this - */ -proto.nitric.deploy.v1.ExecutionUnit.prototype.setWorkers = function(value) { - return jspb.Message.setProto3IntField(this, 10, value); -}; - - -/** - * optional int32 timeout = 11; - * @return {number} - */ -proto.nitric.deploy.v1.ExecutionUnit.prototype.getTimeout = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 11, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.nitric.deploy.v1.ExecutionUnit} returns this - */ -proto.nitric.deploy.v1.ExecutionUnit.prototype.setTimeout = function(value) { - return jspb.Message.setProto3IntField(this, 11, value); -}; - - -/** - * optional int32 memory = 12; - * @return {number} - */ -proto.nitric.deploy.v1.ExecutionUnit.prototype.getMemory = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 12, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.nitric.deploy.v1.ExecutionUnit} returns this - */ -proto.nitric.deploy.v1.ExecutionUnit.prototype.setMemory = function(value) { - return jspb.Message.setProto3IntField(this, 12, value); -}; - - -/** - * optional string type = 13; - * @return {string} - */ -proto.nitric.deploy.v1.ExecutionUnit.prototype.getType = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 13, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.deploy.v1.ExecutionUnit} returns this - */ -proto.nitric.deploy.v1.ExecutionUnit.prototype.setType = function(value) { - return jspb.Message.setProto3StringField(this, 13, value); -}; - - -/** - * map env = 14; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.nitric.deploy.v1.ExecutionUnit.prototype.getEnvMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 14, opt_noLazyCreate, - null)); -}; - - -/** - * Clears values from the map. The map will be non-null. - * @return {!proto.nitric.deploy.v1.ExecutionUnit} returns this - */ -proto.nitric.deploy.v1.ExecutionUnit.prototype.clearEnvMap = function() { - this.getEnvMap().clear(); - return this;}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.nitric.deploy.v1.Bucket.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.nitric.deploy.v1.Bucket.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.deploy.v1.Bucket.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.nitric.deploy.v1.Bucket} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.Bucket.toObject = function(includeInstance, msg) { - var f, obj = { - notificationsList: jspb.Message.toObjectList(msg.getNotificationsList(), - proto.nitric.deploy.v1.BucketNotificationTarget.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.nitric.deploy.v1.Bucket} - */ -proto.nitric.deploy.v1.Bucket.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.deploy.v1.Bucket; - return proto.nitric.deploy.v1.Bucket.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.deploy.v1.Bucket} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.deploy.v1.Bucket} - */ -proto.nitric.deploy.v1.Bucket.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nitric.deploy.v1.BucketNotificationTarget; - reader.readMessage(value,proto.nitric.deploy.v1.BucketNotificationTarget.deserializeBinaryFromReader); - msg.addNotifications(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.deploy.v1.Bucket.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.deploy.v1.Bucket.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.deploy.v1.Bucket} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.Bucket.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getNotificationsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.nitric.deploy.v1.BucketNotificationTarget.serializeBinaryToWriter - ); - } -}; - - -/** - * repeated BucketNotificationTarget notifications = 1; - * @return {!Array} - */ -proto.nitric.deploy.v1.Bucket.prototype.getNotificationsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.nitric.deploy.v1.BucketNotificationTarget, 1)); -}; - - -/** - * @param {!Array} value - * @return {!proto.nitric.deploy.v1.Bucket} returns this -*/ -proto.nitric.deploy.v1.Bucket.prototype.setNotificationsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 1, value); -}; - - -/** - * @param {!proto.nitric.deploy.v1.BucketNotificationTarget=} opt_value - * @param {number=} opt_index - * @return {!proto.nitric.deploy.v1.BucketNotificationTarget} - */ -proto.nitric.deploy.v1.Bucket.prototype.addNotifications = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.nitric.deploy.v1.BucketNotificationTarget, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.nitric.deploy.v1.Bucket} returns this - */ -proto.nitric.deploy.v1.Bucket.prototype.clearNotificationsList = function() { - return this.setNotificationsList([]); -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.nitric.deploy.v1.BucketNotificationTarget.oneofGroups_ = [[2]]; - -/** - * @enum {number} - */ -proto.nitric.deploy.v1.BucketNotificationTarget.TargetCase = { - TARGET_NOT_SET: 0, - EXECUTION_UNIT: 2 -}; - -/** - * @return {proto.nitric.deploy.v1.BucketNotificationTarget.TargetCase} - */ -proto.nitric.deploy.v1.BucketNotificationTarget.prototype.getTargetCase = function() { - return /** @type {proto.nitric.deploy.v1.BucketNotificationTarget.TargetCase} */(jspb.Message.computeOneofCase(this, proto.nitric.deploy.v1.BucketNotificationTarget.oneofGroups_[0])); -}; - - - -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.nitric.deploy.v1.BucketNotificationTarget.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.deploy.v1.BucketNotificationTarget.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.nitric.deploy.v1.BucketNotificationTarget} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.BucketNotificationTarget.toObject = function(includeInstance, msg) { - var f, obj = { - config: (f = msg.getConfig()) && proto_faas_v1_faas_pb.BucketNotificationConfig.toObject(includeInstance, f), - executionUnit: 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.nitric.deploy.v1.BucketNotificationTarget} - */ -proto.nitric.deploy.v1.BucketNotificationTarget.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.deploy.v1.BucketNotificationTarget; - return proto.nitric.deploy.v1.BucketNotificationTarget.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.deploy.v1.BucketNotificationTarget} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.deploy.v1.BucketNotificationTarget} - */ -proto.nitric.deploy.v1.BucketNotificationTarget.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto_faas_v1_faas_pb.BucketNotificationConfig; - reader.readMessage(value,proto_faas_v1_faas_pb.BucketNotificationConfig.deserializeBinaryFromReader); - msg.setConfig(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setExecutionUnit(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.deploy.v1.BucketNotificationTarget.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.deploy.v1.BucketNotificationTarget.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.deploy.v1.BucketNotificationTarget} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.BucketNotificationTarget.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getConfig(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto_faas_v1_faas_pb.BucketNotificationConfig.serializeBinaryToWriter - ); - } - f = /** @type {string} */ (jspb.Message.getField(message, 2)); - if (f != null) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional nitric.faas.v1.BucketNotificationConfig config = 1; - * @return {?proto.nitric.faas.v1.BucketNotificationConfig} - */ -proto.nitric.deploy.v1.BucketNotificationTarget.prototype.getConfig = function() { - return /** @type{?proto.nitric.faas.v1.BucketNotificationConfig} */ ( - jspb.Message.getWrapperField(this, proto_faas_v1_faas_pb.BucketNotificationConfig, 1)); -}; - - -/** - * @param {?proto.nitric.faas.v1.BucketNotificationConfig|undefined} value - * @return {!proto.nitric.deploy.v1.BucketNotificationTarget} returns this -*/ -proto.nitric.deploy.v1.BucketNotificationTarget.prototype.setConfig = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.deploy.v1.BucketNotificationTarget} returns this - */ -proto.nitric.deploy.v1.BucketNotificationTarget.prototype.clearConfig = function() { - return this.setConfig(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.deploy.v1.BucketNotificationTarget.prototype.hasConfig = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional string execution_unit = 2; - * @return {string} - */ -proto.nitric.deploy.v1.BucketNotificationTarget.prototype.getExecutionUnit = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.deploy.v1.BucketNotificationTarget} returns this - */ -proto.nitric.deploy.v1.BucketNotificationTarget.prototype.setExecutionUnit = function(value) { - return jspb.Message.setOneofField(this, 2, proto.nitric.deploy.v1.BucketNotificationTarget.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.nitric.deploy.v1.BucketNotificationTarget} returns this - */ -proto.nitric.deploy.v1.BucketNotificationTarget.prototype.clearExecutionUnit = function() { - return jspb.Message.setOneofField(this, 2, proto.nitric.deploy.v1.BucketNotificationTarget.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.deploy.v1.BucketNotificationTarget.prototype.hasExecutionUnit = function() { - return jspb.Message.getField(this, 2) != null; -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.nitric.deploy.v1.Topic.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.nitric.deploy.v1.Topic.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.deploy.v1.Topic.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.nitric.deploy.v1.Topic} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.Topic.toObject = function(includeInstance, msg) { - var f, obj = { - subscriptionsList: jspb.Message.toObjectList(msg.getSubscriptionsList(), - proto.nitric.deploy.v1.SubscriptionTarget.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.nitric.deploy.v1.Topic} - */ -proto.nitric.deploy.v1.Topic.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.deploy.v1.Topic; - return proto.nitric.deploy.v1.Topic.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.deploy.v1.Topic} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.deploy.v1.Topic} - */ -proto.nitric.deploy.v1.Topic.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nitric.deploy.v1.SubscriptionTarget; - reader.readMessage(value,proto.nitric.deploy.v1.SubscriptionTarget.deserializeBinaryFromReader); - msg.addSubscriptions(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.deploy.v1.Topic.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.deploy.v1.Topic.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.deploy.v1.Topic} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.Topic.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getSubscriptionsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.nitric.deploy.v1.SubscriptionTarget.serializeBinaryToWriter - ); - } -}; - - -/** - * repeated SubscriptionTarget subscriptions = 1; - * @return {!Array} - */ -proto.nitric.deploy.v1.Topic.prototype.getSubscriptionsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.nitric.deploy.v1.SubscriptionTarget, 1)); -}; - - -/** - * @param {!Array} value - * @return {!proto.nitric.deploy.v1.Topic} returns this -*/ -proto.nitric.deploy.v1.Topic.prototype.setSubscriptionsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 1, value); -}; - - -/** - * @param {!proto.nitric.deploy.v1.SubscriptionTarget=} opt_value - * @param {number=} opt_index - * @return {!proto.nitric.deploy.v1.SubscriptionTarget} - */ -proto.nitric.deploy.v1.Topic.prototype.addSubscriptions = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.nitric.deploy.v1.SubscriptionTarget, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.nitric.deploy.v1.Topic} returns this - */ -proto.nitric.deploy.v1.Topic.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.nitric.deploy.v1.Queue.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.deploy.v1.Queue.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.nitric.deploy.v1.Queue} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.Queue.toObject = function(includeInstance, msg) { - var f, obj = { - - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.deploy.v1.Queue} - */ -proto.nitric.deploy.v1.Queue.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.deploy.v1.Queue; - return proto.nitric.deploy.v1.Queue.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.deploy.v1.Queue} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.deploy.v1.Queue} - */ -proto.nitric.deploy.v1.Queue.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.deploy.v1.Queue.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.deploy.v1.Queue.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.deploy.v1.Queue} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.Queue.serializeBinaryToWriter = function(message, writer) { - var f = undefined; -}; - - - - - -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.nitric.deploy.v1.Collection.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.deploy.v1.Collection.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.nitric.deploy.v1.Collection} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.Collection.toObject = function(includeInstance, msg) { - var f, obj = { - - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.deploy.v1.Collection} - */ -proto.nitric.deploy.v1.Collection.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.deploy.v1.Collection; - return proto.nitric.deploy.v1.Collection.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.deploy.v1.Collection} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.deploy.v1.Collection} - */ -proto.nitric.deploy.v1.Collection.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.deploy.v1.Collection.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.deploy.v1.Collection.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.deploy.v1.Collection} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.Collection.serializeBinaryToWriter = function(message, writer) { - var f = undefined; -}; - - - - - -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.nitric.deploy.v1.Secret.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.deploy.v1.Secret.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.nitric.deploy.v1.Secret} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.Secret.toObject = function(includeInstance, msg) { - var f, obj = { - - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.deploy.v1.Secret} - */ -proto.nitric.deploy.v1.Secret.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.deploy.v1.Secret; - return proto.nitric.deploy.v1.Secret.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.deploy.v1.Secret} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.deploy.v1.Secret} - */ -proto.nitric.deploy.v1.Secret.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.deploy.v1.Secret.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.deploy.v1.Secret.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.deploy.v1.Secret} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.Secret.serializeBinaryToWriter = function(message, writer) { - var f = undefined; -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.nitric.deploy.v1.SubscriptionTarget.oneofGroups_ = [[1]]; - -/** - * @enum {number} - */ -proto.nitric.deploy.v1.SubscriptionTarget.TargetCase = { - TARGET_NOT_SET: 0, - EXECUTION_UNIT: 1 -}; - -/** - * @return {proto.nitric.deploy.v1.SubscriptionTarget.TargetCase} - */ -proto.nitric.deploy.v1.SubscriptionTarget.prototype.getTargetCase = function() { - return /** @type {proto.nitric.deploy.v1.SubscriptionTarget.TargetCase} */(jspb.Message.computeOneofCase(this, proto.nitric.deploy.v1.SubscriptionTarget.oneofGroups_[0])); -}; - - - -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.nitric.deploy.v1.SubscriptionTarget.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.deploy.v1.SubscriptionTarget.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.nitric.deploy.v1.SubscriptionTarget} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.SubscriptionTarget.toObject = function(includeInstance, msg) { - var f, obj = { - executionUnit: 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.nitric.deploy.v1.SubscriptionTarget} - */ -proto.nitric.deploy.v1.SubscriptionTarget.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.deploy.v1.SubscriptionTarget; - return proto.nitric.deploy.v1.SubscriptionTarget.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.deploy.v1.SubscriptionTarget} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.deploy.v1.SubscriptionTarget} - */ -proto.nitric.deploy.v1.SubscriptionTarget.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.setExecutionUnit(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.deploy.v1.SubscriptionTarget.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.deploy.v1.SubscriptionTarget.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.deploy.v1.SubscriptionTarget} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.SubscriptionTarget.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {string} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string execution_unit = 1; - * @return {string} - */ -proto.nitric.deploy.v1.SubscriptionTarget.prototype.getExecutionUnit = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.deploy.v1.SubscriptionTarget} returns this - */ -proto.nitric.deploy.v1.SubscriptionTarget.prototype.setExecutionUnit = function(value) { - return jspb.Message.setOneofField(this, 1, proto.nitric.deploy.v1.SubscriptionTarget.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.nitric.deploy.v1.SubscriptionTarget} returns this - */ -proto.nitric.deploy.v1.SubscriptionTarget.prototype.clearExecutionUnit = function() { - return jspb.Message.setOneofField(this, 1, proto.nitric.deploy.v1.SubscriptionTarget.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.deploy.v1.SubscriptionTarget.prototype.hasExecutionUnit = 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.nitric.deploy.v1.TopicSubscription.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.deploy.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.nitric.deploy.v1.TopicSubscription} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.TopicSubscription.toObject = function(includeInstance, msg) { - var f, obj = { - target: (f = msg.getTarget()) && proto.nitric.deploy.v1.SubscriptionTarget.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.nitric.deploy.v1.TopicSubscription} - */ -proto.nitric.deploy.v1.TopicSubscription.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.deploy.v1.TopicSubscription; - return proto.nitric.deploy.v1.TopicSubscription.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.deploy.v1.TopicSubscription} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.deploy.v1.TopicSubscription} - */ -proto.nitric.deploy.v1.TopicSubscription.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nitric.deploy.v1.SubscriptionTarget; - reader.readMessage(value,proto.nitric.deploy.v1.SubscriptionTarget.deserializeBinaryFromReader); - msg.setTarget(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.deploy.v1.TopicSubscription.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.deploy.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.nitric.deploy.v1.TopicSubscription} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.TopicSubscription.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getTarget(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.nitric.deploy.v1.SubscriptionTarget.serializeBinaryToWriter - ); - } -}; - - -/** - * optional SubscriptionTarget target = 1; - * @return {?proto.nitric.deploy.v1.SubscriptionTarget} - */ -proto.nitric.deploy.v1.TopicSubscription.prototype.getTarget = function() { - return /** @type{?proto.nitric.deploy.v1.SubscriptionTarget} */ ( - jspb.Message.getWrapperField(this, proto.nitric.deploy.v1.SubscriptionTarget, 1)); -}; - - -/** - * @param {?proto.nitric.deploy.v1.SubscriptionTarget|undefined} value - * @return {!proto.nitric.deploy.v1.TopicSubscription} returns this -*/ -proto.nitric.deploy.v1.TopicSubscription.prototype.setTarget = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.deploy.v1.TopicSubscription} returns this - */ -proto.nitric.deploy.v1.TopicSubscription.prototype.clearTarget = function() { - return this.setTarget(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.deploy.v1.TopicSubscription.prototype.hasTarget = function() { - return jspb.Message.getField(this, 1) != null; -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.nitric.deploy.v1.HttpTarget.oneofGroups_ = [[1]]; - -/** - * @enum {number} - */ -proto.nitric.deploy.v1.HttpTarget.TargetCase = { - TARGET_NOT_SET: 0, - EXECUTION_UNIT: 1 -}; - -/** - * @return {proto.nitric.deploy.v1.HttpTarget.TargetCase} - */ -proto.nitric.deploy.v1.HttpTarget.prototype.getTargetCase = function() { - return /** @type {proto.nitric.deploy.v1.HttpTarget.TargetCase} */(jspb.Message.computeOneofCase(this, proto.nitric.deploy.v1.HttpTarget.oneofGroups_[0])); -}; - - - -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.nitric.deploy.v1.HttpTarget.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.deploy.v1.HttpTarget.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.nitric.deploy.v1.HttpTarget} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.HttpTarget.toObject = function(includeInstance, msg) { - var f, obj = { - executionUnit: 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.nitric.deploy.v1.HttpTarget} - */ -proto.nitric.deploy.v1.HttpTarget.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.deploy.v1.HttpTarget; - return proto.nitric.deploy.v1.HttpTarget.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.deploy.v1.HttpTarget} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.deploy.v1.HttpTarget} - */ -proto.nitric.deploy.v1.HttpTarget.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.setExecutionUnit(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.deploy.v1.HttpTarget.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.deploy.v1.HttpTarget.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.deploy.v1.HttpTarget} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.HttpTarget.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {string} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string execution_unit = 1; - * @return {string} - */ -proto.nitric.deploy.v1.HttpTarget.prototype.getExecutionUnit = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.deploy.v1.HttpTarget} returns this - */ -proto.nitric.deploy.v1.HttpTarget.prototype.setExecutionUnit = function(value) { - return jspb.Message.setOneofField(this, 1, proto.nitric.deploy.v1.HttpTarget.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.nitric.deploy.v1.HttpTarget} returns this - */ -proto.nitric.deploy.v1.HttpTarget.prototype.clearExecutionUnit = function() { - return jspb.Message.setOneofField(this, 1, proto.nitric.deploy.v1.HttpTarget.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.deploy.v1.HttpTarget.prototype.hasExecutionUnit = 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.nitric.deploy.v1.Http.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.deploy.v1.Http.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.nitric.deploy.v1.Http} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.Http.toObject = function(includeInstance, msg) { - var f, obj = { - target: (f = msg.getTarget()) && proto.nitric.deploy.v1.HttpTarget.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.nitric.deploy.v1.Http} - */ -proto.nitric.deploy.v1.Http.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.deploy.v1.Http; - return proto.nitric.deploy.v1.Http.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.deploy.v1.Http} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.deploy.v1.Http} - */ -proto.nitric.deploy.v1.Http.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nitric.deploy.v1.HttpTarget; - reader.readMessage(value,proto.nitric.deploy.v1.HttpTarget.deserializeBinaryFromReader); - msg.setTarget(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.deploy.v1.Http.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.deploy.v1.Http.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.deploy.v1.Http} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.Http.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getTarget(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.nitric.deploy.v1.HttpTarget.serializeBinaryToWriter - ); - } -}; - - -/** - * optional HttpTarget target = 1; - * @return {?proto.nitric.deploy.v1.HttpTarget} - */ -proto.nitric.deploy.v1.Http.prototype.getTarget = function() { - return /** @type{?proto.nitric.deploy.v1.HttpTarget} */ ( - jspb.Message.getWrapperField(this, proto.nitric.deploy.v1.HttpTarget, 1)); -}; - - -/** - * @param {?proto.nitric.deploy.v1.HttpTarget|undefined} value - * @return {!proto.nitric.deploy.v1.Http} returns this -*/ -proto.nitric.deploy.v1.Http.prototype.setTarget = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.deploy.v1.Http} returns this - */ -proto.nitric.deploy.v1.Http.prototype.clearTarget = function() { - return this.setTarget(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.deploy.v1.Http.prototype.hasTarget = function() { - return jspb.Message.getField(this, 1) != null; -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.nitric.deploy.v1.Api.oneofGroups_ = [[1]]; - -/** - * @enum {number} - */ -proto.nitric.deploy.v1.Api.DocumentCase = { - DOCUMENT_NOT_SET: 0, - OPENAPI: 1 -}; - -/** - * @return {proto.nitric.deploy.v1.Api.DocumentCase} - */ -proto.nitric.deploy.v1.Api.prototype.getDocumentCase = function() { - return /** @type {proto.nitric.deploy.v1.Api.DocumentCase} */(jspb.Message.computeOneofCase(this, proto.nitric.deploy.v1.Api.oneofGroups_[0])); -}; - - - -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.nitric.deploy.v1.Api.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.deploy.v1.Api.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.nitric.deploy.v1.Api} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.Api.toObject = function(includeInstance, msg) { - var f, obj = { - openapi: 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.nitric.deploy.v1.Api} - */ -proto.nitric.deploy.v1.Api.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.deploy.v1.Api; - return proto.nitric.deploy.v1.Api.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.deploy.v1.Api} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.deploy.v1.Api} - */ -proto.nitric.deploy.v1.Api.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.setOpenapi(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.deploy.v1.Api.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.deploy.v1.Api.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.deploy.v1.Api} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.Api.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {string} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string openapi = 1; - * @return {string} - */ -proto.nitric.deploy.v1.Api.prototype.getOpenapi = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.deploy.v1.Api} returns this - */ -proto.nitric.deploy.v1.Api.prototype.setOpenapi = function(value) { - return jspb.Message.setOneofField(this, 1, proto.nitric.deploy.v1.Api.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.nitric.deploy.v1.Api} returns this - */ -proto.nitric.deploy.v1.Api.prototype.clearOpenapi = function() { - return jspb.Message.setOneofField(this, 1, proto.nitric.deploy.v1.Api.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.deploy.v1.Api.prototype.hasOpenapi = 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.nitric.deploy.v1.Websocket.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.deploy.v1.Websocket.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.nitric.deploy.v1.Websocket} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.Websocket.toObject = function(includeInstance, msg) { - var f, obj = { - connectTarget: (f = msg.getConnectTarget()) && proto.nitric.deploy.v1.WebsocketTarget.toObject(includeInstance, f), - disconnectTarget: (f = msg.getDisconnectTarget()) && proto.nitric.deploy.v1.WebsocketTarget.toObject(includeInstance, f), - messageTarget: (f = msg.getMessageTarget()) && proto.nitric.deploy.v1.WebsocketTarget.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.nitric.deploy.v1.Websocket} - */ -proto.nitric.deploy.v1.Websocket.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.deploy.v1.Websocket; - return proto.nitric.deploy.v1.Websocket.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.deploy.v1.Websocket} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.deploy.v1.Websocket} - */ -proto.nitric.deploy.v1.Websocket.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nitric.deploy.v1.WebsocketTarget; - reader.readMessage(value,proto.nitric.deploy.v1.WebsocketTarget.deserializeBinaryFromReader); - msg.setConnectTarget(value); - break; - case 2: - var value = new proto.nitric.deploy.v1.WebsocketTarget; - reader.readMessage(value,proto.nitric.deploy.v1.WebsocketTarget.deserializeBinaryFromReader); - msg.setDisconnectTarget(value); - break; - case 3: - var value = new proto.nitric.deploy.v1.WebsocketTarget; - reader.readMessage(value,proto.nitric.deploy.v1.WebsocketTarget.deserializeBinaryFromReader); - msg.setMessageTarget(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.deploy.v1.Websocket.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.deploy.v1.Websocket.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.deploy.v1.Websocket} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.Websocket.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getConnectTarget(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.nitric.deploy.v1.WebsocketTarget.serializeBinaryToWriter - ); - } - f = message.getDisconnectTarget(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.nitric.deploy.v1.WebsocketTarget.serializeBinaryToWriter - ); - } - f = message.getMessageTarget(); - if (f != null) { - writer.writeMessage( - 3, - f, - proto.nitric.deploy.v1.WebsocketTarget.serializeBinaryToWriter - ); - } -}; - - -/** - * optional WebsocketTarget connect_target = 1; - * @return {?proto.nitric.deploy.v1.WebsocketTarget} - */ -proto.nitric.deploy.v1.Websocket.prototype.getConnectTarget = function() { - return /** @type{?proto.nitric.deploy.v1.WebsocketTarget} */ ( - jspb.Message.getWrapperField(this, proto.nitric.deploy.v1.WebsocketTarget, 1)); -}; - - -/** - * @param {?proto.nitric.deploy.v1.WebsocketTarget|undefined} value - * @return {!proto.nitric.deploy.v1.Websocket} returns this -*/ -proto.nitric.deploy.v1.Websocket.prototype.setConnectTarget = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.deploy.v1.Websocket} returns this - */ -proto.nitric.deploy.v1.Websocket.prototype.clearConnectTarget = function() { - return this.setConnectTarget(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.deploy.v1.Websocket.prototype.hasConnectTarget = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional WebsocketTarget disconnect_target = 2; - * @return {?proto.nitric.deploy.v1.WebsocketTarget} - */ -proto.nitric.deploy.v1.Websocket.prototype.getDisconnectTarget = function() { - return /** @type{?proto.nitric.deploy.v1.WebsocketTarget} */ ( - jspb.Message.getWrapperField(this, proto.nitric.deploy.v1.WebsocketTarget, 2)); -}; - - -/** - * @param {?proto.nitric.deploy.v1.WebsocketTarget|undefined} value - * @return {!proto.nitric.deploy.v1.Websocket} returns this -*/ -proto.nitric.deploy.v1.Websocket.prototype.setDisconnectTarget = function(value) { - return jspb.Message.setWrapperField(this, 2, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.deploy.v1.Websocket} returns this - */ -proto.nitric.deploy.v1.Websocket.prototype.clearDisconnectTarget = function() { - return this.setDisconnectTarget(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.deploy.v1.Websocket.prototype.hasDisconnectTarget = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional WebsocketTarget message_target = 3; - * @return {?proto.nitric.deploy.v1.WebsocketTarget} - */ -proto.nitric.deploy.v1.Websocket.prototype.getMessageTarget = function() { - return /** @type{?proto.nitric.deploy.v1.WebsocketTarget} */ ( - jspb.Message.getWrapperField(this, proto.nitric.deploy.v1.WebsocketTarget, 3)); -}; - - -/** - * @param {?proto.nitric.deploy.v1.WebsocketTarget|undefined} value - * @return {!proto.nitric.deploy.v1.Websocket} returns this -*/ -proto.nitric.deploy.v1.Websocket.prototype.setMessageTarget = function(value) { - return jspb.Message.setWrapperField(this, 3, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.deploy.v1.Websocket} returns this - */ -proto.nitric.deploy.v1.Websocket.prototype.clearMessageTarget = function() { - return this.setMessageTarget(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.deploy.v1.Websocket.prototype.hasMessageTarget = function() { - return jspb.Message.getField(this, 3) != null; -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.nitric.deploy.v1.WebsocketTarget.oneofGroups_ = [[1]]; - -/** - * @enum {number} - */ -proto.nitric.deploy.v1.WebsocketTarget.TargetCase = { - TARGET_NOT_SET: 0, - EXECUTION_UNIT: 1 -}; - -/** - * @return {proto.nitric.deploy.v1.WebsocketTarget.TargetCase} - */ -proto.nitric.deploy.v1.WebsocketTarget.prototype.getTargetCase = function() { - return /** @type {proto.nitric.deploy.v1.WebsocketTarget.TargetCase} */(jspb.Message.computeOneofCase(this, proto.nitric.deploy.v1.WebsocketTarget.oneofGroups_[0])); -}; - - - -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.nitric.deploy.v1.WebsocketTarget.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.deploy.v1.WebsocketTarget.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.nitric.deploy.v1.WebsocketTarget} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.WebsocketTarget.toObject = function(includeInstance, msg) { - var f, obj = { - executionUnit: 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.nitric.deploy.v1.WebsocketTarget} - */ -proto.nitric.deploy.v1.WebsocketTarget.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.deploy.v1.WebsocketTarget; - return proto.nitric.deploy.v1.WebsocketTarget.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.deploy.v1.WebsocketTarget} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.deploy.v1.WebsocketTarget} - */ -proto.nitric.deploy.v1.WebsocketTarget.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.setExecutionUnit(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.deploy.v1.WebsocketTarget.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.deploy.v1.WebsocketTarget.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.deploy.v1.WebsocketTarget} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.WebsocketTarget.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {string} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string execution_unit = 1; - * @return {string} - */ -proto.nitric.deploy.v1.WebsocketTarget.prototype.getExecutionUnit = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.deploy.v1.WebsocketTarget} returns this - */ -proto.nitric.deploy.v1.WebsocketTarget.prototype.setExecutionUnit = function(value) { - return jspb.Message.setOneofField(this, 1, proto.nitric.deploy.v1.WebsocketTarget.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.nitric.deploy.v1.WebsocketTarget} returns this - */ -proto.nitric.deploy.v1.WebsocketTarget.prototype.clearExecutionUnit = function() { - return jspb.Message.setOneofField(this, 1, proto.nitric.deploy.v1.WebsocketTarget.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.deploy.v1.WebsocketTarget.prototype.hasExecutionUnit = function() { - return jspb.Message.getField(this, 1) != null; -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.nitric.deploy.v1.ScheduleTarget.oneofGroups_ = [[1]]; - -/** - * @enum {number} - */ -proto.nitric.deploy.v1.ScheduleTarget.TargetCase = { - TARGET_NOT_SET: 0, - EXECUTION_UNIT: 1 -}; - -/** - * @return {proto.nitric.deploy.v1.ScheduleTarget.TargetCase} - */ -proto.nitric.deploy.v1.ScheduleTarget.prototype.getTargetCase = function() { - return /** @type {proto.nitric.deploy.v1.ScheduleTarget.TargetCase} */(jspb.Message.computeOneofCase(this, proto.nitric.deploy.v1.ScheduleTarget.oneofGroups_[0])); -}; - - - -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.nitric.deploy.v1.ScheduleTarget.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.deploy.v1.ScheduleTarget.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.nitric.deploy.v1.ScheduleTarget} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.ScheduleTarget.toObject = function(includeInstance, msg) { - var f, obj = { - executionUnit: 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.nitric.deploy.v1.ScheduleTarget} - */ -proto.nitric.deploy.v1.ScheduleTarget.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.deploy.v1.ScheduleTarget; - return proto.nitric.deploy.v1.ScheduleTarget.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.deploy.v1.ScheduleTarget} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.deploy.v1.ScheduleTarget} - */ -proto.nitric.deploy.v1.ScheduleTarget.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.setExecutionUnit(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.deploy.v1.ScheduleTarget.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.deploy.v1.ScheduleTarget.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.deploy.v1.ScheduleTarget} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.ScheduleTarget.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {string} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string execution_unit = 1; - * @return {string} - */ -proto.nitric.deploy.v1.ScheduleTarget.prototype.getExecutionUnit = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.deploy.v1.ScheduleTarget} returns this - */ -proto.nitric.deploy.v1.ScheduleTarget.prototype.setExecutionUnit = function(value) { - return jspb.Message.setOneofField(this, 1, proto.nitric.deploy.v1.ScheduleTarget.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.nitric.deploy.v1.ScheduleTarget} returns this - */ -proto.nitric.deploy.v1.ScheduleTarget.prototype.clearExecutionUnit = function() { - return jspb.Message.setOneofField(this, 1, proto.nitric.deploy.v1.ScheduleTarget.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.deploy.v1.ScheduleTarget.prototype.hasExecutionUnit = 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.nitric.deploy.v1.Schedule.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.deploy.v1.Schedule.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.nitric.deploy.v1.Schedule} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.Schedule.toObject = function(includeInstance, msg) { - var f, obj = { - cron: jspb.Message.getFieldWithDefault(msg, 1, ""), - target: (f = msg.getTarget()) && proto.nitric.deploy.v1.ScheduleTarget.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.nitric.deploy.v1.Schedule} - */ -proto.nitric.deploy.v1.Schedule.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.deploy.v1.Schedule; - return proto.nitric.deploy.v1.Schedule.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.deploy.v1.Schedule} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.deploy.v1.Schedule} - */ -proto.nitric.deploy.v1.Schedule.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.setCron(value); - break; - case 2: - var value = new proto.nitric.deploy.v1.ScheduleTarget; - reader.readMessage(value,proto.nitric.deploy.v1.ScheduleTarget.deserializeBinaryFromReader); - msg.setTarget(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.deploy.v1.Schedule.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.deploy.v1.Schedule.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.deploy.v1.Schedule} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.Schedule.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getCron(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getTarget(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.nitric.deploy.v1.ScheduleTarget.serializeBinaryToWriter - ); - } -}; - - -/** - * optional string cron = 1; - * @return {string} - */ -proto.nitric.deploy.v1.Schedule.prototype.getCron = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.deploy.v1.Schedule} returns this - */ -proto.nitric.deploy.v1.Schedule.prototype.setCron = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional ScheduleTarget target = 2; - * @return {?proto.nitric.deploy.v1.ScheduleTarget} - */ -proto.nitric.deploy.v1.Schedule.prototype.getTarget = function() { - return /** @type{?proto.nitric.deploy.v1.ScheduleTarget} */ ( - jspb.Message.getWrapperField(this, proto.nitric.deploy.v1.ScheduleTarget, 2)); -}; - - -/** - * @param {?proto.nitric.deploy.v1.ScheduleTarget|undefined} value - * @return {!proto.nitric.deploy.v1.Schedule} returns this -*/ -proto.nitric.deploy.v1.Schedule.prototype.setTarget = function(value) { - return jspb.Message.setWrapperField(this, 2, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.deploy.v1.Schedule} returns this - */ -proto.nitric.deploy.v1.Schedule.prototype.clearTarget = function() { - return this.setTarget(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.deploy.v1.Schedule.prototype.hasTarget = function() { - return jspb.Message.getField(this, 2) != null; -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.nitric.deploy.v1.Resource.oneofGroups_ = [[10,11,12,13,14,15,16,17,18,19,20]]; - -/** - * @enum {number} - */ -proto.nitric.deploy.v1.Resource.ConfigCase = { - CONFIG_NOT_SET: 0, - EXECUTION_UNIT: 10, - BUCKET: 11, - TOPIC: 12, - QUEUE: 13, - API: 14, - POLICY: 15, - SCHEDULE: 16, - COLLECTION: 17, - SECRET: 18, - WEBSOCKET: 19, - HTTP: 20 -}; - -/** - * @return {proto.nitric.deploy.v1.Resource.ConfigCase} - */ -proto.nitric.deploy.v1.Resource.prototype.getConfigCase = function() { - return /** @type {proto.nitric.deploy.v1.Resource.ConfigCase} */(jspb.Message.computeOneofCase(this, proto.nitric.deploy.v1.Resource.oneofGroups_[0])); -}; - - - -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.nitric.deploy.v1.Resource.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.deploy.v1.Resource.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.nitric.deploy.v1.Resource} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.Resource.toObject = function(includeInstance, msg) { - var f, obj = { - name: jspb.Message.getFieldWithDefault(msg, 1, ""), - type: jspb.Message.getFieldWithDefault(msg, 2, 0), - executionUnit: (f = msg.getExecutionUnit()) && proto.nitric.deploy.v1.ExecutionUnit.toObject(includeInstance, f), - bucket: (f = msg.getBucket()) && proto.nitric.deploy.v1.Bucket.toObject(includeInstance, f), - topic: (f = msg.getTopic()) && proto.nitric.deploy.v1.Topic.toObject(includeInstance, f), - queue: (f = msg.getQueue()) && proto.nitric.deploy.v1.Queue.toObject(includeInstance, f), - api: (f = msg.getApi()) && proto.nitric.deploy.v1.Api.toObject(includeInstance, f), - policy: (f = msg.getPolicy()) && proto.nitric.deploy.v1.Policy.toObject(includeInstance, f), - schedule: (f = msg.getSchedule()) && proto.nitric.deploy.v1.Schedule.toObject(includeInstance, f), - collection: (f = msg.getCollection()) && proto.nitric.deploy.v1.Collection.toObject(includeInstance, f), - secret: (f = msg.getSecret()) && proto.nitric.deploy.v1.Secret.toObject(includeInstance, f), - websocket: (f = msg.getWebsocket()) && proto.nitric.deploy.v1.Websocket.toObject(includeInstance, f), - http: (f = msg.getHttp()) && proto.nitric.deploy.v1.Http.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.nitric.deploy.v1.Resource} - */ -proto.nitric.deploy.v1.Resource.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.deploy.v1.Resource; - return proto.nitric.deploy.v1.Resource.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.deploy.v1.Resource} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.deploy.v1.Resource} - */ -proto.nitric.deploy.v1.Resource.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 {!proto.nitric.resource.v1.ResourceType} */ (reader.readEnum()); - msg.setType(value); - break; - case 10: - var value = new proto.nitric.deploy.v1.ExecutionUnit; - reader.readMessage(value,proto.nitric.deploy.v1.ExecutionUnit.deserializeBinaryFromReader); - msg.setExecutionUnit(value); - break; - case 11: - var value = new proto.nitric.deploy.v1.Bucket; - reader.readMessage(value,proto.nitric.deploy.v1.Bucket.deserializeBinaryFromReader); - msg.setBucket(value); - break; - case 12: - var value = new proto.nitric.deploy.v1.Topic; - reader.readMessage(value,proto.nitric.deploy.v1.Topic.deserializeBinaryFromReader); - msg.setTopic(value); - break; - case 13: - var value = new proto.nitric.deploy.v1.Queue; - reader.readMessage(value,proto.nitric.deploy.v1.Queue.deserializeBinaryFromReader); - msg.setQueue(value); - break; - case 14: - var value = new proto.nitric.deploy.v1.Api; - reader.readMessage(value,proto.nitric.deploy.v1.Api.deserializeBinaryFromReader); - msg.setApi(value); - break; - case 15: - var value = new proto.nitric.deploy.v1.Policy; - reader.readMessage(value,proto.nitric.deploy.v1.Policy.deserializeBinaryFromReader); - msg.setPolicy(value); - break; - case 16: - var value = new proto.nitric.deploy.v1.Schedule; - reader.readMessage(value,proto.nitric.deploy.v1.Schedule.deserializeBinaryFromReader); - msg.setSchedule(value); - break; - case 17: - var value = new proto.nitric.deploy.v1.Collection; - reader.readMessage(value,proto.nitric.deploy.v1.Collection.deserializeBinaryFromReader); - msg.setCollection(value); - break; - case 18: - var value = new proto.nitric.deploy.v1.Secret; - reader.readMessage(value,proto.nitric.deploy.v1.Secret.deserializeBinaryFromReader); - msg.setSecret(value); - break; - case 19: - var value = new proto.nitric.deploy.v1.Websocket; - reader.readMessage(value,proto.nitric.deploy.v1.Websocket.deserializeBinaryFromReader); - msg.setWebsocket(value); - break; - case 20: - var value = new proto.nitric.deploy.v1.Http; - reader.readMessage(value,proto.nitric.deploy.v1.Http.deserializeBinaryFromReader); - msg.setHttp(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.deploy.v1.Resource.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.deploy.v1.Resource.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.deploy.v1.Resource} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.Resource.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getName(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getType(); - if (f !== 0.0) { - writer.writeEnum( - 2, - f - ); - } - f = message.getExecutionUnit(); - if (f != null) { - writer.writeMessage( - 10, - f, - proto.nitric.deploy.v1.ExecutionUnit.serializeBinaryToWriter - ); - } - f = message.getBucket(); - if (f != null) { - writer.writeMessage( - 11, - f, - proto.nitric.deploy.v1.Bucket.serializeBinaryToWriter - ); - } - f = message.getTopic(); - if (f != null) { - writer.writeMessage( - 12, - f, - proto.nitric.deploy.v1.Topic.serializeBinaryToWriter - ); - } - f = message.getQueue(); - if (f != null) { - writer.writeMessage( - 13, - f, - proto.nitric.deploy.v1.Queue.serializeBinaryToWriter - ); - } - f = message.getApi(); - if (f != null) { - writer.writeMessage( - 14, - f, - proto.nitric.deploy.v1.Api.serializeBinaryToWriter - ); - } - f = message.getPolicy(); - if (f != null) { - writer.writeMessage( - 15, - f, - proto.nitric.deploy.v1.Policy.serializeBinaryToWriter - ); - } - f = message.getSchedule(); - if (f != null) { - writer.writeMessage( - 16, - f, - proto.nitric.deploy.v1.Schedule.serializeBinaryToWriter - ); - } - f = message.getCollection(); - if (f != null) { - writer.writeMessage( - 17, - f, - proto.nitric.deploy.v1.Collection.serializeBinaryToWriter - ); - } - f = message.getSecret(); - if (f != null) { - writer.writeMessage( - 18, - f, - proto.nitric.deploy.v1.Secret.serializeBinaryToWriter - ); - } - f = message.getWebsocket(); - if (f != null) { - writer.writeMessage( - 19, - f, - proto.nitric.deploy.v1.Websocket.serializeBinaryToWriter - ); - } - f = message.getHttp(); - if (f != null) { - writer.writeMessage( - 20, - f, - proto.nitric.deploy.v1.Http.serializeBinaryToWriter - ); - } -}; - - -/** - * optional string name = 1; - * @return {string} - */ -proto.nitric.deploy.v1.Resource.prototype.getName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.deploy.v1.Resource} returns this - */ -proto.nitric.deploy.v1.Resource.prototype.setName = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional nitric.resource.v1.ResourceType type = 2; - * @return {!proto.nitric.resource.v1.ResourceType} - */ -proto.nitric.deploy.v1.Resource.prototype.getType = function() { - return /** @type {!proto.nitric.resource.v1.ResourceType} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** - * @param {!proto.nitric.resource.v1.ResourceType} value - * @return {!proto.nitric.deploy.v1.Resource} returns this - */ -proto.nitric.deploy.v1.Resource.prototype.setType = function(value) { - return jspb.Message.setProto3EnumField(this, 2, value); -}; - - -/** - * optional ExecutionUnit execution_unit = 10; - * @return {?proto.nitric.deploy.v1.ExecutionUnit} - */ -proto.nitric.deploy.v1.Resource.prototype.getExecutionUnit = function() { - return /** @type{?proto.nitric.deploy.v1.ExecutionUnit} */ ( - jspb.Message.getWrapperField(this, proto.nitric.deploy.v1.ExecutionUnit, 10)); -}; - - -/** - * @param {?proto.nitric.deploy.v1.ExecutionUnit|undefined} value - * @return {!proto.nitric.deploy.v1.Resource} returns this -*/ -proto.nitric.deploy.v1.Resource.prototype.setExecutionUnit = function(value) { - return jspb.Message.setOneofWrapperField(this, 10, proto.nitric.deploy.v1.Resource.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.deploy.v1.Resource} returns this - */ -proto.nitric.deploy.v1.Resource.prototype.clearExecutionUnit = function() { - return this.setExecutionUnit(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.deploy.v1.Resource.prototype.hasExecutionUnit = function() { - return jspb.Message.getField(this, 10) != null; -}; - - -/** - * optional Bucket bucket = 11; - * @return {?proto.nitric.deploy.v1.Bucket} - */ -proto.nitric.deploy.v1.Resource.prototype.getBucket = function() { - return /** @type{?proto.nitric.deploy.v1.Bucket} */ ( - jspb.Message.getWrapperField(this, proto.nitric.deploy.v1.Bucket, 11)); -}; - - -/** - * @param {?proto.nitric.deploy.v1.Bucket|undefined} value - * @return {!proto.nitric.deploy.v1.Resource} returns this -*/ -proto.nitric.deploy.v1.Resource.prototype.setBucket = function(value) { - return jspb.Message.setOneofWrapperField(this, 11, proto.nitric.deploy.v1.Resource.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.deploy.v1.Resource} returns this - */ -proto.nitric.deploy.v1.Resource.prototype.clearBucket = function() { - return this.setBucket(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.deploy.v1.Resource.prototype.hasBucket = function() { - return jspb.Message.getField(this, 11) != null; -}; - - -/** - * optional Topic topic = 12; - * @return {?proto.nitric.deploy.v1.Topic} - */ -proto.nitric.deploy.v1.Resource.prototype.getTopic = function() { - return /** @type{?proto.nitric.deploy.v1.Topic} */ ( - jspb.Message.getWrapperField(this, proto.nitric.deploy.v1.Topic, 12)); -}; - - -/** - * @param {?proto.nitric.deploy.v1.Topic|undefined} value - * @return {!proto.nitric.deploy.v1.Resource} returns this -*/ -proto.nitric.deploy.v1.Resource.prototype.setTopic = function(value) { - return jspb.Message.setOneofWrapperField(this, 12, proto.nitric.deploy.v1.Resource.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.deploy.v1.Resource} returns this - */ -proto.nitric.deploy.v1.Resource.prototype.clearTopic = function() { - return this.setTopic(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.deploy.v1.Resource.prototype.hasTopic = function() { - return jspb.Message.getField(this, 12) != null; -}; - - -/** - * optional Queue queue = 13; - * @return {?proto.nitric.deploy.v1.Queue} - */ -proto.nitric.deploy.v1.Resource.prototype.getQueue = function() { - return /** @type{?proto.nitric.deploy.v1.Queue} */ ( - jspb.Message.getWrapperField(this, proto.nitric.deploy.v1.Queue, 13)); -}; - - -/** - * @param {?proto.nitric.deploy.v1.Queue|undefined} value - * @return {!proto.nitric.deploy.v1.Resource} returns this -*/ -proto.nitric.deploy.v1.Resource.prototype.setQueue = function(value) { - return jspb.Message.setOneofWrapperField(this, 13, proto.nitric.deploy.v1.Resource.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.deploy.v1.Resource} returns this - */ -proto.nitric.deploy.v1.Resource.prototype.clearQueue = function() { - return this.setQueue(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.deploy.v1.Resource.prototype.hasQueue = function() { - return jspb.Message.getField(this, 13) != null; -}; - - -/** - * optional Api api = 14; - * @return {?proto.nitric.deploy.v1.Api} - */ -proto.nitric.deploy.v1.Resource.prototype.getApi = function() { - return /** @type{?proto.nitric.deploy.v1.Api} */ ( - jspb.Message.getWrapperField(this, proto.nitric.deploy.v1.Api, 14)); -}; - - -/** - * @param {?proto.nitric.deploy.v1.Api|undefined} value - * @return {!proto.nitric.deploy.v1.Resource} returns this -*/ -proto.nitric.deploy.v1.Resource.prototype.setApi = function(value) { - return jspb.Message.setOneofWrapperField(this, 14, proto.nitric.deploy.v1.Resource.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.deploy.v1.Resource} returns this - */ -proto.nitric.deploy.v1.Resource.prototype.clearApi = function() { - return this.setApi(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.deploy.v1.Resource.prototype.hasApi = function() { - return jspb.Message.getField(this, 14) != null; -}; - - -/** - * optional Policy policy = 15; - * @return {?proto.nitric.deploy.v1.Policy} - */ -proto.nitric.deploy.v1.Resource.prototype.getPolicy = function() { - return /** @type{?proto.nitric.deploy.v1.Policy} */ ( - jspb.Message.getWrapperField(this, proto.nitric.deploy.v1.Policy, 15)); -}; - - -/** - * @param {?proto.nitric.deploy.v1.Policy|undefined} value - * @return {!proto.nitric.deploy.v1.Resource} returns this -*/ -proto.nitric.deploy.v1.Resource.prototype.setPolicy = function(value) { - return jspb.Message.setOneofWrapperField(this, 15, proto.nitric.deploy.v1.Resource.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.deploy.v1.Resource} returns this - */ -proto.nitric.deploy.v1.Resource.prototype.clearPolicy = function() { - return this.setPolicy(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.deploy.v1.Resource.prototype.hasPolicy = function() { - return jspb.Message.getField(this, 15) != null; -}; - - -/** - * optional Schedule schedule = 16; - * @return {?proto.nitric.deploy.v1.Schedule} - */ -proto.nitric.deploy.v1.Resource.prototype.getSchedule = function() { - return /** @type{?proto.nitric.deploy.v1.Schedule} */ ( - jspb.Message.getWrapperField(this, proto.nitric.deploy.v1.Schedule, 16)); -}; - - -/** - * @param {?proto.nitric.deploy.v1.Schedule|undefined} value - * @return {!proto.nitric.deploy.v1.Resource} returns this -*/ -proto.nitric.deploy.v1.Resource.prototype.setSchedule = function(value) { - return jspb.Message.setOneofWrapperField(this, 16, proto.nitric.deploy.v1.Resource.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.deploy.v1.Resource} returns this - */ -proto.nitric.deploy.v1.Resource.prototype.clearSchedule = function() { - return this.setSchedule(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.deploy.v1.Resource.prototype.hasSchedule = function() { - return jspb.Message.getField(this, 16) != null; -}; - - -/** - * optional Collection collection = 17; - * @return {?proto.nitric.deploy.v1.Collection} - */ -proto.nitric.deploy.v1.Resource.prototype.getCollection = function() { - return /** @type{?proto.nitric.deploy.v1.Collection} */ ( - jspb.Message.getWrapperField(this, proto.nitric.deploy.v1.Collection, 17)); -}; - - -/** - * @param {?proto.nitric.deploy.v1.Collection|undefined} value - * @return {!proto.nitric.deploy.v1.Resource} returns this -*/ -proto.nitric.deploy.v1.Resource.prototype.setCollection = function(value) { - return jspb.Message.setOneofWrapperField(this, 17, proto.nitric.deploy.v1.Resource.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.deploy.v1.Resource} returns this - */ -proto.nitric.deploy.v1.Resource.prototype.clearCollection = function() { - return this.setCollection(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.deploy.v1.Resource.prototype.hasCollection = function() { - return jspb.Message.getField(this, 17) != null; -}; - - -/** - * optional Secret secret = 18; - * @return {?proto.nitric.deploy.v1.Secret} - */ -proto.nitric.deploy.v1.Resource.prototype.getSecret = function() { - return /** @type{?proto.nitric.deploy.v1.Secret} */ ( - jspb.Message.getWrapperField(this, proto.nitric.deploy.v1.Secret, 18)); -}; - - -/** - * @param {?proto.nitric.deploy.v1.Secret|undefined} value - * @return {!proto.nitric.deploy.v1.Resource} returns this -*/ -proto.nitric.deploy.v1.Resource.prototype.setSecret = function(value) { - return jspb.Message.setOneofWrapperField(this, 18, proto.nitric.deploy.v1.Resource.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.deploy.v1.Resource} returns this - */ -proto.nitric.deploy.v1.Resource.prototype.clearSecret = function() { - return this.setSecret(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.deploy.v1.Resource.prototype.hasSecret = function() { - return jspb.Message.getField(this, 18) != null; -}; - - -/** - * optional Websocket websocket = 19; - * @return {?proto.nitric.deploy.v1.Websocket} - */ -proto.nitric.deploy.v1.Resource.prototype.getWebsocket = function() { - return /** @type{?proto.nitric.deploy.v1.Websocket} */ ( - jspb.Message.getWrapperField(this, proto.nitric.deploy.v1.Websocket, 19)); -}; - - -/** - * @param {?proto.nitric.deploy.v1.Websocket|undefined} value - * @return {!proto.nitric.deploy.v1.Resource} returns this -*/ -proto.nitric.deploy.v1.Resource.prototype.setWebsocket = function(value) { - return jspb.Message.setOneofWrapperField(this, 19, proto.nitric.deploy.v1.Resource.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.deploy.v1.Resource} returns this - */ -proto.nitric.deploy.v1.Resource.prototype.clearWebsocket = function() { - return this.setWebsocket(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.deploy.v1.Resource.prototype.hasWebsocket = function() { - return jspb.Message.getField(this, 19) != null; -}; - - -/** - * optional Http http = 20; - * @return {?proto.nitric.deploy.v1.Http} - */ -proto.nitric.deploy.v1.Resource.prototype.getHttp = function() { - return /** @type{?proto.nitric.deploy.v1.Http} */ ( - jspb.Message.getWrapperField(this, proto.nitric.deploy.v1.Http, 20)); -}; - - -/** - * @param {?proto.nitric.deploy.v1.Http|undefined} value - * @return {!proto.nitric.deploy.v1.Resource} returns this -*/ -proto.nitric.deploy.v1.Resource.prototype.setHttp = function(value) { - return jspb.Message.setOneofWrapperField(this, 20, proto.nitric.deploy.v1.Resource.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.deploy.v1.Resource} returns this - */ -proto.nitric.deploy.v1.Resource.prototype.clearHttp = function() { - return this.setHttp(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.deploy.v1.Resource.prototype.hasHttp = function() { - return jspb.Message.getField(this, 20) != null; -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.nitric.deploy.v1.Policy.repeatedFields_ = [1,2,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.nitric.deploy.v1.Policy.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.deploy.v1.Policy.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.nitric.deploy.v1.Policy} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.Policy.toObject = function(includeInstance, msg) { - var f, obj = { - principalsList: jspb.Message.toObjectList(msg.getPrincipalsList(), - proto.nitric.deploy.v1.Resource.toObject, includeInstance), - actionsList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f, - resourcesList: jspb.Message.toObjectList(msg.getResourcesList(), - proto.nitric.deploy.v1.Resource.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.nitric.deploy.v1.Policy} - */ -proto.nitric.deploy.v1.Policy.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.deploy.v1.Policy; - return proto.nitric.deploy.v1.Policy.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.deploy.v1.Policy} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.deploy.v1.Policy} - */ -proto.nitric.deploy.v1.Policy.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nitric.deploy.v1.Resource; - reader.readMessage(value,proto.nitric.deploy.v1.Resource.deserializeBinaryFromReader); - msg.addPrincipals(value); - break; - case 2: - var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedEnum() : [reader.readEnum()]); - for (var i = 0; i < values.length; i++) { - msg.addActions(values[i]); - } - break; - case 3: - var value = new proto.nitric.deploy.v1.Resource; - reader.readMessage(value,proto.nitric.deploy.v1.Resource.deserializeBinaryFromReader); - msg.addResources(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.deploy.v1.Policy.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.deploy.v1.Policy.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.deploy.v1.Policy} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.Policy.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getPrincipalsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.nitric.deploy.v1.Resource.serializeBinaryToWriter - ); - } - f = message.getActionsList(); - if (f.length > 0) { - writer.writePackedEnum( - 2, - f - ); - } - f = message.getResourcesList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 3, - f, - proto.nitric.deploy.v1.Resource.serializeBinaryToWriter - ); - } -}; - - -/** - * repeated Resource principals = 1; - * @return {!Array} - */ -proto.nitric.deploy.v1.Policy.prototype.getPrincipalsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.nitric.deploy.v1.Resource, 1)); -}; - - -/** - * @param {!Array} value - * @return {!proto.nitric.deploy.v1.Policy} returns this -*/ -proto.nitric.deploy.v1.Policy.prototype.setPrincipalsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 1, value); -}; - - -/** - * @param {!proto.nitric.deploy.v1.Resource=} opt_value - * @param {number=} opt_index - * @return {!proto.nitric.deploy.v1.Resource} - */ -proto.nitric.deploy.v1.Policy.prototype.addPrincipals = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.nitric.deploy.v1.Resource, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.nitric.deploy.v1.Policy} returns this - */ -proto.nitric.deploy.v1.Policy.prototype.clearPrincipalsList = function() { - return this.setPrincipalsList([]); -}; - - -/** - * repeated nitric.resource.v1.Action actions = 2; - * @return {!Array} - */ -proto.nitric.deploy.v1.Policy.prototype.getActionsList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 2)); -}; - - -/** - * @param {!Array} value - * @return {!proto.nitric.deploy.v1.Policy} returns this - */ -proto.nitric.deploy.v1.Policy.prototype.setActionsList = function(value) { - return jspb.Message.setField(this, 2, value || []); -}; - - -/** - * @param {!proto.nitric.resource.v1.Action} value - * @param {number=} opt_index - * @return {!proto.nitric.deploy.v1.Policy} returns this - */ -proto.nitric.deploy.v1.Policy.prototype.addActions = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 2, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.nitric.deploy.v1.Policy} returns this - */ -proto.nitric.deploy.v1.Policy.prototype.clearActionsList = function() { - return this.setActionsList([]); -}; - - -/** - * repeated Resource resources = 3; - * @return {!Array} - */ -proto.nitric.deploy.v1.Policy.prototype.getResourcesList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.nitric.deploy.v1.Resource, 3)); -}; - - -/** - * @param {!Array} value - * @return {!proto.nitric.deploy.v1.Policy} returns this -*/ -proto.nitric.deploy.v1.Policy.prototype.setResourcesList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 3, value); -}; - - -/** - * @param {!proto.nitric.deploy.v1.Resource=} opt_value - * @param {number=} opt_index - * @return {!proto.nitric.deploy.v1.Resource} - */ -proto.nitric.deploy.v1.Policy.prototype.addResources = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.nitric.deploy.v1.Resource, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.nitric.deploy.v1.Policy} returns this - */ -proto.nitric.deploy.v1.Policy.prototype.clearResourcesList = function() { - return this.setResourcesList([]); -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.nitric.deploy.v1.Spec.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.nitric.deploy.v1.Spec.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.deploy.v1.Spec.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.nitric.deploy.v1.Spec} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.Spec.toObject = function(includeInstance, msg) { - var f, obj = { - resourcesList: jspb.Message.toObjectList(msg.getResourcesList(), - proto.nitric.deploy.v1.Resource.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.nitric.deploy.v1.Spec} - */ -proto.nitric.deploy.v1.Spec.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.deploy.v1.Spec; - return proto.nitric.deploy.v1.Spec.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.deploy.v1.Spec} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.deploy.v1.Spec} - */ -proto.nitric.deploy.v1.Spec.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nitric.deploy.v1.Resource; - reader.readMessage(value,proto.nitric.deploy.v1.Resource.deserializeBinaryFromReader); - msg.addResources(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.deploy.v1.Spec.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.deploy.v1.Spec.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.deploy.v1.Spec} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.deploy.v1.Spec.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getResourcesList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.nitric.deploy.v1.Resource.serializeBinaryToWriter - ); - } -}; - - -/** - * repeated Resource resources = 1; - * @return {!Array} - */ -proto.nitric.deploy.v1.Spec.prototype.getResourcesList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.nitric.deploy.v1.Resource, 1)); -}; - - -/** - * @param {!Array} value - * @return {!proto.nitric.deploy.v1.Spec} returns this -*/ -proto.nitric.deploy.v1.Spec.prototype.setResourcesList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 1, value); -}; - - -/** - * @param {!proto.nitric.deploy.v1.Resource=} opt_value - * @param {number=} opt_index - * @return {!proto.nitric.deploy.v1.Resource} - */ -proto.nitric.deploy.v1.Spec.prototype.addResources = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.nitric.deploy.v1.Resource, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.nitric.deploy.v1.Spec} returns this - */ -proto.nitric.deploy.v1.Spec.prototype.clearResourcesList = function() { - return this.setResourcesList([]); -}; - - -goog.object.extend(exports, proto.nitric.deploy.v1); diff --git a/src/gen/proto/document/v1/document_grpc_pb.d.ts b/src/gen/proto/document/v1/document_grpc_pb.d.ts deleted file mode 100644 index 8c822e07..00000000 --- a/src/gen/proto/document/v1/document_grpc_pb.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -// GENERATED CODE -- DO NOT EDIT! - -// package: nitric.document.v1 -// file: proto/document/v1/document.proto - -import * as proto_document_v1_document_pb from "../../../proto/document/v1/document_pb"; -import * as grpc from "@grpc/grpc-js"; - -interface IDocumentServiceService extends grpc.ServiceDefinition { - get: grpc.MethodDefinition; - set: grpc.MethodDefinition; - delete: grpc.MethodDefinition; - query: grpc.MethodDefinition; - queryStream: grpc.MethodDefinition; -} - -export const DocumentServiceService: IDocumentServiceService; - -export interface IDocumentServiceServer extends grpc.UntypedServiceImplementation { - get: grpc.handleUnaryCall; - set: grpc.handleUnaryCall; - delete: grpc.handleUnaryCall; - query: grpc.handleUnaryCall; - queryStream: grpc.handleServerStreamingCall; -} - -export class DocumentServiceClient extends grpc.Client { - constructor(address: string, credentials: grpc.ChannelCredentials, options?: object); - get(argument: proto_document_v1_document_pb.DocumentGetRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; - get(argument: proto_document_v1_document_pb.DocumentGetRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - get(argument: proto_document_v1_document_pb.DocumentGetRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - set(argument: proto_document_v1_document_pb.DocumentSetRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; - set(argument: proto_document_v1_document_pb.DocumentSetRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - set(argument: proto_document_v1_document_pb.DocumentSetRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - delete(argument: proto_document_v1_document_pb.DocumentDeleteRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; - delete(argument: proto_document_v1_document_pb.DocumentDeleteRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - delete(argument: proto_document_v1_document_pb.DocumentDeleteRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - query(argument: proto_document_v1_document_pb.DocumentQueryRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; - query(argument: proto_document_v1_document_pb.DocumentQueryRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - query(argument: proto_document_v1_document_pb.DocumentQueryRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - queryStream(argument: proto_document_v1_document_pb.DocumentQueryStreamRequest, metadataOrOptions?: grpc.Metadata | grpc.CallOptions | null): grpc.ClientReadableStream; - queryStream(argument: proto_document_v1_document_pb.DocumentQueryStreamRequest, metadata?: grpc.Metadata | null, options?: grpc.CallOptions | null): grpc.ClientReadableStream; -} diff --git a/src/gen/proto/document/v1/document_grpc_pb.js b/src/gen/proto/document/v1/document_grpc_pb.js deleted file mode 100644 index fade79f2..00000000 --- a/src/gen/proto/document/v1/document_grpc_pb.js +++ /dev/null @@ -1,184 +0,0 @@ -// GENERATED CODE -- DO NOT EDIT! - -'use strict'; -var grpc = require('@grpc/grpc-js'); -var proto_document_v1_document_pb = require('../../../proto/document/v1/document_pb.js'); -var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js'); -var validate_validate_pb = require('../../../validate/validate_pb.js'); - -function serialize_nitric_document_v1_DocumentDeleteRequest(arg) { - if (!(arg instanceof proto_document_v1_document_pb.DocumentDeleteRequest)) { - throw new Error('Expected argument of type nitric.document.v1.DocumentDeleteRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_document_v1_DocumentDeleteRequest(buffer_arg) { - return proto_document_v1_document_pb.DocumentDeleteRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_document_v1_DocumentDeleteResponse(arg) { - if (!(arg instanceof proto_document_v1_document_pb.DocumentDeleteResponse)) { - throw new Error('Expected argument of type nitric.document.v1.DocumentDeleteResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_document_v1_DocumentDeleteResponse(buffer_arg) { - return proto_document_v1_document_pb.DocumentDeleteResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_document_v1_DocumentGetRequest(arg) { - if (!(arg instanceof proto_document_v1_document_pb.DocumentGetRequest)) { - throw new Error('Expected argument of type nitric.document.v1.DocumentGetRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_document_v1_DocumentGetRequest(buffer_arg) { - return proto_document_v1_document_pb.DocumentGetRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_document_v1_DocumentGetResponse(arg) { - if (!(arg instanceof proto_document_v1_document_pb.DocumentGetResponse)) { - throw new Error('Expected argument of type nitric.document.v1.DocumentGetResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_document_v1_DocumentGetResponse(buffer_arg) { - return proto_document_v1_document_pb.DocumentGetResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_document_v1_DocumentQueryRequest(arg) { - if (!(arg instanceof proto_document_v1_document_pb.DocumentQueryRequest)) { - throw new Error('Expected argument of type nitric.document.v1.DocumentQueryRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_document_v1_DocumentQueryRequest(buffer_arg) { - return proto_document_v1_document_pb.DocumentQueryRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_document_v1_DocumentQueryResponse(arg) { - if (!(arg instanceof proto_document_v1_document_pb.DocumentQueryResponse)) { - throw new Error('Expected argument of type nitric.document.v1.DocumentQueryResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_document_v1_DocumentQueryResponse(buffer_arg) { - return proto_document_v1_document_pb.DocumentQueryResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_document_v1_DocumentQueryStreamRequest(arg) { - if (!(arg instanceof proto_document_v1_document_pb.DocumentQueryStreamRequest)) { - throw new Error('Expected argument of type nitric.document.v1.DocumentQueryStreamRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_document_v1_DocumentQueryStreamRequest(buffer_arg) { - return proto_document_v1_document_pb.DocumentQueryStreamRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_document_v1_DocumentQueryStreamResponse(arg) { - if (!(arg instanceof proto_document_v1_document_pb.DocumentQueryStreamResponse)) { - throw new Error('Expected argument of type nitric.document.v1.DocumentQueryStreamResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_document_v1_DocumentQueryStreamResponse(buffer_arg) { - return proto_document_v1_document_pb.DocumentQueryStreamResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_document_v1_DocumentSetRequest(arg) { - if (!(arg instanceof proto_document_v1_document_pb.DocumentSetRequest)) { - throw new Error('Expected argument of type nitric.document.v1.DocumentSetRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_document_v1_DocumentSetRequest(buffer_arg) { - return proto_document_v1_document_pb.DocumentSetRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_document_v1_DocumentSetResponse(arg) { - if (!(arg instanceof proto_document_v1_document_pb.DocumentSetResponse)) { - throw new Error('Expected argument of type nitric.document.v1.DocumentSetResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_document_v1_DocumentSetResponse(buffer_arg) { - return proto_document_v1_document_pb.DocumentSetResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - - -// Service for storage and retrieval of simple JSON keyValue -var DocumentServiceService = exports.DocumentServiceService = { - // Get an existing document -get: { - path: '/nitric.document.v1.DocumentService/Get', - requestStream: false, - responseStream: false, - requestType: proto_document_v1_document_pb.DocumentGetRequest, - responseType: proto_document_v1_document_pb.DocumentGetResponse, - requestSerialize: serialize_nitric_document_v1_DocumentGetRequest, - requestDeserialize: deserialize_nitric_document_v1_DocumentGetRequest, - responseSerialize: serialize_nitric_document_v1_DocumentGetResponse, - responseDeserialize: deserialize_nitric_document_v1_DocumentGetResponse, - }, - // Create a new or overwrite an existing document -set: { - path: '/nitric.document.v1.DocumentService/Set', - requestStream: false, - responseStream: false, - requestType: proto_document_v1_document_pb.DocumentSetRequest, - responseType: proto_document_v1_document_pb.DocumentSetResponse, - requestSerialize: serialize_nitric_document_v1_DocumentSetRequest, - requestDeserialize: deserialize_nitric_document_v1_DocumentSetRequest, - responseSerialize: serialize_nitric_document_v1_DocumentSetResponse, - responseDeserialize: deserialize_nitric_document_v1_DocumentSetResponse, - }, - // Delete an existing document -delete: { - path: '/nitric.document.v1.DocumentService/Delete', - requestStream: false, - responseStream: false, - requestType: proto_document_v1_document_pb.DocumentDeleteRequest, - responseType: proto_document_v1_document_pb.DocumentDeleteResponse, - requestSerialize: serialize_nitric_document_v1_DocumentDeleteRequest, - requestDeserialize: deserialize_nitric_document_v1_DocumentDeleteRequest, - responseSerialize: serialize_nitric_document_v1_DocumentDeleteResponse, - responseDeserialize: deserialize_nitric_document_v1_DocumentDeleteResponse, - }, - // Query the document collection (supports pagination) -query: { - path: '/nitric.document.v1.DocumentService/Query', - requestStream: false, - responseStream: false, - requestType: proto_document_v1_document_pb.DocumentQueryRequest, - responseType: proto_document_v1_document_pb.DocumentQueryResponse, - requestSerialize: serialize_nitric_document_v1_DocumentQueryRequest, - requestDeserialize: deserialize_nitric_document_v1_DocumentQueryRequest, - responseSerialize: serialize_nitric_document_v1_DocumentQueryResponse, - responseDeserialize: deserialize_nitric_document_v1_DocumentQueryResponse, - }, - // Query the document collection (supports streaming) -queryStream: { - path: '/nitric.document.v1.DocumentService/QueryStream', - requestStream: false, - responseStream: true, - requestType: proto_document_v1_document_pb.DocumentQueryStreamRequest, - responseType: proto_document_v1_document_pb.DocumentQueryStreamResponse, - requestSerialize: serialize_nitric_document_v1_DocumentQueryStreamRequest, - requestDeserialize: deserialize_nitric_document_v1_DocumentQueryStreamRequest, - responseSerialize: serialize_nitric_document_v1_DocumentQueryStreamResponse, - responseDeserialize: deserialize_nitric_document_v1_DocumentQueryStreamResponse, - }, -}; - -exports.DocumentServiceClient = grpc.makeGenericClientConstructor(DocumentServiceService); diff --git a/src/gen/proto/document/v1/document_pb.d.ts b/src/gen/proto/document/v1/document_pb.d.ts deleted file mode 100644 index 74004da9..00000000 --- a/src/gen/proto/document/v1/document_pb.d.ts +++ /dev/null @@ -1,406 +0,0 @@ -// package: nitric.document.v1 -// file: proto/document/v1/document.proto - -import * as jspb from "google-protobuf"; -import * as google_protobuf_struct_pb from "google-protobuf/google/protobuf/struct_pb"; -import * as validate_validate_pb from "../../../validate/validate_pb"; - -export class Collection extends jspb.Message { - getName(): string; - setName(value: string): void; - - hasParent(): boolean; - clearParent(): void; - getParent(): Key | undefined; - setParent(value?: Key): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Collection.AsObject; - static toObject(includeInstance: boolean, msg: Collection): Collection.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Collection, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Collection; - static deserializeBinaryFromReader(message: Collection, reader: jspb.BinaryReader): Collection; -} - -export namespace Collection { - export type AsObject = { - name: string, - parent?: Key.AsObject, - } -} - -export class Key extends jspb.Message { - hasCollection(): boolean; - clearCollection(): void; - getCollection(): Collection | undefined; - setCollection(value?: Collection): void; - - getId(): string; - setId(value: string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Key.AsObject; - static toObject(includeInstance: boolean, msg: Key): Key.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Key, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Key; - static deserializeBinaryFromReader(message: Key, reader: jspb.BinaryReader): Key; -} - -export namespace Key { - export type AsObject = { - collection?: Collection.AsObject, - id: string, - } -} - -export class Document extends jspb.Message { - hasContent(): boolean; - clearContent(): void; - getContent(): google_protobuf_struct_pb.Struct | undefined; - setContent(value?: google_protobuf_struct_pb.Struct): void; - - hasKey(): boolean; - clearKey(): void; - getKey(): Key | undefined; - setKey(value?: Key): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Document.AsObject; - static toObject(includeInstance: boolean, msg: Document): Document.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Document, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Document; - static deserializeBinaryFromReader(message: Document, reader: jspb.BinaryReader): Document; -} - -export namespace Document { - export type AsObject = { - content?: google_protobuf_struct_pb.Struct.AsObject, - key?: Key.AsObject, - } -} - -export class ExpressionValue extends jspb.Message { - hasIntValue(): boolean; - clearIntValue(): void; - getIntValue(): number; - setIntValue(value: number): void; - - hasDoubleValue(): boolean; - clearDoubleValue(): void; - getDoubleValue(): number; - setDoubleValue(value: number): void; - - hasStringValue(): boolean; - clearStringValue(): void; - getStringValue(): string; - setStringValue(value: string): void; - - hasBoolValue(): boolean; - clearBoolValue(): void; - getBoolValue(): boolean; - setBoolValue(value: boolean): void; - - getKindCase(): ExpressionValue.KindCase; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): ExpressionValue.AsObject; - static toObject(includeInstance: boolean, msg: ExpressionValue): ExpressionValue.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: ExpressionValue, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): ExpressionValue; - static deserializeBinaryFromReader(message: ExpressionValue, reader: jspb.BinaryReader): ExpressionValue; -} - -export namespace ExpressionValue { - export type AsObject = { - intValue: number, - doubleValue: number, - stringValue: string, - boolValue: boolean, - } - - export enum KindCase { - KIND_NOT_SET = 0, - INT_VALUE = 1, - DOUBLE_VALUE = 2, - STRING_VALUE = 3, - BOOL_VALUE = 4, - } -} - -export class Expression extends jspb.Message { - getOperand(): string; - setOperand(value: string): void; - - getOperator(): string; - setOperator(value: string): void; - - hasValue(): boolean; - clearValue(): void; - getValue(): ExpressionValue | undefined; - setValue(value?: ExpressionValue): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Expression.AsObject; - static toObject(includeInstance: boolean, msg: Expression): Expression.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Expression, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Expression; - static deserializeBinaryFromReader(message: Expression, reader: jspb.BinaryReader): Expression; -} - -export namespace Expression { - export type AsObject = { - operand: string, - operator: string, - value?: ExpressionValue.AsObject, - } -} - -export class DocumentGetRequest extends jspb.Message { - hasKey(): boolean; - clearKey(): void; - getKey(): Key | undefined; - setKey(value?: Key): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): DocumentGetRequest.AsObject; - static toObject(includeInstance: boolean, msg: DocumentGetRequest): DocumentGetRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: DocumentGetRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): DocumentGetRequest; - static deserializeBinaryFromReader(message: DocumentGetRequest, reader: jspb.BinaryReader): DocumentGetRequest; -} - -export namespace DocumentGetRequest { - export type AsObject = { - key?: Key.AsObject, - } -} - -export class DocumentGetResponse extends jspb.Message { - hasDocument(): boolean; - clearDocument(): void; - getDocument(): Document | undefined; - setDocument(value?: Document): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): DocumentGetResponse.AsObject; - static toObject(includeInstance: boolean, msg: DocumentGetResponse): DocumentGetResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: DocumentGetResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): DocumentGetResponse; - static deserializeBinaryFromReader(message: DocumentGetResponse, reader: jspb.BinaryReader): DocumentGetResponse; -} - -export namespace DocumentGetResponse { - export type AsObject = { - document?: Document.AsObject, - } -} - -export class DocumentSetRequest extends jspb.Message { - hasKey(): boolean; - clearKey(): void; - getKey(): Key | undefined; - setKey(value?: Key): void; - - hasContent(): boolean; - clearContent(): void; - getContent(): google_protobuf_struct_pb.Struct | undefined; - setContent(value?: google_protobuf_struct_pb.Struct): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): DocumentSetRequest.AsObject; - static toObject(includeInstance: boolean, msg: DocumentSetRequest): DocumentSetRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: DocumentSetRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): DocumentSetRequest; - static deserializeBinaryFromReader(message: DocumentSetRequest, reader: jspb.BinaryReader): DocumentSetRequest; -} - -export namespace DocumentSetRequest { - export type AsObject = { - key?: Key.AsObject, - content?: google_protobuf_struct_pb.Struct.AsObject, - } -} - -export class DocumentSetResponse extends jspb.Message { - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): DocumentSetResponse.AsObject; - static toObject(includeInstance: boolean, msg: DocumentSetResponse): DocumentSetResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: DocumentSetResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): DocumentSetResponse; - static deserializeBinaryFromReader(message: DocumentSetResponse, reader: jspb.BinaryReader): DocumentSetResponse; -} - -export namespace DocumentSetResponse { - export type AsObject = { - } -} - -export class DocumentDeleteRequest extends jspb.Message { - hasKey(): boolean; - clearKey(): void; - getKey(): Key | undefined; - setKey(value?: Key): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): DocumentDeleteRequest.AsObject; - static toObject(includeInstance: boolean, msg: DocumentDeleteRequest): DocumentDeleteRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: DocumentDeleteRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): DocumentDeleteRequest; - static deserializeBinaryFromReader(message: DocumentDeleteRequest, reader: jspb.BinaryReader): DocumentDeleteRequest; -} - -export namespace DocumentDeleteRequest { - export type AsObject = { - key?: Key.AsObject, - } -} - -export class DocumentDeleteResponse extends jspb.Message { - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): DocumentDeleteResponse.AsObject; - static toObject(includeInstance: boolean, msg: DocumentDeleteResponse): DocumentDeleteResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: DocumentDeleteResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): DocumentDeleteResponse; - static deserializeBinaryFromReader(message: DocumentDeleteResponse, reader: jspb.BinaryReader): DocumentDeleteResponse; -} - -export namespace DocumentDeleteResponse { - export type AsObject = { - } -} - -export class DocumentQueryRequest extends jspb.Message { - hasCollection(): boolean; - clearCollection(): void; - getCollection(): Collection | undefined; - setCollection(value?: Collection): void; - - clearExpressionsList(): void; - getExpressionsList(): Array; - setExpressionsList(value: Array): void; - addExpressions(value?: Expression, index?: number): Expression; - - getLimit(): number; - setLimit(value: number): void; - - getPagingTokenMap(): jspb.Map; - clearPagingTokenMap(): void; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): DocumentQueryRequest.AsObject; - static toObject(includeInstance: boolean, msg: DocumentQueryRequest): DocumentQueryRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: DocumentQueryRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): DocumentQueryRequest; - static deserializeBinaryFromReader(message: DocumentQueryRequest, reader: jspb.BinaryReader): DocumentQueryRequest; -} - -export namespace DocumentQueryRequest { - export type AsObject = { - collection?: Collection.AsObject, - expressionsList: Array, - limit: number, - pagingTokenMap: Array<[string, string]>, - } -} - -export class DocumentQueryResponse extends jspb.Message { - clearDocumentsList(): void; - getDocumentsList(): Array; - setDocumentsList(value: Array): void; - addDocuments(value?: Document, index?: number): Document; - - getPagingTokenMap(): jspb.Map; - clearPagingTokenMap(): void; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): DocumentQueryResponse.AsObject; - static toObject(includeInstance: boolean, msg: DocumentQueryResponse): DocumentQueryResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: DocumentQueryResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): DocumentQueryResponse; - static deserializeBinaryFromReader(message: DocumentQueryResponse, reader: jspb.BinaryReader): DocumentQueryResponse; -} - -export namespace DocumentQueryResponse { - export type AsObject = { - documentsList: Array, - pagingTokenMap: Array<[string, string]>, - } -} - -export class DocumentQueryStreamRequest extends jspb.Message { - hasCollection(): boolean; - clearCollection(): void; - getCollection(): Collection | undefined; - setCollection(value?: Collection): void; - - clearExpressionsList(): void; - getExpressionsList(): Array; - setExpressionsList(value: Array): void; - addExpressions(value?: Expression, index?: number): Expression; - - getLimit(): number; - setLimit(value: number): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): DocumentQueryStreamRequest.AsObject; - static toObject(includeInstance: boolean, msg: DocumentQueryStreamRequest): DocumentQueryStreamRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: DocumentQueryStreamRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): DocumentQueryStreamRequest; - static deserializeBinaryFromReader(message: DocumentQueryStreamRequest, reader: jspb.BinaryReader): DocumentQueryStreamRequest; -} - -export namespace DocumentQueryStreamRequest { - export type AsObject = { - collection?: Collection.AsObject, - expressionsList: Array, - limit: number, - } -} - -export class DocumentQueryStreamResponse extends jspb.Message { - hasDocument(): boolean; - clearDocument(): void; - getDocument(): Document | undefined; - setDocument(value?: Document): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): DocumentQueryStreamResponse.AsObject; - static toObject(includeInstance: boolean, msg: DocumentQueryStreamResponse): DocumentQueryStreamResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: DocumentQueryStreamResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): DocumentQueryStreamResponse; - static deserializeBinaryFromReader(message: DocumentQueryStreamResponse, reader: jspb.BinaryReader): DocumentQueryStreamResponse; -} - -export namespace DocumentQueryStreamResponse { - export type AsObject = { - document?: Document.AsObject, - } -} - diff --git a/src/gen/proto/document/v1/document_pb.js b/src/gen/proto/document/v1/document_pb.js deleted file mode 100644 index b6b16e3f..00000000 --- a/src/gen/proto/document/v1/document_pb.js +++ /dev/null @@ -1,3170 +0,0 @@ -// source: proto/document/v1/document.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() { - if (this) { return this; } - if (typeof window !== 'undefined') { return window; } - if (typeof global !== 'undefined') { return global; } - if (typeof self !== 'undefined') { return self; } - return Function('return this')(); -}.call(null)); - -var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js'); -goog.object.extend(proto, google_protobuf_struct_pb); -var validate_validate_pb = require('../../../validate/validate_pb.js'); -goog.object.extend(proto, validate_validate_pb); -goog.exportSymbol('proto.nitric.document.v1.Collection', null, global); -goog.exportSymbol('proto.nitric.document.v1.Document', null, global); -goog.exportSymbol('proto.nitric.document.v1.DocumentDeleteRequest', null, global); -goog.exportSymbol('proto.nitric.document.v1.DocumentDeleteResponse', null, global); -goog.exportSymbol('proto.nitric.document.v1.DocumentGetRequest', null, global); -goog.exportSymbol('proto.nitric.document.v1.DocumentGetResponse', null, global); -goog.exportSymbol('proto.nitric.document.v1.DocumentQueryRequest', null, global); -goog.exportSymbol('proto.nitric.document.v1.DocumentQueryResponse', null, global); -goog.exportSymbol('proto.nitric.document.v1.DocumentQueryStreamRequest', null, global); -goog.exportSymbol('proto.nitric.document.v1.DocumentQueryStreamResponse', null, global); -goog.exportSymbol('proto.nitric.document.v1.DocumentSetRequest', null, global); -goog.exportSymbol('proto.nitric.document.v1.DocumentSetResponse', null, global); -goog.exportSymbol('proto.nitric.document.v1.Expression', null, global); -goog.exportSymbol('proto.nitric.document.v1.ExpressionValue', null, global); -goog.exportSymbol('proto.nitric.document.v1.ExpressionValue.KindCase', null, global); -goog.exportSymbol('proto.nitric.document.v1.Key', 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.nitric.document.v1.Collection = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.document.v1.Collection, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.document.v1.Collection.displayName = 'proto.nitric.document.v1.Collection'; -} -/** - * 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.nitric.document.v1.Key = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.document.v1.Key, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.document.v1.Key.displayName = 'proto.nitric.document.v1.Key'; -} -/** - * 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.nitric.document.v1.Document = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.document.v1.Document, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.document.v1.Document.displayName = 'proto.nitric.document.v1.Document'; -} -/** - * 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.nitric.document.v1.ExpressionValue = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.document.v1.ExpressionValue.oneofGroups_); -}; -goog.inherits(proto.nitric.document.v1.ExpressionValue, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.document.v1.ExpressionValue.displayName = 'proto.nitric.document.v1.ExpressionValue'; -} -/** - * 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.nitric.document.v1.Expression = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.document.v1.Expression, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.document.v1.Expression.displayName = 'proto.nitric.document.v1.Expression'; -} -/** - * 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.nitric.document.v1.DocumentGetRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.document.v1.DocumentGetRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.document.v1.DocumentGetRequest.displayName = 'proto.nitric.document.v1.DocumentGetRequest'; -} -/** - * 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.nitric.document.v1.DocumentGetResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.document.v1.DocumentGetResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.document.v1.DocumentGetResponse.displayName = 'proto.nitric.document.v1.DocumentGetResponse'; -} -/** - * 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.nitric.document.v1.DocumentSetRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.document.v1.DocumentSetRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.document.v1.DocumentSetRequest.displayName = 'proto.nitric.document.v1.DocumentSetRequest'; -} -/** - * 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.nitric.document.v1.DocumentSetResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.document.v1.DocumentSetResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.document.v1.DocumentSetResponse.displayName = 'proto.nitric.document.v1.DocumentSetResponse'; -} -/** - * 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.nitric.document.v1.DocumentDeleteRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.document.v1.DocumentDeleteRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.document.v1.DocumentDeleteRequest.displayName = 'proto.nitric.document.v1.DocumentDeleteRequest'; -} -/** - * 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.nitric.document.v1.DocumentDeleteResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.document.v1.DocumentDeleteResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.document.v1.DocumentDeleteResponse.displayName = 'proto.nitric.document.v1.DocumentDeleteResponse'; -} -/** - * 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.nitric.document.v1.DocumentQueryRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.document.v1.DocumentQueryRequest.repeatedFields_, null); -}; -goog.inherits(proto.nitric.document.v1.DocumentQueryRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.document.v1.DocumentQueryRequest.displayName = 'proto.nitric.document.v1.DocumentQueryRequest'; -} -/** - * 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.nitric.document.v1.DocumentQueryResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.document.v1.DocumentQueryResponse.repeatedFields_, null); -}; -goog.inherits(proto.nitric.document.v1.DocumentQueryResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.document.v1.DocumentQueryResponse.displayName = 'proto.nitric.document.v1.DocumentQueryResponse'; -} -/** - * 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.nitric.document.v1.DocumentQueryStreamRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.document.v1.DocumentQueryStreamRequest.repeatedFields_, null); -}; -goog.inherits(proto.nitric.document.v1.DocumentQueryStreamRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.document.v1.DocumentQueryStreamRequest.displayName = 'proto.nitric.document.v1.DocumentQueryStreamRequest'; -} -/** - * 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.nitric.document.v1.DocumentQueryStreamResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.document.v1.DocumentQueryStreamResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.document.v1.DocumentQueryStreamResponse.displayName = 'proto.nitric.document.v1.DocumentQueryStreamResponse'; -} - - - -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.nitric.document.v1.Collection.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.document.v1.Collection.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.nitric.document.v1.Collection} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.document.v1.Collection.toObject = function(includeInstance, msg) { - var f, obj = { - name: jspb.Message.getFieldWithDefault(msg, 1, ""), - parent: (f = msg.getParent()) && proto.nitric.document.v1.Key.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.nitric.document.v1.Collection} - */ -proto.nitric.document.v1.Collection.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.document.v1.Collection; - return proto.nitric.document.v1.Collection.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.document.v1.Collection} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.document.v1.Collection} - */ -proto.nitric.document.v1.Collection.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 = new proto.nitric.document.v1.Key; - reader.readMessage(value,proto.nitric.document.v1.Key.deserializeBinaryFromReader); - msg.setParent(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.document.v1.Collection.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.document.v1.Collection.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.document.v1.Collection} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.document.v1.Collection.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getName(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getParent(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.nitric.document.v1.Key.serializeBinaryToWriter - ); - } -}; - - -/** - * optional string name = 1; - * @return {string} - */ -proto.nitric.document.v1.Collection.prototype.getName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.document.v1.Collection} returns this - */ -proto.nitric.document.v1.Collection.prototype.setName = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional Key parent = 2; - * @return {?proto.nitric.document.v1.Key} - */ -proto.nitric.document.v1.Collection.prototype.getParent = function() { - return /** @type{?proto.nitric.document.v1.Key} */ ( - jspb.Message.getWrapperField(this, proto.nitric.document.v1.Key, 2)); -}; - - -/** - * @param {?proto.nitric.document.v1.Key|undefined} value - * @return {!proto.nitric.document.v1.Collection} returns this -*/ -proto.nitric.document.v1.Collection.prototype.setParent = function(value) { - return jspb.Message.setWrapperField(this, 2, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.document.v1.Collection} returns this - */ -proto.nitric.document.v1.Collection.prototype.clearParent = function() { - return this.setParent(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.document.v1.Collection.prototype.hasParent = 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.nitric.document.v1.Key.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.document.v1.Key.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.nitric.document.v1.Key} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.document.v1.Key.toObject = function(includeInstance, msg) { - var f, obj = { - collection: (f = msg.getCollection()) && proto.nitric.document.v1.Collection.toObject(includeInstance, f), - id: 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.nitric.document.v1.Key} - */ -proto.nitric.document.v1.Key.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.document.v1.Key; - return proto.nitric.document.v1.Key.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.document.v1.Key} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.document.v1.Key} - */ -proto.nitric.document.v1.Key.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nitric.document.v1.Collection; - reader.readMessage(value,proto.nitric.document.v1.Collection.deserializeBinaryFromReader); - msg.setCollection(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setId(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.document.v1.Key.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.document.v1.Key.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.document.v1.Key} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.document.v1.Key.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getCollection(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.nitric.document.v1.Collection.serializeBinaryToWriter - ); - } - f = message.getId(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional Collection collection = 1; - * @return {?proto.nitric.document.v1.Collection} - */ -proto.nitric.document.v1.Key.prototype.getCollection = function() { - return /** @type{?proto.nitric.document.v1.Collection} */ ( - jspb.Message.getWrapperField(this, proto.nitric.document.v1.Collection, 1)); -}; - - -/** - * @param {?proto.nitric.document.v1.Collection|undefined} value - * @return {!proto.nitric.document.v1.Key} returns this -*/ -proto.nitric.document.v1.Key.prototype.setCollection = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.document.v1.Key} returns this - */ -proto.nitric.document.v1.Key.prototype.clearCollection = function() { - return this.setCollection(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.document.v1.Key.prototype.hasCollection = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional string id = 2; - * @return {string} - */ -proto.nitric.document.v1.Key.prototype.getId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.document.v1.Key} returns this - */ -proto.nitric.document.v1.Key.prototype.setId = 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.nitric.document.v1.Document.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.document.v1.Document.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.nitric.document.v1.Document} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.document.v1.Document.toObject = function(includeInstance, msg) { - var f, obj = { - content: (f = msg.getContent()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f), - key: (f = msg.getKey()) && proto.nitric.document.v1.Key.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.nitric.document.v1.Document} - */ -proto.nitric.document.v1.Document.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.document.v1.Document; - return proto.nitric.document.v1.Document.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.document.v1.Document} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.document.v1.Document} - */ -proto.nitric.document.v1.Document.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new google_protobuf_struct_pb.Struct; - reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); - msg.setContent(value); - break; - case 2: - var value = new proto.nitric.document.v1.Key; - reader.readMessage(value,proto.nitric.document.v1.Key.deserializeBinaryFromReader); - msg.setKey(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.document.v1.Document.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.document.v1.Document.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.document.v1.Document} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.document.v1.Document.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getContent(); - if (f != null) { - writer.writeMessage( - 1, - f, - google_protobuf_struct_pb.Struct.serializeBinaryToWriter - ); - } - f = message.getKey(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.nitric.document.v1.Key.serializeBinaryToWriter - ); - } -}; - - -/** - * optional google.protobuf.Struct content = 1; - * @return {?proto.google.protobuf.Struct} - */ -proto.nitric.document.v1.Document.prototype.getContent = function() { - return /** @type{?proto.google.protobuf.Struct} */ ( - jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 1)); -}; - - -/** - * @param {?proto.google.protobuf.Struct|undefined} value - * @return {!proto.nitric.document.v1.Document} returns this -*/ -proto.nitric.document.v1.Document.prototype.setContent = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.document.v1.Document} returns this - */ -proto.nitric.document.v1.Document.prototype.clearContent = function() { - return this.setContent(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.document.v1.Document.prototype.hasContent = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional Key key = 2; - * @return {?proto.nitric.document.v1.Key} - */ -proto.nitric.document.v1.Document.prototype.getKey = function() { - return /** @type{?proto.nitric.document.v1.Key} */ ( - jspb.Message.getWrapperField(this, proto.nitric.document.v1.Key, 2)); -}; - - -/** - * @param {?proto.nitric.document.v1.Key|undefined} value - * @return {!proto.nitric.document.v1.Document} returns this -*/ -proto.nitric.document.v1.Document.prototype.setKey = function(value) { - return jspb.Message.setWrapperField(this, 2, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.document.v1.Document} returns this - */ -proto.nitric.document.v1.Document.prototype.clearKey = function() { - return this.setKey(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.document.v1.Document.prototype.hasKey = function() { - return jspb.Message.getField(this, 2) != null; -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.nitric.document.v1.ExpressionValue.oneofGroups_ = [[1,2,3,4]]; - -/** - * @enum {number} - */ -proto.nitric.document.v1.ExpressionValue.KindCase = { - KIND_NOT_SET: 0, - INT_VALUE: 1, - DOUBLE_VALUE: 2, - STRING_VALUE: 3, - BOOL_VALUE: 4 -}; - -/** - * @return {proto.nitric.document.v1.ExpressionValue.KindCase} - */ -proto.nitric.document.v1.ExpressionValue.prototype.getKindCase = function() { - return /** @type {proto.nitric.document.v1.ExpressionValue.KindCase} */(jspb.Message.computeOneofCase(this, proto.nitric.document.v1.ExpressionValue.oneofGroups_[0])); -}; - - - -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.nitric.document.v1.ExpressionValue.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.document.v1.ExpressionValue.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.nitric.document.v1.ExpressionValue} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.document.v1.ExpressionValue.toObject = function(includeInstance, msg) { - var f, obj = { - intValue: jspb.Message.getFieldWithDefault(msg, 1, 0), - doubleValue: jspb.Message.getFloatingPointFieldWithDefault(msg, 2, 0.0), - stringValue: jspb.Message.getFieldWithDefault(msg, 3, ""), - boolValue: jspb.Message.getBooleanFieldWithDefault(msg, 4, 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.nitric.document.v1.ExpressionValue} - */ -proto.nitric.document.v1.ExpressionValue.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.document.v1.ExpressionValue; - return proto.nitric.document.v1.ExpressionValue.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.document.v1.ExpressionValue} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.document.v1.ExpressionValue} - */ -proto.nitric.document.v1.ExpressionValue.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readInt64()); - msg.setIntValue(value); - break; - case 2: - var value = /** @type {number} */ (reader.readDouble()); - msg.setDoubleValue(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setStringValue(value); - break; - case 4: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setBoolValue(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.document.v1.ExpressionValue.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.document.v1.ExpressionValue.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.document.v1.ExpressionValue} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.document.v1.ExpressionValue.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {number} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeInt64( - 1, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 2)); - if (f != null) { - writer.writeDouble( - 2, - f - ); - } - f = /** @type {string} */ (jspb.Message.getField(message, 3)); - if (f != null) { - writer.writeString( - 3, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 4)); - if (f != null) { - writer.writeBool( - 4, - f - ); - } -}; - - -/** - * optional int64 int_value = 1; - * @return {number} - */ -proto.nitric.document.v1.ExpressionValue.prototype.getIntValue = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.nitric.document.v1.ExpressionValue} returns this - */ -proto.nitric.document.v1.ExpressionValue.prototype.setIntValue = function(value) { - return jspb.Message.setOneofField(this, 1, proto.nitric.document.v1.ExpressionValue.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.nitric.document.v1.ExpressionValue} returns this - */ -proto.nitric.document.v1.ExpressionValue.prototype.clearIntValue = function() { - return jspb.Message.setOneofField(this, 1, proto.nitric.document.v1.ExpressionValue.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.document.v1.ExpressionValue.prototype.hasIntValue = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional double double_value = 2; - * @return {number} - */ -proto.nitric.document.v1.ExpressionValue.prototype.getDoubleValue = function() { - return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 2, 0.0)); -}; - - -/** - * @param {number} value - * @return {!proto.nitric.document.v1.ExpressionValue} returns this - */ -proto.nitric.document.v1.ExpressionValue.prototype.setDoubleValue = function(value) { - return jspb.Message.setOneofField(this, 2, proto.nitric.document.v1.ExpressionValue.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.nitric.document.v1.ExpressionValue} returns this - */ -proto.nitric.document.v1.ExpressionValue.prototype.clearDoubleValue = function() { - return jspb.Message.setOneofField(this, 2, proto.nitric.document.v1.ExpressionValue.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.document.v1.ExpressionValue.prototype.hasDoubleValue = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional string string_value = 3; - * @return {string} - */ -proto.nitric.document.v1.ExpressionValue.prototype.getStringValue = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.document.v1.ExpressionValue} returns this - */ -proto.nitric.document.v1.ExpressionValue.prototype.setStringValue = function(value) { - return jspb.Message.setOneofField(this, 3, proto.nitric.document.v1.ExpressionValue.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.nitric.document.v1.ExpressionValue} returns this - */ -proto.nitric.document.v1.ExpressionValue.prototype.clearStringValue = function() { - return jspb.Message.setOneofField(this, 3, proto.nitric.document.v1.ExpressionValue.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.document.v1.ExpressionValue.prototype.hasStringValue = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * optional bool bool_value = 4; - * @return {boolean} - */ -proto.nitric.document.v1.ExpressionValue.prototype.getBoolValue = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.nitric.document.v1.ExpressionValue} returns this - */ -proto.nitric.document.v1.ExpressionValue.prototype.setBoolValue = function(value) { - return jspb.Message.setOneofField(this, 4, proto.nitric.document.v1.ExpressionValue.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.nitric.document.v1.ExpressionValue} returns this - */ -proto.nitric.document.v1.ExpressionValue.prototype.clearBoolValue = function() { - return jspb.Message.setOneofField(this, 4, proto.nitric.document.v1.ExpressionValue.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.document.v1.ExpressionValue.prototype.hasBoolValue = 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.nitric.document.v1.Expression.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.document.v1.Expression.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.nitric.document.v1.Expression} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.document.v1.Expression.toObject = function(includeInstance, msg) { - var f, obj = { - operand: jspb.Message.getFieldWithDefault(msg, 1, ""), - operator: jspb.Message.getFieldWithDefault(msg, 2, ""), - value: (f = msg.getValue()) && proto.nitric.document.v1.ExpressionValue.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.nitric.document.v1.Expression} - */ -proto.nitric.document.v1.Expression.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.document.v1.Expression; - return proto.nitric.document.v1.Expression.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.document.v1.Expression} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.document.v1.Expression} - */ -proto.nitric.document.v1.Expression.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.setOperand(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setOperator(value); - break; - case 3: - var value = new proto.nitric.document.v1.ExpressionValue; - reader.readMessage(value,proto.nitric.document.v1.ExpressionValue.deserializeBinaryFromReader); - msg.setValue(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.document.v1.Expression.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.document.v1.Expression.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.document.v1.Expression} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.document.v1.Expression.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getOperand(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getOperator(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getValue(); - if (f != null) { - writer.writeMessage( - 3, - f, - proto.nitric.document.v1.ExpressionValue.serializeBinaryToWriter - ); - } -}; - - -/** - * optional string operand = 1; - * @return {string} - */ -proto.nitric.document.v1.Expression.prototype.getOperand = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.document.v1.Expression} returns this - */ -proto.nitric.document.v1.Expression.prototype.setOperand = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string operator = 2; - * @return {string} - */ -proto.nitric.document.v1.Expression.prototype.getOperator = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.document.v1.Expression} returns this - */ -proto.nitric.document.v1.Expression.prototype.setOperator = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional ExpressionValue value = 3; - * @return {?proto.nitric.document.v1.ExpressionValue} - */ -proto.nitric.document.v1.Expression.prototype.getValue = function() { - return /** @type{?proto.nitric.document.v1.ExpressionValue} */ ( - jspb.Message.getWrapperField(this, proto.nitric.document.v1.ExpressionValue, 3)); -}; - - -/** - * @param {?proto.nitric.document.v1.ExpressionValue|undefined} value - * @return {!proto.nitric.document.v1.Expression} returns this -*/ -proto.nitric.document.v1.Expression.prototype.setValue = function(value) { - return jspb.Message.setWrapperField(this, 3, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.document.v1.Expression} returns this - */ -proto.nitric.document.v1.Expression.prototype.clearValue = function() { - return this.setValue(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.document.v1.Expression.prototype.hasValue = 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.nitric.document.v1.DocumentGetRequest.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.document.v1.DocumentGetRequest.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.nitric.document.v1.DocumentGetRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.document.v1.DocumentGetRequest.toObject = function(includeInstance, msg) { - var f, obj = { - key: (f = msg.getKey()) && proto.nitric.document.v1.Key.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.nitric.document.v1.DocumentGetRequest} - */ -proto.nitric.document.v1.DocumentGetRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.document.v1.DocumentGetRequest; - return proto.nitric.document.v1.DocumentGetRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.document.v1.DocumentGetRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.document.v1.DocumentGetRequest} - */ -proto.nitric.document.v1.DocumentGetRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nitric.document.v1.Key; - reader.readMessage(value,proto.nitric.document.v1.Key.deserializeBinaryFromReader); - msg.setKey(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.document.v1.DocumentGetRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.document.v1.DocumentGetRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.document.v1.DocumentGetRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.document.v1.DocumentGetRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getKey(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.nitric.document.v1.Key.serializeBinaryToWriter - ); - } -}; - - -/** - * optional Key key = 1; - * @return {?proto.nitric.document.v1.Key} - */ -proto.nitric.document.v1.DocumentGetRequest.prototype.getKey = function() { - return /** @type{?proto.nitric.document.v1.Key} */ ( - jspb.Message.getWrapperField(this, proto.nitric.document.v1.Key, 1)); -}; - - -/** - * @param {?proto.nitric.document.v1.Key|undefined} value - * @return {!proto.nitric.document.v1.DocumentGetRequest} returns this -*/ -proto.nitric.document.v1.DocumentGetRequest.prototype.setKey = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.document.v1.DocumentGetRequest} returns this - */ -proto.nitric.document.v1.DocumentGetRequest.prototype.clearKey = function() { - return this.setKey(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.document.v1.DocumentGetRequest.prototype.hasKey = 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.nitric.document.v1.DocumentGetResponse.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.document.v1.DocumentGetResponse.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.nitric.document.v1.DocumentGetResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.document.v1.DocumentGetResponse.toObject = function(includeInstance, msg) { - var f, obj = { - document: (f = msg.getDocument()) && proto.nitric.document.v1.Document.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.nitric.document.v1.DocumentGetResponse} - */ -proto.nitric.document.v1.DocumentGetResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.document.v1.DocumentGetResponse; - return proto.nitric.document.v1.DocumentGetResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.document.v1.DocumentGetResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.document.v1.DocumentGetResponse} - */ -proto.nitric.document.v1.DocumentGetResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nitric.document.v1.Document; - reader.readMessage(value,proto.nitric.document.v1.Document.deserializeBinaryFromReader); - msg.setDocument(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.document.v1.DocumentGetResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.document.v1.DocumentGetResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.document.v1.DocumentGetResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.document.v1.DocumentGetResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getDocument(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.nitric.document.v1.Document.serializeBinaryToWriter - ); - } -}; - - -/** - * optional Document document = 1; - * @return {?proto.nitric.document.v1.Document} - */ -proto.nitric.document.v1.DocumentGetResponse.prototype.getDocument = function() { - return /** @type{?proto.nitric.document.v1.Document} */ ( - jspb.Message.getWrapperField(this, proto.nitric.document.v1.Document, 1)); -}; - - -/** - * @param {?proto.nitric.document.v1.Document|undefined} value - * @return {!proto.nitric.document.v1.DocumentGetResponse} returns this -*/ -proto.nitric.document.v1.DocumentGetResponse.prototype.setDocument = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.document.v1.DocumentGetResponse} returns this - */ -proto.nitric.document.v1.DocumentGetResponse.prototype.clearDocument = function() { - return this.setDocument(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.document.v1.DocumentGetResponse.prototype.hasDocument = 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.nitric.document.v1.DocumentSetRequest.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.document.v1.DocumentSetRequest.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.nitric.document.v1.DocumentSetRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.document.v1.DocumentSetRequest.toObject = function(includeInstance, msg) { - var f, obj = { - key: (f = msg.getKey()) && proto.nitric.document.v1.Key.toObject(includeInstance, f), - content: (f = msg.getContent()) && google_protobuf_struct_pb.Struct.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.nitric.document.v1.DocumentSetRequest} - */ -proto.nitric.document.v1.DocumentSetRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.document.v1.DocumentSetRequest; - return proto.nitric.document.v1.DocumentSetRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.document.v1.DocumentSetRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.document.v1.DocumentSetRequest} - */ -proto.nitric.document.v1.DocumentSetRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nitric.document.v1.Key; - reader.readMessage(value,proto.nitric.document.v1.Key.deserializeBinaryFromReader); - msg.setKey(value); - break; - case 3: - var value = new google_protobuf_struct_pb.Struct; - reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); - msg.setContent(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.document.v1.DocumentSetRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.document.v1.DocumentSetRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.document.v1.DocumentSetRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.document.v1.DocumentSetRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getKey(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.nitric.document.v1.Key.serializeBinaryToWriter - ); - } - f = message.getContent(); - if (f != null) { - writer.writeMessage( - 3, - f, - google_protobuf_struct_pb.Struct.serializeBinaryToWriter - ); - } -}; - - -/** - * optional Key key = 1; - * @return {?proto.nitric.document.v1.Key} - */ -proto.nitric.document.v1.DocumentSetRequest.prototype.getKey = function() { - return /** @type{?proto.nitric.document.v1.Key} */ ( - jspb.Message.getWrapperField(this, proto.nitric.document.v1.Key, 1)); -}; - - -/** - * @param {?proto.nitric.document.v1.Key|undefined} value - * @return {!proto.nitric.document.v1.DocumentSetRequest} returns this -*/ -proto.nitric.document.v1.DocumentSetRequest.prototype.setKey = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.document.v1.DocumentSetRequest} returns this - */ -proto.nitric.document.v1.DocumentSetRequest.prototype.clearKey = function() { - return this.setKey(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.document.v1.DocumentSetRequest.prototype.hasKey = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional google.protobuf.Struct content = 3; - * @return {?proto.google.protobuf.Struct} - */ -proto.nitric.document.v1.DocumentSetRequest.prototype.getContent = function() { - return /** @type{?proto.google.protobuf.Struct} */ ( - jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 3)); -}; - - -/** - * @param {?proto.google.protobuf.Struct|undefined} value - * @return {!proto.nitric.document.v1.DocumentSetRequest} returns this -*/ -proto.nitric.document.v1.DocumentSetRequest.prototype.setContent = function(value) { - return jspb.Message.setWrapperField(this, 3, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.document.v1.DocumentSetRequest} returns this - */ -proto.nitric.document.v1.DocumentSetRequest.prototype.clearContent = function() { - return this.setContent(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.document.v1.DocumentSetRequest.prototype.hasContent = 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.nitric.document.v1.DocumentSetResponse.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.document.v1.DocumentSetResponse.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.nitric.document.v1.DocumentSetResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.document.v1.DocumentSetResponse.toObject = function(includeInstance, msg) { - var f, obj = { - - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.document.v1.DocumentSetResponse} - */ -proto.nitric.document.v1.DocumentSetResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.document.v1.DocumentSetResponse; - return proto.nitric.document.v1.DocumentSetResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.document.v1.DocumentSetResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.document.v1.DocumentSetResponse} - */ -proto.nitric.document.v1.DocumentSetResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.document.v1.DocumentSetResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.document.v1.DocumentSetResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.document.v1.DocumentSetResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.document.v1.DocumentSetResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; -}; - - - - - -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.nitric.document.v1.DocumentDeleteRequest.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.document.v1.DocumentDeleteRequest.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.nitric.document.v1.DocumentDeleteRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.document.v1.DocumentDeleteRequest.toObject = function(includeInstance, msg) { - var f, obj = { - key: (f = msg.getKey()) && proto.nitric.document.v1.Key.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.nitric.document.v1.DocumentDeleteRequest} - */ -proto.nitric.document.v1.DocumentDeleteRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.document.v1.DocumentDeleteRequest; - return proto.nitric.document.v1.DocumentDeleteRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.document.v1.DocumentDeleteRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.document.v1.DocumentDeleteRequest} - */ -proto.nitric.document.v1.DocumentDeleteRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nitric.document.v1.Key; - reader.readMessage(value,proto.nitric.document.v1.Key.deserializeBinaryFromReader); - msg.setKey(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.document.v1.DocumentDeleteRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.document.v1.DocumentDeleteRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.document.v1.DocumentDeleteRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.document.v1.DocumentDeleteRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getKey(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.nitric.document.v1.Key.serializeBinaryToWriter - ); - } -}; - - -/** - * optional Key key = 1; - * @return {?proto.nitric.document.v1.Key} - */ -proto.nitric.document.v1.DocumentDeleteRequest.prototype.getKey = function() { - return /** @type{?proto.nitric.document.v1.Key} */ ( - jspb.Message.getWrapperField(this, proto.nitric.document.v1.Key, 1)); -}; - - -/** - * @param {?proto.nitric.document.v1.Key|undefined} value - * @return {!proto.nitric.document.v1.DocumentDeleteRequest} returns this -*/ -proto.nitric.document.v1.DocumentDeleteRequest.prototype.setKey = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.document.v1.DocumentDeleteRequest} returns this - */ -proto.nitric.document.v1.DocumentDeleteRequest.prototype.clearKey = function() { - return this.setKey(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.document.v1.DocumentDeleteRequest.prototype.hasKey = 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.nitric.document.v1.DocumentDeleteResponse.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.document.v1.DocumentDeleteResponse.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.nitric.document.v1.DocumentDeleteResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.document.v1.DocumentDeleteResponse.toObject = function(includeInstance, msg) { - var f, obj = { - - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.document.v1.DocumentDeleteResponse} - */ -proto.nitric.document.v1.DocumentDeleteResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.document.v1.DocumentDeleteResponse; - return proto.nitric.document.v1.DocumentDeleteResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.document.v1.DocumentDeleteResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.document.v1.DocumentDeleteResponse} - */ -proto.nitric.document.v1.DocumentDeleteResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.document.v1.DocumentDeleteResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.document.v1.DocumentDeleteResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.document.v1.DocumentDeleteResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.document.v1.DocumentDeleteResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.nitric.document.v1.DocumentQueryRequest.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.nitric.document.v1.DocumentQueryRequest.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.document.v1.DocumentQueryRequest.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.nitric.document.v1.DocumentQueryRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.document.v1.DocumentQueryRequest.toObject = function(includeInstance, msg) { - var f, obj = { - collection: (f = msg.getCollection()) && proto.nitric.document.v1.Collection.toObject(includeInstance, f), - expressionsList: jspb.Message.toObjectList(msg.getExpressionsList(), - proto.nitric.document.v1.Expression.toObject, includeInstance), - limit: jspb.Message.getFieldWithDefault(msg, 4, 0), - pagingTokenMap: (f = msg.getPagingTokenMap()) ? 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.nitric.document.v1.DocumentQueryRequest} - */ -proto.nitric.document.v1.DocumentQueryRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.document.v1.DocumentQueryRequest; - return proto.nitric.document.v1.DocumentQueryRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.document.v1.DocumentQueryRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.document.v1.DocumentQueryRequest} - */ -proto.nitric.document.v1.DocumentQueryRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nitric.document.v1.Collection; - reader.readMessage(value,proto.nitric.document.v1.Collection.deserializeBinaryFromReader); - msg.setCollection(value); - break; - case 3: - var value = new proto.nitric.document.v1.Expression; - reader.readMessage(value,proto.nitric.document.v1.Expression.deserializeBinaryFromReader); - msg.addExpressions(value); - break; - case 4: - var value = /** @type {number} */ (reader.readInt32()); - msg.setLimit(value); - break; - case 5: - var value = msg.getPagingTokenMap(); - 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.nitric.document.v1.DocumentQueryRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.document.v1.DocumentQueryRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.document.v1.DocumentQueryRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.document.v1.DocumentQueryRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getCollection(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.nitric.document.v1.Collection.serializeBinaryToWriter - ); - } - f = message.getExpressionsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 3, - f, - proto.nitric.document.v1.Expression.serializeBinaryToWriter - ); - } - f = message.getLimit(); - if (f !== 0) { - writer.writeInt32( - 4, - f - ); - } - f = message.getPagingTokenMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); - } -}; - - -/** - * optional Collection collection = 1; - * @return {?proto.nitric.document.v1.Collection} - */ -proto.nitric.document.v1.DocumentQueryRequest.prototype.getCollection = function() { - return /** @type{?proto.nitric.document.v1.Collection} */ ( - jspb.Message.getWrapperField(this, proto.nitric.document.v1.Collection, 1)); -}; - - -/** - * @param {?proto.nitric.document.v1.Collection|undefined} value - * @return {!proto.nitric.document.v1.DocumentQueryRequest} returns this -*/ -proto.nitric.document.v1.DocumentQueryRequest.prototype.setCollection = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.document.v1.DocumentQueryRequest} returns this - */ -proto.nitric.document.v1.DocumentQueryRequest.prototype.clearCollection = function() { - return this.setCollection(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.document.v1.DocumentQueryRequest.prototype.hasCollection = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * repeated Expression expressions = 3; - * @return {!Array} - */ -proto.nitric.document.v1.DocumentQueryRequest.prototype.getExpressionsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.nitric.document.v1.Expression, 3)); -}; - - -/** - * @param {!Array} value - * @return {!proto.nitric.document.v1.DocumentQueryRequest} returns this -*/ -proto.nitric.document.v1.DocumentQueryRequest.prototype.setExpressionsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 3, value); -}; - - -/** - * @param {!proto.nitric.document.v1.Expression=} opt_value - * @param {number=} opt_index - * @return {!proto.nitric.document.v1.Expression} - */ -proto.nitric.document.v1.DocumentQueryRequest.prototype.addExpressions = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.nitric.document.v1.Expression, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.nitric.document.v1.DocumentQueryRequest} returns this - */ -proto.nitric.document.v1.DocumentQueryRequest.prototype.clearExpressionsList = function() { - return this.setExpressionsList([]); -}; - - -/** - * optional int32 limit = 4; - * @return {number} - */ -proto.nitric.document.v1.DocumentQueryRequest.prototype.getLimit = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.nitric.document.v1.DocumentQueryRequest} returns this - */ -proto.nitric.document.v1.DocumentQueryRequest.prototype.setLimit = function(value) { - return jspb.Message.setProto3IntField(this, 4, value); -}; - - -/** - * map paging_token = 5; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.nitric.document.v1.DocumentQueryRequest.prototype.getPagingTokenMap = 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.nitric.document.v1.DocumentQueryRequest} returns this - */ -proto.nitric.document.v1.DocumentQueryRequest.prototype.clearPagingTokenMap = function() { - this.getPagingTokenMap().clear(); - return this;}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.nitric.document.v1.DocumentQueryResponse.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.nitric.document.v1.DocumentQueryResponse.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.document.v1.DocumentQueryResponse.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.nitric.document.v1.DocumentQueryResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.document.v1.DocumentQueryResponse.toObject = function(includeInstance, msg) { - var f, obj = { - documentsList: jspb.Message.toObjectList(msg.getDocumentsList(), - proto.nitric.document.v1.Document.toObject, includeInstance), - pagingTokenMap: (f = msg.getPagingTokenMap()) ? 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.nitric.document.v1.DocumentQueryResponse} - */ -proto.nitric.document.v1.DocumentQueryResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.document.v1.DocumentQueryResponse; - return proto.nitric.document.v1.DocumentQueryResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.document.v1.DocumentQueryResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.document.v1.DocumentQueryResponse} - */ -proto.nitric.document.v1.DocumentQueryResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nitric.document.v1.Document; - reader.readMessage(value,proto.nitric.document.v1.Document.deserializeBinaryFromReader); - msg.addDocuments(value); - break; - case 2: - var value = msg.getPagingTokenMap(); - 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.nitric.document.v1.DocumentQueryResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.document.v1.DocumentQueryResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.document.v1.DocumentQueryResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.document.v1.DocumentQueryResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getDocumentsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.nitric.document.v1.Document.serializeBinaryToWriter - ); - } - f = message.getPagingTokenMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); - } -}; - - -/** - * repeated Document documents = 1; - * @return {!Array} - */ -proto.nitric.document.v1.DocumentQueryResponse.prototype.getDocumentsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.nitric.document.v1.Document, 1)); -}; - - -/** - * @param {!Array} value - * @return {!proto.nitric.document.v1.DocumentQueryResponse} returns this -*/ -proto.nitric.document.v1.DocumentQueryResponse.prototype.setDocumentsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 1, value); -}; - - -/** - * @param {!proto.nitric.document.v1.Document=} opt_value - * @param {number=} opt_index - * @return {!proto.nitric.document.v1.Document} - */ -proto.nitric.document.v1.DocumentQueryResponse.prototype.addDocuments = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.nitric.document.v1.Document, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.nitric.document.v1.DocumentQueryResponse} returns this - */ -proto.nitric.document.v1.DocumentQueryResponse.prototype.clearDocumentsList = function() { - return this.setDocumentsList([]); -}; - - -/** - * map paging_token = 2; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.nitric.document.v1.DocumentQueryResponse.prototype.getPagingTokenMap = 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.nitric.document.v1.DocumentQueryResponse} returns this - */ -proto.nitric.document.v1.DocumentQueryResponse.prototype.clearPagingTokenMap = function() { - this.getPagingTokenMap().clear(); - return this;}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.nitric.document.v1.DocumentQueryStreamRequest.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.nitric.document.v1.DocumentQueryStreamRequest.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.document.v1.DocumentQueryStreamRequest.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.nitric.document.v1.DocumentQueryStreamRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.document.v1.DocumentQueryStreamRequest.toObject = function(includeInstance, msg) { - var f, obj = { - collection: (f = msg.getCollection()) && proto.nitric.document.v1.Collection.toObject(includeInstance, f), - expressionsList: jspb.Message.toObjectList(msg.getExpressionsList(), - proto.nitric.document.v1.Expression.toObject, includeInstance), - limit: 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.nitric.document.v1.DocumentQueryStreamRequest} - */ -proto.nitric.document.v1.DocumentQueryStreamRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.document.v1.DocumentQueryStreamRequest; - return proto.nitric.document.v1.DocumentQueryStreamRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.document.v1.DocumentQueryStreamRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.document.v1.DocumentQueryStreamRequest} - */ -proto.nitric.document.v1.DocumentQueryStreamRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nitric.document.v1.Collection; - reader.readMessage(value,proto.nitric.document.v1.Collection.deserializeBinaryFromReader); - msg.setCollection(value); - break; - case 3: - var value = new proto.nitric.document.v1.Expression; - reader.readMessage(value,proto.nitric.document.v1.Expression.deserializeBinaryFromReader); - msg.addExpressions(value); - break; - case 4: - var value = /** @type {number} */ (reader.readInt32()); - msg.setLimit(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.document.v1.DocumentQueryStreamRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.document.v1.DocumentQueryStreamRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.document.v1.DocumentQueryStreamRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.document.v1.DocumentQueryStreamRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getCollection(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.nitric.document.v1.Collection.serializeBinaryToWriter - ); - } - f = message.getExpressionsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 3, - f, - proto.nitric.document.v1.Expression.serializeBinaryToWriter - ); - } - f = message.getLimit(); - if (f !== 0) { - writer.writeInt32( - 4, - f - ); - } -}; - - -/** - * optional Collection collection = 1; - * @return {?proto.nitric.document.v1.Collection} - */ -proto.nitric.document.v1.DocumentQueryStreamRequest.prototype.getCollection = function() { - return /** @type{?proto.nitric.document.v1.Collection} */ ( - jspb.Message.getWrapperField(this, proto.nitric.document.v1.Collection, 1)); -}; - - -/** - * @param {?proto.nitric.document.v1.Collection|undefined} value - * @return {!proto.nitric.document.v1.DocumentQueryStreamRequest} returns this -*/ -proto.nitric.document.v1.DocumentQueryStreamRequest.prototype.setCollection = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.document.v1.DocumentQueryStreamRequest} returns this - */ -proto.nitric.document.v1.DocumentQueryStreamRequest.prototype.clearCollection = function() { - return this.setCollection(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.document.v1.DocumentQueryStreamRequest.prototype.hasCollection = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * repeated Expression expressions = 3; - * @return {!Array} - */ -proto.nitric.document.v1.DocumentQueryStreamRequest.prototype.getExpressionsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.nitric.document.v1.Expression, 3)); -}; - - -/** - * @param {!Array} value - * @return {!proto.nitric.document.v1.DocumentQueryStreamRequest} returns this -*/ -proto.nitric.document.v1.DocumentQueryStreamRequest.prototype.setExpressionsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 3, value); -}; - - -/** - * @param {!proto.nitric.document.v1.Expression=} opt_value - * @param {number=} opt_index - * @return {!proto.nitric.document.v1.Expression} - */ -proto.nitric.document.v1.DocumentQueryStreamRequest.prototype.addExpressions = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.nitric.document.v1.Expression, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.nitric.document.v1.DocumentQueryStreamRequest} returns this - */ -proto.nitric.document.v1.DocumentQueryStreamRequest.prototype.clearExpressionsList = function() { - return this.setExpressionsList([]); -}; - - -/** - * optional int32 limit = 4; - * @return {number} - */ -proto.nitric.document.v1.DocumentQueryStreamRequest.prototype.getLimit = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.nitric.document.v1.DocumentQueryStreamRequest} returns this - */ -proto.nitric.document.v1.DocumentQueryStreamRequest.prototype.setLimit = 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.nitric.document.v1.DocumentQueryStreamResponse.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.document.v1.DocumentQueryStreamResponse.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.nitric.document.v1.DocumentQueryStreamResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.document.v1.DocumentQueryStreamResponse.toObject = function(includeInstance, msg) { - var f, obj = { - document: (f = msg.getDocument()) && proto.nitric.document.v1.Document.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.nitric.document.v1.DocumentQueryStreamResponse} - */ -proto.nitric.document.v1.DocumentQueryStreamResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.document.v1.DocumentQueryStreamResponse; - return proto.nitric.document.v1.DocumentQueryStreamResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.document.v1.DocumentQueryStreamResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.document.v1.DocumentQueryStreamResponse} - */ -proto.nitric.document.v1.DocumentQueryStreamResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nitric.document.v1.Document; - reader.readMessage(value,proto.nitric.document.v1.Document.deserializeBinaryFromReader); - msg.setDocument(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.document.v1.DocumentQueryStreamResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.document.v1.DocumentQueryStreamResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.document.v1.DocumentQueryStreamResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.document.v1.DocumentQueryStreamResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getDocument(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.nitric.document.v1.Document.serializeBinaryToWriter - ); - } -}; - - -/** - * optional Document document = 1; - * @return {?proto.nitric.document.v1.Document} - */ -proto.nitric.document.v1.DocumentQueryStreamResponse.prototype.getDocument = function() { - return /** @type{?proto.nitric.document.v1.Document} */ ( - jspb.Message.getWrapperField(this, proto.nitric.document.v1.Document, 1)); -}; - - -/** - * @param {?proto.nitric.document.v1.Document|undefined} value - * @return {!proto.nitric.document.v1.DocumentQueryStreamResponse} returns this -*/ -proto.nitric.document.v1.DocumentQueryStreamResponse.prototype.setDocument = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.document.v1.DocumentQueryStreamResponse} returns this - */ -proto.nitric.document.v1.DocumentQueryStreamResponse.prototype.clearDocument = function() { - return this.setDocument(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.document.v1.DocumentQueryStreamResponse.prototype.hasDocument = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -goog.object.extend(exports, proto.nitric.document.v1); diff --git a/src/gen/proto/error/v1/error_grpc_pb.d.ts b/src/gen/proto/error/v1/error_grpc_pb.d.ts deleted file mode 100644 index 51b4d695..00000000 --- a/src/gen/proto/error/v1/error_grpc_pb.d.ts +++ /dev/null @@ -1 +0,0 @@ -// GENERATED CODE -- NO SERVICES IN PROTO diff --git a/src/gen/proto/error/v1/error_grpc_pb.js b/src/gen/proto/error/v1/error_grpc_pb.js deleted file mode 100644 index 97b3a246..00000000 --- a/src/gen/proto/error/v1/error_grpc_pb.js +++ /dev/null @@ -1 +0,0 @@ -// GENERATED CODE -- NO SERVICES IN PROTO \ No newline at end of file diff --git a/src/gen/proto/error/v1/error_pb.d.ts b/src/gen/proto/error/v1/error_pb.d.ts deleted file mode 100644 index f002155e..00000000 --- a/src/gen/proto/error/v1/error_pb.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -// package: nitric.error.v1 -// file: proto/error/v1/error.proto - -import * as jspb from "google-protobuf"; - -export class ErrorScope extends jspb.Message { - getService(): string; - setService(value: string): void; - - getPlugin(): string; - setPlugin(value: string): void; - - getArgsMap(): jspb.Map; - clearArgsMap(): void; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): ErrorScope.AsObject; - static toObject(includeInstance: boolean, msg: ErrorScope): ErrorScope.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: ErrorScope, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): ErrorScope; - static deserializeBinaryFromReader(message: ErrorScope, reader: jspb.BinaryReader): ErrorScope; -} - -export namespace ErrorScope { - export type AsObject = { - service: string, - plugin: string, - argsMap: Array<[string, string]>, - } -} - -export class ErrorDetails extends jspb.Message { - getMessage(): string; - setMessage(value: string): void; - - getCause(): string; - setCause(value: string): void; - - hasScope(): boolean; - clearScope(): void; - getScope(): ErrorScope | undefined; - setScope(value?: ErrorScope): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): ErrorDetails.AsObject; - static toObject(includeInstance: boolean, msg: ErrorDetails): ErrorDetails.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: ErrorDetails, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): ErrorDetails; - static deserializeBinaryFromReader(message: ErrorDetails, reader: jspb.BinaryReader): ErrorDetails; -} - -export namespace ErrorDetails { - export type AsObject = { - message: string, - cause: string, - scope?: ErrorScope.AsObject, - } -} - diff --git a/src/gen/proto/error/v1/error_pb.js b/src/gen/proto/error/v1/error_pb.js deleted file mode 100644 index f3e2857a..00000000 --- a/src/gen/proto/error/v1/error_pb.js +++ /dev/null @@ -1,472 +0,0 @@ -// source: proto/error/v1/error.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() { - if (this) { return this; } - if (typeof window !== 'undefined') { return window; } - if (typeof global !== 'undefined') { return global; } - if (typeof self !== 'undefined') { return self; } - return Function('return this')(); -}.call(null)); - -goog.exportSymbol('proto.nitric.error.v1.ErrorDetails', null, global); -goog.exportSymbol('proto.nitric.error.v1.ErrorScope', 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.nitric.error.v1.ErrorScope = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.error.v1.ErrorScope, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.error.v1.ErrorScope.displayName = 'proto.nitric.error.v1.ErrorScope'; -} -/** - * 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.nitric.error.v1.ErrorDetails = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.error.v1.ErrorDetails, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.error.v1.ErrorDetails.displayName = 'proto.nitric.error.v1.ErrorDetails'; -} - - - -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.nitric.error.v1.ErrorScope.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.error.v1.ErrorScope.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.nitric.error.v1.ErrorScope} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.error.v1.ErrorScope.toObject = function(includeInstance, msg) { - var f, obj = { - service: jspb.Message.getFieldWithDefault(msg, 1, ""), - plugin: jspb.Message.getFieldWithDefault(msg, 2, ""), - argsMap: (f = msg.getArgsMap()) ? 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.nitric.error.v1.ErrorScope} - */ -proto.nitric.error.v1.ErrorScope.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.error.v1.ErrorScope; - return proto.nitric.error.v1.ErrorScope.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.error.v1.ErrorScope} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.error.v1.ErrorScope} - */ -proto.nitric.error.v1.ErrorScope.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.setService(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setPlugin(value); - break; - case 3: - var value = msg.getArgsMap(); - 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.nitric.error.v1.ErrorScope.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.error.v1.ErrorScope.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.error.v1.ErrorScope} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.error.v1.ErrorScope.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getService(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getPlugin(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getArgsMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(3, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); - } -}; - - -/** - * optional string service = 1; - * @return {string} - */ -proto.nitric.error.v1.ErrorScope.prototype.getService = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.error.v1.ErrorScope} returns this - */ -proto.nitric.error.v1.ErrorScope.prototype.setService = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string plugin = 2; - * @return {string} - */ -proto.nitric.error.v1.ErrorScope.prototype.getPlugin = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.error.v1.ErrorScope} returns this - */ -proto.nitric.error.v1.ErrorScope.prototype.setPlugin = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * map args = 3; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.nitric.error.v1.ErrorScope.prototype.getArgsMap = 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.nitric.error.v1.ErrorScope} returns this - */ -proto.nitric.error.v1.ErrorScope.prototype.clearArgsMap = function() { - this.getArgsMap().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.nitric.error.v1.ErrorDetails.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.error.v1.ErrorDetails.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.nitric.error.v1.ErrorDetails} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.error.v1.ErrorDetails.toObject = function(includeInstance, msg) { - var f, obj = { - message: jspb.Message.getFieldWithDefault(msg, 1, ""), - cause: jspb.Message.getFieldWithDefault(msg, 2, ""), - scope: (f = msg.getScope()) && proto.nitric.error.v1.ErrorScope.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.nitric.error.v1.ErrorDetails} - */ -proto.nitric.error.v1.ErrorDetails.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.error.v1.ErrorDetails; - return proto.nitric.error.v1.ErrorDetails.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.error.v1.ErrorDetails} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.error.v1.ErrorDetails} - */ -proto.nitric.error.v1.ErrorDetails.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.setMessage(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setCause(value); - break; - case 3: - var value = new proto.nitric.error.v1.ErrorScope; - reader.readMessage(value,proto.nitric.error.v1.ErrorScope.deserializeBinaryFromReader); - msg.setScope(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.error.v1.ErrorDetails.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.error.v1.ErrorDetails.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.error.v1.ErrorDetails} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.error.v1.ErrorDetails.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getMessage(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getCause(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getScope(); - if (f != null) { - writer.writeMessage( - 3, - f, - proto.nitric.error.v1.ErrorScope.serializeBinaryToWriter - ); - } -}; - - -/** - * optional string message = 1; - * @return {string} - */ -proto.nitric.error.v1.ErrorDetails.prototype.getMessage = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.error.v1.ErrorDetails} returns this - */ -proto.nitric.error.v1.ErrorDetails.prototype.setMessage = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string cause = 2; - * @return {string} - */ -proto.nitric.error.v1.ErrorDetails.prototype.getCause = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.error.v1.ErrorDetails} returns this - */ -proto.nitric.error.v1.ErrorDetails.prototype.setCause = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional ErrorScope scope = 3; - * @return {?proto.nitric.error.v1.ErrorScope} - */ -proto.nitric.error.v1.ErrorDetails.prototype.getScope = function() { - return /** @type{?proto.nitric.error.v1.ErrorScope} */ ( - jspb.Message.getWrapperField(this, proto.nitric.error.v1.ErrorScope, 3)); -}; - - -/** - * @param {?proto.nitric.error.v1.ErrorScope|undefined} value - * @return {!proto.nitric.error.v1.ErrorDetails} returns this -*/ -proto.nitric.error.v1.ErrorDetails.prototype.setScope = function(value) { - return jspb.Message.setWrapperField(this, 3, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.error.v1.ErrorDetails} returns this - */ -proto.nitric.error.v1.ErrorDetails.prototype.clearScope = function() { - return this.setScope(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.error.v1.ErrorDetails.prototype.hasScope = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -goog.object.extend(exports, proto.nitric.error.v1); diff --git a/src/gen/proto/event/v1/event_grpc_pb.d.ts b/src/gen/proto/event/v1/event_grpc_pb.d.ts deleted file mode 100644 index c2837004..00000000 --- a/src/gen/proto/event/v1/event_grpc_pb.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -// GENERATED CODE -- DO NOT EDIT! - -// package: nitric.event.v1 -// file: proto/event/v1/event.proto - -import * as proto_event_v1_event_pb from "../../../proto/event/v1/event_pb"; -import * as grpc from "@grpc/grpc-js"; - -interface IEventServiceService extends grpc.ServiceDefinition { - publish: grpc.MethodDefinition; -} - -export const EventServiceService: IEventServiceService; - -export interface IEventServiceServer extends grpc.UntypedServiceImplementation { - publish: grpc.handleUnaryCall; -} - -export class EventServiceClient extends grpc.Client { - constructor(address: string, credentials: grpc.ChannelCredentials, options?: object); - publish(argument: proto_event_v1_event_pb.EventPublishRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; - publish(argument: proto_event_v1_event_pb.EventPublishRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - publish(argument: proto_event_v1_event_pb.EventPublishRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; -} - -interface ITopicServiceService extends grpc.ServiceDefinition { - list: grpc.MethodDefinition; -} - -export const TopicServiceService: ITopicServiceService; - -export interface ITopicServiceServer extends grpc.UntypedServiceImplementation { - list: grpc.handleUnaryCall; -} - -export class TopicServiceClient extends grpc.Client { - constructor(address: string, credentials: grpc.ChannelCredentials, options?: object); - list(argument: proto_event_v1_event_pb.TopicListRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; - list(argument: proto_event_v1_event_pb.TopicListRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - list(argument: proto_event_v1_event_pb.TopicListRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; -} diff --git a/src/gen/proto/event/v1/event_grpc_pb.js b/src/gen/proto/event/v1/event_grpc_pb.js deleted file mode 100644 index bbbbeb6f..00000000 --- a/src/gen/proto/event/v1/event_grpc_pb.js +++ /dev/null @@ -1,87 +0,0 @@ -// GENERATED CODE -- DO NOT EDIT! - -'use strict'; -var grpc = require('@grpc/grpc-js'); -var proto_event_v1_event_pb = require('../../../proto/event/v1/event_pb.js'); -var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js'); -var validate_validate_pb = require('../../../validate/validate_pb.js'); - -function serialize_nitric_event_v1_EventPublishRequest(arg) { - if (!(arg instanceof proto_event_v1_event_pb.EventPublishRequest)) { - throw new Error('Expected argument of type nitric.event.v1.EventPublishRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_event_v1_EventPublishRequest(buffer_arg) { - return proto_event_v1_event_pb.EventPublishRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_event_v1_EventPublishResponse(arg) { - if (!(arg instanceof proto_event_v1_event_pb.EventPublishResponse)) { - throw new Error('Expected argument of type nitric.event.v1.EventPublishResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_event_v1_EventPublishResponse(buffer_arg) { - return proto_event_v1_event_pb.EventPublishResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_event_v1_TopicListRequest(arg) { - if (!(arg instanceof proto_event_v1_event_pb.TopicListRequest)) { - throw new Error('Expected argument of type nitric.event.v1.TopicListRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_event_v1_TopicListRequest(buffer_arg) { - return proto_event_v1_event_pb.TopicListRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_event_v1_TopicListResponse(arg) { - if (!(arg instanceof proto_event_v1_event_pb.TopicListResponse)) { - throw new Error('Expected argument of type nitric.event.v1.TopicListResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_event_v1_TopicListResponse(buffer_arg) { - return proto_event_v1_event_pb.TopicListResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - - -// Service for publishing asynchronous event -var EventServiceService = exports.EventServiceService = { - // Publishes an message to a given topic -publish: { - path: '/nitric.event.v1.EventService/Publish', - requestStream: false, - responseStream: false, - requestType: proto_event_v1_event_pb.EventPublishRequest, - responseType: proto_event_v1_event_pb.EventPublishResponse, - requestSerialize: serialize_nitric_event_v1_EventPublishRequest, - requestDeserialize: deserialize_nitric_event_v1_EventPublishRequest, - responseSerialize: serialize_nitric_event_v1_EventPublishResponse, - responseDeserialize: deserialize_nitric_event_v1_EventPublishResponse, - }, -}; - -exports.EventServiceClient = grpc.makeGenericClientConstructor(EventServiceService); -// Service for management of event topics -var TopicServiceService = exports.TopicServiceService = { - // Return a list of existing topics in the provider environment -list: { - path: '/nitric.event.v1.TopicService/List', - requestStream: false, - responseStream: false, - requestType: proto_event_v1_event_pb.TopicListRequest, - responseType: proto_event_v1_event_pb.TopicListResponse, - requestSerialize: serialize_nitric_event_v1_TopicListRequest, - requestDeserialize: deserialize_nitric_event_v1_TopicListRequest, - responseSerialize: serialize_nitric_event_v1_TopicListResponse, - responseDeserialize: deserialize_nitric_event_v1_TopicListResponse, - }, -}; - -exports.TopicServiceClient = grpc.makeGenericClientConstructor(TopicServiceService); diff --git a/src/gen/proto/event/v1/event_pb.d.ts b/src/gen/proto/event/v1/event_pb.d.ts deleted file mode 100644 index 6a669ec4..00000000 --- a/src/gen/proto/event/v1/event_pb.d.ts +++ /dev/null @@ -1,145 +0,0 @@ -// package: nitric.event.v1 -// file: proto/event/v1/event.proto - -import * as jspb from "google-protobuf"; -import * as google_protobuf_struct_pb from "google-protobuf/google/protobuf/struct_pb"; -import * as validate_validate_pb from "../../../validate/validate_pb"; - -export class EventPublishRequest extends jspb.Message { - getTopic(): string; - setTopic(value: string): void; - - hasEvent(): boolean; - clearEvent(): void; - getEvent(): NitricEvent | undefined; - setEvent(value?: NitricEvent): void; - - getDelay(): number; - setDelay(value: number): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): EventPublishRequest.AsObject; - static toObject(includeInstance: boolean, msg: EventPublishRequest): EventPublishRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: EventPublishRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): EventPublishRequest; - static deserializeBinaryFromReader(message: EventPublishRequest, reader: jspb.BinaryReader): EventPublishRequest; -} - -export namespace EventPublishRequest { - export type AsObject = { - topic: string, - event?: NitricEvent.AsObject, - delay: number, - } -} - -export class EventPublishResponse extends jspb.Message { - getId(): string; - setId(value: string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): EventPublishResponse.AsObject; - static toObject(includeInstance: boolean, msg: EventPublishResponse): EventPublishResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: EventPublishResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): EventPublishResponse; - static deserializeBinaryFromReader(message: EventPublishResponse, reader: jspb.BinaryReader): EventPublishResponse; -} - -export namespace EventPublishResponse { - export type AsObject = { - id: string, - } -} - -export class TopicListRequest extends jspb.Message { - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): TopicListRequest.AsObject; - static toObject(includeInstance: boolean, msg: TopicListRequest): TopicListRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: TopicListRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): TopicListRequest; - static deserializeBinaryFromReader(message: TopicListRequest, reader: jspb.BinaryReader): TopicListRequest; -} - -export namespace TopicListRequest { - export type AsObject = { - } -} - -export class TopicListResponse extends jspb.Message { - clearTopicsList(): void; - getTopicsList(): Array; - setTopicsList(value: Array): void; - addTopics(value?: NitricTopic, index?: number): NitricTopic; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): TopicListResponse.AsObject; - static toObject(includeInstance: boolean, msg: TopicListResponse): TopicListResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: TopicListResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): TopicListResponse; - static deserializeBinaryFromReader(message: TopicListResponse, reader: jspb.BinaryReader): TopicListResponse; -} - -export namespace TopicListResponse { - export type AsObject = { - topicsList: Array, - } -} - -export class NitricTopic extends jspb.Message { - getName(): string; - setName(value: string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): NitricTopic.AsObject; - static toObject(includeInstance: boolean, msg: NitricTopic): NitricTopic.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: NitricTopic, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): NitricTopic; - static deserializeBinaryFromReader(message: NitricTopic, reader: jspb.BinaryReader): NitricTopic; -} - -export namespace NitricTopic { - export type AsObject = { - name: string, - } -} - -export class NitricEvent extends jspb.Message { - getId(): string; - setId(value: string): void; - - getPayloadType(): string; - setPayloadType(value: string): void; - - hasPayload(): boolean; - clearPayload(): void; - getPayload(): google_protobuf_struct_pb.Struct | undefined; - setPayload(value?: google_protobuf_struct_pb.Struct): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): NitricEvent.AsObject; - static toObject(includeInstance: boolean, msg: NitricEvent): NitricEvent.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: NitricEvent, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): NitricEvent; - static deserializeBinaryFromReader(message: NitricEvent, reader: jspb.BinaryReader): NitricEvent; -} - -export namespace NitricEvent { - export type AsObject = { - id: string, - payloadType: string, - payload?: google_protobuf_struct_pb.Struct.AsObject, - } -} - diff --git a/src/gen/proto/event/v1/event_pb.js b/src/gen/proto/event/v1/event_pb.js deleted file mode 100644 index b676f5e9..00000000 --- a/src/gen/proto/event/v1/event_pb.js +++ /dev/null @@ -1,1103 +0,0 @@ -// source: proto/event/v1/event.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() { - if (this) { return this; } - if (typeof window !== 'undefined') { return window; } - if (typeof global !== 'undefined') { return global; } - if (typeof self !== 'undefined') { return self; } - return Function('return this')(); -}.call(null)); - -var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js'); -goog.object.extend(proto, google_protobuf_struct_pb); -var validate_validate_pb = require('../../../validate/validate_pb.js'); -goog.object.extend(proto, validate_validate_pb); -goog.exportSymbol('proto.nitric.event.v1.EventPublishRequest', null, global); -goog.exportSymbol('proto.nitric.event.v1.EventPublishResponse', null, global); -goog.exportSymbol('proto.nitric.event.v1.NitricEvent', null, global); -goog.exportSymbol('proto.nitric.event.v1.NitricTopic', null, global); -goog.exportSymbol('proto.nitric.event.v1.TopicListRequest', null, global); -goog.exportSymbol('proto.nitric.event.v1.TopicListResponse', 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.nitric.event.v1.EventPublishRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.event.v1.EventPublishRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.event.v1.EventPublishRequest.displayName = 'proto.nitric.event.v1.EventPublishRequest'; -} -/** - * 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.nitric.event.v1.EventPublishResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.event.v1.EventPublishResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.event.v1.EventPublishResponse.displayName = 'proto.nitric.event.v1.EventPublishResponse'; -} -/** - * 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.nitric.event.v1.TopicListRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.event.v1.TopicListRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.event.v1.TopicListRequest.displayName = 'proto.nitric.event.v1.TopicListRequest'; -} -/** - * 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.nitric.event.v1.TopicListResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.event.v1.TopicListResponse.repeatedFields_, null); -}; -goog.inherits(proto.nitric.event.v1.TopicListResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.event.v1.TopicListResponse.displayName = 'proto.nitric.event.v1.TopicListResponse'; -} -/** - * 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.nitric.event.v1.NitricTopic = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.event.v1.NitricTopic, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.event.v1.NitricTopic.displayName = 'proto.nitric.event.v1.NitricTopic'; -} -/** - * 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.nitric.event.v1.NitricEvent = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.event.v1.NitricEvent, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.event.v1.NitricEvent.displayName = 'proto.nitric.event.v1.NitricEvent'; -} - - - -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.nitric.event.v1.EventPublishRequest.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.event.v1.EventPublishRequest.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.nitric.event.v1.EventPublishRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.event.v1.EventPublishRequest.toObject = function(includeInstance, msg) { - var f, obj = { - topic: jspb.Message.getFieldWithDefault(msg, 1, ""), - event: (f = msg.getEvent()) && proto.nitric.event.v1.NitricEvent.toObject(includeInstance, f), - delay: jspb.Message.getFieldWithDefault(msg, 3, 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.nitric.event.v1.EventPublishRequest} - */ -proto.nitric.event.v1.EventPublishRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.event.v1.EventPublishRequest; - return proto.nitric.event.v1.EventPublishRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.event.v1.EventPublishRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.event.v1.EventPublishRequest} - */ -proto.nitric.event.v1.EventPublishRequest.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.setTopic(value); - break; - case 2: - var value = new proto.nitric.event.v1.NitricEvent; - reader.readMessage(value,proto.nitric.event.v1.NitricEvent.deserializeBinaryFromReader); - msg.setEvent(value); - break; - case 3: - var value = /** @type {number} */ (reader.readUint32()); - msg.setDelay(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.event.v1.EventPublishRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.event.v1.EventPublishRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.event.v1.EventPublishRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.event.v1.EventPublishRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getTopic(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getEvent(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.nitric.event.v1.NitricEvent.serializeBinaryToWriter - ); - } - f = message.getDelay(); - if (f !== 0) { - writer.writeUint32( - 3, - f - ); - } -}; - - -/** - * optional string topic = 1; - * @return {string} - */ -proto.nitric.event.v1.EventPublishRequest.prototype.getTopic = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.event.v1.EventPublishRequest} returns this - */ -proto.nitric.event.v1.EventPublishRequest.prototype.setTopic = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional NitricEvent event = 2; - * @return {?proto.nitric.event.v1.NitricEvent} - */ -proto.nitric.event.v1.EventPublishRequest.prototype.getEvent = function() { - return /** @type{?proto.nitric.event.v1.NitricEvent} */ ( - jspb.Message.getWrapperField(this, proto.nitric.event.v1.NitricEvent, 2)); -}; - - -/** - * @param {?proto.nitric.event.v1.NitricEvent|undefined} value - * @return {!proto.nitric.event.v1.EventPublishRequest} returns this -*/ -proto.nitric.event.v1.EventPublishRequest.prototype.setEvent = function(value) { - return jspb.Message.setWrapperField(this, 2, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.event.v1.EventPublishRequest} returns this - */ -proto.nitric.event.v1.EventPublishRequest.prototype.clearEvent = function() { - return this.setEvent(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.event.v1.EventPublishRequest.prototype.hasEvent = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional uint32 delay = 3; - * @return {number} - */ -proto.nitric.event.v1.EventPublishRequest.prototype.getDelay = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.nitric.event.v1.EventPublishRequest} returns this - */ -proto.nitric.event.v1.EventPublishRequest.prototype.setDelay = function(value) { - return jspb.Message.setProto3IntField(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.nitric.event.v1.EventPublishResponse.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.event.v1.EventPublishResponse.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.nitric.event.v1.EventPublishResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.event.v1.EventPublishResponse.toObject = function(includeInstance, msg) { - var f, obj = { - id: 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.nitric.event.v1.EventPublishResponse} - */ -proto.nitric.event.v1.EventPublishResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.event.v1.EventPublishResponse; - return proto.nitric.event.v1.EventPublishResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.event.v1.EventPublishResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.event.v1.EventPublishResponse} - */ -proto.nitric.event.v1.EventPublishResponse.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; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.event.v1.EventPublishResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.event.v1.EventPublishResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.event.v1.EventPublishResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.event.v1.EventPublishResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getId(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string id = 1; - * @return {string} - */ -proto.nitric.event.v1.EventPublishResponse.prototype.getId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.event.v1.EventPublishResponse} returns this - */ -proto.nitric.event.v1.EventPublishResponse.prototype.setId = 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.nitric.event.v1.TopicListRequest.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.event.v1.TopicListRequest.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.nitric.event.v1.TopicListRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.event.v1.TopicListRequest.toObject = function(includeInstance, msg) { - var f, obj = { - - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.event.v1.TopicListRequest} - */ -proto.nitric.event.v1.TopicListRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.event.v1.TopicListRequest; - return proto.nitric.event.v1.TopicListRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.event.v1.TopicListRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.event.v1.TopicListRequest} - */ -proto.nitric.event.v1.TopicListRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.event.v1.TopicListRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.event.v1.TopicListRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.event.v1.TopicListRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.event.v1.TopicListRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.nitric.event.v1.TopicListResponse.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.nitric.event.v1.TopicListResponse.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.event.v1.TopicListResponse.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.nitric.event.v1.TopicListResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.event.v1.TopicListResponse.toObject = function(includeInstance, msg) { - var f, obj = { - topicsList: jspb.Message.toObjectList(msg.getTopicsList(), - proto.nitric.event.v1.NitricTopic.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.nitric.event.v1.TopicListResponse} - */ -proto.nitric.event.v1.TopicListResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.event.v1.TopicListResponse; - return proto.nitric.event.v1.TopicListResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.event.v1.TopicListResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.event.v1.TopicListResponse} - */ -proto.nitric.event.v1.TopicListResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nitric.event.v1.NitricTopic; - reader.readMessage(value,proto.nitric.event.v1.NitricTopic.deserializeBinaryFromReader); - msg.addTopics(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.event.v1.TopicListResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.event.v1.TopicListResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.event.v1.TopicListResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.event.v1.TopicListResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getTopicsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.nitric.event.v1.NitricTopic.serializeBinaryToWriter - ); - } -}; - - -/** - * repeated NitricTopic topics = 1; - * @return {!Array} - */ -proto.nitric.event.v1.TopicListResponse.prototype.getTopicsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.nitric.event.v1.NitricTopic, 1)); -}; - - -/** - * @param {!Array} value - * @return {!proto.nitric.event.v1.TopicListResponse} returns this -*/ -proto.nitric.event.v1.TopicListResponse.prototype.setTopicsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 1, value); -}; - - -/** - * @param {!proto.nitric.event.v1.NitricTopic=} opt_value - * @param {number=} opt_index - * @return {!proto.nitric.event.v1.NitricTopic} - */ -proto.nitric.event.v1.TopicListResponse.prototype.addTopics = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.nitric.event.v1.NitricTopic, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.nitric.event.v1.TopicListResponse} returns this - */ -proto.nitric.event.v1.TopicListResponse.prototype.clearTopicsList = function() { - return this.setTopicsList([]); -}; - - - - - -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.nitric.event.v1.NitricTopic.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.event.v1.NitricTopic.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.nitric.event.v1.NitricTopic} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.event.v1.NitricTopic.toObject = function(includeInstance, msg) { - var f, obj = { - name: 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.nitric.event.v1.NitricTopic} - */ -proto.nitric.event.v1.NitricTopic.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.event.v1.NitricTopic; - return proto.nitric.event.v1.NitricTopic.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.event.v1.NitricTopic} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.event.v1.NitricTopic} - */ -proto.nitric.event.v1.NitricTopic.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; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.event.v1.NitricTopic.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.event.v1.NitricTopic.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.event.v1.NitricTopic} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.event.v1.NitricTopic.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getName(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string name = 1; - * @return {string} - */ -proto.nitric.event.v1.NitricTopic.prototype.getName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.event.v1.NitricTopic} returns this - */ -proto.nitric.event.v1.NitricTopic.prototype.setName = 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.nitric.event.v1.NitricEvent.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.event.v1.NitricEvent.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.nitric.event.v1.NitricEvent} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.event.v1.NitricEvent.toObject = function(includeInstance, msg) { - var f, obj = { - id: jspb.Message.getFieldWithDefault(msg, 1, ""), - payloadType: jspb.Message.getFieldWithDefault(msg, 2, ""), - payload: (f = msg.getPayload()) && google_protobuf_struct_pb.Struct.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.nitric.event.v1.NitricEvent} - */ -proto.nitric.event.v1.NitricEvent.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.event.v1.NitricEvent; - return proto.nitric.event.v1.NitricEvent.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.event.v1.NitricEvent} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.event.v1.NitricEvent} - */ -proto.nitric.event.v1.NitricEvent.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.setPayloadType(value); - break; - case 3: - var value = new google_protobuf_struct_pb.Struct; - reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); - msg.setPayload(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.event.v1.NitricEvent.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.event.v1.NitricEvent.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.event.v1.NitricEvent} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.event.v1.NitricEvent.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getId(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getPayloadType(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getPayload(); - if (f != null) { - writer.writeMessage( - 3, - f, - google_protobuf_struct_pb.Struct.serializeBinaryToWriter - ); - } -}; - - -/** - * optional string id = 1; - * @return {string} - */ -proto.nitric.event.v1.NitricEvent.prototype.getId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.event.v1.NitricEvent} returns this - */ -proto.nitric.event.v1.NitricEvent.prototype.setId = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string payload_type = 2; - * @return {string} - */ -proto.nitric.event.v1.NitricEvent.prototype.getPayloadType = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.event.v1.NitricEvent} returns this - */ -proto.nitric.event.v1.NitricEvent.prototype.setPayloadType = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional google.protobuf.Struct payload = 3; - * @return {?proto.google.protobuf.Struct} - */ -proto.nitric.event.v1.NitricEvent.prototype.getPayload = function() { - return /** @type{?proto.google.protobuf.Struct} */ ( - jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 3)); -}; - - -/** - * @param {?proto.google.protobuf.Struct|undefined} value - * @return {!proto.nitric.event.v1.NitricEvent} returns this -*/ -proto.nitric.event.v1.NitricEvent.prototype.setPayload = function(value) { - return jspb.Message.setWrapperField(this, 3, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.event.v1.NitricEvent} returns this - */ -proto.nitric.event.v1.NitricEvent.prototype.clearPayload = function() { - return this.setPayload(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.event.v1.NitricEvent.prototype.hasPayload = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -goog.object.extend(exports, proto.nitric.event.v1); diff --git a/src/gen/proto/faas/v1/faas_grpc_pb.d.ts b/src/gen/proto/faas/v1/faas_grpc_pb.d.ts deleted file mode 100644 index f601d1cd..00000000 --- a/src/gen/proto/faas/v1/faas_grpc_pb.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -// GENERATED CODE -- DO NOT EDIT! - -// package: nitric.faas.v1 -// file: proto/faas/v1/faas.proto - -import * as proto_faas_v1_faas_pb from "../../../proto/faas/v1/faas_pb"; -import * as grpc from "@grpc/grpc-js"; - -interface IFaasServiceService extends grpc.ServiceDefinition { - triggerStream: grpc.MethodDefinition; -} - -export const FaasServiceService: IFaasServiceService; - -export interface IFaasServiceServer extends grpc.UntypedServiceImplementation { - triggerStream: grpc.handleBidiStreamingCall; -} - -export class FaasServiceClient extends grpc.Client { - constructor(address: string, credentials: grpc.ChannelCredentials, options?: object); - triggerStream(metadataOrOptions?: grpc.Metadata | grpc.CallOptions | null): grpc.ClientDuplexStream; - triggerStream(metadata?: grpc.Metadata | null, options?: grpc.CallOptions | null): grpc.ClientDuplexStream; -} diff --git a/src/gen/proto/faas/v1/faas_grpc_pb.js b/src/gen/proto/faas/v1/faas_grpc_pb.js deleted file mode 100644 index ce31b270..00000000 --- a/src/gen/proto/faas/v1/faas_grpc_pb.js +++ /dev/null @@ -1,46 +0,0 @@ -// GENERATED CODE -- DO NOT EDIT! - -'use strict'; -var grpc = require('@grpc/grpc-js'); -var proto_faas_v1_faas_pb = require('../../../proto/faas/v1/faas_pb.js'); - -function serialize_nitric_faas_v1_ClientMessage(arg) { - if (!(arg instanceof proto_faas_v1_faas_pb.ClientMessage)) { - throw new Error('Expected argument of type nitric.faas.v1.ClientMessage'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_faas_v1_ClientMessage(buffer_arg) { - return proto_faas_v1_faas_pb.ClientMessage.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_faas_v1_ServerMessage(arg) { - if (!(arg instanceof proto_faas_v1_faas_pb.ServerMessage)) { - throw new Error('Expected argument of type nitric.faas.v1.ServerMessage'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_faas_v1_ServerMessage(buffer_arg) { - return proto_faas_v1_faas_pb.ServerMessage.deserializeBinary(new Uint8Array(buffer_arg)); -} - - -// Service for streaming communication with gRPC FaaS implementations -var FaasServiceService = exports.FaasServiceService = { - // Begin streaming triggers/response to/from the membrane -triggerStream: { - path: '/nitric.faas.v1.FaasService/TriggerStream', - requestStream: true, - responseStream: true, - requestType: proto_faas_v1_faas_pb.ClientMessage, - responseType: proto_faas_v1_faas_pb.ServerMessage, - requestSerialize: serialize_nitric_faas_v1_ClientMessage, - requestDeserialize: deserialize_nitric_faas_v1_ClientMessage, - responseSerialize: serialize_nitric_faas_v1_ServerMessage, - responseDeserialize: deserialize_nitric_faas_v1_ServerMessage, - }, -}; - -exports.FaasServiceClient = grpc.makeGenericClientConstructor(FaasServiceService); diff --git a/src/gen/proto/faas/v1/faas_pb.d.ts b/src/gen/proto/faas/v1/faas_pb.d.ts deleted file mode 100644 index a49c8f8f..00000000 --- a/src/gen/proto/faas/v1/faas_pb.d.ts +++ /dev/null @@ -1,867 +0,0 @@ -// package: nitric.faas.v1 -// file: proto/faas/v1/faas.proto - -import * as jspb from "google-protobuf"; - -export class ClientMessage extends jspb.Message { - getId(): string; - setId(value: string): void; - - hasInitRequest(): boolean; - clearInitRequest(): void; - getInitRequest(): InitRequest | undefined; - setInitRequest(value?: InitRequest): void; - - hasTriggerResponse(): boolean; - clearTriggerResponse(): void; - getTriggerResponse(): TriggerResponse | undefined; - setTriggerResponse(value?: TriggerResponse): void; - - getContentCase(): ClientMessage.ContentCase; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): ClientMessage.AsObject; - static toObject(includeInstance: boolean, msg: ClientMessage): ClientMessage.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: ClientMessage, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): ClientMessage; - static deserializeBinaryFromReader(message: ClientMessage, reader: jspb.BinaryReader): ClientMessage; -} - -export namespace ClientMessage { - export type AsObject = { - id: string, - initRequest?: InitRequest.AsObject, - triggerResponse?: TriggerResponse.AsObject, - } - - export enum ContentCase { - CONTENT_NOT_SET = 0, - INIT_REQUEST = 2, - TRIGGER_RESPONSE = 3, - } -} - -export class ServerMessage extends jspb.Message { - getId(): string; - setId(value: string): void; - - hasInitResponse(): boolean; - clearInitResponse(): void; - getInitResponse(): InitResponse | undefined; - setInitResponse(value?: InitResponse): void; - - hasTriggerRequest(): boolean; - clearTriggerRequest(): void; - getTriggerRequest(): TriggerRequest | undefined; - setTriggerRequest(value?: TriggerRequest): void; - - getContentCase(): ServerMessage.ContentCase; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): ServerMessage.AsObject; - static toObject(includeInstance: boolean, msg: ServerMessage): ServerMessage.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: ServerMessage, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): ServerMessage; - static deserializeBinaryFromReader(message: ServerMessage, reader: jspb.BinaryReader): ServerMessage; -} - -export namespace ServerMessage { - export type AsObject = { - id: string, - initResponse?: InitResponse.AsObject, - triggerRequest?: TriggerRequest.AsObject, - } - - export enum ContentCase { - CONTENT_NOT_SET = 0, - INIT_RESPONSE = 2, - TRIGGER_REQUEST = 3, - } -} - -export class ApiWorkerScopes extends jspb.Message { - clearScopesList(): void; - getScopesList(): Array; - setScopesList(value: Array): void; - addScopes(value: string, index?: number): string; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): ApiWorkerScopes.AsObject; - static toObject(includeInstance: boolean, msg: ApiWorkerScopes): ApiWorkerScopes.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: ApiWorkerScopes, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): ApiWorkerScopes; - static deserializeBinaryFromReader(message: ApiWorkerScopes, reader: jspb.BinaryReader): ApiWorkerScopes; -} - -export namespace ApiWorkerScopes { - export type AsObject = { - scopesList: Array, - } -} - -export class ApiWorkerOptions extends jspb.Message { - getSecurityMap(): jspb.Map; - clearSecurityMap(): void; - getSecurityDisabled(): boolean; - setSecurityDisabled(value: boolean): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): ApiWorkerOptions.AsObject; - static toObject(includeInstance: boolean, msg: ApiWorkerOptions): ApiWorkerOptions.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: ApiWorkerOptions, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): ApiWorkerOptions; - static deserializeBinaryFromReader(message: ApiWorkerOptions, reader: jspb.BinaryReader): ApiWorkerOptions; -} - -export namespace ApiWorkerOptions { - export type AsObject = { - securityMap: Array<[string, ApiWorkerScopes.AsObject]>, - securityDisabled: boolean, - } -} - -export class ApiWorker extends jspb.Message { - getApi(): string; - setApi(value: string): void; - - getPath(): string; - setPath(value: string): void; - - clearMethodsList(): void; - getMethodsList(): Array; - setMethodsList(value: Array): void; - addMethods(value: string, index?: number): string; - - hasOptions(): boolean; - clearOptions(): void; - getOptions(): ApiWorkerOptions | undefined; - setOptions(value?: ApiWorkerOptions): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): ApiWorker.AsObject; - static toObject(includeInstance: boolean, msg: ApiWorker): ApiWorker.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: ApiWorker, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): ApiWorker; - static deserializeBinaryFromReader(message: ApiWorker, reader: jspb.BinaryReader): ApiWorker; -} - -export namespace ApiWorker { - export type AsObject = { - api: string, - path: string, - methodsList: Array, - options?: ApiWorkerOptions.AsObject, - } -} - -export class SubscriptionWorker extends jspb.Message { - getTopic(): string; - setTopic(value: string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): SubscriptionWorker.AsObject; - static toObject(includeInstance: boolean, msg: SubscriptionWorker): SubscriptionWorker.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: SubscriptionWorker, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): SubscriptionWorker; - static deserializeBinaryFromReader(message: SubscriptionWorker, reader: jspb.BinaryReader): SubscriptionWorker; -} - -export namespace SubscriptionWorker { - export type AsObject = { - topic: string, - } -} - -export class ScheduleWorker extends jspb.Message { - getKey(): string; - setKey(value: string): void; - - hasRate(): boolean; - clearRate(): void; - getRate(): ScheduleRate | undefined; - setRate(value?: ScheduleRate): void; - - hasCron(): boolean; - clearCron(): void; - getCron(): ScheduleCron | undefined; - setCron(value?: ScheduleCron): void; - - getCadenceCase(): ScheduleWorker.CadenceCase; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): ScheduleWorker.AsObject; - static toObject(includeInstance: boolean, msg: ScheduleWorker): ScheduleWorker.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: ScheduleWorker, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): ScheduleWorker; - static deserializeBinaryFromReader(message: ScheduleWorker, reader: jspb.BinaryReader): ScheduleWorker; -} - -export namespace ScheduleWorker { - export type AsObject = { - key: string, - rate?: ScheduleRate.AsObject, - cron?: ScheduleCron.AsObject, - } - - export enum CadenceCase { - CADENCE_NOT_SET = 0, - RATE = 10, - CRON = 11, - } -} - -export class ScheduleRate extends jspb.Message { - getRate(): string; - setRate(value: string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): ScheduleRate.AsObject; - static toObject(includeInstance: boolean, msg: ScheduleRate): ScheduleRate.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: ScheduleRate, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): ScheduleRate; - static deserializeBinaryFromReader(message: ScheduleRate, reader: jspb.BinaryReader): ScheduleRate; -} - -export namespace ScheduleRate { - export type AsObject = { - rate: string, - } -} - -export class ScheduleCron extends jspb.Message { - getCron(): string; - setCron(value: string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): ScheduleCron.AsObject; - static toObject(includeInstance: boolean, msg: ScheduleCron): ScheduleCron.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: ScheduleCron, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): ScheduleCron; - static deserializeBinaryFromReader(message: ScheduleCron, reader: jspb.BinaryReader): ScheduleCron; -} - -export namespace ScheduleCron { - export type AsObject = { - cron: string, - } -} - -export class HttpWorker extends jspb.Message { - getPort(): number; - setPort(value: number): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): HttpWorker.AsObject; - static toObject(includeInstance: boolean, msg: HttpWorker): HttpWorker.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: HttpWorker, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): HttpWorker; - static deserializeBinaryFromReader(message: HttpWorker, reader: jspb.BinaryReader): HttpWorker; -} - -export namespace HttpWorker { - export type AsObject = { - port: number, - } -} - -export class BucketNotificationWorker extends jspb.Message { - getBucket(): string; - setBucket(value: string): void; - - hasConfig(): boolean; - clearConfig(): void; - getConfig(): BucketNotificationConfig | undefined; - setConfig(value?: BucketNotificationConfig): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): BucketNotificationWorker.AsObject; - static toObject(includeInstance: boolean, msg: BucketNotificationWorker): BucketNotificationWorker.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: BucketNotificationWorker, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): BucketNotificationWorker; - static deserializeBinaryFromReader(message: BucketNotificationWorker, reader: jspb.BinaryReader): BucketNotificationWorker; -} - -export namespace BucketNotificationWorker { - export type AsObject = { - bucket: string, - config?: BucketNotificationConfig.AsObject, - } -} - -export class BucketNotificationConfig extends jspb.Message { - getNotificationType(): BucketNotificationTypeMap[keyof BucketNotificationTypeMap]; - setNotificationType(value: BucketNotificationTypeMap[keyof BucketNotificationTypeMap]): void; - - getNotificationPrefixFilter(): string; - setNotificationPrefixFilter(value: string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): BucketNotificationConfig.AsObject; - static toObject(includeInstance: boolean, msg: BucketNotificationConfig): BucketNotificationConfig.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: BucketNotificationConfig, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): BucketNotificationConfig; - static deserializeBinaryFromReader(message: BucketNotificationConfig, reader: jspb.BinaryReader): BucketNotificationConfig; -} - -export namespace BucketNotificationConfig { - export type AsObject = { - notificationType: BucketNotificationTypeMap[keyof BucketNotificationTypeMap], - notificationPrefixFilter: string, - } -} - -export class WebsocketWorker extends jspb.Message { - getSocket(): string; - setSocket(value: string): void; - - getEvent(): WebsocketEventMap[keyof WebsocketEventMap]; - setEvent(value: WebsocketEventMap[keyof WebsocketEventMap]): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): WebsocketWorker.AsObject; - static toObject(includeInstance: boolean, msg: WebsocketWorker): WebsocketWorker.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: WebsocketWorker, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): WebsocketWorker; - static deserializeBinaryFromReader(message: WebsocketWorker, reader: jspb.BinaryReader): WebsocketWorker; -} - -export namespace WebsocketWorker { - export type AsObject = { - socket: string, - event: WebsocketEventMap[keyof WebsocketEventMap], - } -} - -export class InitRequest extends jspb.Message { - hasApi(): boolean; - clearApi(): void; - getApi(): ApiWorker | undefined; - setApi(value?: ApiWorker): void; - - hasSubscription(): boolean; - clearSubscription(): void; - getSubscription(): SubscriptionWorker | undefined; - setSubscription(value?: SubscriptionWorker): void; - - hasSchedule(): boolean; - clearSchedule(): void; - getSchedule(): ScheduleWorker | undefined; - setSchedule(value?: ScheduleWorker): void; - - hasBucketNotification(): boolean; - clearBucketNotification(): void; - getBucketNotification(): BucketNotificationWorker | undefined; - setBucketNotification(value?: BucketNotificationWorker): void; - - hasWebsocket(): boolean; - clearWebsocket(): void; - getWebsocket(): WebsocketWorker | undefined; - setWebsocket(value?: WebsocketWorker): void; - - hasHttpWorker(): boolean; - clearHttpWorker(): void; - getHttpWorker(): HttpWorker | undefined; - setHttpWorker(value?: HttpWorker): void; - - getWorkerCase(): InitRequest.WorkerCase; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): InitRequest.AsObject; - static toObject(includeInstance: boolean, msg: InitRequest): InitRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: InitRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): InitRequest; - static deserializeBinaryFromReader(message: InitRequest, reader: jspb.BinaryReader): InitRequest; -} - -export namespace InitRequest { - export type AsObject = { - api?: ApiWorker.AsObject, - subscription?: SubscriptionWorker.AsObject, - schedule?: ScheduleWorker.AsObject, - bucketNotification?: BucketNotificationWorker.AsObject, - websocket?: WebsocketWorker.AsObject, - httpWorker?: HttpWorker.AsObject, - } - - export enum WorkerCase { - WORKER_NOT_SET = 0, - API = 10, - SUBSCRIPTION = 11, - SCHEDULE = 12, - BUCKET_NOTIFICATION = 13, - WEBSOCKET = 14, - HTTP_WORKER = 15, - } -} - -export class InitResponse extends jspb.Message { - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): InitResponse.AsObject; - static toObject(includeInstance: boolean, msg: InitResponse): InitResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: InitResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): InitResponse; - static deserializeBinaryFromReader(message: InitResponse, reader: jspb.BinaryReader): InitResponse; -} - -export namespace InitResponse { - export type AsObject = { - } -} - -export class TraceContext extends jspb.Message { - getValuesMap(): jspb.Map; - clearValuesMap(): void; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): TraceContext.AsObject; - static toObject(includeInstance: boolean, msg: TraceContext): TraceContext.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: TraceContext, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): TraceContext; - static deserializeBinaryFromReader(message: TraceContext, reader: jspb.BinaryReader): TraceContext; -} - -export namespace TraceContext { - export type AsObject = { - valuesMap: Array<[string, string]>, - } -} - -export class TriggerRequest extends jspb.Message { - getData(): Uint8Array | string; - getData_asU8(): Uint8Array; - getData_asB64(): string; - setData(value: Uint8Array | string): void; - - getMimeType(): string; - setMimeType(value: string): void; - - hasTraceContext(): boolean; - clearTraceContext(): void; - getTraceContext(): TraceContext | undefined; - setTraceContext(value?: TraceContext): void; - - hasHttp(): boolean; - clearHttp(): void; - getHttp(): HttpTriggerContext | undefined; - setHttp(value?: HttpTriggerContext): void; - - hasTopic(): boolean; - clearTopic(): void; - getTopic(): TopicTriggerContext | undefined; - setTopic(value?: TopicTriggerContext): void; - - hasNotification(): boolean; - clearNotification(): void; - getNotification(): NotificationTriggerContext | undefined; - setNotification(value?: NotificationTriggerContext): void; - - hasWebsocket(): boolean; - clearWebsocket(): void; - getWebsocket(): WebsocketTriggerContext | undefined; - setWebsocket(value?: WebsocketTriggerContext): void; - - getContextCase(): TriggerRequest.ContextCase; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): TriggerRequest.AsObject; - static toObject(includeInstance: boolean, msg: TriggerRequest): TriggerRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: TriggerRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): TriggerRequest; - static deserializeBinaryFromReader(message: TriggerRequest, reader: jspb.BinaryReader): TriggerRequest; -} - -export namespace TriggerRequest { - export type AsObject = { - data: Uint8Array | string, - mimeType: string, - traceContext?: TraceContext.AsObject, - http?: HttpTriggerContext.AsObject, - topic?: TopicTriggerContext.AsObject, - notification?: NotificationTriggerContext.AsObject, - websocket?: WebsocketTriggerContext.AsObject, - } - - export enum ContextCase { - CONTEXT_NOT_SET = 0, - HTTP = 3, - TOPIC = 4, - NOTIFICATION = 5, - WEBSOCKET = 6, - } -} - -export class HeaderValue extends jspb.Message { - clearValueList(): void; - getValueList(): Array; - setValueList(value: Array): void; - addValue(value: string, index?: number): string; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): HeaderValue.AsObject; - static toObject(includeInstance: boolean, msg: HeaderValue): HeaderValue.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: HeaderValue, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): HeaderValue; - static deserializeBinaryFromReader(message: HeaderValue, reader: jspb.BinaryReader): HeaderValue; -} - -export namespace HeaderValue { - export type AsObject = { - valueList: Array, - } -} - -export class QueryValue extends jspb.Message { - clearValueList(): void; - getValueList(): Array; - setValueList(value: Array): void; - addValue(value: string, index?: number): string; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): QueryValue.AsObject; - static toObject(includeInstance: boolean, msg: QueryValue): QueryValue.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: QueryValue, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): QueryValue; - static deserializeBinaryFromReader(message: QueryValue, reader: jspb.BinaryReader): QueryValue; -} - -export namespace QueryValue { - export type AsObject = { - valueList: Array, - } -} - -export class HttpTriggerContext extends jspb.Message { - getMethod(): string; - setMethod(value: string): void; - - getPath(): string; - setPath(value: string): void; - - getHeadersOldMap(): jspb.Map; - clearHeadersOldMap(): void; - getQueryParamsOldMap(): jspb.Map; - clearQueryParamsOldMap(): void; - getHeadersMap(): jspb.Map; - clearHeadersMap(): void; - getQueryParamsMap(): jspb.Map; - clearQueryParamsMap(): void; - getPathParamsMap(): jspb.Map; - clearPathParamsMap(): void; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): HttpTriggerContext.AsObject; - static toObject(includeInstance: boolean, msg: HttpTriggerContext): HttpTriggerContext.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: HttpTriggerContext, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): HttpTriggerContext; - static deserializeBinaryFromReader(message: HttpTriggerContext, reader: jspb.BinaryReader): HttpTriggerContext; -} - -export namespace HttpTriggerContext { - export type AsObject = { - method: string, - path: string, - headersOldMap: Array<[string, string]>, - queryParamsOldMap: Array<[string, string]>, - headersMap: Array<[string, HeaderValue.AsObject]>, - queryParamsMap: Array<[string, QueryValue.AsObject]>, - pathParamsMap: Array<[string, string]>, - } -} - -export class TopicTriggerContext extends jspb.Message { - getTopic(): string; - setTopic(value: string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): TopicTriggerContext.AsObject; - static toObject(includeInstance: boolean, msg: TopicTriggerContext): TopicTriggerContext.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: TopicTriggerContext, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): TopicTriggerContext; - static deserializeBinaryFromReader(message: TopicTriggerContext, reader: jspb.BinaryReader): TopicTriggerContext; -} - -export namespace TopicTriggerContext { - export type AsObject = { - topic: string, - } -} - -export class BucketNotification extends jspb.Message { - getKey(): string; - setKey(value: string): void; - - getType(): BucketNotificationTypeMap[keyof BucketNotificationTypeMap]; - setType(value: BucketNotificationTypeMap[keyof BucketNotificationTypeMap]): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): BucketNotification.AsObject; - static toObject(includeInstance: boolean, msg: BucketNotification): BucketNotification.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: BucketNotification, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): BucketNotification; - static deserializeBinaryFromReader(message: BucketNotification, reader: jspb.BinaryReader): BucketNotification; -} - -export namespace BucketNotification { - export type AsObject = { - key: string, - type: BucketNotificationTypeMap[keyof BucketNotificationTypeMap], - } -} - -export class NotificationTriggerContext extends jspb.Message { - getSource(): string; - setSource(value: string): void; - - hasBucket(): boolean; - clearBucket(): void; - getBucket(): BucketNotification | undefined; - setBucket(value?: BucketNotification): void; - - getNotificationCase(): NotificationTriggerContext.NotificationCase; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): NotificationTriggerContext.AsObject; - static toObject(includeInstance: boolean, msg: NotificationTriggerContext): NotificationTriggerContext.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: NotificationTriggerContext, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): NotificationTriggerContext; - static deserializeBinaryFromReader(message: NotificationTriggerContext, reader: jspb.BinaryReader): NotificationTriggerContext; -} - -export namespace NotificationTriggerContext { - export type AsObject = { - source: string, - bucket?: BucketNotification.AsObject, - } - - export enum NotificationCase { - NOTIFICATION_NOT_SET = 0, - BUCKET = 10, - } -} - -export class WebsocketTriggerContext extends jspb.Message { - getSocket(): string; - setSocket(value: string): void; - - getEvent(): WebsocketEventMap[keyof WebsocketEventMap]; - setEvent(value: WebsocketEventMap[keyof WebsocketEventMap]): void; - - getConnectionid(): string; - setConnectionid(value: string): void; - - getQueryParamsMap(): jspb.Map; - clearQueryParamsMap(): void; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): WebsocketTriggerContext.AsObject; - static toObject(includeInstance: boolean, msg: WebsocketTriggerContext): WebsocketTriggerContext.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: WebsocketTriggerContext, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): WebsocketTriggerContext; - static deserializeBinaryFromReader(message: WebsocketTriggerContext, reader: jspb.BinaryReader): WebsocketTriggerContext; -} - -export namespace WebsocketTriggerContext { - export type AsObject = { - socket: string, - event: WebsocketEventMap[keyof WebsocketEventMap], - connectionid: string, - queryParamsMap: Array<[string, QueryValue.AsObject]>, - } -} - -export class TriggerResponse extends jspb.Message { - getData(): Uint8Array | string; - getData_asU8(): Uint8Array; - getData_asB64(): string; - setData(value: Uint8Array | string): void; - - hasHttp(): boolean; - clearHttp(): void; - getHttp(): HttpResponseContext | undefined; - setHttp(value?: HttpResponseContext): void; - - hasTopic(): boolean; - clearTopic(): void; - getTopic(): TopicResponseContext | undefined; - setTopic(value?: TopicResponseContext): void; - - hasNotification(): boolean; - clearNotification(): void; - getNotification(): NotificationResponseContext | undefined; - setNotification(value?: NotificationResponseContext): void; - - hasWebsocket(): boolean; - clearWebsocket(): void; - getWebsocket(): WebsocketResponseContext | undefined; - setWebsocket(value?: WebsocketResponseContext): void; - - getContextCase(): TriggerResponse.ContextCase; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): TriggerResponse.AsObject; - static toObject(includeInstance: boolean, msg: TriggerResponse): TriggerResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: TriggerResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): TriggerResponse; - static deserializeBinaryFromReader(message: TriggerResponse, reader: jspb.BinaryReader): TriggerResponse; -} - -export namespace TriggerResponse { - export type AsObject = { - data: Uint8Array | string, - http?: HttpResponseContext.AsObject, - topic?: TopicResponseContext.AsObject, - notification?: NotificationResponseContext.AsObject, - websocket?: WebsocketResponseContext.AsObject, - } - - export enum ContextCase { - CONTEXT_NOT_SET = 0, - HTTP = 10, - TOPIC = 11, - NOTIFICATION = 12, - WEBSOCKET = 13, - } -} - -export class HttpResponseContext extends jspb.Message { - getHeadersOldMap(): jspb.Map; - clearHeadersOldMap(): void; - getStatus(): number; - setStatus(value: number): void; - - getHeadersMap(): jspb.Map; - clearHeadersMap(): void; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): HttpResponseContext.AsObject; - static toObject(includeInstance: boolean, msg: HttpResponseContext): HttpResponseContext.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: HttpResponseContext, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): HttpResponseContext; - static deserializeBinaryFromReader(message: HttpResponseContext, reader: jspb.BinaryReader): HttpResponseContext; -} - -export namespace HttpResponseContext { - export type AsObject = { - headersOldMap: Array<[string, string]>, - status: number, - headersMap: Array<[string, HeaderValue.AsObject]>, - } -} - -export class TopicResponseContext extends jspb.Message { - getSuccess(): boolean; - setSuccess(value: boolean): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): TopicResponseContext.AsObject; - static toObject(includeInstance: boolean, msg: TopicResponseContext): TopicResponseContext.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: TopicResponseContext, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): TopicResponseContext; - static deserializeBinaryFromReader(message: TopicResponseContext, reader: jspb.BinaryReader): TopicResponseContext; -} - -export namespace TopicResponseContext { - export type AsObject = { - success: boolean, - } -} - -export class NotificationResponseContext extends jspb.Message { - getSuccess(): boolean; - setSuccess(value: boolean): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): NotificationResponseContext.AsObject; - static toObject(includeInstance: boolean, msg: NotificationResponseContext): NotificationResponseContext.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: NotificationResponseContext, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): NotificationResponseContext; - static deserializeBinaryFromReader(message: NotificationResponseContext, reader: jspb.BinaryReader): NotificationResponseContext; -} - -export namespace NotificationResponseContext { - export type AsObject = { - success: boolean, - } -} - -export class WebsocketResponseContext extends jspb.Message { - getSuccess(): boolean; - setSuccess(value: boolean): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): WebsocketResponseContext.AsObject; - static toObject(includeInstance: boolean, msg: WebsocketResponseContext): WebsocketResponseContext.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: WebsocketResponseContext, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): WebsocketResponseContext; - static deserializeBinaryFromReader(message: WebsocketResponseContext, reader: jspb.BinaryReader): WebsocketResponseContext; -} - -export namespace WebsocketResponseContext { - export type AsObject = { - success: boolean, - } -} - -export interface BucketNotificationTypeMap { - ALL: 0; - CREATED: 1; - DELETED: 2; -} - -export const BucketNotificationType: BucketNotificationTypeMap; - -export interface WebsocketEventMap { - CONNECT: 0; - DISCONNECT: 1; - MESSAGE: 2; -} - -export const WebsocketEvent: WebsocketEventMap; - diff --git a/src/gen/proto/faas/v1/faas_pb.js b/src/gen/proto/faas/v1/faas_pb.js deleted file mode 100644 index b01e567d..00000000 --- a/src/gen/proto/faas/v1/faas_pb.js +++ /dev/null @@ -1,6535 +0,0 @@ -// source: proto/faas/v1/faas.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() { - if (this) { return this; } - if (typeof window !== 'undefined') { return window; } - if (typeof global !== 'undefined') { return global; } - if (typeof self !== 'undefined') { return self; } - return Function('return this')(); -}.call(null)); - -goog.exportSymbol('proto.nitric.faas.v1.ApiWorker', null, global); -goog.exportSymbol('proto.nitric.faas.v1.ApiWorkerOptions', null, global); -goog.exportSymbol('proto.nitric.faas.v1.ApiWorkerScopes', null, global); -goog.exportSymbol('proto.nitric.faas.v1.BucketNotification', null, global); -goog.exportSymbol('proto.nitric.faas.v1.BucketNotificationConfig', null, global); -goog.exportSymbol('proto.nitric.faas.v1.BucketNotificationType', null, global); -goog.exportSymbol('proto.nitric.faas.v1.BucketNotificationWorker', null, global); -goog.exportSymbol('proto.nitric.faas.v1.ClientMessage', null, global); -goog.exportSymbol('proto.nitric.faas.v1.ClientMessage.ContentCase', null, global); -goog.exportSymbol('proto.nitric.faas.v1.HeaderValue', null, global); -goog.exportSymbol('proto.nitric.faas.v1.HttpResponseContext', null, global); -goog.exportSymbol('proto.nitric.faas.v1.HttpTriggerContext', null, global); -goog.exportSymbol('proto.nitric.faas.v1.HttpWorker', null, global); -goog.exportSymbol('proto.nitric.faas.v1.InitRequest', null, global); -goog.exportSymbol('proto.nitric.faas.v1.InitRequest.WorkerCase', null, global); -goog.exportSymbol('proto.nitric.faas.v1.InitResponse', null, global); -goog.exportSymbol('proto.nitric.faas.v1.NotificationResponseContext', null, global); -goog.exportSymbol('proto.nitric.faas.v1.NotificationTriggerContext', null, global); -goog.exportSymbol('proto.nitric.faas.v1.NotificationTriggerContext.NotificationCase', null, global); -goog.exportSymbol('proto.nitric.faas.v1.QueryValue', null, global); -goog.exportSymbol('proto.nitric.faas.v1.ScheduleCron', null, global); -goog.exportSymbol('proto.nitric.faas.v1.ScheduleRate', null, global); -goog.exportSymbol('proto.nitric.faas.v1.ScheduleWorker', null, global); -goog.exportSymbol('proto.nitric.faas.v1.ScheduleWorker.CadenceCase', null, global); -goog.exportSymbol('proto.nitric.faas.v1.ServerMessage', null, global); -goog.exportSymbol('proto.nitric.faas.v1.ServerMessage.ContentCase', null, global); -goog.exportSymbol('proto.nitric.faas.v1.SubscriptionWorker', null, global); -goog.exportSymbol('proto.nitric.faas.v1.TopicResponseContext', null, global); -goog.exportSymbol('proto.nitric.faas.v1.TopicTriggerContext', null, global); -goog.exportSymbol('proto.nitric.faas.v1.TraceContext', null, global); -goog.exportSymbol('proto.nitric.faas.v1.TriggerRequest', null, global); -goog.exportSymbol('proto.nitric.faas.v1.TriggerRequest.ContextCase', null, global); -goog.exportSymbol('proto.nitric.faas.v1.TriggerResponse', null, global); -goog.exportSymbol('proto.nitric.faas.v1.TriggerResponse.ContextCase', null, global); -goog.exportSymbol('proto.nitric.faas.v1.WebsocketEvent', null, global); -goog.exportSymbol('proto.nitric.faas.v1.WebsocketResponseContext', null, global); -goog.exportSymbol('proto.nitric.faas.v1.WebsocketTriggerContext', null, global); -goog.exportSymbol('proto.nitric.faas.v1.WebsocketWorker', 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.nitric.faas.v1.ClientMessage = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.faas.v1.ClientMessage.oneofGroups_); -}; -goog.inherits(proto.nitric.faas.v1.ClientMessage, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.faas.v1.ClientMessage.displayName = 'proto.nitric.faas.v1.ClientMessage'; -} -/** - * 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.nitric.faas.v1.ServerMessage = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.faas.v1.ServerMessage.oneofGroups_); -}; -goog.inherits(proto.nitric.faas.v1.ServerMessage, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.faas.v1.ServerMessage.displayName = 'proto.nitric.faas.v1.ServerMessage'; -} -/** - * 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.nitric.faas.v1.ApiWorkerScopes = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.faas.v1.ApiWorkerScopes.repeatedFields_, null); -}; -goog.inherits(proto.nitric.faas.v1.ApiWorkerScopes, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.faas.v1.ApiWorkerScopes.displayName = 'proto.nitric.faas.v1.ApiWorkerScopes'; -} -/** - * 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.nitric.faas.v1.ApiWorkerOptions = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.faas.v1.ApiWorkerOptions, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.faas.v1.ApiWorkerOptions.displayName = 'proto.nitric.faas.v1.ApiWorkerOptions'; -} -/** - * 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.nitric.faas.v1.ApiWorker = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.faas.v1.ApiWorker.repeatedFields_, null); -}; -goog.inherits(proto.nitric.faas.v1.ApiWorker, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.faas.v1.ApiWorker.displayName = 'proto.nitric.faas.v1.ApiWorker'; -} -/** - * 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.nitric.faas.v1.SubscriptionWorker = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.faas.v1.SubscriptionWorker, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.faas.v1.SubscriptionWorker.displayName = 'proto.nitric.faas.v1.SubscriptionWorker'; -} -/** - * 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.nitric.faas.v1.ScheduleWorker = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.faas.v1.ScheduleWorker.oneofGroups_); -}; -goog.inherits(proto.nitric.faas.v1.ScheduleWorker, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.faas.v1.ScheduleWorker.displayName = 'proto.nitric.faas.v1.ScheduleWorker'; -} -/** - * 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.nitric.faas.v1.ScheduleRate = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.faas.v1.ScheduleRate, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.faas.v1.ScheduleRate.displayName = 'proto.nitric.faas.v1.ScheduleRate'; -} -/** - * 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.nitric.faas.v1.ScheduleCron = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.faas.v1.ScheduleCron, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.faas.v1.ScheduleCron.displayName = 'proto.nitric.faas.v1.ScheduleCron'; -} -/** - * 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.nitric.faas.v1.HttpWorker = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.faas.v1.HttpWorker, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.faas.v1.HttpWorker.displayName = 'proto.nitric.faas.v1.HttpWorker'; -} -/** - * 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.nitric.faas.v1.BucketNotificationWorker = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.faas.v1.BucketNotificationWorker, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.faas.v1.BucketNotificationWorker.displayName = 'proto.nitric.faas.v1.BucketNotificationWorker'; -} -/** - * 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.nitric.faas.v1.BucketNotificationConfig = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.faas.v1.BucketNotificationConfig, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.faas.v1.BucketNotificationConfig.displayName = 'proto.nitric.faas.v1.BucketNotificationConfig'; -} -/** - * 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.nitric.faas.v1.WebsocketWorker = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.faas.v1.WebsocketWorker, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.faas.v1.WebsocketWorker.displayName = 'proto.nitric.faas.v1.WebsocketWorker'; -} -/** - * 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.nitric.faas.v1.InitRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.faas.v1.InitRequest.oneofGroups_); -}; -goog.inherits(proto.nitric.faas.v1.InitRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.faas.v1.InitRequest.displayName = 'proto.nitric.faas.v1.InitRequest'; -} -/** - * 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.nitric.faas.v1.InitResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.faas.v1.InitResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.faas.v1.InitResponse.displayName = 'proto.nitric.faas.v1.InitResponse'; -} -/** - * 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.nitric.faas.v1.TraceContext = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.faas.v1.TraceContext, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.faas.v1.TraceContext.displayName = 'proto.nitric.faas.v1.TraceContext'; -} -/** - * 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.nitric.faas.v1.TriggerRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.faas.v1.TriggerRequest.oneofGroups_); -}; -goog.inherits(proto.nitric.faas.v1.TriggerRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.faas.v1.TriggerRequest.displayName = 'proto.nitric.faas.v1.TriggerRequest'; -} -/** - * 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.nitric.faas.v1.HeaderValue = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.faas.v1.HeaderValue.repeatedFields_, null); -}; -goog.inherits(proto.nitric.faas.v1.HeaderValue, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.faas.v1.HeaderValue.displayName = 'proto.nitric.faas.v1.HeaderValue'; -} -/** - * 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.nitric.faas.v1.QueryValue = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.faas.v1.QueryValue.repeatedFields_, null); -}; -goog.inherits(proto.nitric.faas.v1.QueryValue, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.faas.v1.QueryValue.displayName = 'proto.nitric.faas.v1.QueryValue'; -} -/** - * 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.nitric.faas.v1.HttpTriggerContext = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.faas.v1.HttpTriggerContext, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.faas.v1.HttpTriggerContext.displayName = 'proto.nitric.faas.v1.HttpTriggerContext'; -} -/** - * 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.nitric.faas.v1.TopicTriggerContext = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.faas.v1.TopicTriggerContext, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.faas.v1.TopicTriggerContext.displayName = 'proto.nitric.faas.v1.TopicTriggerContext'; -} -/** - * 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.nitric.faas.v1.BucketNotification = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.faas.v1.BucketNotification, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.faas.v1.BucketNotification.displayName = 'proto.nitric.faas.v1.BucketNotification'; -} -/** - * 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.nitric.faas.v1.NotificationTriggerContext = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.faas.v1.NotificationTriggerContext.oneofGroups_); -}; -goog.inherits(proto.nitric.faas.v1.NotificationTriggerContext, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.faas.v1.NotificationTriggerContext.displayName = 'proto.nitric.faas.v1.NotificationTriggerContext'; -} -/** - * 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.nitric.faas.v1.WebsocketTriggerContext = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.faas.v1.WebsocketTriggerContext, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.faas.v1.WebsocketTriggerContext.displayName = 'proto.nitric.faas.v1.WebsocketTriggerContext'; -} -/** - * 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.nitric.faas.v1.TriggerResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.faas.v1.TriggerResponse.oneofGroups_); -}; -goog.inherits(proto.nitric.faas.v1.TriggerResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.faas.v1.TriggerResponse.displayName = 'proto.nitric.faas.v1.TriggerResponse'; -} -/** - * 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.nitric.faas.v1.HttpResponseContext = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.faas.v1.HttpResponseContext, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.faas.v1.HttpResponseContext.displayName = 'proto.nitric.faas.v1.HttpResponseContext'; -} -/** - * 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.nitric.faas.v1.TopicResponseContext = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.faas.v1.TopicResponseContext, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.faas.v1.TopicResponseContext.displayName = 'proto.nitric.faas.v1.TopicResponseContext'; -} -/** - * 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.nitric.faas.v1.NotificationResponseContext = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.faas.v1.NotificationResponseContext, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.faas.v1.NotificationResponseContext.displayName = 'proto.nitric.faas.v1.NotificationResponseContext'; -} -/** - * 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.nitric.faas.v1.WebsocketResponseContext = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.faas.v1.WebsocketResponseContext, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.faas.v1.WebsocketResponseContext.displayName = 'proto.nitric.faas.v1.WebsocketResponseContext'; -} - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.nitric.faas.v1.ClientMessage.oneofGroups_ = [[2,3]]; - -/** - * @enum {number} - */ -proto.nitric.faas.v1.ClientMessage.ContentCase = { - CONTENT_NOT_SET: 0, - INIT_REQUEST: 2, - TRIGGER_RESPONSE: 3 -}; - -/** - * @return {proto.nitric.faas.v1.ClientMessage.ContentCase} - */ -proto.nitric.faas.v1.ClientMessage.prototype.getContentCase = function() { - return /** @type {proto.nitric.faas.v1.ClientMessage.ContentCase} */(jspb.Message.computeOneofCase(this, proto.nitric.faas.v1.ClientMessage.oneofGroups_[0])); -}; - - - -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.nitric.faas.v1.ClientMessage.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.faas.v1.ClientMessage.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.nitric.faas.v1.ClientMessage} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.ClientMessage.toObject = function(includeInstance, msg) { - var f, obj = { - id: jspb.Message.getFieldWithDefault(msg, 1, ""), - initRequest: (f = msg.getInitRequest()) && proto.nitric.faas.v1.InitRequest.toObject(includeInstance, f), - triggerResponse: (f = msg.getTriggerResponse()) && proto.nitric.faas.v1.TriggerResponse.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.nitric.faas.v1.ClientMessage} - */ -proto.nitric.faas.v1.ClientMessage.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.faas.v1.ClientMessage; - return proto.nitric.faas.v1.ClientMessage.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.faas.v1.ClientMessage} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.faas.v1.ClientMessage} - */ -proto.nitric.faas.v1.ClientMessage.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 = new proto.nitric.faas.v1.InitRequest; - reader.readMessage(value,proto.nitric.faas.v1.InitRequest.deserializeBinaryFromReader); - msg.setInitRequest(value); - break; - case 3: - var value = new proto.nitric.faas.v1.TriggerResponse; - reader.readMessage(value,proto.nitric.faas.v1.TriggerResponse.deserializeBinaryFromReader); - msg.setTriggerResponse(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.faas.v1.ClientMessage.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.ClientMessage.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.ClientMessage} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.ClientMessage.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getId(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getInitRequest(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.nitric.faas.v1.InitRequest.serializeBinaryToWriter - ); - } - f = message.getTriggerResponse(); - if (f != null) { - writer.writeMessage( - 3, - f, - proto.nitric.faas.v1.TriggerResponse.serializeBinaryToWriter - ); - } -}; - - -/** - * optional string id = 1; - * @return {string} - */ -proto.nitric.faas.v1.ClientMessage.prototype.getId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.faas.v1.ClientMessage} returns this - */ -proto.nitric.faas.v1.ClientMessage.prototype.setId = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional InitRequest init_request = 2; - * @return {?proto.nitric.faas.v1.InitRequest} - */ -proto.nitric.faas.v1.ClientMessage.prototype.getInitRequest = function() { - return /** @type{?proto.nitric.faas.v1.InitRequest} */ ( - jspb.Message.getWrapperField(this, proto.nitric.faas.v1.InitRequest, 2)); -}; - - -/** - * @param {?proto.nitric.faas.v1.InitRequest|undefined} value - * @return {!proto.nitric.faas.v1.ClientMessage} returns this -*/ -proto.nitric.faas.v1.ClientMessage.prototype.setInitRequest = function(value) { - return jspb.Message.setOneofWrapperField(this, 2, proto.nitric.faas.v1.ClientMessage.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.faas.v1.ClientMessage} returns this - */ -proto.nitric.faas.v1.ClientMessage.prototype.clearInitRequest = function() { - return this.setInitRequest(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.faas.v1.ClientMessage.prototype.hasInitRequest = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional TriggerResponse trigger_response = 3; - * @return {?proto.nitric.faas.v1.TriggerResponse} - */ -proto.nitric.faas.v1.ClientMessage.prototype.getTriggerResponse = function() { - return /** @type{?proto.nitric.faas.v1.TriggerResponse} */ ( - jspb.Message.getWrapperField(this, proto.nitric.faas.v1.TriggerResponse, 3)); -}; - - -/** - * @param {?proto.nitric.faas.v1.TriggerResponse|undefined} value - * @return {!proto.nitric.faas.v1.ClientMessage} returns this -*/ -proto.nitric.faas.v1.ClientMessage.prototype.setTriggerResponse = function(value) { - return jspb.Message.setOneofWrapperField(this, 3, proto.nitric.faas.v1.ClientMessage.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.faas.v1.ClientMessage} returns this - */ -proto.nitric.faas.v1.ClientMessage.prototype.clearTriggerResponse = function() { - return this.setTriggerResponse(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.faas.v1.ClientMessage.prototype.hasTriggerResponse = function() { - return jspb.Message.getField(this, 3) != null; -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.nitric.faas.v1.ServerMessage.oneofGroups_ = [[2,3]]; - -/** - * @enum {number} - */ -proto.nitric.faas.v1.ServerMessage.ContentCase = { - CONTENT_NOT_SET: 0, - INIT_RESPONSE: 2, - TRIGGER_REQUEST: 3 -}; - -/** - * @return {proto.nitric.faas.v1.ServerMessage.ContentCase} - */ -proto.nitric.faas.v1.ServerMessage.prototype.getContentCase = function() { - return /** @type {proto.nitric.faas.v1.ServerMessage.ContentCase} */(jspb.Message.computeOneofCase(this, proto.nitric.faas.v1.ServerMessage.oneofGroups_[0])); -}; - - - -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.nitric.faas.v1.ServerMessage.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.faas.v1.ServerMessage.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.nitric.faas.v1.ServerMessage} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.ServerMessage.toObject = function(includeInstance, msg) { - var f, obj = { - id: jspb.Message.getFieldWithDefault(msg, 1, ""), - initResponse: (f = msg.getInitResponse()) && proto.nitric.faas.v1.InitResponse.toObject(includeInstance, f), - triggerRequest: (f = msg.getTriggerRequest()) && proto.nitric.faas.v1.TriggerRequest.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.nitric.faas.v1.ServerMessage} - */ -proto.nitric.faas.v1.ServerMessage.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.faas.v1.ServerMessage; - return proto.nitric.faas.v1.ServerMessage.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.faas.v1.ServerMessage} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.faas.v1.ServerMessage} - */ -proto.nitric.faas.v1.ServerMessage.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 = new proto.nitric.faas.v1.InitResponse; - reader.readMessage(value,proto.nitric.faas.v1.InitResponse.deserializeBinaryFromReader); - msg.setInitResponse(value); - break; - case 3: - var value = new proto.nitric.faas.v1.TriggerRequest; - reader.readMessage(value,proto.nitric.faas.v1.TriggerRequest.deserializeBinaryFromReader); - msg.setTriggerRequest(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.faas.v1.ServerMessage.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.ServerMessage.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.ServerMessage} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.ServerMessage.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getId(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getInitResponse(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.nitric.faas.v1.InitResponse.serializeBinaryToWriter - ); - } - f = message.getTriggerRequest(); - if (f != null) { - writer.writeMessage( - 3, - f, - proto.nitric.faas.v1.TriggerRequest.serializeBinaryToWriter - ); - } -}; - - -/** - * optional string id = 1; - * @return {string} - */ -proto.nitric.faas.v1.ServerMessage.prototype.getId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.faas.v1.ServerMessage} returns this - */ -proto.nitric.faas.v1.ServerMessage.prototype.setId = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional InitResponse init_response = 2; - * @return {?proto.nitric.faas.v1.InitResponse} - */ -proto.nitric.faas.v1.ServerMessage.prototype.getInitResponse = function() { - return /** @type{?proto.nitric.faas.v1.InitResponse} */ ( - jspb.Message.getWrapperField(this, proto.nitric.faas.v1.InitResponse, 2)); -}; - - -/** - * @param {?proto.nitric.faas.v1.InitResponse|undefined} value - * @return {!proto.nitric.faas.v1.ServerMessage} returns this -*/ -proto.nitric.faas.v1.ServerMessage.prototype.setInitResponse = function(value) { - return jspb.Message.setOneofWrapperField(this, 2, proto.nitric.faas.v1.ServerMessage.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.faas.v1.ServerMessage} returns this - */ -proto.nitric.faas.v1.ServerMessage.prototype.clearInitResponse = function() { - return this.setInitResponse(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.faas.v1.ServerMessage.prototype.hasInitResponse = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional TriggerRequest trigger_request = 3; - * @return {?proto.nitric.faas.v1.TriggerRequest} - */ -proto.nitric.faas.v1.ServerMessage.prototype.getTriggerRequest = function() { - return /** @type{?proto.nitric.faas.v1.TriggerRequest} */ ( - jspb.Message.getWrapperField(this, proto.nitric.faas.v1.TriggerRequest, 3)); -}; - - -/** - * @param {?proto.nitric.faas.v1.TriggerRequest|undefined} value - * @return {!proto.nitric.faas.v1.ServerMessage} returns this -*/ -proto.nitric.faas.v1.ServerMessage.prototype.setTriggerRequest = function(value) { - return jspb.Message.setOneofWrapperField(this, 3, proto.nitric.faas.v1.ServerMessage.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.faas.v1.ServerMessage} returns this - */ -proto.nitric.faas.v1.ServerMessage.prototype.clearTriggerRequest = function() { - return this.setTriggerRequest(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.faas.v1.ServerMessage.prototype.hasTriggerRequest = function() { - return jspb.Message.getField(this, 3) != null; -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.nitric.faas.v1.ApiWorkerScopes.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.nitric.faas.v1.ApiWorkerScopes.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.faas.v1.ApiWorkerScopes.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.nitric.faas.v1.ApiWorkerScopes} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.ApiWorkerScopes.toObject = function(includeInstance, msg) { - var f, obj = { - scopesList: (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.nitric.faas.v1.ApiWorkerScopes} - */ -proto.nitric.faas.v1.ApiWorkerScopes.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.faas.v1.ApiWorkerScopes; - return proto.nitric.faas.v1.ApiWorkerScopes.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.faas.v1.ApiWorkerScopes} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.faas.v1.ApiWorkerScopes} - */ -proto.nitric.faas.v1.ApiWorkerScopes.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.addScopes(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.faas.v1.ApiWorkerScopes.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.ApiWorkerScopes.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.ApiWorkerScopes} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.ApiWorkerScopes.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getScopesList(); - if (f.length > 0) { - writer.writeRepeatedString( - 1, - f - ); - } -}; - - -/** - * repeated string scopes = 1; - * @return {!Array} - */ -proto.nitric.faas.v1.ApiWorkerScopes.prototype.getScopesList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); -}; - - -/** - * @param {!Array} value - * @return {!proto.nitric.faas.v1.ApiWorkerScopes} returns this - */ -proto.nitric.faas.v1.ApiWorkerScopes.prototype.setScopesList = function(value) { - return jspb.Message.setField(this, 1, value || []); -}; - - -/** - * @param {string} value - * @param {number=} opt_index - * @return {!proto.nitric.faas.v1.ApiWorkerScopes} returns this - */ -proto.nitric.faas.v1.ApiWorkerScopes.prototype.addScopes = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 1, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.nitric.faas.v1.ApiWorkerScopes} returns this - */ -proto.nitric.faas.v1.ApiWorkerScopes.prototype.clearScopesList = function() { - return this.setScopesList([]); -}; - - - - - -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.nitric.faas.v1.ApiWorkerOptions.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.faas.v1.ApiWorkerOptions.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.nitric.faas.v1.ApiWorkerOptions} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.ApiWorkerOptions.toObject = function(includeInstance, msg) { - var f, obj = { - securityMap: (f = msg.getSecurityMap()) ? f.toObject(includeInstance, proto.nitric.faas.v1.ApiWorkerScopes.toObject) : [], - securityDisabled: jspb.Message.getBooleanFieldWithDefault(msg, 2, 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.nitric.faas.v1.ApiWorkerOptions} - */ -proto.nitric.faas.v1.ApiWorkerOptions.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.faas.v1.ApiWorkerOptions; - return proto.nitric.faas.v1.ApiWorkerOptions.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.faas.v1.ApiWorkerOptions} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.faas.v1.ApiWorkerOptions} - */ -proto.nitric.faas.v1.ApiWorkerOptions.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = msg.getSecurityMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.nitric.faas.v1.ApiWorkerScopes.deserializeBinaryFromReader, "", new proto.nitric.faas.v1.ApiWorkerScopes()); - }); - break; - case 2: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setSecurityDisabled(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.faas.v1.ApiWorkerOptions.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.ApiWorkerOptions.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.ApiWorkerOptions} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.ApiWorkerOptions.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getSecurityMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.nitric.faas.v1.ApiWorkerScopes.serializeBinaryToWriter); - } - f = message.getSecurityDisabled(); - if (f) { - writer.writeBool( - 2, - f - ); - } -}; - - -/** - * map security = 1; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.nitric.faas.v1.ApiWorkerOptions.prototype.getSecurityMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 1, opt_noLazyCreate, - proto.nitric.faas.v1.ApiWorkerScopes)); -}; - - -/** - * Clears values from the map. The map will be non-null. - * @return {!proto.nitric.faas.v1.ApiWorkerOptions} returns this - */ -proto.nitric.faas.v1.ApiWorkerOptions.prototype.clearSecurityMap = function() { - this.getSecurityMap().clear(); - return this;}; - - -/** - * optional bool security_disabled = 2; - * @return {boolean} - */ -proto.nitric.faas.v1.ApiWorkerOptions.prototype.getSecurityDisabled = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.nitric.faas.v1.ApiWorkerOptions} returns this - */ -proto.nitric.faas.v1.ApiWorkerOptions.prototype.setSecurityDisabled = function(value) { - return jspb.Message.setProto3BooleanField(this, 2, value); -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.nitric.faas.v1.ApiWorker.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.nitric.faas.v1.ApiWorker.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.faas.v1.ApiWorker.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.nitric.faas.v1.ApiWorker} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.ApiWorker.toObject = function(includeInstance, msg) { - var f, obj = { - api: jspb.Message.getFieldWithDefault(msg, 1, ""), - path: jspb.Message.getFieldWithDefault(msg, 2, ""), - methodsList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f, - options: (f = msg.getOptions()) && proto.nitric.faas.v1.ApiWorkerOptions.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.nitric.faas.v1.ApiWorker} - */ -proto.nitric.faas.v1.ApiWorker.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.faas.v1.ApiWorker; - return proto.nitric.faas.v1.ApiWorker.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.faas.v1.ApiWorker} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.faas.v1.ApiWorker} - */ -proto.nitric.faas.v1.ApiWorker.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.setApi(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setPath(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.addMethods(value); - break; - case 4: - var value = new proto.nitric.faas.v1.ApiWorkerOptions; - reader.readMessage(value,proto.nitric.faas.v1.ApiWorkerOptions.deserializeBinaryFromReader); - msg.setOptions(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.faas.v1.ApiWorker.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.ApiWorker.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.ApiWorker} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.ApiWorker.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getApi(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getPath(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getMethodsList(); - if (f.length > 0) { - writer.writeRepeatedString( - 3, - f - ); - } - f = message.getOptions(); - if (f != null) { - writer.writeMessage( - 4, - f, - proto.nitric.faas.v1.ApiWorkerOptions.serializeBinaryToWriter - ); - } -}; - - -/** - * optional string api = 1; - * @return {string} - */ -proto.nitric.faas.v1.ApiWorker.prototype.getApi = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.faas.v1.ApiWorker} returns this - */ -proto.nitric.faas.v1.ApiWorker.prototype.setApi = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string path = 2; - * @return {string} - */ -proto.nitric.faas.v1.ApiWorker.prototype.getPath = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.faas.v1.ApiWorker} returns this - */ -proto.nitric.faas.v1.ApiWorker.prototype.setPath = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * repeated string methods = 3; - * @return {!Array} - */ -proto.nitric.faas.v1.ApiWorker.prototype.getMethodsList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 3)); -}; - - -/** - * @param {!Array} value - * @return {!proto.nitric.faas.v1.ApiWorker} returns this - */ -proto.nitric.faas.v1.ApiWorker.prototype.setMethodsList = function(value) { - return jspb.Message.setField(this, 3, value || []); -}; - - -/** - * @param {string} value - * @param {number=} opt_index - * @return {!proto.nitric.faas.v1.ApiWorker} returns this - */ -proto.nitric.faas.v1.ApiWorker.prototype.addMethods = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 3, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.nitric.faas.v1.ApiWorker} returns this - */ -proto.nitric.faas.v1.ApiWorker.prototype.clearMethodsList = function() { - return this.setMethodsList([]); -}; - - -/** - * optional ApiWorkerOptions options = 4; - * @return {?proto.nitric.faas.v1.ApiWorkerOptions} - */ -proto.nitric.faas.v1.ApiWorker.prototype.getOptions = function() { - return /** @type{?proto.nitric.faas.v1.ApiWorkerOptions} */ ( - jspb.Message.getWrapperField(this, proto.nitric.faas.v1.ApiWorkerOptions, 4)); -}; - - -/** - * @param {?proto.nitric.faas.v1.ApiWorkerOptions|undefined} value - * @return {!proto.nitric.faas.v1.ApiWorker} returns this -*/ -proto.nitric.faas.v1.ApiWorker.prototype.setOptions = function(value) { - return jspb.Message.setWrapperField(this, 4, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.faas.v1.ApiWorker} returns this - */ -proto.nitric.faas.v1.ApiWorker.prototype.clearOptions = function() { - return this.setOptions(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.faas.v1.ApiWorker.prototype.hasOptions = 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.nitric.faas.v1.SubscriptionWorker.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.faas.v1.SubscriptionWorker.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.nitric.faas.v1.SubscriptionWorker} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.SubscriptionWorker.toObject = function(includeInstance, msg) { - var f, obj = { - topic: 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.nitric.faas.v1.SubscriptionWorker} - */ -proto.nitric.faas.v1.SubscriptionWorker.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.faas.v1.SubscriptionWorker; - return proto.nitric.faas.v1.SubscriptionWorker.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.faas.v1.SubscriptionWorker} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.faas.v1.SubscriptionWorker} - */ -proto.nitric.faas.v1.SubscriptionWorker.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.setTopic(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.faas.v1.SubscriptionWorker.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.SubscriptionWorker.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.SubscriptionWorker} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.SubscriptionWorker.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getTopic(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string topic = 1; - * @return {string} - */ -proto.nitric.faas.v1.SubscriptionWorker.prototype.getTopic = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.faas.v1.SubscriptionWorker} returns this - */ -proto.nitric.faas.v1.SubscriptionWorker.prototype.setTopic = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.nitric.faas.v1.ScheduleWorker.oneofGroups_ = [[10,11]]; - -/** - * @enum {number} - */ -proto.nitric.faas.v1.ScheduleWorker.CadenceCase = { - CADENCE_NOT_SET: 0, - RATE: 10, - CRON: 11 -}; - -/** - * @return {proto.nitric.faas.v1.ScheduleWorker.CadenceCase} - */ -proto.nitric.faas.v1.ScheduleWorker.prototype.getCadenceCase = function() { - return /** @type {proto.nitric.faas.v1.ScheduleWorker.CadenceCase} */(jspb.Message.computeOneofCase(this, proto.nitric.faas.v1.ScheduleWorker.oneofGroups_[0])); -}; - - - -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.nitric.faas.v1.ScheduleWorker.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.faas.v1.ScheduleWorker.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.nitric.faas.v1.ScheduleWorker} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.ScheduleWorker.toObject = function(includeInstance, msg) { - var f, obj = { - key: jspb.Message.getFieldWithDefault(msg, 1, ""), - rate: (f = msg.getRate()) && proto.nitric.faas.v1.ScheduleRate.toObject(includeInstance, f), - cron: (f = msg.getCron()) && proto.nitric.faas.v1.ScheduleCron.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.nitric.faas.v1.ScheduleWorker} - */ -proto.nitric.faas.v1.ScheduleWorker.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.faas.v1.ScheduleWorker; - return proto.nitric.faas.v1.ScheduleWorker.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.faas.v1.ScheduleWorker} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.faas.v1.ScheduleWorker} - */ -proto.nitric.faas.v1.ScheduleWorker.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 10: - var value = new proto.nitric.faas.v1.ScheduleRate; - reader.readMessage(value,proto.nitric.faas.v1.ScheduleRate.deserializeBinaryFromReader); - msg.setRate(value); - break; - case 11: - var value = new proto.nitric.faas.v1.ScheduleCron; - reader.readMessage(value,proto.nitric.faas.v1.ScheduleCron.deserializeBinaryFromReader); - msg.setCron(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.faas.v1.ScheduleWorker.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.ScheduleWorker.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.ScheduleWorker} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.ScheduleWorker.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getKey(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getRate(); - if (f != null) { - writer.writeMessage( - 10, - f, - proto.nitric.faas.v1.ScheduleRate.serializeBinaryToWriter - ); - } - f = message.getCron(); - if (f != null) { - writer.writeMessage( - 11, - f, - proto.nitric.faas.v1.ScheduleCron.serializeBinaryToWriter - ); - } -}; - - -/** - * optional string key = 1; - * @return {string} - */ -proto.nitric.faas.v1.ScheduleWorker.prototype.getKey = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.faas.v1.ScheduleWorker} returns this - */ -proto.nitric.faas.v1.ScheduleWorker.prototype.setKey = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional ScheduleRate rate = 10; - * @return {?proto.nitric.faas.v1.ScheduleRate} - */ -proto.nitric.faas.v1.ScheduleWorker.prototype.getRate = function() { - return /** @type{?proto.nitric.faas.v1.ScheduleRate} */ ( - jspb.Message.getWrapperField(this, proto.nitric.faas.v1.ScheduleRate, 10)); -}; - - -/** - * @param {?proto.nitric.faas.v1.ScheduleRate|undefined} value - * @return {!proto.nitric.faas.v1.ScheduleWorker} returns this -*/ -proto.nitric.faas.v1.ScheduleWorker.prototype.setRate = function(value) { - return jspb.Message.setOneofWrapperField(this, 10, proto.nitric.faas.v1.ScheduleWorker.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.faas.v1.ScheduleWorker} returns this - */ -proto.nitric.faas.v1.ScheduleWorker.prototype.clearRate = function() { - return this.setRate(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.faas.v1.ScheduleWorker.prototype.hasRate = function() { - return jspb.Message.getField(this, 10) != null; -}; - - -/** - * optional ScheduleCron cron = 11; - * @return {?proto.nitric.faas.v1.ScheduleCron} - */ -proto.nitric.faas.v1.ScheduleWorker.prototype.getCron = function() { - return /** @type{?proto.nitric.faas.v1.ScheduleCron} */ ( - jspb.Message.getWrapperField(this, proto.nitric.faas.v1.ScheduleCron, 11)); -}; - - -/** - * @param {?proto.nitric.faas.v1.ScheduleCron|undefined} value - * @return {!proto.nitric.faas.v1.ScheduleWorker} returns this -*/ -proto.nitric.faas.v1.ScheduleWorker.prototype.setCron = function(value) { - return jspb.Message.setOneofWrapperField(this, 11, proto.nitric.faas.v1.ScheduleWorker.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.faas.v1.ScheduleWorker} returns this - */ -proto.nitric.faas.v1.ScheduleWorker.prototype.clearCron = function() { - return this.setCron(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.faas.v1.ScheduleWorker.prototype.hasCron = function() { - return jspb.Message.getField(this, 11) != 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.nitric.faas.v1.ScheduleRate.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.faas.v1.ScheduleRate.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.nitric.faas.v1.ScheduleRate} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.ScheduleRate.toObject = function(includeInstance, msg) { - var f, obj = { - rate: 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.nitric.faas.v1.ScheduleRate} - */ -proto.nitric.faas.v1.ScheduleRate.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.faas.v1.ScheduleRate; - return proto.nitric.faas.v1.ScheduleRate.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.faas.v1.ScheduleRate} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.faas.v1.ScheduleRate} - */ -proto.nitric.faas.v1.ScheduleRate.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.setRate(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.faas.v1.ScheduleRate.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.ScheduleRate.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.ScheduleRate} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.ScheduleRate.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getRate(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string rate = 1; - * @return {string} - */ -proto.nitric.faas.v1.ScheduleRate.prototype.getRate = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.faas.v1.ScheduleRate} returns this - */ -proto.nitric.faas.v1.ScheduleRate.prototype.setRate = 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.nitric.faas.v1.ScheduleCron.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.faas.v1.ScheduleCron.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.nitric.faas.v1.ScheduleCron} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.ScheduleCron.toObject = function(includeInstance, msg) { - var f, obj = { - cron: 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.nitric.faas.v1.ScheduleCron} - */ -proto.nitric.faas.v1.ScheduleCron.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.faas.v1.ScheduleCron; - return proto.nitric.faas.v1.ScheduleCron.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.faas.v1.ScheduleCron} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.faas.v1.ScheduleCron} - */ -proto.nitric.faas.v1.ScheduleCron.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.setCron(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.faas.v1.ScheduleCron.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.ScheduleCron.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.ScheduleCron} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.ScheduleCron.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getCron(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string cron = 1; - * @return {string} - */ -proto.nitric.faas.v1.ScheduleCron.prototype.getCron = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.faas.v1.ScheduleCron} returns this - */ -proto.nitric.faas.v1.ScheduleCron.prototype.setCron = 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.nitric.faas.v1.HttpWorker.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.faas.v1.HttpWorker.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.nitric.faas.v1.HttpWorker} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.HttpWorker.toObject = function(includeInstance, msg) { - var f, obj = { - port: 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.nitric.faas.v1.HttpWorker} - */ -proto.nitric.faas.v1.HttpWorker.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.faas.v1.HttpWorker; - return proto.nitric.faas.v1.HttpWorker.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.faas.v1.HttpWorker} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.faas.v1.HttpWorker} - */ -proto.nitric.faas.v1.HttpWorker.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readInt32()); - msg.setPort(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.faas.v1.HttpWorker.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.HttpWorker.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.HttpWorker} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.HttpWorker.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getPort(); - if (f !== 0) { - writer.writeInt32( - 1, - f - ); - } -}; - - -/** - * optional int32 port = 1; - * @return {number} - */ -proto.nitric.faas.v1.HttpWorker.prototype.getPort = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.nitric.faas.v1.HttpWorker} returns this - */ -proto.nitric.faas.v1.HttpWorker.prototype.setPort = function(value) { - return jspb.Message.setProto3IntField(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.nitric.faas.v1.BucketNotificationWorker.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.faas.v1.BucketNotificationWorker.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.nitric.faas.v1.BucketNotificationWorker} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.BucketNotificationWorker.toObject = function(includeInstance, msg) { - var f, obj = { - bucket: jspb.Message.getFieldWithDefault(msg, 1, ""), - config: (f = msg.getConfig()) && proto.nitric.faas.v1.BucketNotificationConfig.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.nitric.faas.v1.BucketNotificationWorker} - */ -proto.nitric.faas.v1.BucketNotificationWorker.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.faas.v1.BucketNotificationWorker; - return proto.nitric.faas.v1.BucketNotificationWorker.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.faas.v1.BucketNotificationWorker} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.faas.v1.BucketNotificationWorker} - */ -proto.nitric.faas.v1.BucketNotificationWorker.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.setBucket(value); - break; - case 2: - var value = new proto.nitric.faas.v1.BucketNotificationConfig; - reader.readMessage(value,proto.nitric.faas.v1.BucketNotificationConfig.deserializeBinaryFromReader); - msg.setConfig(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.faas.v1.BucketNotificationWorker.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.BucketNotificationWorker.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.BucketNotificationWorker} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.BucketNotificationWorker.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getBucket(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getConfig(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.nitric.faas.v1.BucketNotificationConfig.serializeBinaryToWriter - ); - } -}; - - -/** - * optional string bucket = 1; - * @return {string} - */ -proto.nitric.faas.v1.BucketNotificationWorker.prototype.getBucket = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.faas.v1.BucketNotificationWorker} returns this - */ -proto.nitric.faas.v1.BucketNotificationWorker.prototype.setBucket = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional BucketNotificationConfig config = 2; - * @return {?proto.nitric.faas.v1.BucketNotificationConfig} - */ -proto.nitric.faas.v1.BucketNotificationWorker.prototype.getConfig = function() { - return /** @type{?proto.nitric.faas.v1.BucketNotificationConfig} */ ( - jspb.Message.getWrapperField(this, proto.nitric.faas.v1.BucketNotificationConfig, 2)); -}; - - -/** - * @param {?proto.nitric.faas.v1.BucketNotificationConfig|undefined} value - * @return {!proto.nitric.faas.v1.BucketNotificationWorker} returns this -*/ -proto.nitric.faas.v1.BucketNotificationWorker.prototype.setConfig = function(value) { - return jspb.Message.setWrapperField(this, 2, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.faas.v1.BucketNotificationWorker} returns this - */ -proto.nitric.faas.v1.BucketNotificationWorker.prototype.clearConfig = function() { - return this.setConfig(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.faas.v1.BucketNotificationWorker.prototype.hasConfig = 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.nitric.faas.v1.BucketNotificationConfig.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.faas.v1.BucketNotificationConfig.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.nitric.faas.v1.BucketNotificationConfig} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.BucketNotificationConfig.toObject = function(includeInstance, msg) { - var f, obj = { - notificationType: jspb.Message.getFieldWithDefault(msg, 1, 0), - notificationPrefixFilter: 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.nitric.faas.v1.BucketNotificationConfig} - */ -proto.nitric.faas.v1.BucketNotificationConfig.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.faas.v1.BucketNotificationConfig; - return proto.nitric.faas.v1.BucketNotificationConfig.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.faas.v1.BucketNotificationConfig} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.faas.v1.BucketNotificationConfig} - */ -proto.nitric.faas.v1.BucketNotificationConfig.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!proto.nitric.faas.v1.BucketNotificationType} */ (reader.readEnum()); - msg.setNotificationType(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setNotificationPrefixFilter(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.faas.v1.BucketNotificationConfig.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.BucketNotificationConfig.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.BucketNotificationConfig} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.BucketNotificationConfig.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getNotificationType(); - if (f !== 0.0) { - writer.writeEnum( - 1, - f - ); - } - f = message.getNotificationPrefixFilter(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional BucketNotificationType notification_type = 1; - * @return {!proto.nitric.faas.v1.BucketNotificationType} - */ -proto.nitric.faas.v1.BucketNotificationConfig.prototype.getNotificationType = function() { - return /** @type {!proto.nitric.faas.v1.BucketNotificationType} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {!proto.nitric.faas.v1.BucketNotificationType} value - * @return {!proto.nitric.faas.v1.BucketNotificationConfig} returns this - */ -proto.nitric.faas.v1.BucketNotificationConfig.prototype.setNotificationType = function(value) { - return jspb.Message.setProto3EnumField(this, 1, value); -}; - - -/** - * optional string notification_prefix_filter = 2; - * @return {string} - */ -proto.nitric.faas.v1.BucketNotificationConfig.prototype.getNotificationPrefixFilter = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.faas.v1.BucketNotificationConfig} returns this - */ -proto.nitric.faas.v1.BucketNotificationConfig.prototype.setNotificationPrefixFilter = 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.nitric.faas.v1.WebsocketWorker.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.faas.v1.WebsocketWorker.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.nitric.faas.v1.WebsocketWorker} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.WebsocketWorker.toObject = function(includeInstance, msg) { - var f, obj = { - socket: jspb.Message.getFieldWithDefault(msg, 1, ""), - event: 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.nitric.faas.v1.WebsocketWorker} - */ -proto.nitric.faas.v1.WebsocketWorker.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.faas.v1.WebsocketWorker; - return proto.nitric.faas.v1.WebsocketWorker.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.faas.v1.WebsocketWorker} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.faas.v1.WebsocketWorker} - */ -proto.nitric.faas.v1.WebsocketWorker.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.setSocket(value); - break; - case 2: - var value = /** @type {!proto.nitric.faas.v1.WebsocketEvent} */ (reader.readEnum()); - msg.setEvent(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.faas.v1.WebsocketWorker.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.WebsocketWorker.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.WebsocketWorker} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.WebsocketWorker.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getSocket(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getEvent(); - if (f !== 0.0) { - writer.writeEnum( - 2, - f - ); - } -}; - - -/** - * optional string socket = 1; - * @return {string} - */ -proto.nitric.faas.v1.WebsocketWorker.prototype.getSocket = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.faas.v1.WebsocketWorker} returns this - */ -proto.nitric.faas.v1.WebsocketWorker.prototype.setSocket = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional WebsocketEvent event = 2; - * @return {!proto.nitric.faas.v1.WebsocketEvent} - */ -proto.nitric.faas.v1.WebsocketWorker.prototype.getEvent = function() { - return /** @type {!proto.nitric.faas.v1.WebsocketEvent} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** - * @param {!proto.nitric.faas.v1.WebsocketEvent} value - * @return {!proto.nitric.faas.v1.WebsocketWorker} returns this - */ -proto.nitric.faas.v1.WebsocketWorker.prototype.setEvent = function(value) { - return jspb.Message.setProto3EnumField(this, 2, value); -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.nitric.faas.v1.InitRequest.oneofGroups_ = [[10,11,12,13,14,15]]; - -/** - * @enum {number} - */ -proto.nitric.faas.v1.InitRequest.WorkerCase = { - WORKER_NOT_SET: 0, - API: 10, - SUBSCRIPTION: 11, - SCHEDULE: 12, - BUCKET_NOTIFICATION: 13, - WEBSOCKET: 14, - HTTP_WORKER: 15 -}; - -/** - * @return {proto.nitric.faas.v1.InitRequest.WorkerCase} - */ -proto.nitric.faas.v1.InitRequest.prototype.getWorkerCase = function() { - return /** @type {proto.nitric.faas.v1.InitRequest.WorkerCase} */(jspb.Message.computeOneofCase(this, proto.nitric.faas.v1.InitRequest.oneofGroups_[0])); -}; - - - -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.nitric.faas.v1.InitRequest.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.faas.v1.InitRequest.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.nitric.faas.v1.InitRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.InitRequest.toObject = function(includeInstance, msg) { - var f, obj = { - api: (f = msg.getApi()) && proto.nitric.faas.v1.ApiWorker.toObject(includeInstance, f), - subscription: (f = msg.getSubscription()) && proto.nitric.faas.v1.SubscriptionWorker.toObject(includeInstance, f), - schedule: (f = msg.getSchedule()) && proto.nitric.faas.v1.ScheduleWorker.toObject(includeInstance, f), - bucketNotification: (f = msg.getBucketNotification()) && proto.nitric.faas.v1.BucketNotificationWorker.toObject(includeInstance, f), - websocket: (f = msg.getWebsocket()) && proto.nitric.faas.v1.WebsocketWorker.toObject(includeInstance, f), - httpWorker: (f = msg.getHttpWorker()) && proto.nitric.faas.v1.HttpWorker.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.nitric.faas.v1.InitRequest} - */ -proto.nitric.faas.v1.InitRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.faas.v1.InitRequest; - return proto.nitric.faas.v1.InitRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.faas.v1.InitRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.faas.v1.InitRequest} - */ -proto.nitric.faas.v1.InitRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 10: - var value = new proto.nitric.faas.v1.ApiWorker; - reader.readMessage(value,proto.nitric.faas.v1.ApiWorker.deserializeBinaryFromReader); - msg.setApi(value); - break; - case 11: - var value = new proto.nitric.faas.v1.SubscriptionWorker; - reader.readMessage(value,proto.nitric.faas.v1.SubscriptionWorker.deserializeBinaryFromReader); - msg.setSubscription(value); - break; - case 12: - var value = new proto.nitric.faas.v1.ScheduleWorker; - reader.readMessage(value,proto.nitric.faas.v1.ScheduleWorker.deserializeBinaryFromReader); - msg.setSchedule(value); - break; - case 13: - var value = new proto.nitric.faas.v1.BucketNotificationWorker; - reader.readMessage(value,proto.nitric.faas.v1.BucketNotificationWorker.deserializeBinaryFromReader); - msg.setBucketNotification(value); - break; - case 14: - var value = new proto.nitric.faas.v1.WebsocketWorker; - reader.readMessage(value,proto.nitric.faas.v1.WebsocketWorker.deserializeBinaryFromReader); - msg.setWebsocket(value); - break; - case 15: - var value = new proto.nitric.faas.v1.HttpWorker; - reader.readMessage(value,proto.nitric.faas.v1.HttpWorker.deserializeBinaryFromReader); - msg.setHttpWorker(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.faas.v1.InitRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.InitRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.InitRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.InitRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getApi(); - if (f != null) { - writer.writeMessage( - 10, - f, - proto.nitric.faas.v1.ApiWorker.serializeBinaryToWriter - ); - } - f = message.getSubscription(); - if (f != null) { - writer.writeMessage( - 11, - f, - proto.nitric.faas.v1.SubscriptionWorker.serializeBinaryToWriter - ); - } - f = message.getSchedule(); - if (f != null) { - writer.writeMessage( - 12, - f, - proto.nitric.faas.v1.ScheduleWorker.serializeBinaryToWriter - ); - } - f = message.getBucketNotification(); - if (f != null) { - writer.writeMessage( - 13, - f, - proto.nitric.faas.v1.BucketNotificationWorker.serializeBinaryToWriter - ); - } - f = message.getWebsocket(); - if (f != null) { - writer.writeMessage( - 14, - f, - proto.nitric.faas.v1.WebsocketWorker.serializeBinaryToWriter - ); - } - f = message.getHttpWorker(); - if (f != null) { - writer.writeMessage( - 15, - f, - proto.nitric.faas.v1.HttpWorker.serializeBinaryToWriter - ); - } -}; - - -/** - * optional ApiWorker api = 10; - * @return {?proto.nitric.faas.v1.ApiWorker} - */ -proto.nitric.faas.v1.InitRequest.prototype.getApi = function() { - return /** @type{?proto.nitric.faas.v1.ApiWorker} */ ( - jspb.Message.getWrapperField(this, proto.nitric.faas.v1.ApiWorker, 10)); -}; - - -/** - * @param {?proto.nitric.faas.v1.ApiWorker|undefined} value - * @return {!proto.nitric.faas.v1.InitRequest} returns this -*/ -proto.nitric.faas.v1.InitRequest.prototype.setApi = function(value) { - return jspb.Message.setOneofWrapperField(this, 10, proto.nitric.faas.v1.InitRequest.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.faas.v1.InitRequest} returns this - */ -proto.nitric.faas.v1.InitRequest.prototype.clearApi = function() { - return this.setApi(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.faas.v1.InitRequest.prototype.hasApi = function() { - return jspb.Message.getField(this, 10) != null; -}; - - -/** - * optional SubscriptionWorker subscription = 11; - * @return {?proto.nitric.faas.v1.SubscriptionWorker} - */ -proto.nitric.faas.v1.InitRequest.prototype.getSubscription = function() { - return /** @type{?proto.nitric.faas.v1.SubscriptionWorker} */ ( - jspb.Message.getWrapperField(this, proto.nitric.faas.v1.SubscriptionWorker, 11)); -}; - - -/** - * @param {?proto.nitric.faas.v1.SubscriptionWorker|undefined} value - * @return {!proto.nitric.faas.v1.InitRequest} returns this -*/ -proto.nitric.faas.v1.InitRequest.prototype.setSubscription = function(value) { - return jspb.Message.setOneofWrapperField(this, 11, proto.nitric.faas.v1.InitRequest.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.faas.v1.InitRequest} returns this - */ -proto.nitric.faas.v1.InitRequest.prototype.clearSubscription = function() { - return this.setSubscription(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.faas.v1.InitRequest.prototype.hasSubscription = function() { - return jspb.Message.getField(this, 11) != null; -}; - - -/** - * optional ScheduleWorker schedule = 12; - * @return {?proto.nitric.faas.v1.ScheduleWorker} - */ -proto.nitric.faas.v1.InitRequest.prototype.getSchedule = function() { - return /** @type{?proto.nitric.faas.v1.ScheduleWorker} */ ( - jspb.Message.getWrapperField(this, proto.nitric.faas.v1.ScheduleWorker, 12)); -}; - - -/** - * @param {?proto.nitric.faas.v1.ScheduleWorker|undefined} value - * @return {!proto.nitric.faas.v1.InitRequest} returns this -*/ -proto.nitric.faas.v1.InitRequest.prototype.setSchedule = function(value) { - return jspb.Message.setOneofWrapperField(this, 12, proto.nitric.faas.v1.InitRequest.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.faas.v1.InitRequest} returns this - */ -proto.nitric.faas.v1.InitRequest.prototype.clearSchedule = function() { - return this.setSchedule(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.faas.v1.InitRequest.prototype.hasSchedule = function() { - return jspb.Message.getField(this, 12) != null; -}; - - -/** - * optional BucketNotificationWorker bucket_notification = 13; - * @return {?proto.nitric.faas.v1.BucketNotificationWorker} - */ -proto.nitric.faas.v1.InitRequest.prototype.getBucketNotification = function() { - return /** @type{?proto.nitric.faas.v1.BucketNotificationWorker} */ ( - jspb.Message.getWrapperField(this, proto.nitric.faas.v1.BucketNotificationWorker, 13)); -}; - - -/** - * @param {?proto.nitric.faas.v1.BucketNotificationWorker|undefined} value - * @return {!proto.nitric.faas.v1.InitRequest} returns this -*/ -proto.nitric.faas.v1.InitRequest.prototype.setBucketNotification = function(value) { - return jspb.Message.setOneofWrapperField(this, 13, proto.nitric.faas.v1.InitRequest.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.faas.v1.InitRequest} returns this - */ -proto.nitric.faas.v1.InitRequest.prototype.clearBucketNotification = function() { - return this.setBucketNotification(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.faas.v1.InitRequest.prototype.hasBucketNotification = function() { - return jspb.Message.getField(this, 13) != null; -}; - - -/** - * optional WebsocketWorker websocket = 14; - * @return {?proto.nitric.faas.v1.WebsocketWorker} - */ -proto.nitric.faas.v1.InitRequest.prototype.getWebsocket = function() { - return /** @type{?proto.nitric.faas.v1.WebsocketWorker} */ ( - jspb.Message.getWrapperField(this, proto.nitric.faas.v1.WebsocketWorker, 14)); -}; - - -/** - * @param {?proto.nitric.faas.v1.WebsocketWorker|undefined} value - * @return {!proto.nitric.faas.v1.InitRequest} returns this -*/ -proto.nitric.faas.v1.InitRequest.prototype.setWebsocket = function(value) { - return jspb.Message.setOneofWrapperField(this, 14, proto.nitric.faas.v1.InitRequest.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.faas.v1.InitRequest} returns this - */ -proto.nitric.faas.v1.InitRequest.prototype.clearWebsocket = function() { - return this.setWebsocket(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.faas.v1.InitRequest.prototype.hasWebsocket = function() { - return jspb.Message.getField(this, 14) != null; -}; - - -/** - * optional HttpWorker http_worker = 15; - * @return {?proto.nitric.faas.v1.HttpWorker} - */ -proto.nitric.faas.v1.InitRequest.prototype.getHttpWorker = function() { - return /** @type{?proto.nitric.faas.v1.HttpWorker} */ ( - jspb.Message.getWrapperField(this, proto.nitric.faas.v1.HttpWorker, 15)); -}; - - -/** - * @param {?proto.nitric.faas.v1.HttpWorker|undefined} value - * @return {!proto.nitric.faas.v1.InitRequest} returns this -*/ -proto.nitric.faas.v1.InitRequest.prototype.setHttpWorker = function(value) { - return jspb.Message.setOneofWrapperField(this, 15, proto.nitric.faas.v1.InitRequest.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.faas.v1.InitRequest} returns this - */ -proto.nitric.faas.v1.InitRequest.prototype.clearHttpWorker = function() { - return this.setHttpWorker(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.faas.v1.InitRequest.prototype.hasHttpWorker = function() { - return jspb.Message.getField(this, 15) != 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.nitric.faas.v1.InitResponse.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.faas.v1.InitResponse.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.nitric.faas.v1.InitResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.InitResponse.toObject = function(includeInstance, msg) { - var f, obj = { - - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.faas.v1.InitResponse} - */ -proto.nitric.faas.v1.InitResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.faas.v1.InitResponse; - return proto.nitric.faas.v1.InitResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.faas.v1.InitResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.faas.v1.InitResponse} - */ -proto.nitric.faas.v1.InitResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.faas.v1.InitResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.InitResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.InitResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.InitResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; -}; - - - - - -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.nitric.faas.v1.TraceContext.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.faas.v1.TraceContext.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.nitric.faas.v1.TraceContext} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.TraceContext.toObject = function(includeInstance, msg) { - var f, obj = { - valuesMap: (f = msg.getValuesMap()) ? 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.nitric.faas.v1.TraceContext} - */ -proto.nitric.faas.v1.TraceContext.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.faas.v1.TraceContext; - return proto.nitric.faas.v1.TraceContext.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.faas.v1.TraceContext} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.faas.v1.TraceContext} - */ -proto.nitric.faas.v1.TraceContext.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = msg.getValuesMap(); - 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.nitric.faas.v1.TraceContext.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.TraceContext.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.TraceContext} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.TraceContext.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getValuesMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); - } -}; - - -/** - * map values = 1; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.nitric.faas.v1.TraceContext.prototype.getValuesMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 1, opt_noLazyCreate, - null)); -}; - - -/** - * Clears values from the map. The map will be non-null. - * @return {!proto.nitric.faas.v1.TraceContext} returns this - */ -proto.nitric.faas.v1.TraceContext.prototype.clearValuesMap = function() { - this.getValuesMap().clear(); - return this;}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.nitric.faas.v1.TriggerRequest.oneofGroups_ = [[3,4,5,6]]; - -/** - * @enum {number} - */ -proto.nitric.faas.v1.TriggerRequest.ContextCase = { - CONTEXT_NOT_SET: 0, - HTTP: 3, - TOPIC: 4, - NOTIFICATION: 5, - WEBSOCKET: 6 -}; - -/** - * @return {proto.nitric.faas.v1.TriggerRequest.ContextCase} - */ -proto.nitric.faas.v1.TriggerRequest.prototype.getContextCase = function() { - return /** @type {proto.nitric.faas.v1.TriggerRequest.ContextCase} */(jspb.Message.computeOneofCase(this, proto.nitric.faas.v1.TriggerRequest.oneofGroups_[0])); -}; - - - -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.nitric.faas.v1.TriggerRequest.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.faas.v1.TriggerRequest.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.nitric.faas.v1.TriggerRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.TriggerRequest.toObject = function(includeInstance, msg) { - var f, obj = { - data: msg.getData_asB64(), - mimeType: jspb.Message.getFieldWithDefault(msg, 2, ""), - traceContext: (f = msg.getTraceContext()) && proto.nitric.faas.v1.TraceContext.toObject(includeInstance, f), - http: (f = msg.getHttp()) && proto.nitric.faas.v1.HttpTriggerContext.toObject(includeInstance, f), - topic: (f = msg.getTopic()) && proto.nitric.faas.v1.TopicTriggerContext.toObject(includeInstance, f), - notification: (f = msg.getNotification()) && proto.nitric.faas.v1.NotificationTriggerContext.toObject(includeInstance, f), - websocket: (f = msg.getWebsocket()) && proto.nitric.faas.v1.WebsocketTriggerContext.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.nitric.faas.v1.TriggerRequest} - */ -proto.nitric.faas.v1.TriggerRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.faas.v1.TriggerRequest; - return proto.nitric.faas.v1.TriggerRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.faas.v1.TriggerRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.faas.v1.TriggerRequest} - */ -proto.nitric.faas.v1.TriggerRequest.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.setMimeType(value); - break; - case 10: - var value = new proto.nitric.faas.v1.TraceContext; - reader.readMessage(value,proto.nitric.faas.v1.TraceContext.deserializeBinaryFromReader); - msg.setTraceContext(value); - break; - case 3: - var value = new proto.nitric.faas.v1.HttpTriggerContext; - reader.readMessage(value,proto.nitric.faas.v1.HttpTriggerContext.deserializeBinaryFromReader); - msg.setHttp(value); - break; - case 4: - var value = new proto.nitric.faas.v1.TopicTriggerContext; - reader.readMessage(value,proto.nitric.faas.v1.TopicTriggerContext.deserializeBinaryFromReader); - msg.setTopic(value); - break; - case 5: - var value = new proto.nitric.faas.v1.NotificationTriggerContext; - reader.readMessage(value,proto.nitric.faas.v1.NotificationTriggerContext.deserializeBinaryFromReader); - msg.setNotification(value); - break; - case 6: - var value = new proto.nitric.faas.v1.WebsocketTriggerContext; - reader.readMessage(value,proto.nitric.faas.v1.WebsocketTriggerContext.deserializeBinaryFromReader); - msg.setWebsocket(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.faas.v1.TriggerRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.TriggerRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.TriggerRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.TriggerRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getData_asU8(); - if (f.length > 0) { - writer.writeBytes( - 1, - f - ); - } - f = message.getMimeType(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getTraceContext(); - if (f != null) { - writer.writeMessage( - 10, - f, - proto.nitric.faas.v1.TraceContext.serializeBinaryToWriter - ); - } - f = message.getHttp(); - if (f != null) { - writer.writeMessage( - 3, - f, - proto.nitric.faas.v1.HttpTriggerContext.serializeBinaryToWriter - ); - } - f = message.getTopic(); - if (f != null) { - writer.writeMessage( - 4, - f, - proto.nitric.faas.v1.TopicTriggerContext.serializeBinaryToWriter - ); - } - f = message.getNotification(); - if (f != null) { - writer.writeMessage( - 5, - f, - proto.nitric.faas.v1.NotificationTriggerContext.serializeBinaryToWriter - ); - } - f = message.getWebsocket(); - if (f != null) { - writer.writeMessage( - 6, - f, - proto.nitric.faas.v1.WebsocketTriggerContext.serializeBinaryToWriter - ); - } -}; - - -/** - * optional bytes data = 1; - * @return {!(string|Uint8Array)} - */ -proto.nitric.faas.v1.TriggerRequest.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.nitric.faas.v1.TriggerRequest.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.nitric.faas.v1.TriggerRequest.prototype.getData_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getData())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.nitric.faas.v1.TriggerRequest} returns this - */ -proto.nitric.faas.v1.TriggerRequest.prototype.setData = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); -}; - - -/** - * optional string mime_type = 2; - * @return {string} - */ -proto.nitric.faas.v1.TriggerRequest.prototype.getMimeType = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.faas.v1.TriggerRequest} returns this - */ -proto.nitric.faas.v1.TriggerRequest.prototype.setMimeType = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional TraceContext trace_context = 10; - * @return {?proto.nitric.faas.v1.TraceContext} - */ -proto.nitric.faas.v1.TriggerRequest.prototype.getTraceContext = function() { - return /** @type{?proto.nitric.faas.v1.TraceContext} */ ( - jspb.Message.getWrapperField(this, proto.nitric.faas.v1.TraceContext, 10)); -}; - - -/** - * @param {?proto.nitric.faas.v1.TraceContext|undefined} value - * @return {!proto.nitric.faas.v1.TriggerRequest} returns this -*/ -proto.nitric.faas.v1.TriggerRequest.prototype.setTraceContext = function(value) { - return jspb.Message.setWrapperField(this, 10, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.faas.v1.TriggerRequest} returns this - */ -proto.nitric.faas.v1.TriggerRequest.prototype.clearTraceContext = function() { - return this.setTraceContext(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.faas.v1.TriggerRequest.prototype.hasTraceContext = function() { - return jspb.Message.getField(this, 10) != null; -}; - - -/** - * optional HttpTriggerContext http = 3; - * @return {?proto.nitric.faas.v1.HttpTriggerContext} - */ -proto.nitric.faas.v1.TriggerRequest.prototype.getHttp = function() { - return /** @type{?proto.nitric.faas.v1.HttpTriggerContext} */ ( - jspb.Message.getWrapperField(this, proto.nitric.faas.v1.HttpTriggerContext, 3)); -}; - - -/** - * @param {?proto.nitric.faas.v1.HttpTriggerContext|undefined} value - * @return {!proto.nitric.faas.v1.TriggerRequest} returns this -*/ -proto.nitric.faas.v1.TriggerRequest.prototype.setHttp = function(value) { - return jspb.Message.setOneofWrapperField(this, 3, proto.nitric.faas.v1.TriggerRequest.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.faas.v1.TriggerRequest} returns this - */ -proto.nitric.faas.v1.TriggerRequest.prototype.clearHttp = function() { - return this.setHttp(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.faas.v1.TriggerRequest.prototype.hasHttp = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * optional TopicTriggerContext topic = 4; - * @return {?proto.nitric.faas.v1.TopicTriggerContext} - */ -proto.nitric.faas.v1.TriggerRequest.prototype.getTopic = function() { - return /** @type{?proto.nitric.faas.v1.TopicTriggerContext} */ ( - jspb.Message.getWrapperField(this, proto.nitric.faas.v1.TopicTriggerContext, 4)); -}; - - -/** - * @param {?proto.nitric.faas.v1.TopicTriggerContext|undefined} value - * @return {!proto.nitric.faas.v1.TriggerRequest} returns this -*/ -proto.nitric.faas.v1.TriggerRequest.prototype.setTopic = function(value) { - return jspb.Message.setOneofWrapperField(this, 4, proto.nitric.faas.v1.TriggerRequest.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.faas.v1.TriggerRequest} returns this - */ -proto.nitric.faas.v1.TriggerRequest.prototype.clearTopic = function() { - return this.setTopic(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.faas.v1.TriggerRequest.prototype.hasTopic = function() { - return jspb.Message.getField(this, 4) != null; -}; - - -/** - * optional NotificationTriggerContext notification = 5; - * @return {?proto.nitric.faas.v1.NotificationTriggerContext} - */ -proto.nitric.faas.v1.TriggerRequest.prototype.getNotification = function() { - return /** @type{?proto.nitric.faas.v1.NotificationTriggerContext} */ ( - jspb.Message.getWrapperField(this, proto.nitric.faas.v1.NotificationTriggerContext, 5)); -}; - - -/** - * @param {?proto.nitric.faas.v1.NotificationTriggerContext|undefined} value - * @return {!proto.nitric.faas.v1.TriggerRequest} returns this -*/ -proto.nitric.faas.v1.TriggerRequest.prototype.setNotification = function(value) { - return jspb.Message.setOneofWrapperField(this, 5, proto.nitric.faas.v1.TriggerRequest.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.faas.v1.TriggerRequest} returns this - */ -proto.nitric.faas.v1.TriggerRequest.prototype.clearNotification = function() { - return this.setNotification(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.faas.v1.TriggerRequest.prototype.hasNotification = function() { - return jspb.Message.getField(this, 5) != null; -}; - - -/** - * optional WebsocketTriggerContext websocket = 6; - * @return {?proto.nitric.faas.v1.WebsocketTriggerContext} - */ -proto.nitric.faas.v1.TriggerRequest.prototype.getWebsocket = function() { - return /** @type{?proto.nitric.faas.v1.WebsocketTriggerContext} */ ( - jspb.Message.getWrapperField(this, proto.nitric.faas.v1.WebsocketTriggerContext, 6)); -}; - - -/** - * @param {?proto.nitric.faas.v1.WebsocketTriggerContext|undefined} value - * @return {!proto.nitric.faas.v1.TriggerRequest} returns this -*/ -proto.nitric.faas.v1.TriggerRequest.prototype.setWebsocket = function(value) { - return jspb.Message.setOneofWrapperField(this, 6, proto.nitric.faas.v1.TriggerRequest.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.faas.v1.TriggerRequest} returns this - */ -proto.nitric.faas.v1.TriggerRequest.prototype.clearWebsocket = function() { - return this.setWebsocket(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.faas.v1.TriggerRequest.prototype.hasWebsocket = function() { - return jspb.Message.getField(this, 6) != null; -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.nitric.faas.v1.HeaderValue.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.nitric.faas.v1.HeaderValue.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.faas.v1.HeaderValue.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.nitric.faas.v1.HeaderValue} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.HeaderValue.toObject = function(includeInstance, msg) { - var f, obj = { - valueList: (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.nitric.faas.v1.HeaderValue} - */ -proto.nitric.faas.v1.HeaderValue.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.faas.v1.HeaderValue; - return proto.nitric.faas.v1.HeaderValue.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.faas.v1.HeaderValue} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.faas.v1.HeaderValue} - */ -proto.nitric.faas.v1.HeaderValue.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.addValue(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.faas.v1.HeaderValue.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.HeaderValue.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.HeaderValue} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.HeaderValue.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getValueList(); - if (f.length > 0) { - writer.writeRepeatedString( - 1, - f - ); - } -}; - - -/** - * repeated string value = 1; - * @return {!Array} - */ -proto.nitric.faas.v1.HeaderValue.prototype.getValueList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); -}; - - -/** - * @param {!Array} value - * @return {!proto.nitric.faas.v1.HeaderValue} returns this - */ -proto.nitric.faas.v1.HeaderValue.prototype.setValueList = function(value) { - return jspb.Message.setField(this, 1, value || []); -}; - - -/** - * @param {string} value - * @param {number=} opt_index - * @return {!proto.nitric.faas.v1.HeaderValue} returns this - */ -proto.nitric.faas.v1.HeaderValue.prototype.addValue = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 1, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.nitric.faas.v1.HeaderValue} returns this - */ -proto.nitric.faas.v1.HeaderValue.prototype.clearValueList = function() { - return this.setValueList([]); -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.nitric.faas.v1.QueryValue.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.nitric.faas.v1.QueryValue.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.faas.v1.QueryValue.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.nitric.faas.v1.QueryValue} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.QueryValue.toObject = function(includeInstance, msg) { - var f, obj = { - valueList: (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.nitric.faas.v1.QueryValue} - */ -proto.nitric.faas.v1.QueryValue.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.faas.v1.QueryValue; - return proto.nitric.faas.v1.QueryValue.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.faas.v1.QueryValue} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.faas.v1.QueryValue} - */ -proto.nitric.faas.v1.QueryValue.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.addValue(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.faas.v1.QueryValue.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.QueryValue.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.QueryValue} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.QueryValue.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getValueList(); - if (f.length > 0) { - writer.writeRepeatedString( - 1, - f - ); - } -}; - - -/** - * repeated string value = 1; - * @return {!Array} - */ -proto.nitric.faas.v1.QueryValue.prototype.getValueList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); -}; - - -/** - * @param {!Array} value - * @return {!proto.nitric.faas.v1.QueryValue} returns this - */ -proto.nitric.faas.v1.QueryValue.prototype.setValueList = function(value) { - return jspb.Message.setField(this, 1, value || []); -}; - - -/** - * @param {string} value - * @param {number=} opt_index - * @return {!proto.nitric.faas.v1.QueryValue} returns this - */ -proto.nitric.faas.v1.QueryValue.prototype.addValue = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 1, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.nitric.faas.v1.QueryValue} returns this - */ -proto.nitric.faas.v1.QueryValue.prototype.clearValueList = function() { - return this.setValueList([]); -}; - - - - - -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.nitric.faas.v1.HttpTriggerContext.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.faas.v1.HttpTriggerContext.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.nitric.faas.v1.HttpTriggerContext} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.HttpTriggerContext.toObject = function(includeInstance, msg) { - var f, obj = { - method: jspb.Message.getFieldWithDefault(msg, 1, ""), - path: jspb.Message.getFieldWithDefault(msg, 2, ""), - headersOldMap: (f = msg.getHeadersOldMap()) ? f.toObject(includeInstance, undefined) : [], - queryParamsOldMap: (f = msg.getQueryParamsOldMap()) ? f.toObject(includeInstance, undefined) : [], - headersMap: (f = msg.getHeadersMap()) ? f.toObject(includeInstance, proto.nitric.faas.v1.HeaderValue.toObject) : [], - queryParamsMap: (f = msg.getQueryParamsMap()) ? f.toObject(includeInstance, proto.nitric.faas.v1.QueryValue.toObject) : [], - pathParamsMap: (f = msg.getPathParamsMap()) ? 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.nitric.faas.v1.HttpTriggerContext} - */ -proto.nitric.faas.v1.HttpTriggerContext.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.faas.v1.HttpTriggerContext; - return proto.nitric.faas.v1.HttpTriggerContext.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.faas.v1.HttpTriggerContext} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.faas.v1.HttpTriggerContext} - */ -proto.nitric.faas.v1.HttpTriggerContext.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 = /** @type {string} */ (reader.readString()); - msg.setPath(value); - break; - case 3: - var value = msg.getHeadersOldMap(); - 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 = msg.getQueryParamsOldMap(); - 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 = msg.getHeadersMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.nitric.faas.v1.HeaderValue.deserializeBinaryFromReader, "", new proto.nitric.faas.v1.HeaderValue()); - }); - break; - case 6: - var value = msg.getQueryParamsMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.nitric.faas.v1.QueryValue.deserializeBinaryFromReader, "", new proto.nitric.faas.v1.QueryValue()); - }); - break; - case 7: - var value = msg.getPathParamsMap(); - 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.nitric.faas.v1.HttpTriggerContext.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.HttpTriggerContext.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.HttpTriggerContext} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.HttpTriggerContext.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getMethod(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getPath(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getHeadersOldMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(3, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); - } - f = message.getQueryParamsOldMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(4, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); - } - f = message.getHeadersMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.nitric.faas.v1.HeaderValue.serializeBinaryToWriter); - } - f = message.getQueryParamsMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(6, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.nitric.faas.v1.QueryValue.serializeBinaryToWriter); - } - f = message.getPathParamsMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(7, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); - } -}; - - -/** - * optional string method = 1; - * @return {string} - */ -proto.nitric.faas.v1.HttpTriggerContext.prototype.getMethod = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.faas.v1.HttpTriggerContext} returns this - */ -proto.nitric.faas.v1.HttpTriggerContext.prototype.setMethod = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string path = 2; - * @return {string} - */ -proto.nitric.faas.v1.HttpTriggerContext.prototype.getPath = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.faas.v1.HttpTriggerContext} returns this - */ -proto.nitric.faas.v1.HttpTriggerContext.prototype.setPath = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * map headers_old = 3; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.nitric.faas.v1.HttpTriggerContext.prototype.getHeadersOldMap = 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.nitric.faas.v1.HttpTriggerContext} returns this - */ -proto.nitric.faas.v1.HttpTriggerContext.prototype.clearHeadersOldMap = function() { - this.getHeadersOldMap().clear(); - return this;}; - - -/** - * map query_params_old = 4; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.nitric.faas.v1.HttpTriggerContext.prototype.getQueryParamsOldMap = 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.nitric.faas.v1.HttpTriggerContext} returns this - */ -proto.nitric.faas.v1.HttpTriggerContext.prototype.clearQueryParamsOldMap = function() { - this.getQueryParamsOldMap().clear(); - return this;}; - - -/** - * map headers = 5; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.nitric.faas.v1.HttpTriggerContext.prototype.getHeadersMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 5, opt_noLazyCreate, - proto.nitric.faas.v1.HeaderValue)); -}; - - -/** - * Clears values from the map. The map will be non-null. - * @return {!proto.nitric.faas.v1.HttpTriggerContext} returns this - */ -proto.nitric.faas.v1.HttpTriggerContext.prototype.clearHeadersMap = function() { - this.getHeadersMap().clear(); - return this;}; - - -/** - * map query_params = 6; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.nitric.faas.v1.HttpTriggerContext.prototype.getQueryParamsMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 6, opt_noLazyCreate, - proto.nitric.faas.v1.QueryValue)); -}; - - -/** - * Clears values from the map. The map will be non-null. - * @return {!proto.nitric.faas.v1.HttpTriggerContext} returns this - */ -proto.nitric.faas.v1.HttpTriggerContext.prototype.clearQueryParamsMap = function() { - this.getQueryParamsMap().clear(); - return this;}; - - -/** - * map path_params = 7; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.nitric.faas.v1.HttpTriggerContext.prototype.getPathParamsMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 7, opt_noLazyCreate, - null)); -}; - - -/** - * Clears values from the map. The map will be non-null. - * @return {!proto.nitric.faas.v1.HttpTriggerContext} returns this - */ -proto.nitric.faas.v1.HttpTriggerContext.prototype.clearPathParamsMap = function() { - this.getPathParamsMap().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.nitric.faas.v1.TopicTriggerContext.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.faas.v1.TopicTriggerContext.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.nitric.faas.v1.TopicTriggerContext} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.TopicTriggerContext.toObject = function(includeInstance, msg) { - var f, obj = { - topic: 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.nitric.faas.v1.TopicTriggerContext} - */ -proto.nitric.faas.v1.TopicTriggerContext.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.faas.v1.TopicTriggerContext; - return proto.nitric.faas.v1.TopicTriggerContext.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.faas.v1.TopicTriggerContext} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.faas.v1.TopicTriggerContext} - */ -proto.nitric.faas.v1.TopicTriggerContext.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.setTopic(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.faas.v1.TopicTriggerContext.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.TopicTriggerContext.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.TopicTriggerContext} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.TopicTriggerContext.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getTopic(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string topic = 1; - * @return {string} - */ -proto.nitric.faas.v1.TopicTriggerContext.prototype.getTopic = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.faas.v1.TopicTriggerContext} returns this - */ -proto.nitric.faas.v1.TopicTriggerContext.prototype.setTopic = 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.nitric.faas.v1.BucketNotification.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.faas.v1.BucketNotification.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.nitric.faas.v1.BucketNotification} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.BucketNotification.toObject = function(includeInstance, msg) { - var f, obj = { - key: jspb.Message.getFieldWithDefault(msg, 1, ""), - type: 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.nitric.faas.v1.BucketNotification} - */ -proto.nitric.faas.v1.BucketNotification.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.faas.v1.BucketNotification; - return proto.nitric.faas.v1.BucketNotification.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.faas.v1.BucketNotification} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.faas.v1.BucketNotification} - */ -proto.nitric.faas.v1.BucketNotification.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 {!proto.nitric.faas.v1.BucketNotificationType} */ (reader.readEnum()); - msg.setType(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.faas.v1.BucketNotification.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.BucketNotification.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.BucketNotification} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.BucketNotification.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getKey(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getType(); - if (f !== 0.0) { - writer.writeEnum( - 2, - f - ); - } -}; - - -/** - * optional string key = 1; - * @return {string} - */ -proto.nitric.faas.v1.BucketNotification.prototype.getKey = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.faas.v1.BucketNotification} returns this - */ -proto.nitric.faas.v1.BucketNotification.prototype.setKey = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional BucketNotificationType type = 2; - * @return {!proto.nitric.faas.v1.BucketNotificationType} - */ -proto.nitric.faas.v1.BucketNotification.prototype.getType = function() { - return /** @type {!proto.nitric.faas.v1.BucketNotificationType} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** - * @param {!proto.nitric.faas.v1.BucketNotificationType} value - * @return {!proto.nitric.faas.v1.BucketNotification} returns this - */ -proto.nitric.faas.v1.BucketNotification.prototype.setType = function(value) { - return jspb.Message.setProto3EnumField(this, 2, value); -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.nitric.faas.v1.NotificationTriggerContext.oneofGroups_ = [[10]]; - -/** - * @enum {number} - */ -proto.nitric.faas.v1.NotificationTriggerContext.NotificationCase = { - NOTIFICATION_NOT_SET: 0, - BUCKET: 10 -}; - -/** - * @return {proto.nitric.faas.v1.NotificationTriggerContext.NotificationCase} - */ -proto.nitric.faas.v1.NotificationTriggerContext.prototype.getNotificationCase = function() { - return /** @type {proto.nitric.faas.v1.NotificationTriggerContext.NotificationCase} */(jspb.Message.computeOneofCase(this, proto.nitric.faas.v1.NotificationTriggerContext.oneofGroups_[0])); -}; - - - -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.nitric.faas.v1.NotificationTriggerContext.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.faas.v1.NotificationTriggerContext.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.nitric.faas.v1.NotificationTriggerContext} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.NotificationTriggerContext.toObject = function(includeInstance, msg) { - var f, obj = { - source: jspb.Message.getFieldWithDefault(msg, 1, ""), - bucket: (f = msg.getBucket()) && proto.nitric.faas.v1.BucketNotification.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.nitric.faas.v1.NotificationTriggerContext} - */ -proto.nitric.faas.v1.NotificationTriggerContext.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.faas.v1.NotificationTriggerContext; - return proto.nitric.faas.v1.NotificationTriggerContext.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.faas.v1.NotificationTriggerContext} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.faas.v1.NotificationTriggerContext} - */ -proto.nitric.faas.v1.NotificationTriggerContext.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.setSource(value); - break; - case 10: - var value = new proto.nitric.faas.v1.BucketNotification; - reader.readMessage(value,proto.nitric.faas.v1.BucketNotification.deserializeBinaryFromReader); - msg.setBucket(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.faas.v1.NotificationTriggerContext.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.NotificationTriggerContext.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.NotificationTriggerContext} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.NotificationTriggerContext.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getSource(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getBucket(); - if (f != null) { - writer.writeMessage( - 10, - f, - proto.nitric.faas.v1.BucketNotification.serializeBinaryToWriter - ); - } -}; - - -/** - * optional string source = 1; - * @return {string} - */ -proto.nitric.faas.v1.NotificationTriggerContext.prototype.getSource = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.faas.v1.NotificationTriggerContext} returns this - */ -proto.nitric.faas.v1.NotificationTriggerContext.prototype.setSource = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional BucketNotification bucket = 10; - * @return {?proto.nitric.faas.v1.BucketNotification} - */ -proto.nitric.faas.v1.NotificationTriggerContext.prototype.getBucket = function() { - return /** @type{?proto.nitric.faas.v1.BucketNotification} */ ( - jspb.Message.getWrapperField(this, proto.nitric.faas.v1.BucketNotification, 10)); -}; - - -/** - * @param {?proto.nitric.faas.v1.BucketNotification|undefined} value - * @return {!proto.nitric.faas.v1.NotificationTriggerContext} returns this -*/ -proto.nitric.faas.v1.NotificationTriggerContext.prototype.setBucket = function(value) { - return jspb.Message.setOneofWrapperField(this, 10, proto.nitric.faas.v1.NotificationTriggerContext.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.faas.v1.NotificationTriggerContext} returns this - */ -proto.nitric.faas.v1.NotificationTriggerContext.prototype.clearBucket = function() { - return this.setBucket(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.faas.v1.NotificationTriggerContext.prototype.hasBucket = function() { - return jspb.Message.getField(this, 10) != 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.nitric.faas.v1.WebsocketTriggerContext.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.faas.v1.WebsocketTriggerContext.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.nitric.faas.v1.WebsocketTriggerContext} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.WebsocketTriggerContext.toObject = function(includeInstance, msg) { - var f, obj = { - socket: jspb.Message.getFieldWithDefault(msg, 1, ""), - event: jspb.Message.getFieldWithDefault(msg, 2, 0), - connectionid: jspb.Message.getFieldWithDefault(msg, 3, ""), - queryParamsMap: (f = msg.getQueryParamsMap()) ? f.toObject(includeInstance, proto.nitric.faas.v1.QueryValue.toObject) : [] - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.faas.v1.WebsocketTriggerContext} - */ -proto.nitric.faas.v1.WebsocketTriggerContext.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.faas.v1.WebsocketTriggerContext; - return proto.nitric.faas.v1.WebsocketTriggerContext.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.faas.v1.WebsocketTriggerContext} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.faas.v1.WebsocketTriggerContext} - */ -proto.nitric.faas.v1.WebsocketTriggerContext.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.setSocket(value); - break; - case 2: - var value = /** @type {!proto.nitric.faas.v1.WebsocketEvent} */ (reader.readEnum()); - msg.setEvent(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setConnectionid(value); - break; - case 6: - var value = msg.getQueryParamsMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.nitric.faas.v1.QueryValue.deserializeBinaryFromReader, "", new proto.nitric.faas.v1.QueryValue()); - }); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.faas.v1.WebsocketTriggerContext.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.WebsocketTriggerContext.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.WebsocketTriggerContext} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.WebsocketTriggerContext.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getSocket(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getEvent(); - if (f !== 0.0) { - writer.writeEnum( - 2, - f - ); - } - f = message.getConnectionid(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } - f = message.getQueryParamsMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(6, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.nitric.faas.v1.QueryValue.serializeBinaryToWriter); - } -}; - - -/** - * optional string socket = 1; - * @return {string} - */ -proto.nitric.faas.v1.WebsocketTriggerContext.prototype.getSocket = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.faas.v1.WebsocketTriggerContext} returns this - */ -proto.nitric.faas.v1.WebsocketTriggerContext.prototype.setSocket = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional WebsocketEvent event = 2; - * @return {!proto.nitric.faas.v1.WebsocketEvent} - */ -proto.nitric.faas.v1.WebsocketTriggerContext.prototype.getEvent = function() { - return /** @type {!proto.nitric.faas.v1.WebsocketEvent} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** - * @param {!proto.nitric.faas.v1.WebsocketEvent} value - * @return {!proto.nitric.faas.v1.WebsocketTriggerContext} returns this - */ -proto.nitric.faas.v1.WebsocketTriggerContext.prototype.setEvent = function(value) { - return jspb.Message.setProto3EnumField(this, 2, value); -}; - - -/** - * optional string connectionId = 3; - * @return {string} - */ -proto.nitric.faas.v1.WebsocketTriggerContext.prototype.getConnectionid = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.faas.v1.WebsocketTriggerContext} returns this - */ -proto.nitric.faas.v1.WebsocketTriggerContext.prototype.setConnectionid = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - -/** - * map query_params = 6; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.nitric.faas.v1.WebsocketTriggerContext.prototype.getQueryParamsMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 6, opt_noLazyCreate, - proto.nitric.faas.v1.QueryValue)); -}; - - -/** - * Clears values from the map. The map will be non-null. - * @return {!proto.nitric.faas.v1.WebsocketTriggerContext} returns this - */ -proto.nitric.faas.v1.WebsocketTriggerContext.prototype.clearQueryParamsMap = function() { - this.getQueryParamsMap().clear(); - return this;}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.nitric.faas.v1.TriggerResponse.oneofGroups_ = [[10,11,12,13]]; - -/** - * @enum {number} - */ -proto.nitric.faas.v1.TriggerResponse.ContextCase = { - CONTEXT_NOT_SET: 0, - HTTP: 10, - TOPIC: 11, - NOTIFICATION: 12, - WEBSOCKET: 13 -}; - -/** - * @return {proto.nitric.faas.v1.TriggerResponse.ContextCase} - */ -proto.nitric.faas.v1.TriggerResponse.prototype.getContextCase = function() { - return /** @type {proto.nitric.faas.v1.TriggerResponse.ContextCase} */(jspb.Message.computeOneofCase(this, proto.nitric.faas.v1.TriggerResponse.oneofGroups_[0])); -}; - - - -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.nitric.faas.v1.TriggerResponse.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.faas.v1.TriggerResponse.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.nitric.faas.v1.TriggerResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.TriggerResponse.toObject = function(includeInstance, msg) { - var f, obj = { - data: msg.getData_asB64(), - http: (f = msg.getHttp()) && proto.nitric.faas.v1.HttpResponseContext.toObject(includeInstance, f), - topic: (f = msg.getTopic()) && proto.nitric.faas.v1.TopicResponseContext.toObject(includeInstance, f), - notification: (f = msg.getNotification()) && proto.nitric.faas.v1.NotificationResponseContext.toObject(includeInstance, f), - websocket: (f = msg.getWebsocket()) && proto.nitric.faas.v1.WebsocketResponseContext.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.nitric.faas.v1.TriggerResponse} - */ -proto.nitric.faas.v1.TriggerResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.faas.v1.TriggerResponse; - return proto.nitric.faas.v1.TriggerResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.faas.v1.TriggerResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.faas.v1.TriggerResponse} - */ -proto.nitric.faas.v1.TriggerResponse.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 10: - var value = new proto.nitric.faas.v1.HttpResponseContext; - reader.readMessage(value,proto.nitric.faas.v1.HttpResponseContext.deserializeBinaryFromReader); - msg.setHttp(value); - break; - case 11: - var value = new proto.nitric.faas.v1.TopicResponseContext; - reader.readMessage(value,proto.nitric.faas.v1.TopicResponseContext.deserializeBinaryFromReader); - msg.setTopic(value); - break; - case 12: - var value = new proto.nitric.faas.v1.NotificationResponseContext; - reader.readMessage(value,proto.nitric.faas.v1.NotificationResponseContext.deserializeBinaryFromReader); - msg.setNotification(value); - break; - case 13: - var value = new proto.nitric.faas.v1.WebsocketResponseContext; - reader.readMessage(value,proto.nitric.faas.v1.WebsocketResponseContext.deserializeBinaryFromReader); - msg.setWebsocket(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.faas.v1.TriggerResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.TriggerResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.TriggerResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.TriggerResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getData_asU8(); - if (f.length > 0) { - writer.writeBytes( - 1, - f - ); - } - f = message.getHttp(); - if (f != null) { - writer.writeMessage( - 10, - f, - proto.nitric.faas.v1.HttpResponseContext.serializeBinaryToWriter - ); - } - f = message.getTopic(); - if (f != null) { - writer.writeMessage( - 11, - f, - proto.nitric.faas.v1.TopicResponseContext.serializeBinaryToWriter - ); - } - f = message.getNotification(); - if (f != null) { - writer.writeMessage( - 12, - f, - proto.nitric.faas.v1.NotificationResponseContext.serializeBinaryToWriter - ); - } - f = message.getWebsocket(); - if (f != null) { - writer.writeMessage( - 13, - f, - proto.nitric.faas.v1.WebsocketResponseContext.serializeBinaryToWriter - ); - } -}; - - -/** - * optional bytes data = 1; - * @return {!(string|Uint8Array)} - */ -proto.nitric.faas.v1.TriggerResponse.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.nitric.faas.v1.TriggerResponse.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.nitric.faas.v1.TriggerResponse.prototype.getData_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getData())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.nitric.faas.v1.TriggerResponse} returns this - */ -proto.nitric.faas.v1.TriggerResponse.prototype.setData = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); -}; - - -/** - * optional HttpResponseContext http = 10; - * @return {?proto.nitric.faas.v1.HttpResponseContext} - */ -proto.nitric.faas.v1.TriggerResponse.prototype.getHttp = function() { - return /** @type{?proto.nitric.faas.v1.HttpResponseContext} */ ( - jspb.Message.getWrapperField(this, proto.nitric.faas.v1.HttpResponseContext, 10)); -}; - - -/** - * @param {?proto.nitric.faas.v1.HttpResponseContext|undefined} value - * @return {!proto.nitric.faas.v1.TriggerResponse} returns this -*/ -proto.nitric.faas.v1.TriggerResponse.prototype.setHttp = function(value) { - return jspb.Message.setOneofWrapperField(this, 10, proto.nitric.faas.v1.TriggerResponse.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.faas.v1.TriggerResponse} returns this - */ -proto.nitric.faas.v1.TriggerResponse.prototype.clearHttp = function() { - return this.setHttp(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.faas.v1.TriggerResponse.prototype.hasHttp = function() { - return jspb.Message.getField(this, 10) != null; -}; - - -/** - * optional TopicResponseContext topic = 11; - * @return {?proto.nitric.faas.v1.TopicResponseContext} - */ -proto.nitric.faas.v1.TriggerResponse.prototype.getTopic = function() { - return /** @type{?proto.nitric.faas.v1.TopicResponseContext} */ ( - jspb.Message.getWrapperField(this, proto.nitric.faas.v1.TopicResponseContext, 11)); -}; - - -/** - * @param {?proto.nitric.faas.v1.TopicResponseContext|undefined} value - * @return {!proto.nitric.faas.v1.TriggerResponse} returns this -*/ -proto.nitric.faas.v1.TriggerResponse.prototype.setTopic = function(value) { - return jspb.Message.setOneofWrapperField(this, 11, proto.nitric.faas.v1.TriggerResponse.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.faas.v1.TriggerResponse} returns this - */ -proto.nitric.faas.v1.TriggerResponse.prototype.clearTopic = function() { - return this.setTopic(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.faas.v1.TriggerResponse.prototype.hasTopic = function() { - return jspb.Message.getField(this, 11) != null; -}; - - -/** - * optional NotificationResponseContext notification = 12; - * @return {?proto.nitric.faas.v1.NotificationResponseContext} - */ -proto.nitric.faas.v1.TriggerResponse.prototype.getNotification = function() { - return /** @type{?proto.nitric.faas.v1.NotificationResponseContext} */ ( - jspb.Message.getWrapperField(this, proto.nitric.faas.v1.NotificationResponseContext, 12)); -}; - - -/** - * @param {?proto.nitric.faas.v1.NotificationResponseContext|undefined} value - * @return {!proto.nitric.faas.v1.TriggerResponse} returns this -*/ -proto.nitric.faas.v1.TriggerResponse.prototype.setNotification = function(value) { - return jspb.Message.setOneofWrapperField(this, 12, proto.nitric.faas.v1.TriggerResponse.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.faas.v1.TriggerResponse} returns this - */ -proto.nitric.faas.v1.TriggerResponse.prototype.clearNotification = function() { - return this.setNotification(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.faas.v1.TriggerResponse.prototype.hasNotification = function() { - return jspb.Message.getField(this, 12) != null; -}; - - -/** - * optional WebsocketResponseContext websocket = 13; - * @return {?proto.nitric.faas.v1.WebsocketResponseContext} - */ -proto.nitric.faas.v1.TriggerResponse.prototype.getWebsocket = function() { - return /** @type{?proto.nitric.faas.v1.WebsocketResponseContext} */ ( - jspb.Message.getWrapperField(this, proto.nitric.faas.v1.WebsocketResponseContext, 13)); -}; - - -/** - * @param {?proto.nitric.faas.v1.WebsocketResponseContext|undefined} value - * @return {!proto.nitric.faas.v1.TriggerResponse} returns this -*/ -proto.nitric.faas.v1.TriggerResponse.prototype.setWebsocket = function(value) { - return jspb.Message.setOneofWrapperField(this, 13, proto.nitric.faas.v1.TriggerResponse.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.faas.v1.TriggerResponse} returns this - */ -proto.nitric.faas.v1.TriggerResponse.prototype.clearWebsocket = function() { - return this.setWebsocket(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.faas.v1.TriggerResponse.prototype.hasWebsocket = function() { - return jspb.Message.getField(this, 13) != 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.nitric.faas.v1.HttpResponseContext.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.faas.v1.HttpResponseContext.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.nitric.faas.v1.HttpResponseContext} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.HttpResponseContext.toObject = function(includeInstance, msg) { - var f, obj = { - headersOldMap: (f = msg.getHeadersOldMap()) ? f.toObject(includeInstance, undefined) : [], - status: jspb.Message.getFieldWithDefault(msg, 2, 0), - headersMap: (f = msg.getHeadersMap()) ? f.toObject(includeInstance, proto.nitric.faas.v1.HeaderValue.toObject) : [] - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.faas.v1.HttpResponseContext} - */ -proto.nitric.faas.v1.HttpResponseContext.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.faas.v1.HttpResponseContext; - return proto.nitric.faas.v1.HttpResponseContext.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.faas.v1.HttpResponseContext} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.faas.v1.HttpResponseContext} - */ -proto.nitric.faas.v1.HttpResponseContext.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = msg.getHeadersOldMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); - }); - break; - case 2: - var value = /** @type {number} */ (reader.readInt32()); - msg.setStatus(value); - break; - case 3: - var value = msg.getHeadersMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.nitric.faas.v1.HeaderValue.deserializeBinaryFromReader, "", new proto.nitric.faas.v1.HeaderValue()); - }); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.faas.v1.HttpResponseContext.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.HttpResponseContext.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.HttpResponseContext} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.HttpResponseContext.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getHeadersOldMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); - } - f = message.getStatus(); - if (f !== 0) { - writer.writeInt32( - 2, - f - ); - } - f = message.getHeadersMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(3, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.nitric.faas.v1.HeaderValue.serializeBinaryToWriter); - } -}; - - -/** - * map headers_old = 1; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.nitric.faas.v1.HttpResponseContext.prototype.getHeadersOldMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 1, opt_noLazyCreate, - null)); -}; - - -/** - * Clears values from the map. The map will be non-null. - * @return {!proto.nitric.faas.v1.HttpResponseContext} returns this - */ -proto.nitric.faas.v1.HttpResponseContext.prototype.clearHeadersOldMap = function() { - this.getHeadersOldMap().clear(); - return this;}; - - -/** - * optional int32 status = 2; - * @return {number} - */ -proto.nitric.faas.v1.HttpResponseContext.prototype.getStatus = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.nitric.faas.v1.HttpResponseContext} returns this - */ -proto.nitric.faas.v1.HttpResponseContext.prototype.setStatus = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); -}; - - -/** - * map headers = 3; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.nitric.faas.v1.HttpResponseContext.prototype.getHeadersMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 3, opt_noLazyCreate, - proto.nitric.faas.v1.HeaderValue)); -}; - - -/** - * Clears values from the map. The map will be non-null. - * @return {!proto.nitric.faas.v1.HttpResponseContext} returns this - */ -proto.nitric.faas.v1.HttpResponseContext.prototype.clearHeadersMap = function() { - this.getHeadersMap().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.nitric.faas.v1.TopicResponseContext.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.faas.v1.TopicResponseContext.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.nitric.faas.v1.TopicResponseContext} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.TopicResponseContext.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.nitric.faas.v1.TopicResponseContext} - */ -proto.nitric.faas.v1.TopicResponseContext.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.faas.v1.TopicResponseContext; - return proto.nitric.faas.v1.TopicResponseContext.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.faas.v1.TopicResponseContext} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.faas.v1.TopicResponseContext} - */ -proto.nitric.faas.v1.TopicResponseContext.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.nitric.faas.v1.TopicResponseContext.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.TopicResponseContext.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.TopicResponseContext} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.TopicResponseContext.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getSuccess(); - if (f) { - writer.writeBool( - 1, - f - ); - } -}; - - -/** - * optional bool success = 1; - * @return {boolean} - */ -proto.nitric.faas.v1.TopicResponseContext.prototype.getSuccess = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.nitric.faas.v1.TopicResponseContext} returns this - */ -proto.nitric.faas.v1.TopicResponseContext.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.nitric.faas.v1.NotificationResponseContext.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.faas.v1.NotificationResponseContext.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.nitric.faas.v1.NotificationResponseContext} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.NotificationResponseContext.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.nitric.faas.v1.NotificationResponseContext} - */ -proto.nitric.faas.v1.NotificationResponseContext.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.faas.v1.NotificationResponseContext; - return proto.nitric.faas.v1.NotificationResponseContext.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.faas.v1.NotificationResponseContext} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.faas.v1.NotificationResponseContext} - */ -proto.nitric.faas.v1.NotificationResponseContext.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.nitric.faas.v1.NotificationResponseContext.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.NotificationResponseContext.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.NotificationResponseContext} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.NotificationResponseContext.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getSuccess(); - if (f) { - writer.writeBool( - 1, - f - ); - } -}; - - -/** - * optional bool success = 1; - * @return {boolean} - */ -proto.nitric.faas.v1.NotificationResponseContext.prototype.getSuccess = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.nitric.faas.v1.NotificationResponseContext} returns this - */ -proto.nitric.faas.v1.NotificationResponseContext.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.nitric.faas.v1.WebsocketResponseContext.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.faas.v1.WebsocketResponseContext.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.nitric.faas.v1.WebsocketResponseContext} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.WebsocketResponseContext.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.nitric.faas.v1.WebsocketResponseContext} - */ -proto.nitric.faas.v1.WebsocketResponseContext.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.faas.v1.WebsocketResponseContext; - return proto.nitric.faas.v1.WebsocketResponseContext.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.faas.v1.WebsocketResponseContext} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.faas.v1.WebsocketResponseContext} - */ -proto.nitric.faas.v1.WebsocketResponseContext.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.nitric.faas.v1.WebsocketResponseContext.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.WebsocketResponseContext.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.WebsocketResponseContext} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.faas.v1.WebsocketResponseContext.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getSuccess(); - if (f) { - writer.writeBool( - 1, - f - ); - } -}; - - -/** - * optional bool success = 1; - * @return {boolean} - */ -proto.nitric.faas.v1.WebsocketResponseContext.prototype.getSuccess = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.nitric.faas.v1.WebsocketResponseContext} returns this - */ -proto.nitric.faas.v1.WebsocketResponseContext.prototype.setSuccess = function(value) { - return jspb.Message.setProto3BooleanField(this, 1, value); -}; - - -/** - * @enum {number} - */ -proto.nitric.faas.v1.BucketNotificationType = { - ALL: 0, - CREATED: 1, - DELETED: 2 -}; - -/** - * @enum {number} - */ -proto.nitric.faas.v1.WebsocketEvent = { - CONNECT: 0, - DISCONNECT: 1, - MESSAGE: 2 -}; - -goog.object.extend(exports, proto.nitric.faas.v1); diff --git a/src/gen/proto/queue/v1/queue_grpc_pb.d.ts b/src/gen/proto/queue/v1/queue_grpc_pb.d.ts deleted file mode 100644 index c6c8dc39..00000000 --- a/src/gen/proto/queue/v1/queue_grpc_pb.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -// GENERATED CODE -- DO NOT EDIT! - -// package: nitric.queue.v1 -// file: proto/queue/v1/queue.proto - -import * as proto_queue_v1_queue_pb from "../../../proto/queue/v1/queue_pb"; -import * as grpc from "@grpc/grpc-js"; - -interface IQueueServiceService extends grpc.ServiceDefinition { - send: grpc.MethodDefinition; - sendBatch: grpc.MethodDefinition; - receive: grpc.MethodDefinition; - complete: grpc.MethodDefinition; -} - -export const QueueServiceService: IQueueServiceService; - -export interface IQueueServiceServer extends grpc.UntypedServiceImplementation { - send: grpc.handleUnaryCall; - sendBatch: grpc.handleUnaryCall; - receive: grpc.handleUnaryCall; - complete: grpc.handleUnaryCall; -} - -export class QueueServiceClient extends grpc.Client { - constructor(address: string, credentials: grpc.ChannelCredentials, options?: object); - send(argument: proto_queue_v1_queue_pb.QueueSendRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; - send(argument: proto_queue_v1_queue_pb.QueueSendRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - send(argument: proto_queue_v1_queue_pb.QueueSendRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - sendBatch(argument: proto_queue_v1_queue_pb.QueueSendBatchRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; - sendBatch(argument: proto_queue_v1_queue_pb.QueueSendBatchRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - sendBatch(argument: proto_queue_v1_queue_pb.QueueSendBatchRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - receive(argument: proto_queue_v1_queue_pb.QueueReceiveRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; - receive(argument: proto_queue_v1_queue_pb.QueueReceiveRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - receive(argument: proto_queue_v1_queue_pb.QueueReceiveRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - complete(argument: proto_queue_v1_queue_pb.QueueCompleteRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; - complete(argument: proto_queue_v1_queue_pb.QueueCompleteRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - complete(argument: proto_queue_v1_queue_pb.QueueCompleteRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; -} diff --git a/src/gen/proto/queue/v1/queue_grpc_pb.js b/src/gen/proto/queue/v1/queue_grpc_pb.js deleted file mode 100644 index cf8de686..00000000 --- a/src/gen/proto/queue/v1/queue_grpc_pb.js +++ /dev/null @@ -1,150 +0,0 @@ -// GENERATED CODE -- DO NOT EDIT! - -'use strict'; -var grpc = require('@grpc/grpc-js'); -var proto_queue_v1_queue_pb = require('../../../proto/queue/v1/queue_pb.js'); -var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js'); -var validate_validate_pb = require('../../../validate/validate_pb.js'); - -function serialize_nitric_queue_v1_QueueCompleteRequest(arg) { - if (!(arg instanceof proto_queue_v1_queue_pb.QueueCompleteRequest)) { - throw new Error('Expected argument of type nitric.queue.v1.QueueCompleteRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_queue_v1_QueueCompleteRequest(buffer_arg) { - return proto_queue_v1_queue_pb.QueueCompleteRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_queue_v1_QueueCompleteResponse(arg) { - if (!(arg instanceof proto_queue_v1_queue_pb.QueueCompleteResponse)) { - throw new Error('Expected argument of type nitric.queue.v1.QueueCompleteResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_queue_v1_QueueCompleteResponse(buffer_arg) { - return proto_queue_v1_queue_pb.QueueCompleteResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_queue_v1_QueueReceiveRequest(arg) { - if (!(arg instanceof proto_queue_v1_queue_pb.QueueReceiveRequest)) { - throw new Error('Expected argument of type nitric.queue.v1.QueueReceiveRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_queue_v1_QueueReceiveRequest(buffer_arg) { - return proto_queue_v1_queue_pb.QueueReceiveRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_queue_v1_QueueReceiveResponse(arg) { - if (!(arg instanceof proto_queue_v1_queue_pb.QueueReceiveResponse)) { - throw new Error('Expected argument of type nitric.queue.v1.QueueReceiveResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_queue_v1_QueueReceiveResponse(buffer_arg) { - return proto_queue_v1_queue_pb.QueueReceiveResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_queue_v1_QueueSendBatchRequest(arg) { - if (!(arg instanceof proto_queue_v1_queue_pb.QueueSendBatchRequest)) { - throw new Error('Expected argument of type nitric.queue.v1.QueueSendBatchRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_queue_v1_QueueSendBatchRequest(buffer_arg) { - return proto_queue_v1_queue_pb.QueueSendBatchRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_queue_v1_QueueSendBatchResponse(arg) { - if (!(arg instanceof proto_queue_v1_queue_pb.QueueSendBatchResponse)) { - throw new Error('Expected argument of type nitric.queue.v1.QueueSendBatchResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_queue_v1_QueueSendBatchResponse(buffer_arg) { - return proto_queue_v1_queue_pb.QueueSendBatchResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_queue_v1_QueueSendRequest(arg) { - if (!(arg instanceof proto_queue_v1_queue_pb.QueueSendRequest)) { - throw new Error('Expected argument of type nitric.queue.v1.QueueSendRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_queue_v1_QueueSendRequest(buffer_arg) { - return proto_queue_v1_queue_pb.QueueSendRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_queue_v1_QueueSendResponse(arg) { - if (!(arg instanceof proto_queue_v1_queue_pb.QueueSendResponse)) { - throw new Error('Expected argument of type nitric.queue.v1.QueueSendResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_queue_v1_QueueSendResponse(buffer_arg) { - return proto_queue_v1_queue_pb.QueueSendResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - - -// The Nitric Queue Service contract -var QueueServiceService = exports.QueueServiceService = { - // Send a single event to a queue -send: { - path: '/nitric.queue.v1.QueueService/Send', - requestStream: false, - responseStream: false, - requestType: proto_queue_v1_queue_pb.QueueSendRequest, - responseType: proto_queue_v1_queue_pb.QueueSendResponse, - requestSerialize: serialize_nitric_queue_v1_QueueSendRequest, - requestDeserialize: deserialize_nitric_queue_v1_QueueSendRequest, - responseSerialize: serialize_nitric_queue_v1_QueueSendResponse, - responseDeserialize: deserialize_nitric_queue_v1_QueueSendResponse, - }, - // Send multiple events to a queue -sendBatch: { - path: '/nitric.queue.v1.QueueService/SendBatch', - requestStream: false, - responseStream: false, - requestType: proto_queue_v1_queue_pb.QueueSendBatchRequest, - responseType: proto_queue_v1_queue_pb.QueueSendBatchResponse, - requestSerialize: serialize_nitric_queue_v1_QueueSendBatchRequest, - requestDeserialize: deserialize_nitric_queue_v1_QueueSendBatchRequest, - responseSerialize: serialize_nitric_queue_v1_QueueSendBatchResponse, - responseDeserialize: deserialize_nitric_queue_v1_QueueSendBatchResponse, - }, - // Receive event(s) off a queue -receive: { - path: '/nitric.queue.v1.QueueService/Receive', - requestStream: false, - responseStream: false, - requestType: proto_queue_v1_queue_pb.QueueReceiveRequest, - responseType: proto_queue_v1_queue_pb.QueueReceiveResponse, - requestSerialize: serialize_nitric_queue_v1_QueueReceiveRequest, - requestDeserialize: deserialize_nitric_queue_v1_QueueReceiveRequest, - responseSerialize: serialize_nitric_queue_v1_QueueReceiveResponse, - responseDeserialize: deserialize_nitric_queue_v1_QueueReceiveResponse, - }, - // Complete an event previously popped from a queue -complete: { - path: '/nitric.queue.v1.QueueService/Complete', - requestStream: false, - responseStream: false, - requestType: proto_queue_v1_queue_pb.QueueCompleteRequest, - responseType: proto_queue_v1_queue_pb.QueueCompleteResponse, - requestSerialize: serialize_nitric_queue_v1_QueueCompleteRequest, - requestDeserialize: deserialize_nitric_queue_v1_QueueCompleteRequest, - responseSerialize: serialize_nitric_queue_v1_QueueCompleteResponse, - responseDeserialize: deserialize_nitric_queue_v1_QueueCompleteResponse, - }, -}; - -exports.QueueServiceClient = grpc.makeGenericClientConstructor(QueueServiceService); diff --git a/src/gen/proto/queue/v1/queue_pb.d.ts b/src/gen/proto/queue/v1/queue_pb.d.ts deleted file mode 100644 index e025870a..00000000 --- a/src/gen/proto/queue/v1/queue_pb.d.ts +++ /dev/null @@ -1,243 +0,0 @@ -// package: nitric.queue.v1 -// file: proto/queue/v1/queue.proto - -import * as jspb from "google-protobuf"; -import * as google_protobuf_struct_pb from "google-protobuf/google/protobuf/struct_pb"; -import * as validate_validate_pb from "../../../validate/validate_pb"; - -export class QueueSendRequest extends jspb.Message { - getQueue(): string; - setQueue(value: string): void; - - hasTask(): boolean; - clearTask(): void; - getTask(): NitricTask | undefined; - setTask(value?: NitricTask): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): QueueSendRequest.AsObject; - static toObject(includeInstance: boolean, msg: QueueSendRequest): QueueSendRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: QueueSendRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): QueueSendRequest; - static deserializeBinaryFromReader(message: QueueSendRequest, reader: jspb.BinaryReader): QueueSendRequest; -} - -export namespace QueueSendRequest { - export type AsObject = { - queue: string, - task?: NitricTask.AsObject, - } -} - -export class QueueSendResponse extends jspb.Message { - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): QueueSendResponse.AsObject; - static toObject(includeInstance: boolean, msg: QueueSendResponse): QueueSendResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: QueueSendResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): QueueSendResponse; - static deserializeBinaryFromReader(message: QueueSendResponse, reader: jspb.BinaryReader): QueueSendResponse; -} - -export namespace QueueSendResponse { - export type AsObject = { - } -} - -export class QueueSendBatchRequest extends jspb.Message { - getQueue(): string; - setQueue(value: string): void; - - clearTasksList(): void; - getTasksList(): Array; - setTasksList(value: Array): void; - addTasks(value?: NitricTask, index?: number): NitricTask; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): QueueSendBatchRequest.AsObject; - static toObject(includeInstance: boolean, msg: QueueSendBatchRequest): QueueSendBatchRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: QueueSendBatchRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): QueueSendBatchRequest; - static deserializeBinaryFromReader(message: QueueSendBatchRequest, reader: jspb.BinaryReader): QueueSendBatchRequest; -} - -export namespace QueueSendBatchRequest { - export type AsObject = { - queue: string, - tasksList: Array, - } -} - -export class QueueSendBatchResponse extends jspb.Message { - clearFailedtasksList(): void; - getFailedtasksList(): Array; - setFailedtasksList(value: Array): void; - addFailedtasks(value?: FailedTask, index?: number): FailedTask; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): QueueSendBatchResponse.AsObject; - static toObject(includeInstance: boolean, msg: QueueSendBatchResponse): QueueSendBatchResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: QueueSendBatchResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): QueueSendBatchResponse; - static deserializeBinaryFromReader(message: QueueSendBatchResponse, reader: jspb.BinaryReader): QueueSendBatchResponse; -} - -export namespace QueueSendBatchResponse { - export type AsObject = { - failedtasksList: Array, - } -} - -export class QueueReceiveRequest extends jspb.Message { - getQueue(): string; - setQueue(value: string): void; - - getDepth(): number; - setDepth(value: number): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): QueueReceiveRequest.AsObject; - static toObject(includeInstance: boolean, msg: QueueReceiveRequest): QueueReceiveRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: QueueReceiveRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): QueueReceiveRequest; - static deserializeBinaryFromReader(message: QueueReceiveRequest, reader: jspb.BinaryReader): QueueReceiveRequest; -} - -export namespace QueueReceiveRequest { - export type AsObject = { - queue: string, - depth: number, - } -} - -export class QueueReceiveResponse extends jspb.Message { - clearTasksList(): void; - getTasksList(): Array; - setTasksList(value: Array): void; - addTasks(value?: NitricTask, index?: number): NitricTask; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): QueueReceiveResponse.AsObject; - static toObject(includeInstance: boolean, msg: QueueReceiveResponse): QueueReceiveResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: QueueReceiveResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): QueueReceiveResponse; - static deserializeBinaryFromReader(message: QueueReceiveResponse, reader: jspb.BinaryReader): QueueReceiveResponse; -} - -export namespace QueueReceiveResponse { - export type AsObject = { - tasksList: Array, - } -} - -export class QueueCompleteRequest extends jspb.Message { - getQueue(): string; - setQueue(value: string): void; - - getLeaseId(): string; - setLeaseId(value: string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): QueueCompleteRequest.AsObject; - static toObject(includeInstance: boolean, msg: QueueCompleteRequest): QueueCompleteRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: QueueCompleteRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): QueueCompleteRequest; - static deserializeBinaryFromReader(message: QueueCompleteRequest, reader: jspb.BinaryReader): QueueCompleteRequest; -} - -export namespace QueueCompleteRequest { - export type AsObject = { - queue: string, - leaseId: string, - } -} - -export class QueueCompleteResponse extends jspb.Message { - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): QueueCompleteResponse.AsObject; - static toObject(includeInstance: boolean, msg: QueueCompleteResponse): QueueCompleteResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: QueueCompleteResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): QueueCompleteResponse; - static deserializeBinaryFromReader(message: QueueCompleteResponse, reader: jspb.BinaryReader): QueueCompleteResponse; -} - -export namespace QueueCompleteResponse { - export type AsObject = { - } -} - -export class FailedTask extends jspb.Message { - hasTask(): boolean; - clearTask(): void; - getTask(): NitricTask | undefined; - setTask(value?: NitricTask): void; - - getMessage(): string; - setMessage(value: string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): FailedTask.AsObject; - static toObject(includeInstance: boolean, msg: FailedTask): FailedTask.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: FailedTask, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): FailedTask; - static deserializeBinaryFromReader(message: FailedTask, reader: jspb.BinaryReader): FailedTask; -} - -export namespace FailedTask { - export type AsObject = { - task?: NitricTask.AsObject, - message: string, - } -} - -export class NitricTask extends jspb.Message { - getId(): string; - setId(value: string): void; - - getLeaseId(): string; - setLeaseId(value: string): void; - - getPayloadType(): string; - setPayloadType(value: string): void; - - hasPayload(): boolean; - clearPayload(): void; - getPayload(): google_protobuf_struct_pb.Struct | undefined; - setPayload(value?: google_protobuf_struct_pb.Struct): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): NitricTask.AsObject; - static toObject(includeInstance: boolean, msg: NitricTask): NitricTask.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: NitricTask, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): NitricTask; - static deserializeBinaryFromReader(message: NitricTask, reader: jspb.BinaryReader): NitricTask; -} - -export namespace NitricTask { - export type AsObject = { - id: string, - leaseId: string, - payloadType: string, - payload?: google_protobuf_struct_pb.Struct.AsObject, - } -} - diff --git a/src/gen/proto/resource/v1/resource_grpc_pb.d.ts b/src/gen/proto/resource/v1/resource_grpc_pb.d.ts deleted file mode 100644 index 077a2fa3..00000000 --- a/src/gen/proto/resource/v1/resource_grpc_pb.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -// GENERATED CODE -- DO NOT EDIT! - -// package: nitric.resource.v1 -// file: proto/resource/v1/resource.proto - -import * as proto_resource_v1_resource_pb from "../../../proto/resource/v1/resource_pb"; -import * as grpc from "@grpc/grpc-js"; - -interface IResourceServiceService extends grpc.ServiceDefinition { - declare: grpc.MethodDefinition; - details: grpc.MethodDefinition; -} - -export const ResourceServiceService: IResourceServiceService; - -export interface IResourceServiceServer extends grpc.UntypedServiceImplementation { - declare: grpc.handleUnaryCall; - details: grpc.handleUnaryCall; -} - -export class ResourceServiceClient extends grpc.Client { - constructor(address: string, credentials: grpc.ChannelCredentials, options?: object); - declare(argument: proto_resource_v1_resource_pb.ResourceDeclareRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; - declare(argument: proto_resource_v1_resource_pb.ResourceDeclareRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - declare(argument: proto_resource_v1_resource_pb.ResourceDeclareRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - details(argument: proto_resource_v1_resource_pb.ResourceDetailsRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; - details(argument: proto_resource_v1_resource_pb.ResourceDetailsRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - details(argument: proto_resource_v1_resource_pb.ResourceDetailsRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; -} diff --git a/src/gen/proto/resource/v1/resource_grpc_pb.js b/src/gen/proto/resource/v1/resource_grpc_pb.js deleted file mode 100644 index 28f99a36..00000000 --- a/src/gen/proto/resource/v1/resource_grpc_pb.js +++ /dev/null @@ -1,83 +0,0 @@ -// GENERATED CODE -- DO NOT EDIT! - -'use strict'; -var grpc = require('@grpc/grpc-js'); -var proto_resource_v1_resource_pb = require('../../../proto/resource/v1/resource_pb.js'); - -function serialize_nitric_resource_v1_ResourceDeclareRequest(arg) { - if (!(arg instanceof proto_resource_v1_resource_pb.ResourceDeclareRequest)) { - throw new Error('Expected argument of type nitric.resource.v1.ResourceDeclareRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_resource_v1_ResourceDeclareRequest(buffer_arg) { - return proto_resource_v1_resource_pb.ResourceDeclareRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_resource_v1_ResourceDeclareResponse(arg) { - if (!(arg instanceof proto_resource_v1_resource_pb.ResourceDeclareResponse)) { - throw new Error('Expected argument of type nitric.resource.v1.ResourceDeclareResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_resource_v1_ResourceDeclareResponse(buffer_arg) { - return proto_resource_v1_resource_pb.ResourceDeclareResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_resource_v1_ResourceDetailsRequest(arg) { - if (!(arg instanceof proto_resource_v1_resource_pb.ResourceDetailsRequest)) { - throw new Error('Expected argument of type nitric.resource.v1.ResourceDetailsRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_resource_v1_ResourceDetailsRequest(buffer_arg) { - return proto_resource_v1_resource_pb.ResourceDetailsRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_resource_v1_ResourceDetailsResponse(arg) { - if (!(arg instanceof proto_resource_v1_resource_pb.ResourceDetailsResponse)) { - throw new Error('Expected argument of type nitric.resource.v1.ResourceDetailsResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_resource_v1_ResourceDetailsResponse(buffer_arg) { - return proto_resource_v1_resource_pb.ResourceDetailsResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - - -// Nitric Resource Service -// The service definition exists to allow a nitric application to declare peripheral dependencies -var ResourceServiceService = exports.ResourceServiceService = { - // Declare a resource for the nitric application -// At Deploy time this will create resources as part of the nitric stacks dependency graph -// At runtime -declare: { - path: '/nitric.resource.v1.ResourceService/Declare', - requestStream: false, - responseStream: false, - requestType: proto_resource_v1_resource_pb.ResourceDeclareRequest, - responseType: proto_resource_v1_resource_pb.ResourceDeclareResponse, - requestSerialize: serialize_nitric_resource_v1_ResourceDeclareRequest, - requestDeserialize: deserialize_nitric_resource_v1_ResourceDeclareRequest, - responseSerialize: serialize_nitric_resource_v1_ResourceDeclareResponse, - responseDeserialize: deserialize_nitric_resource_v1_ResourceDeclareResponse, - }, - // Retrieve details about a resource at runtime -details: { - path: '/nitric.resource.v1.ResourceService/Details', - requestStream: false, - responseStream: false, - requestType: proto_resource_v1_resource_pb.ResourceDetailsRequest, - responseType: proto_resource_v1_resource_pb.ResourceDetailsResponse, - requestSerialize: serialize_nitric_resource_v1_ResourceDetailsRequest, - requestDeserialize: deserialize_nitric_resource_v1_ResourceDetailsRequest, - responseSerialize: serialize_nitric_resource_v1_ResourceDetailsResponse, - responseDeserialize: deserialize_nitric_resource_v1_ResourceDetailsResponse, - }, -}; - -exports.ResourceServiceClient = grpc.makeGenericClientConstructor(ResourceServiceService); diff --git a/src/gen/proto/resource/v1/resource_pb.js b/src/gen/proto/resource/v1/resource_pb.js deleted file mode 100644 index d22d7ca5..00000000 --- a/src/gen/proto/resource/v1/resource_pb.js +++ /dev/null @@ -1,3429 +0,0 @@ -// source: proto/resource/v1/resource.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() { - if (this) { return this; } - if (typeof window !== 'undefined') { return window; } - if (typeof global !== 'undefined') { return global; } - if (typeof self !== 'undefined') { return self; } - return Function('return this')(); -}.call(null)); - -goog.exportSymbol('proto.nitric.resource.v1.Action', null, global); -goog.exportSymbol('proto.nitric.resource.v1.ApiResource', null, global); -goog.exportSymbol('proto.nitric.resource.v1.ApiResourceDetails', null, global); -goog.exportSymbol('proto.nitric.resource.v1.ApiScopes', null, global); -goog.exportSymbol('proto.nitric.resource.v1.ApiSecurityDefinition', null, global); -goog.exportSymbol('proto.nitric.resource.v1.ApiSecurityDefinition.DefinitionCase', null, global); -goog.exportSymbol('proto.nitric.resource.v1.ApiSecurityDefinitionJwt', null, global); -goog.exportSymbol('proto.nitric.resource.v1.BucketResource', null, global); -goog.exportSymbol('proto.nitric.resource.v1.CollectionResource', null, global); -goog.exportSymbol('proto.nitric.resource.v1.PolicyResource', null, global); -goog.exportSymbol('proto.nitric.resource.v1.QueueResource', null, global); -goog.exportSymbol('proto.nitric.resource.v1.Resource', null, global); -goog.exportSymbol('proto.nitric.resource.v1.ResourceDeclareRequest', null, global); -goog.exportSymbol('proto.nitric.resource.v1.ResourceDeclareRequest.ConfigCase', null, global); -goog.exportSymbol('proto.nitric.resource.v1.ResourceDeclareResponse', null, global); -goog.exportSymbol('proto.nitric.resource.v1.ResourceDetailsRequest', null, global); -goog.exportSymbol('proto.nitric.resource.v1.ResourceDetailsResponse', null, global); -goog.exportSymbol('proto.nitric.resource.v1.ResourceDetailsResponse.DetailsCase', null, global); -goog.exportSymbol('proto.nitric.resource.v1.ResourceType', null, global); -goog.exportSymbol('proto.nitric.resource.v1.SecretResource', null, global); -goog.exportSymbol('proto.nitric.resource.v1.TopicResource', null, global); -goog.exportSymbol('proto.nitric.resource.v1.WebsocketResourceDetails', 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.nitric.resource.v1.PolicyResource = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.resource.v1.PolicyResource.repeatedFields_, null); -}; -goog.inherits(proto.nitric.resource.v1.PolicyResource, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.resource.v1.PolicyResource.displayName = 'proto.nitric.resource.v1.PolicyResource'; -} -/** - * 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.nitric.resource.v1.Resource = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.resource.v1.Resource, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.resource.v1.Resource.displayName = 'proto.nitric.resource.v1.Resource'; -} -/** - * 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.nitric.resource.v1.ResourceDeclareRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.resource.v1.ResourceDeclareRequest.oneofGroups_); -}; -goog.inherits(proto.nitric.resource.v1.ResourceDeclareRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.resource.v1.ResourceDeclareRequest.displayName = 'proto.nitric.resource.v1.ResourceDeclareRequest'; -} -/** - * 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.nitric.resource.v1.BucketResource = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.resource.v1.BucketResource, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.resource.v1.BucketResource.displayName = 'proto.nitric.resource.v1.BucketResource'; -} -/** - * 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.nitric.resource.v1.QueueResource = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.resource.v1.QueueResource, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.resource.v1.QueueResource.displayName = 'proto.nitric.resource.v1.QueueResource'; -} -/** - * 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.nitric.resource.v1.TopicResource = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.resource.v1.TopicResource, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.resource.v1.TopicResource.displayName = 'proto.nitric.resource.v1.TopicResource'; -} -/** - * 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.nitric.resource.v1.CollectionResource = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.resource.v1.CollectionResource, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.resource.v1.CollectionResource.displayName = 'proto.nitric.resource.v1.CollectionResource'; -} -/** - * 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.nitric.resource.v1.SecretResource = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.resource.v1.SecretResource, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.resource.v1.SecretResource.displayName = 'proto.nitric.resource.v1.SecretResource'; -} -/** - * 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.nitric.resource.v1.ApiSecurityDefinitionJwt = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.resource.v1.ApiSecurityDefinitionJwt.repeatedFields_, null); -}; -goog.inherits(proto.nitric.resource.v1.ApiSecurityDefinitionJwt, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.resource.v1.ApiSecurityDefinitionJwt.displayName = 'proto.nitric.resource.v1.ApiSecurityDefinitionJwt'; -} -/** - * 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.nitric.resource.v1.ApiSecurityDefinition = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.resource.v1.ApiSecurityDefinition.oneofGroups_); -}; -goog.inherits(proto.nitric.resource.v1.ApiSecurityDefinition, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.resource.v1.ApiSecurityDefinition.displayName = 'proto.nitric.resource.v1.ApiSecurityDefinition'; -} -/** - * 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.nitric.resource.v1.ApiScopes = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.resource.v1.ApiScopes.repeatedFields_, null); -}; -goog.inherits(proto.nitric.resource.v1.ApiScopes, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.resource.v1.ApiScopes.displayName = 'proto.nitric.resource.v1.ApiScopes'; -} -/** - * 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.nitric.resource.v1.ApiResource = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.resource.v1.ApiResource, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.resource.v1.ApiResource.displayName = 'proto.nitric.resource.v1.ApiResource'; -} -/** - * 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.nitric.resource.v1.ResourceDeclareResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.resource.v1.ResourceDeclareResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.resource.v1.ResourceDeclareResponse.displayName = 'proto.nitric.resource.v1.ResourceDeclareResponse'; -} -/** - * 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.nitric.resource.v1.ApiResourceDetails = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.resource.v1.ApiResourceDetails, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.resource.v1.ApiResourceDetails.displayName = 'proto.nitric.resource.v1.ApiResourceDetails'; -} -/** - * 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.nitric.resource.v1.WebsocketResourceDetails = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.resource.v1.WebsocketResourceDetails, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.resource.v1.WebsocketResourceDetails.displayName = 'proto.nitric.resource.v1.WebsocketResourceDetails'; -} -/** - * 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.nitric.resource.v1.ResourceDetailsRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.resource.v1.ResourceDetailsRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.resource.v1.ResourceDetailsRequest.displayName = 'proto.nitric.resource.v1.ResourceDetailsRequest'; -} -/** - * 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.nitric.resource.v1.ResourceDetailsResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.resource.v1.ResourceDetailsResponse.oneofGroups_); -}; -goog.inherits(proto.nitric.resource.v1.ResourceDetailsResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.resource.v1.ResourceDetailsResponse.displayName = 'proto.nitric.resource.v1.ResourceDetailsResponse'; -} - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.nitric.resource.v1.PolicyResource.repeatedFields_ = [1,2,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.nitric.resource.v1.PolicyResource.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.resource.v1.PolicyResource.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.nitric.resource.v1.PolicyResource} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.resource.v1.PolicyResource.toObject = function(includeInstance, msg) { - var f, obj = { - principalsList: jspb.Message.toObjectList(msg.getPrincipalsList(), - proto.nitric.resource.v1.Resource.toObject, includeInstance), - actionsList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f, - resourcesList: jspb.Message.toObjectList(msg.getResourcesList(), - proto.nitric.resource.v1.Resource.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.nitric.resource.v1.PolicyResource} - */ -proto.nitric.resource.v1.PolicyResource.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.resource.v1.PolicyResource; - return proto.nitric.resource.v1.PolicyResource.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.resource.v1.PolicyResource} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.resource.v1.PolicyResource} - */ -proto.nitric.resource.v1.PolicyResource.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nitric.resource.v1.Resource; - reader.readMessage(value,proto.nitric.resource.v1.Resource.deserializeBinaryFromReader); - msg.addPrincipals(value); - break; - case 2: - var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedEnum() : [reader.readEnum()]); - for (var i = 0; i < values.length; i++) { - msg.addActions(values[i]); - } - break; - case 3: - var value = new proto.nitric.resource.v1.Resource; - reader.readMessage(value,proto.nitric.resource.v1.Resource.deserializeBinaryFromReader); - msg.addResources(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.resource.v1.PolicyResource.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.resource.v1.PolicyResource.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.resource.v1.PolicyResource} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.resource.v1.PolicyResource.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getPrincipalsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.nitric.resource.v1.Resource.serializeBinaryToWriter - ); - } - f = message.getActionsList(); - if (f.length > 0) { - writer.writePackedEnum( - 2, - f - ); - } - f = message.getResourcesList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 3, - f, - proto.nitric.resource.v1.Resource.serializeBinaryToWriter - ); - } -}; - - -/** - * repeated Resource principals = 1; - * @return {!Array} - */ -proto.nitric.resource.v1.PolicyResource.prototype.getPrincipalsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.nitric.resource.v1.Resource, 1)); -}; - - -/** - * @param {!Array} value - * @return {!proto.nitric.resource.v1.PolicyResource} returns this -*/ -proto.nitric.resource.v1.PolicyResource.prototype.setPrincipalsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 1, value); -}; - - -/** - * @param {!proto.nitric.resource.v1.Resource=} opt_value - * @param {number=} opt_index - * @return {!proto.nitric.resource.v1.Resource} - */ -proto.nitric.resource.v1.PolicyResource.prototype.addPrincipals = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.nitric.resource.v1.Resource, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.nitric.resource.v1.PolicyResource} returns this - */ -proto.nitric.resource.v1.PolicyResource.prototype.clearPrincipalsList = function() { - return this.setPrincipalsList([]); -}; - - -/** - * repeated Action actions = 2; - * @return {!Array} - */ -proto.nitric.resource.v1.PolicyResource.prototype.getActionsList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 2)); -}; - - -/** - * @param {!Array} value - * @return {!proto.nitric.resource.v1.PolicyResource} returns this - */ -proto.nitric.resource.v1.PolicyResource.prototype.setActionsList = function(value) { - return jspb.Message.setField(this, 2, value || []); -}; - - -/** - * @param {!proto.nitric.resource.v1.Action} value - * @param {number=} opt_index - * @return {!proto.nitric.resource.v1.PolicyResource} returns this - */ -proto.nitric.resource.v1.PolicyResource.prototype.addActions = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 2, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.nitric.resource.v1.PolicyResource} returns this - */ -proto.nitric.resource.v1.PolicyResource.prototype.clearActionsList = function() { - return this.setActionsList([]); -}; - - -/** - * repeated Resource resources = 3; - * @return {!Array} - */ -proto.nitric.resource.v1.PolicyResource.prototype.getResourcesList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.nitric.resource.v1.Resource, 3)); -}; - - -/** - * @param {!Array} value - * @return {!proto.nitric.resource.v1.PolicyResource} returns this -*/ -proto.nitric.resource.v1.PolicyResource.prototype.setResourcesList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 3, value); -}; - - -/** - * @param {!proto.nitric.resource.v1.Resource=} opt_value - * @param {number=} opt_index - * @return {!proto.nitric.resource.v1.Resource} - */ -proto.nitric.resource.v1.PolicyResource.prototype.addResources = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.nitric.resource.v1.Resource, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.nitric.resource.v1.PolicyResource} returns this - */ -proto.nitric.resource.v1.PolicyResource.prototype.clearResourcesList = function() { - return this.setResourcesList([]); -}; - - - - - -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.nitric.resource.v1.Resource.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.resource.v1.Resource.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.nitric.resource.v1.Resource} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.resource.v1.Resource.toObject = function(includeInstance, msg) { - var f, obj = { - type: jspb.Message.getFieldWithDefault(msg, 1, 0), - name: 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.nitric.resource.v1.Resource} - */ -proto.nitric.resource.v1.Resource.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.resource.v1.Resource; - return proto.nitric.resource.v1.Resource.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.resource.v1.Resource} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.resource.v1.Resource} - */ -proto.nitric.resource.v1.Resource.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!proto.nitric.resource.v1.ResourceType} */ (reader.readEnum()); - msg.setType(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setName(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.resource.v1.Resource.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.resource.v1.Resource.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.resource.v1.Resource} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.resource.v1.Resource.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getType(); - if (f !== 0.0) { - writer.writeEnum( - 1, - f - ); - } - f = message.getName(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional ResourceType type = 1; - * @return {!proto.nitric.resource.v1.ResourceType} - */ -proto.nitric.resource.v1.Resource.prototype.getType = function() { - return /** @type {!proto.nitric.resource.v1.ResourceType} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {!proto.nitric.resource.v1.ResourceType} value - * @return {!proto.nitric.resource.v1.Resource} returns this - */ -proto.nitric.resource.v1.Resource.prototype.setType = function(value) { - return jspb.Message.setProto3EnumField(this, 1, value); -}; - - -/** - * optional string name = 2; - * @return {string} - */ -proto.nitric.resource.v1.Resource.prototype.getName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.resource.v1.Resource} returns this - */ -proto.nitric.resource.v1.Resource.prototype.setName = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.nitric.resource.v1.ResourceDeclareRequest.oneofGroups_ = [[10,11,12,13,14,15,16]]; - -/** - * @enum {number} - */ -proto.nitric.resource.v1.ResourceDeclareRequest.ConfigCase = { - CONFIG_NOT_SET: 0, - POLICY: 10, - BUCKET: 11, - QUEUE: 12, - TOPIC: 13, - COLLECTION: 14, - SECRET: 15, - API: 16 -}; - -/** - * @return {proto.nitric.resource.v1.ResourceDeclareRequest.ConfigCase} - */ -proto.nitric.resource.v1.ResourceDeclareRequest.prototype.getConfigCase = function() { - return /** @type {proto.nitric.resource.v1.ResourceDeclareRequest.ConfigCase} */(jspb.Message.computeOneofCase(this, proto.nitric.resource.v1.ResourceDeclareRequest.oneofGroups_[0])); -}; - - - -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.nitric.resource.v1.ResourceDeclareRequest.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.resource.v1.ResourceDeclareRequest.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.nitric.resource.v1.ResourceDeclareRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.resource.v1.ResourceDeclareRequest.toObject = function(includeInstance, msg) { - var f, obj = { - resource: (f = msg.getResource()) && proto.nitric.resource.v1.Resource.toObject(includeInstance, f), - policy: (f = msg.getPolicy()) && proto.nitric.resource.v1.PolicyResource.toObject(includeInstance, f), - bucket: (f = msg.getBucket()) && proto.nitric.resource.v1.BucketResource.toObject(includeInstance, f), - queue: (f = msg.getQueue()) && proto.nitric.resource.v1.QueueResource.toObject(includeInstance, f), - topic: (f = msg.getTopic()) && proto.nitric.resource.v1.TopicResource.toObject(includeInstance, f), - collection: (f = msg.getCollection()) && proto.nitric.resource.v1.CollectionResource.toObject(includeInstance, f), - secret: (f = msg.getSecret()) && proto.nitric.resource.v1.SecretResource.toObject(includeInstance, f), - api: (f = msg.getApi()) && proto.nitric.resource.v1.ApiResource.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.nitric.resource.v1.ResourceDeclareRequest} - */ -proto.nitric.resource.v1.ResourceDeclareRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.resource.v1.ResourceDeclareRequest; - return proto.nitric.resource.v1.ResourceDeclareRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.resource.v1.ResourceDeclareRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.resource.v1.ResourceDeclareRequest} - */ -proto.nitric.resource.v1.ResourceDeclareRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nitric.resource.v1.Resource; - reader.readMessage(value,proto.nitric.resource.v1.Resource.deserializeBinaryFromReader); - msg.setResource(value); - break; - case 10: - var value = new proto.nitric.resource.v1.PolicyResource; - reader.readMessage(value,proto.nitric.resource.v1.PolicyResource.deserializeBinaryFromReader); - msg.setPolicy(value); - break; - case 11: - var value = new proto.nitric.resource.v1.BucketResource; - reader.readMessage(value,proto.nitric.resource.v1.BucketResource.deserializeBinaryFromReader); - msg.setBucket(value); - break; - case 12: - var value = new proto.nitric.resource.v1.QueueResource; - reader.readMessage(value,proto.nitric.resource.v1.QueueResource.deserializeBinaryFromReader); - msg.setQueue(value); - break; - case 13: - var value = new proto.nitric.resource.v1.TopicResource; - reader.readMessage(value,proto.nitric.resource.v1.TopicResource.deserializeBinaryFromReader); - msg.setTopic(value); - break; - case 14: - var value = new proto.nitric.resource.v1.CollectionResource; - reader.readMessage(value,proto.nitric.resource.v1.CollectionResource.deserializeBinaryFromReader); - msg.setCollection(value); - break; - case 15: - var value = new proto.nitric.resource.v1.SecretResource; - reader.readMessage(value,proto.nitric.resource.v1.SecretResource.deserializeBinaryFromReader); - msg.setSecret(value); - break; - case 16: - var value = new proto.nitric.resource.v1.ApiResource; - reader.readMessage(value,proto.nitric.resource.v1.ApiResource.deserializeBinaryFromReader); - msg.setApi(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.resource.v1.ResourceDeclareRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.resource.v1.ResourceDeclareRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.resource.v1.ResourceDeclareRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.resource.v1.ResourceDeclareRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getResource(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.nitric.resource.v1.Resource.serializeBinaryToWriter - ); - } - f = message.getPolicy(); - if (f != null) { - writer.writeMessage( - 10, - f, - proto.nitric.resource.v1.PolicyResource.serializeBinaryToWriter - ); - } - f = message.getBucket(); - if (f != null) { - writer.writeMessage( - 11, - f, - proto.nitric.resource.v1.BucketResource.serializeBinaryToWriter - ); - } - f = message.getQueue(); - if (f != null) { - writer.writeMessage( - 12, - f, - proto.nitric.resource.v1.QueueResource.serializeBinaryToWriter - ); - } - f = message.getTopic(); - if (f != null) { - writer.writeMessage( - 13, - f, - proto.nitric.resource.v1.TopicResource.serializeBinaryToWriter - ); - } - f = message.getCollection(); - if (f != null) { - writer.writeMessage( - 14, - f, - proto.nitric.resource.v1.CollectionResource.serializeBinaryToWriter - ); - } - f = message.getSecret(); - if (f != null) { - writer.writeMessage( - 15, - f, - proto.nitric.resource.v1.SecretResource.serializeBinaryToWriter - ); - } - f = message.getApi(); - if (f != null) { - writer.writeMessage( - 16, - f, - proto.nitric.resource.v1.ApiResource.serializeBinaryToWriter - ); - } -}; - - -/** - * optional Resource resource = 1; - * @return {?proto.nitric.resource.v1.Resource} - */ -proto.nitric.resource.v1.ResourceDeclareRequest.prototype.getResource = function() { - return /** @type{?proto.nitric.resource.v1.Resource} */ ( - jspb.Message.getWrapperField(this, proto.nitric.resource.v1.Resource, 1)); -}; - - -/** - * @param {?proto.nitric.resource.v1.Resource|undefined} value - * @return {!proto.nitric.resource.v1.ResourceDeclareRequest} returns this -*/ -proto.nitric.resource.v1.ResourceDeclareRequest.prototype.setResource = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.resource.v1.ResourceDeclareRequest} returns this - */ -proto.nitric.resource.v1.ResourceDeclareRequest.prototype.clearResource = function() { - return this.setResource(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.resource.v1.ResourceDeclareRequest.prototype.hasResource = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional PolicyResource policy = 10; - * @return {?proto.nitric.resource.v1.PolicyResource} - */ -proto.nitric.resource.v1.ResourceDeclareRequest.prototype.getPolicy = function() { - return /** @type{?proto.nitric.resource.v1.PolicyResource} */ ( - jspb.Message.getWrapperField(this, proto.nitric.resource.v1.PolicyResource, 10)); -}; - - -/** - * @param {?proto.nitric.resource.v1.PolicyResource|undefined} value - * @return {!proto.nitric.resource.v1.ResourceDeclareRequest} returns this -*/ -proto.nitric.resource.v1.ResourceDeclareRequest.prototype.setPolicy = function(value) { - return jspb.Message.setOneofWrapperField(this, 10, proto.nitric.resource.v1.ResourceDeclareRequest.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.resource.v1.ResourceDeclareRequest} returns this - */ -proto.nitric.resource.v1.ResourceDeclareRequest.prototype.clearPolicy = function() { - return this.setPolicy(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.resource.v1.ResourceDeclareRequest.prototype.hasPolicy = function() { - return jspb.Message.getField(this, 10) != null; -}; - - -/** - * optional BucketResource bucket = 11; - * @return {?proto.nitric.resource.v1.BucketResource} - */ -proto.nitric.resource.v1.ResourceDeclareRequest.prototype.getBucket = function() { - return /** @type{?proto.nitric.resource.v1.BucketResource} */ ( - jspb.Message.getWrapperField(this, proto.nitric.resource.v1.BucketResource, 11)); -}; - - -/** - * @param {?proto.nitric.resource.v1.BucketResource|undefined} value - * @return {!proto.nitric.resource.v1.ResourceDeclareRequest} returns this -*/ -proto.nitric.resource.v1.ResourceDeclareRequest.prototype.setBucket = function(value) { - return jspb.Message.setOneofWrapperField(this, 11, proto.nitric.resource.v1.ResourceDeclareRequest.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.resource.v1.ResourceDeclareRequest} returns this - */ -proto.nitric.resource.v1.ResourceDeclareRequest.prototype.clearBucket = function() { - return this.setBucket(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.resource.v1.ResourceDeclareRequest.prototype.hasBucket = function() { - return jspb.Message.getField(this, 11) != null; -}; - - -/** - * optional QueueResource queue = 12; - * @return {?proto.nitric.resource.v1.QueueResource} - */ -proto.nitric.resource.v1.ResourceDeclareRequest.prototype.getQueue = function() { - return /** @type{?proto.nitric.resource.v1.QueueResource} */ ( - jspb.Message.getWrapperField(this, proto.nitric.resource.v1.QueueResource, 12)); -}; - - -/** - * @param {?proto.nitric.resource.v1.QueueResource|undefined} value - * @return {!proto.nitric.resource.v1.ResourceDeclareRequest} returns this -*/ -proto.nitric.resource.v1.ResourceDeclareRequest.prototype.setQueue = function(value) { - return jspb.Message.setOneofWrapperField(this, 12, proto.nitric.resource.v1.ResourceDeclareRequest.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.resource.v1.ResourceDeclareRequest} returns this - */ -proto.nitric.resource.v1.ResourceDeclareRequest.prototype.clearQueue = function() { - return this.setQueue(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.resource.v1.ResourceDeclareRequest.prototype.hasQueue = function() { - return jspb.Message.getField(this, 12) != null; -}; - - -/** - * optional TopicResource topic = 13; - * @return {?proto.nitric.resource.v1.TopicResource} - */ -proto.nitric.resource.v1.ResourceDeclareRequest.prototype.getTopic = function() { - return /** @type{?proto.nitric.resource.v1.TopicResource} */ ( - jspb.Message.getWrapperField(this, proto.nitric.resource.v1.TopicResource, 13)); -}; - - -/** - * @param {?proto.nitric.resource.v1.TopicResource|undefined} value - * @return {!proto.nitric.resource.v1.ResourceDeclareRequest} returns this -*/ -proto.nitric.resource.v1.ResourceDeclareRequest.prototype.setTopic = function(value) { - return jspb.Message.setOneofWrapperField(this, 13, proto.nitric.resource.v1.ResourceDeclareRequest.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.resource.v1.ResourceDeclareRequest} returns this - */ -proto.nitric.resource.v1.ResourceDeclareRequest.prototype.clearTopic = function() { - return this.setTopic(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.resource.v1.ResourceDeclareRequest.prototype.hasTopic = function() { - return jspb.Message.getField(this, 13) != null; -}; - - -/** - * optional CollectionResource collection = 14; - * @return {?proto.nitric.resource.v1.CollectionResource} - */ -proto.nitric.resource.v1.ResourceDeclareRequest.prototype.getCollection = function() { - return /** @type{?proto.nitric.resource.v1.CollectionResource} */ ( - jspb.Message.getWrapperField(this, proto.nitric.resource.v1.CollectionResource, 14)); -}; - - -/** - * @param {?proto.nitric.resource.v1.CollectionResource|undefined} value - * @return {!proto.nitric.resource.v1.ResourceDeclareRequest} returns this -*/ -proto.nitric.resource.v1.ResourceDeclareRequest.prototype.setCollection = function(value) { - return jspb.Message.setOneofWrapperField(this, 14, proto.nitric.resource.v1.ResourceDeclareRequest.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.resource.v1.ResourceDeclareRequest} returns this - */ -proto.nitric.resource.v1.ResourceDeclareRequest.prototype.clearCollection = function() { - return this.setCollection(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.resource.v1.ResourceDeclareRequest.prototype.hasCollection = function() { - return jspb.Message.getField(this, 14) != null; -}; - - -/** - * optional SecretResource secret = 15; - * @return {?proto.nitric.resource.v1.SecretResource} - */ -proto.nitric.resource.v1.ResourceDeclareRequest.prototype.getSecret = function() { - return /** @type{?proto.nitric.resource.v1.SecretResource} */ ( - jspb.Message.getWrapperField(this, proto.nitric.resource.v1.SecretResource, 15)); -}; - - -/** - * @param {?proto.nitric.resource.v1.SecretResource|undefined} value - * @return {!proto.nitric.resource.v1.ResourceDeclareRequest} returns this -*/ -proto.nitric.resource.v1.ResourceDeclareRequest.prototype.setSecret = function(value) { - return jspb.Message.setOneofWrapperField(this, 15, proto.nitric.resource.v1.ResourceDeclareRequest.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.resource.v1.ResourceDeclareRequest} returns this - */ -proto.nitric.resource.v1.ResourceDeclareRequest.prototype.clearSecret = function() { - return this.setSecret(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.resource.v1.ResourceDeclareRequest.prototype.hasSecret = function() { - return jspb.Message.getField(this, 15) != null; -}; - - -/** - * optional ApiResource api = 16; - * @return {?proto.nitric.resource.v1.ApiResource} - */ -proto.nitric.resource.v1.ResourceDeclareRequest.prototype.getApi = function() { - return /** @type{?proto.nitric.resource.v1.ApiResource} */ ( - jspb.Message.getWrapperField(this, proto.nitric.resource.v1.ApiResource, 16)); -}; - - -/** - * @param {?proto.nitric.resource.v1.ApiResource|undefined} value - * @return {!proto.nitric.resource.v1.ResourceDeclareRequest} returns this -*/ -proto.nitric.resource.v1.ResourceDeclareRequest.prototype.setApi = function(value) { - return jspb.Message.setOneofWrapperField(this, 16, proto.nitric.resource.v1.ResourceDeclareRequest.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.resource.v1.ResourceDeclareRequest} returns this - */ -proto.nitric.resource.v1.ResourceDeclareRequest.prototype.clearApi = function() { - return this.setApi(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.resource.v1.ResourceDeclareRequest.prototype.hasApi = function() { - return jspb.Message.getField(this, 16) != 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.nitric.resource.v1.BucketResource.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.resource.v1.BucketResource.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.nitric.resource.v1.BucketResource} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.resource.v1.BucketResource.toObject = function(includeInstance, msg) { - var f, obj = { - - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.resource.v1.BucketResource} - */ -proto.nitric.resource.v1.BucketResource.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.resource.v1.BucketResource; - return proto.nitric.resource.v1.BucketResource.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.resource.v1.BucketResource} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.resource.v1.BucketResource} - */ -proto.nitric.resource.v1.BucketResource.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.resource.v1.BucketResource.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.resource.v1.BucketResource.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.resource.v1.BucketResource} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.resource.v1.BucketResource.serializeBinaryToWriter = function(message, writer) { - var f = undefined; -}; - - - - - -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.nitric.resource.v1.QueueResource.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.resource.v1.QueueResource.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.nitric.resource.v1.QueueResource} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.resource.v1.QueueResource.toObject = function(includeInstance, msg) { - var f, obj = { - - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.resource.v1.QueueResource} - */ -proto.nitric.resource.v1.QueueResource.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.resource.v1.QueueResource; - return proto.nitric.resource.v1.QueueResource.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.resource.v1.QueueResource} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.resource.v1.QueueResource} - */ -proto.nitric.resource.v1.QueueResource.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.resource.v1.QueueResource.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.resource.v1.QueueResource.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.resource.v1.QueueResource} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.resource.v1.QueueResource.serializeBinaryToWriter = function(message, writer) { - var f = undefined; -}; - - - - - -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.nitric.resource.v1.TopicResource.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.resource.v1.TopicResource.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.nitric.resource.v1.TopicResource} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.resource.v1.TopicResource.toObject = function(includeInstance, msg) { - var f, obj = { - - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.resource.v1.TopicResource} - */ -proto.nitric.resource.v1.TopicResource.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.resource.v1.TopicResource; - return proto.nitric.resource.v1.TopicResource.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.resource.v1.TopicResource} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.resource.v1.TopicResource} - */ -proto.nitric.resource.v1.TopicResource.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.resource.v1.TopicResource.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.resource.v1.TopicResource.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.resource.v1.TopicResource} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.resource.v1.TopicResource.serializeBinaryToWriter = function(message, writer) { - var f = undefined; -}; - - - - - -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.nitric.resource.v1.CollectionResource.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.resource.v1.CollectionResource.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.nitric.resource.v1.CollectionResource} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.resource.v1.CollectionResource.toObject = function(includeInstance, msg) { - var f, obj = { - - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.resource.v1.CollectionResource} - */ -proto.nitric.resource.v1.CollectionResource.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.resource.v1.CollectionResource; - return proto.nitric.resource.v1.CollectionResource.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.resource.v1.CollectionResource} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.resource.v1.CollectionResource} - */ -proto.nitric.resource.v1.CollectionResource.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.resource.v1.CollectionResource.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.resource.v1.CollectionResource.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.resource.v1.CollectionResource} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.resource.v1.CollectionResource.serializeBinaryToWriter = function(message, writer) { - var f = undefined; -}; - - - - - -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.nitric.resource.v1.SecretResource.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.resource.v1.SecretResource.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.nitric.resource.v1.SecretResource} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.resource.v1.SecretResource.toObject = function(includeInstance, msg) { - var f, obj = { - - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.resource.v1.SecretResource} - */ -proto.nitric.resource.v1.SecretResource.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.resource.v1.SecretResource; - return proto.nitric.resource.v1.SecretResource.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.resource.v1.SecretResource} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.resource.v1.SecretResource} - */ -proto.nitric.resource.v1.SecretResource.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.resource.v1.SecretResource.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.resource.v1.SecretResource.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.resource.v1.SecretResource} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.resource.v1.SecretResource.serializeBinaryToWriter = function(message, writer) { - var f = undefined; -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.nitric.resource.v1.ApiSecurityDefinitionJwt.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.nitric.resource.v1.ApiSecurityDefinitionJwt.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.resource.v1.ApiSecurityDefinitionJwt.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.nitric.resource.v1.ApiSecurityDefinitionJwt} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.resource.v1.ApiSecurityDefinitionJwt.toObject = function(includeInstance, msg) { - var f, obj = { - issuer: jspb.Message.getFieldWithDefault(msg, 1, ""), - audiencesList: (f = jspb.Message.getRepeatedField(msg, 2)) == 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.nitric.resource.v1.ApiSecurityDefinitionJwt} - */ -proto.nitric.resource.v1.ApiSecurityDefinitionJwt.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.resource.v1.ApiSecurityDefinitionJwt; - return proto.nitric.resource.v1.ApiSecurityDefinitionJwt.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.resource.v1.ApiSecurityDefinitionJwt} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.resource.v1.ApiSecurityDefinitionJwt} - */ -proto.nitric.resource.v1.ApiSecurityDefinitionJwt.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.setIssuer(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.addAudiences(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.resource.v1.ApiSecurityDefinitionJwt.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.resource.v1.ApiSecurityDefinitionJwt.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.resource.v1.ApiSecurityDefinitionJwt} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.resource.v1.ApiSecurityDefinitionJwt.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getIssuer(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getAudiencesList(); - if (f.length > 0) { - writer.writeRepeatedString( - 2, - f - ); - } -}; - - -/** - * optional string issuer = 1; - * @return {string} - */ -proto.nitric.resource.v1.ApiSecurityDefinitionJwt.prototype.getIssuer = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.resource.v1.ApiSecurityDefinitionJwt} returns this - */ -proto.nitric.resource.v1.ApiSecurityDefinitionJwt.prototype.setIssuer = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * repeated string audiences = 2; - * @return {!Array} - */ -proto.nitric.resource.v1.ApiSecurityDefinitionJwt.prototype.getAudiencesList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 2)); -}; - - -/** - * @param {!Array} value - * @return {!proto.nitric.resource.v1.ApiSecurityDefinitionJwt} returns this - */ -proto.nitric.resource.v1.ApiSecurityDefinitionJwt.prototype.setAudiencesList = function(value) { - return jspb.Message.setField(this, 2, value || []); -}; - - -/** - * @param {string} value - * @param {number=} opt_index - * @return {!proto.nitric.resource.v1.ApiSecurityDefinitionJwt} returns this - */ -proto.nitric.resource.v1.ApiSecurityDefinitionJwt.prototype.addAudiences = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 2, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.nitric.resource.v1.ApiSecurityDefinitionJwt} returns this - */ -proto.nitric.resource.v1.ApiSecurityDefinitionJwt.prototype.clearAudiencesList = function() { - return this.setAudiencesList([]); -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.nitric.resource.v1.ApiSecurityDefinition.oneofGroups_ = [[1]]; - -/** - * @enum {number} - */ -proto.nitric.resource.v1.ApiSecurityDefinition.DefinitionCase = { - DEFINITION_NOT_SET: 0, - JWT: 1 -}; - -/** - * @return {proto.nitric.resource.v1.ApiSecurityDefinition.DefinitionCase} - */ -proto.nitric.resource.v1.ApiSecurityDefinition.prototype.getDefinitionCase = function() { - return /** @type {proto.nitric.resource.v1.ApiSecurityDefinition.DefinitionCase} */(jspb.Message.computeOneofCase(this, proto.nitric.resource.v1.ApiSecurityDefinition.oneofGroups_[0])); -}; - - - -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.nitric.resource.v1.ApiSecurityDefinition.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.resource.v1.ApiSecurityDefinition.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.nitric.resource.v1.ApiSecurityDefinition} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.resource.v1.ApiSecurityDefinition.toObject = function(includeInstance, msg) { - var f, obj = { - jwt: (f = msg.getJwt()) && proto.nitric.resource.v1.ApiSecurityDefinitionJwt.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.nitric.resource.v1.ApiSecurityDefinition} - */ -proto.nitric.resource.v1.ApiSecurityDefinition.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.resource.v1.ApiSecurityDefinition; - return proto.nitric.resource.v1.ApiSecurityDefinition.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.resource.v1.ApiSecurityDefinition} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.resource.v1.ApiSecurityDefinition} - */ -proto.nitric.resource.v1.ApiSecurityDefinition.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nitric.resource.v1.ApiSecurityDefinitionJwt; - reader.readMessage(value,proto.nitric.resource.v1.ApiSecurityDefinitionJwt.deserializeBinaryFromReader); - msg.setJwt(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.resource.v1.ApiSecurityDefinition.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.resource.v1.ApiSecurityDefinition.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.resource.v1.ApiSecurityDefinition} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.resource.v1.ApiSecurityDefinition.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getJwt(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.nitric.resource.v1.ApiSecurityDefinitionJwt.serializeBinaryToWriter - ); - } -}; - - -/** - * optional ApiSecurityDefinitionJwt jwt = 1; - * @return {?proto.nitric.resource.v1.ApiSecurityDefinitionJwt} - */ -proto.nitric.resource.v1.ApiSecurityDefinition.prototype.getJwt = function() { - return /** @type{?proto.nitric.resource.v1.ApiSecurityDefinitionJwt} */ ( - jspb.Message.getWrapperField(this, proto.nitric.resource.v1.ApiSecurityDefinitionJwt, 1)); -}; - - -/** - * @param {?proto.nitric.resource.v1.ApiSecurityDefinitionJwt|undefined} value - * @return {!proto.nitric.resource.v1.ApiSecurityDefinition} returns this -*/ -proto.nitric.resource.v1.ApiSecurityDefinition.prototype.setJwt = function(value) { - return jspb.Message.setOneofWrapperField(this, 1, proto.nitric.resource.v1.ApiSecurityDefinition.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.resource.v1.ApiSecurityDefinition} returns this - */ -proto.nitric.resource.v1.ApiSecurityDefinition.prototype.clearJwt = function() { - return this.setJwt(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.resource.v1.ApiSecurityDefinition.prototype.hasJwt = function() { - return jspb.Message.getField(this, 1) != null; -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.nitric.resource.v1.ApiScopes.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.nitric.resource.v1.ApiScopes.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.resource.v1.ApiScopes.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.nitric.resource.v1.ApiScopes} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.resource.v1.ApiScopes.toObject = function(includeInstance, msg) { - var f, obj = { - scopesList: (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.nitric.resource.v1.ApiScopes} - */ -proto.nitric.resource.v1.ApiScopes.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.resource.v1.ApiScopes; - return proto.nitric.resource.v1.ApiScopes.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.resource.v1.ApiScopes} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.resource.v1.ApiScopes} - */ -proto.nitric.resource.v1.ApiScopes.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.addScopes(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.resource.v1.ApiScopes.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.resource.v1.ApiScopes.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.resource.v1.ApiScopes} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.resource.v1.ApiScopes.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getScopesList(); - if (f.length > 0) { - writer.writeRepeatedString( - 1, - f - ); - } -}; - - -/** - * repeated string scopes = 1; - * @return {!Array} - */ -proto.nitric.resource.v1.ApiScopes.prototype.getScopesList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); -}; - - -/** - * @param {!Array} value - * @return {!proto.nitric.resource.v1.ApiScopes} returns this - */ -proto.nitric.resource.v1.ApiScopes.prototype.setScopesList = function(value) { - return jspb.Message.setField(this, 1, value || []); -}; - - -/** - * @param {string} value - * @param {number=} opt_index - * @return {!proto.nitric.resource.v1.ApiScopes} returns this - */ -proto.nitric.resource.v1.ApiScopes.prototype.addScopes = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 1, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.nitric.resource.v1.ApiScopes} returns this - */ -proto.nitric.resource.v1.ApiScopes.prototype.clearScopesList = function() { - return this.setScopesList([]); -}; - - - - - -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.nitric.resource.v1.ApiResource.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.resource.v1.ApiResource.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.nitric.resource.v1.ApiResource} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.resource.v1.ApiResource.toObject = function(includeInstance, msg) { - var f, obj = { - securityDefinitionsMap: (f = msg.getSecurityDefinitionsMap()) ? f.toObject(includeInstance, proto.nitric.resource.v1.ApiSecurityDefinition.toObject) : [], - securityMap: (f = msg.getSecurityMap()) ? f.toObject(includeInstance, proto.nitric.resource.v1.ApiScopes.toObject) : [] - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.resource.v1.ApiResource} - */ -proto.nitric.resource.v1.ApiResource.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.resource.v1.ApiResource; - return proto.nitric.resource.v1.ApiResource.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.resource.v1.ApiResource} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.resource.v1.ApiResource} - */ -proto.nitric.resource.v1.ApiResource.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = msg.getSecurityDefinitionsMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.nitric.resource.v1.ApiSecurityDefinition.deserializeBinaryFromReader, "", new proto.nitric.resource.v1.ApiSecurityDefinition()); - }); - break; - case 2: - var value = msg.getSecurityMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.nitric.resource.v1.ApiScopes.deserializeBinaryFromReader, "", new proto.nitric.resource.v1.ApiScopes()); - }); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.resource.v1.ApiResource.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.resource.v1.ApiResource.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.resource.v1.ApiResource} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.resource.v1.ApiResource.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getSecurityDefinitionsMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.nitric.resource.v1.ApiSecurityDefinition.serializeBinaryToWriter); - } - f = message.getSecurityMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.nitric.resource.v1.ApiScopes.serializeBinaryToWriter); - } -}; - - -/** - * map security_definitions = 1; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.nitric.resource.v1.ApiResource.prototype.getSecurityDefinitionsMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 1, opt_noLazyCreate, - proto.nitric.resource.v1.ApiSecurityDefinition)); -}; - - -/** - * Clears values from the map. The map will be non-null. - * @return {!proto.nitric.resource.v1.ApiResource} returns this - */ -proto.nitric.resource.v1.ApiResource.prototype.clearSecurityDefinitionsMap = function() { - this.getSecurityDefinitionsMap().clear(); - return this;}; - - -/** - * map security = 2; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.nitric.resource.v1.ApiResource.prototype.getSecurityMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 2, opt_noLazyCreate, - proto.nitric.resource.v1.ApiScopes)); -}; - - -/** - * Clears values from the map. The map will be non-null. - * @return {!proto.nitric.resource.v1.ApiResource} returns this - */ -proto.nitric.resource.v1.ApiResource.prototype.clearSecurityMap = function() { - this.getSecurityMap().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.nitric.resource.v1.ResourceDeclareResponse.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.resource.v1.ResourceDeclareResponse.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.nitric.resource.v1.ResourceDeclareResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.resource.v1.ResourceDeclareResponse.toObject = function(includeInstance, msg) { - var f, obj = { - - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.resource.v1.ResourceDeclareResponse} - */ -proto.nitric.resource.v1.ResourceDeclareResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.resource.v1.ResourceDeclareResponse; - return proto.nitric.resource.v1.ResourceDeclareResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.resource.v1.ResourceDeclareResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.resource.v1.ResourceDeclareResponse} - */ -proto.nitric.resource.v1.ResourceDeclareResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.resource.v1.ResourceDeclareResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.resource.v1.ResourceDeclareResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.resource.v1.ResourceDeclareResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.resource.v1.ResourceDeclareResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; -}; - - - - - -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.nitric.resource.v1.ApiResourceDetails.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.resource.v1.ApiResourceDetails.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.nitric.resource.v1.ApiResourceDetails} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.resource.v1.ApiResourceDetails.toObject = function(includeInstance, msg) { - var f, obj = { - url: 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.nitric.resource.v1.ApiResourceDetails} - */ -proto.nitric.resource.v1.ApiResourceDetails.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.resource.v1.ApiResourceDetails; - return proto.nitric.resource.v1.ApiResourceDetails.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.resource.v1.ApiResourceDetails} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.resource.v1.ApiResourceDetails} - */ -proto.nitric.resource.v1.ApiResourceDetails.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.setUrl(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.resource.v1.ApiResourceDetails.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.resource.v1.ApiResourceDetails.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.resource.v1.ApiResourceDetails} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.resource.v1.ApiResourceDetails.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getUrl(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string url = 1; - * @return {string} - */ -proto.nitric.resource.v1.ApiResourceDetails.prototype.getUrl = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.resource.v1.ApiResourceDetails} returns this - */ -proto.nitric.resource.v1.ApiResourceDetails.prototype.setUrl = 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.nitric.resource.v1.WebsocketResourceDetails.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.resource.v1.WebsocketResourceDetails.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.nitric.resource.v1.WebsocketResourceDetails} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.resource.v1.WebsocketResourceDetails.toObject = function(includeInstance, msg) { - var f, obj = { - url: 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.nitric.resource.v1.WebsocketResourceDetails} - */ -proto.nitric.resource.v1.WebsocketResourceDetails.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.resource.v1.WebsocketResourceDetails; - return proto.nitric.resource.v1.WebsocketResourceDetails.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.resource.v1.WebsocketResourceDetails} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.resource.v1.WebsocketResourceDetails} - */ -proto.nitric.resource.v1.WebsocketResourceDetails.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.setUrl(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.resource.v1.WebsocketResourceDetails.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.resource.v1.WebsocketResourceDetails.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.resource.v1.WebsocketResourceDetails} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.resource.v1.WebsocketResourceDetails.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getUrl(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string url = 1; - * @return {string} - */ -proto.nitric.resource.v1.WebsocketResourceDetails.prototype.getUrl = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.resource.v1.WebsocketResourceDetails} returns this - */ -proto.nitric.resource.v1.WebsocketResourceDetails.prototype.setUrl = 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.nitric.resource.v1.ResourceDetailsRequest.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.resource.v1.ResourceDetailsRequest.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.nitric.resource.v1.ResourceDetailsRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.resource.v1.ResourceDetailsRequest.toObject = function(includeInstance, msg) { - var f, obj = { - resource: (f = msg.getResource()) && proto.nitric.resource.v1.Resource.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.nitric.resource.v1.ResourceDetailsRequest} - */ -proto.nitric.resource.v1.ResourceDetailsRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.resource.v1.ResourceDetailsRequest; - return proto.nitric.resource.v1.ResourceDetailsRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.resource.v1.ResourceDetailsRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.resource.v1.ResourceDetailsRequest} - */ -proto.nitric.resource.v1.ResourceDetailsRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nitric.resource.v1.Resource; - reader.readMessage(value,proto.nitric.resource.v1.Resource.deserializeBinaryFromReader); - msg.setResource(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.resource.v1.ResourceDetailsRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.resource.v1.ResourceDetailsRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.resource.v1.ResourceDetailsRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.resource.v1.ResourceDetailsRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getResource(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.nitric.resource.v1.Resource.serializeBinaryToWriter - ); - } -}; - - -/** - * optional Resource resource = 1; - * @return {?proto.nitric.resource.v1.Resource} - */ -proto.nitric.resource.v1.ResourceDetailsRequest.prototype.getResource = function() { - return /** @type{?proto.nitric.resource.v1.Resource} */ ( - jspb.Message.getWrapperField(this, proto.nitric.resource.v1.Resource, 1)); -}; - - -/** - * @param {?proto.nitric.resource.v1.Resource|undefined} value - * @return {!proto.nitric.resource.v1.ResourceDetailsRequest} returns this -*/ -proto.nitric.resource.v1.ResourceDetailsRequest.prototype.setResource = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.resource.v1.ResourceDetailsRequest} returns this - */ -proto.nitric.resource.v1.ResourceDetailsRequest.prototype.clearResource = function() { - return this.setResource(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.resource.v1.ResourceDetailsRequest.prototype.hasResource = function() { - return jspb.Message.getField(this, 1) != null; -}; - - - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.nitric.resource.v1.ResourceDetailsResponse.oneofGroups_ = [[10,11]]; - -/** - * @enum {number} - */ -proto.nitric.resource.v1.ResourceDetailsResponse.DetailsCase = { - DETAILS_NOT_SET: 0, - API: 10, - WEBSOCKET: 11 -}; - -/** - * @return {proto.nitric.resource.v1.ResourceDetailsResponse.DetailsCase} - */ -proto.nitric.resource.v1.ResourceDetailsResponse.prototype.getDetailsCase = function() { - return /** @type {proto.nitric.resource.v1.ResourceDetailsResponse.DetailsCase} */(jspb.Message.computeOneofCase(this, proto.nitric.resource.v1.ResourceDetailsResponse.oneofGroups_[0])); -}; - - - -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.nitric.resource.v1.ResourceDetailsResponse.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.resource.v1.ResourceDetailsResponse.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.nitric.resource.v1.ResourceDetailsResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.resource.v1.ResourceDetailsResponse.toObject = function(includeInstance, msg) { - var f, obj = { - id: jspb.Message.getFieldWithDefault(msg, 1, ""), - provider: jspb.Message.getFieldWithDefault(msg, 2, ""), - service: jspb.Message.getFieldWithDefault(msg, 3, ""), - api: (f = msg.getApi()) && proto.nitric.resource.v1.ApiResourceDetails.toObject(includeInstance, f), - websocket: (f = msg.getWebsocket()) && proto.nitric.resource.v1.WebsocketResourceDetails.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.nitric.resource.v1.ResourceDetailsResponse} - */ -proto.nitric.resource.v1.ResourceDetailsResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.resource.v1.ResourceDetailsResponse; - return proto.nitric.resource.v1.ResourceDetailsResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.resource.v1.ResourceDetailsResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.resource.v1.ResourceDetailsResponse} - */ -proto.nitric.resource.v1.ResourceDetailsResponse.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.setProvider(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setService(value); - break; - case 10: - var value = new proto.nitric.resource.v1.ApiResourceDetails; - reader.readMessage(value,proto.nitric.resource.v1.ApiResourceDetails.deserializeBinaryFromReader); - msg.setApi(value); - break; - case 11: - var value = new proto.nitric.resource.v1.WebsocketResourceDetails; - reader.readMessage(value,proto.nitric.resource.v1.WebsocketResourceDetails.deserializeBinaryFromReader); - msg.setWebsocket(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.resource.v1.ResourceDetailsResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.resource.v1.ResourceDetailsResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.resource.v1.ResourceDetailsResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.resource.v1.ResourceDetailsResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getId(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getProvider(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getService(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } - f = message.getApi(); - if (f != null) { - writer.writeMessage( - 10, - f, - proto.nitric.resource.v1.ApiResourceDetails.serializeBinaryToWriter - ); - } - f = message.getWebsocket(); - if (f != null) { - writer.writeMessage( - 11, - f, - proto.nitric.resource.v1.WebsocketResourceDetails.serializeBinaryToWriter - ); - } -}; - - -/** - * optional string id = 1; - * @return {string} - */ -proto.nitric.resource.v1.ResourceDetailsResponse.prototype.getId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.resource.v1.ResourceDetailsResponse} returns this - */ -proto.nitric.resource.v1.ResourceDetailsResponse.prototype.setId = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string provider = 2; - * @return {string} - */ -proto.nitric.resource.v1.ResourceDetailsResponse.prototype.getProvider = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.resource.v1.ResourceDetailsResponse} returns this - */ -proto.nitric.resource.v1.ResourceDetailsResponse.prototype.setProvider = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional string service = 3; - * @return {string} - */ -proto.nitric.resource.v1.ResourceDetailsResponse.prototype.getService = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.resource.v1.ResourceDetailsResponse} returns this - */ -proto.nitric.resource.v1.ResourceDetailsResponse.prototype.setService = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - -/** - * optional ApiResourceDetails api = 10; - * @return {?proto.nitric.resource.v1.ApiResourceDetails} - */ -proto.nitric.resource.v1.ResourceDetailsResponse.prototype.getApi = function() { - return /** @type{?proto.nitric.resource.v1.ApiResourceDetails} */ ( - jspb.Message.getWrapperField(this, proto.nitric.resource.v1.ApiResourceDetails, 10)); -}; - - -/** - * @param {?proto.nitric.resource.v1.ApiResourceDetails|undefined} value - * @return {!proto.nitric.resource.v1.ResourceDetailsResponse} returns this -*/ -proto.nitric.resource.v1.ResourceDetailsResponse.prototype.setApi = function(value) { - return jspb.Message.setOneofWrapperField(this, 10, proto.nitric.resource.v1.ResourceDetailsResponse.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.resource.v1.ResourceDetailsResponse} returns this - */ -proto.nitric.resource.v1.ResourceDetailsResponse.prototype.clearApi = function() { - return this.setApi(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.resource.v1.ResourceDetailsResponse.prototype.hasApi = function() { - return jspb.Message.getField(this, 10) != null; -}; - - -/** - * optional WebsocketResourceDetails websocket = 11; - * @return {?proto.nitric.resource.v1.WebsocketResourceDetails} - */ -proto.nitric.resource.v1.ResourceDetailsResponse.prototype.getWebsocket = function() { - return /** @type{?proto.nitric.resource.v1.WebsocketResourceDetails} */ ( - jspb.Message.getWrapperField(this, proto.nitric.resource.v1.WebsocketResourceDetails, 11)); -}; - - -/** - * @param {?proto.nitric.resource.v1.WebsocketResourceDetails|undefined} value - * @return {!proto.nitric.resource.v1.ResourceDetailsResponse} returns this -*/ -proto.nitric.resource.v1.ResourceDetailsResponse.prototype.setWebsocket = function(value) { - return jspb.Message.setOneofWrapperField(this, 11, proto.nitric.resource.v1.ResourceDetailsResponse.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.nitric.resource.v1.ResourceDetailsResponse} returns this - */ -proto.nitric.resource.v1.ResourceDetailsResponse.prototype.clearWebsocket = function() { - return this.setWebsocket(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.nitric.resource.v1.ResourceDetailsResponse.prototype.hasWebsocket = function() { - return jspb.Message.getField(this, 11) != null; -}; - - -/** - * @enum {number} - */ -proto.nitric.resource.v1.ResourceType = { - API: 0, - FUNCTION: 1, - BUCKET: 2, - QUEUE: 3, - TOPIC: 4, - SCHEDULE: 5, - SUBSCRIPTION: 6, - COLLECTION: 7, - POLICY: 8, - SECRET: 9, - NOTIFICATION: 10, - WEBSOCKET: 11, - HTTP: 12 -}; - -/** - * @enum {number} - */ -proto.nitric.resource.v1.Action = { - BUCKETFILELIST: 0, - BUCKETFILEGET: 1, - BUCKETFILEPUT: 2, - BUCKETFILEDELETE: 3, - TOPICLIST: 200, - TOPICDETAIL: 201, - TOPICEVENTPUBLISH: 202, - QUEUESEND: 300, - QUEUERECEIVE: 301, - QUEUELIST: 302, - QUEUEDETAIL: 303, - COLLECTIONDOCUMENTREAD: 400, - COLLECTIONDOCUMENTWRITE: 401, - COLLECTIONDOCUMENTDELETE: 402, - COLLECTIONQUERY: 403, - COLLECTIONLIST: 404, - SECRETPUT: 500, - SECRETACCESS: 501, - WEBSOCKETMANAGE: 600 -}; - -goog.object.extend(exports, proto.nitric.resource.v1); diff --git a/src/gen/proto/secret/v1/secret_grpc_pb.d.ts b/src/gen/proto/secret/v1/secret_grpc_pb.d.ts deleted file mode 100644 index 0a93b3bd..00000000 --- a/src/gen/proto/secret/v1/secret_grpc_pb.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -// GENERATED CODE -- DO NOT EDIT! - -// package: nitric.secret.v1 -// file: proto/secret/v1/secret.proto - -import * as proto_secret_v1_secret_pb from "../../../proto/secret/v1/secret_pb"; -import * as grpc from "@grpc/grpc-js"; - -interface ISecretServiceService extends grpc.ServiceDefinition { - put: grpc.MethodDefinition; - access: grpc.MethodDefinition; -} - -export const SecretServiceService: ISecretServiceService; - -export interface ISecretServiceServer extends grpc.UntypedServiceImplementation { - put: grpc.handleUnaryCall; - access: grpc.handleUnaryCall; -} - -export class SecretServiceClient extends grpc.Client { - constructor(address: string, credentials: grpc.ChannelCredentials, options?: object); - put(argument: proto_secret_v1_secret_pb.SecretPutRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; - put(argument: proto_secret_v1_secret_pb.SecretPutRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - put(argument: proto_secret_v1_secret_pb.SecretPutRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - access(argument: proto_secret_v1_secret_pb.SecretAccessRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; - access(argument: proto_secret_v1_secret_pb.SecretAccessRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - access(argument: proto_secret_v1_secret_pb.SecretAccessRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; -} diff --git a/src/gen/proto/secret/v1/secret_grpc_pb.js b/src/gen/proto/secret/v1/secret_grpc_pb.js deleted file mode 100644 index caced32b..00000000 --- a/src/gen/proto/secret/v1/secret_grpc_pb.js +++ /dev/null @@ -1,81 +0,0 @@ -// GENERATED CODE -- DO NOT EDIT! - -'use strict'; -var grpc = require('@grpc/grpc-js'); -var proto_secret_v1_secret_pb = require('../../../proto/secret/v1/secret_pb.js'); -var validate_validate_pb = require('../../../validate/validate_pb.js'); - -function serialize_nitric_secret_v1_SecretAccessRequest(arg) { - if (!(arg instanceof proto_secret_v1_secret_pb.SecretAccessRequest)) { - throw new Error('Expected argument of type nitric.secret.v1.SecretAccessRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_secret_v1_SecretAccessRequest(buffer_arg) { - return proto_secret_v1_secret_pb.SecretAccessRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_secret_v1_SecretAccessResponse(arg) { - if (!(arg instanceof proto_secret_v1_secret_pb.SecretAccessResponse)) { - throw new Error('Expected argument of type nitric.secret.v1.SecretAccessResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_secret_v1_SecretAccessResponse(buffer_arg) { - return proto_secret_v1_secret_pb.SecretAccessResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_secret_v1_SecretPutRequest(arg) { - if (!(arg instanceof proto_secret_v1_secret_pb.SecretPutRequest)) { - throw new Error('Expected argument of type nitric.secret.v1.SecretPutRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_secret_v1_SecretPutRequest(buffer_arg) { - return proto_secret_v1_secret_pb.SecretPutRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_secret_v1_SecretPutResponse(arg) { - if (!(arg instanceof proto_secret_v1_secret_pb.SecretPutResponse)) { - throw new Error('Expected argument of type nitric.secret.v1.SecretPutResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_secret_v1_SecretPutResponse(buffer_arg) { - return proto_secret_v1_secret_pb.SecretPutResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - - -// The Nitric Secret Service contract -var SecretServiceService = exports.SecretServiceService = { - // Updates a secret, creating a new one if it doesn't already exist -put: { - path: '/nitric.secret.v1.SecretService/Put', - requestStream: false, - responseStream: false, - requestType: proto_secret_v1_secret_pb.SecretPutRequest, - responseType: proto_secret_v1_secret_pb.SecretPutResponse, - requestSerialize: serialize_nitric_secret_v1_SecretPutRequest, - requestDeserialize: deserialize_nitric_secret_v1_SecretPutRequest, - responseSerialize: serialize_nitric_secret_v1_SecretPutResponse, - responseDeserialize: deserialize_nitric_secret_v1_SecretPutResponse, - }, - // Gets a secret from a Secret Store -access: { - path: '/nitric.secret.v1.SecretService/Access', - requestStream: false, - responseStream: false, - requestType: proto_secret_v1_secret_pb.SecretAccessRequest, - responseType: proto_secret_v1_secret_pb.SecretAccessResponse, - requestSerialize: serialize_nitric_secret_v1_SecretAccessRequest, - requestDeserialize: deserialize_nitric_secret_v1_SecretAccessRequest, - responseSerialize: serialize_nitric_secret_v1_SecretAccessResponse, - responseDeserialize: deserialize_nitric_secret_v1_SecretAccessResponse, - }, -}; - -exports.SecretServiceClient = grpc.makeGenericClientConstructor(SecretServiceService); diff --git a/src/gen/proto/storage/v1/storage_grpc_pb.d.ts b/src/gen/proto/storage/v1/storage_grpc_pb.d.ts deleted file mode 100644 index bfa3640a..00000000 --- a/src/gen/proto/storage/v1/storage_grpc_pb.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -// GENERATED CODE -- DO NOT EDIT! - -// package: nitric.storage.v1 -// file: proto/storage/v1/storage.proto - -import * as proto_storage_v1_storage_pb from "../../../proto/storage/v1/storage_pb"; -import * as grpc from "@grpc/grpc-js"; - -interface IStorageServiceService extends grpc.ServiceDefinition { - read: grpc.MethodDefinition; - write: grpc.MethodDefinition; - delete: grpc.MethodDefinition; - preSignUrl: grpc.MethodDefinition; - listFiles: grpc.MethodDefinition; - exists: grpc.MethodDefinition; -} - -export const StorageServiceService: IStorageServiceService; - -export interface IStorageServiceServer extends grpc.UntypedServiceImplementation { - read: grpc.handleUnaryCall; - write: grpc.handleUnaryCall; - delete: grpc.handleUnaryCall; - preSignUrl: grpc.handleUnaryCall; - listFiles: grpc.handleUnaryCall; - exists: grpc.handleUnaryCall; -} - -export class StorageServiceClient extends grpc.Client { - constructor(address: string, credentials: grpc.ChannelCredentials, options?: object); - read(argument: proto_storage_v1_storage_pb.StorageReadRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; - read(argument: proto_storage_v1_storage_pb.StorageReadRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - read(argument: proto_storage_v1_storage_pb.StorageReadRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - write(argument: proto_storage_v1_storage_pb.StorageWriteRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; - write(argument: proto_storage_v1_storage_pb.StorageWriteRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - write(argument: proto_storage_v1_storage_pb.StorageWriteRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - delete(argument: proto_storage_v1_storage_pb.StorageDeleteRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; - delete(argument: proto_storage_v1_storage_pb.StorageDeleteRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - delete(argument: proto_storage_v1_storage_pb.StorageDeleteRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - preSignUrl(argument: proto_storage_v1_storage_pb.StoragePreSignUrlRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; - preSignUrl(argument: proto_storage_v1_storage_pb.StoragePreSignUrlRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - preSignUrl(argument: proto_storage_v1_storage_pb.StoragePreSignUrlRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - listFiles(argument: proto_storage_v1_storage_pb.StorageListFilesRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; - listFiles(argument: proto_storage_v1_storage_pb.StorageListFilesRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - listFiles(argument: proto_storage_v1_storage_pb.StorageListFilesRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - exists(argument: proto_storage_v1_storage_pb.StorageExistsRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; - exists(argument: proto_storage_v1_storage_pb.StorageExistsRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - exists(argument: proto_storage_v1_storage_pb.StorageExistsRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; -} diff --git a/src/gen/proto/storage/v1/storage_grpc_pb.js b/src/gen/proto/storage/v1/storage_grpc_pb.js deleted file mode 100644 index b05f474e..00000000 --- a/src/gen/proto/storage/v1/storage_grpc_pb.js +++ /dev/null @@ -1,217 +0,0 @@ -// GENERATED CODE -- DO NOT EDIT! - -'use strict'; -var grpc = require('@grpc/grpc-js'); -var proto_storage_v1_storage_pb = require('../../../proto/storage/v1/storage_pb.js'); -var validate_validate_pb = require('../../../validate/validate_pb.js'); - -function serialize_nitric_storage_v1_StorageDeleteRequest(arg) { - if (!(arg instanceof proto_storage_v1_storage_pb.StorageDeleteRequest)) { - throw new Error('Expected argument of type nitric.storage.v1.StorageDeleteRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_storage_v1_StorageDeleteRequest(buffer_arg) { - return proto_storage_v1_storage_pb.StorageDeleteRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_storage_v1_StorageDeleteResponse(arg) { - if (!(arg instanceof proto_storage_v1_storage_pb.StorageDeleteResponse)) { - throw new Error('Expected argument of type nitric.storage.v1.StorageDeleteResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_storage_v1_StorageDeleteResponse(buffer_arg) { - return proto_storage_v1_storage_pb.StorageDeleteResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_storage_v1_StorageExistsRequest(arg) { - if (!(arg instanceof proto_storage_v1_storage_pb.StorageExistsRequest)) { - throw new Error('Expected argument of type nitric.storage.v1.StorageExistsRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_storage_v1_StorageExistsRequest(buffer_arg) { - return proto_storage_v1_storage_pb.StorageExistsRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_storage_v1_StorageExistsResponse(arg) { - if (!(arg instanceof proto_storage_v1_storage_pb.StorageExistsResponse)) { - throw new Error('Expected argument of type nitric.storage.v1.StorageExistsResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_storage_v1_StorageExistsResponse(buffer_arg) { - return proto_storage_v1_storage_pb.StorageExistsResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_storage_v1_StorageListFilesRequest(arg) { - if (!(arg instanceof proto_storage_v1_storage_pb.StorageListFilesRequest)) { - throw new Error('Expected argument of type nitric.storage.v1.StorageListFilesRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_storage_v1_StorageListFilesRequest(buffer_arg) { - return proto_storage_v1_storage_pb.StorageListFilesRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_storage_v1_StorageListFilesResponse(arg) { - if (!(arg instanceof proto_storage_v1_storage_pb.StorageListFilesResponse)) { - throw new Error('Expected argument of type nitric.storage.v1.StorageListFilesResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_storage_v1_StorageListFilesResponse(buffer_arg) { - return proto_storage_v1_storage_pb.StorageListFilesResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_storage_v1_StoragePreSignUrlRequest(arg) { - if (!(arg instanceof proto_storage_v1_storage_pb.StoragePreSignUrlRequest)) { - throw new Error('Expected argument of type nitric.storage.v1.StoragePreSignUrlRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_storage_v1_StoragePreSignUrlRequest(buffer_arg) { - return proto_storage_v1_storage_pb.StoragePreSignUrlRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_storage_v1_StoragePreSignUrlResponse(arg) { - if (!(arg instanceof proto_storage_v1_storage_pb.StoragePreSignUrlResponse)) { - throw new Error('Expected argument of type nitric.storage.v1.StoragePreSignUrlResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_storage_v1_StoragePreSignUrlResponse(buffer_arg) { - return proto_storage_v1_storage_pb.StoragePreSignUrlResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_storage_v1_StorageReadRequest(arg) { - if (!(arg instanceof proto_storage_v1_storage_pb.StorageReadRequest)) { - throw new Error('Expected argument of type nitric.storage.v1.StorageReadRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_storage_v1_StorageReadRequest(buffer_arg) { - return proto_storage_v1_storage_pb.StorageReadRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_storage_v1_StorageReadResponse(arg) { - if (!(arg instanceof proto_storage_v1_storage_pb.StorageReadResponse)) { - throw new Error('Expected argument of type nitric.storage.v1.StorageReadResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_storage_v1_StorageReadResponse(buffer_arg) { - return proto_storage_v1_storage_pb.StorageReadResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_storage_v1_StorageWriteRequest(arg) { - if (!(arg instanceof proto_storage_v1_storage_pb.StorageWriteRequest)) { - throw new Error('Expected argument of type nitric.storage.v1.StorageWriteRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_storage_v1_StorageWriteRequest(buffer_arg) { - return proto_storage_v1_storage_pb.StorageWriteRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_storage_v1_StorageWriteResponse(arg) { - if (!(arg instanceof proto_storage_v1_storage_pb.StorageWriteResponse)) { - throw new Error('Expected argument of type nitric.storage.v1.StorageWriteResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_storage_v1_StorageWriteResponse(buffer_arg) { - return proto_storage_v1_storage_pb.StorageWriteResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - - -// Services for storage and retrieval of files in the form of byte arrays, such as text and binary files. -var StorageServiceService = exports.StorageServiceService = { - // Retrieve an item from a bucket -read: { - path: '/nitric.storage.v1.StorageService/Read', - requestStream: false, - responseStream: false, - requestType: proto_storage_v1_storage_pb.StorageReadRequest, - responseType: proto_storage_v1_storage_pb.StorageReadResponse, - requestSerialize: serialize_nitric_storage_v1_StorageReadRequest, - requestDeserialize: deserialize_nitric_storage_v1_StorageReadRequest, - responseSerialize: serialize_nitric_storage_v1_StorageReadResponse, - responseDeserialize: deserialize_nitric_storage_v1_StorageReadResponse, - }, - // Store an item to a bucket -write: { - path: '/nitric.storage.v1.StorageService/Write', - requestStream: false, - responseStream: false, - requestType: proto_storage_v1_storage_pb.StorageWriteRequest, - responseType: proto_storage_v1_storage_pb.StorageWriteResponse, - requestSerialize: serialize_nitric_storage_v1_StorageWriteRequest, - requestDeserialize: deserialize_nitric_storage_v1_StorageWriteRequest, - responseSerialize: serialize_nitric_storage_v1_StorageWriteResponse, - responseDeserialize: deserialize_nitric_storage_v1_StorageWriteResponse, - }, - // Delete an item from a bucket -delete: { - path: '/nitric.storage.v1.StorageService/Delete', - requestStream: false, - responseStream: false, - requestType: proto_storage_v1_storage_pb.StorageDeleteRequest, - responseType: proto_storage_v1_storage_pb.StorageDeleteResponse, - requestSerialize: serialize_nitric_storage_v1_StorageDeleteRequest, - requestDeserialize: deserialize_nitric_storage_v1_StorageDeleteRequest, - responseSerialize: serialize_nitric_storage_v1_StorageDeleteResponse, - responseDeserialize: deserialize_nitric_storage_v1_StorageDeleteResponse, - }, - // Generate a pre-signed URL for direct operations on an item -preSignUrl: { - path: '/nitric.storage.v1.StorageService/PreSignUrl', - requestStream: false, - responseStream: false, - requestType: proto_storage_v1_storage_pb.StoragePreSignUrlRequest, - responseType: proto_storage_v1_storage_pb.StoragePreSignUrlResponse, - requestSerialize: serialize_nitric_storage_v1_StoragePreSignUrlRequest, - requestDeserialize: deserialize_nitric_storage_v1_StoragePreSignUrlRequest, - responseSerialize: serialize_nitric_storage_v1_StoragePreSignUrlResponse, - responseDeserialize: deserialize_nitric_storage_v1_StoragePreSignUrlResponse, - }, - // List files currently in the bucket -listFiles: { - path: '/nitric.storage.v1.StorageService/ListFiles', - requestStream: false, - responseStream: false, - requestType: proto_storage_v1_storage_pb.StorageListFilesRequest, - responseType: proto_storage_v1_storage_pb.StorageListFilesResponse, - requestSerialize: serialize_nitric_storage_v1_StorageListFilesRequest, - requestDeserialize: deserialize_nitric_storage_v1_StorageListFilesRequest, - responseSerialize: serialize_nitric_storage_v1_StorageListFilesResponse, - responseDeserialize: deserialize_nitric_storage_v1_StorageListFilesResponse, - }, - // Determine is an object exists in a bucket -exists: { - path: '/nitric.storage.v1.StorageService/Exists', - requestStream: false, - responseStream: false, - requestType: proto_storage_v1_storage_pb.StorageExistsRequest, - responseType: proto_storage_v1_storage_pb.StorageExistsResponse, - requestSerialize: serialize_nitric_storage_v1_StorageExistsRequest, - requestDeserialize: deserialize_nitric_storage_v1_StorageExistsRequest, - responseSerialize: serialize_nitric_storage_v1_StorageExistsResponse, - responseDeserialize: deserialize_nitric_storage_v1_StorageExistsResponse, - }, -}; - -exports.StorageServiceClient = grpc.makeGenericClientConstructor(StorageServiceService); diff --git a/src/gen/proto/storage/v1/storage_pb.js b/src/gen/proto/storage/v1/storage_pb.js deleted file mode 100644 index b9b904ab..00000000 --- a/src/gen/proto/storage/v1/storage_pb.js +++ /dev/null @@ -1,2301 +0,0 @@ -// source: proto/storage/v1/storage.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() { - if (this) { return this; } - if (typeof window !== 'undefined') { return window; } - if (typeof global !== 'undefined') { return global; } - if (typeof self !== 'undefined') { return self; } - return Function('return this')(); -}.call(null)); - -var validate_validate_pb = require('../../../validate/validate_pb.js'); -goog.object.extend(proto, validate_validate_pb); -goog.exportSymbol('proto.nitric.storage.v1.File', null, global); -goog.exportSymbol('proto.nitric.storage.v1.StorageDeleteRequest', null, global); -goog.exportSymbol('proto.nitric.storage.v1.StorageDeleteResponse', null, global); -goog.exportSymbol('proto.nitric.storage.v1.StorageExistsRequest', null, global); -goog.exportSymbol('proto.nitric.storage.v1.StorageExistsResponse', null, global); -goog.exportSymbol('proto.nitric.storage.v1.StorageListFilesRequest', null, global); -goog.exportSymbol('proto.nitric.storage.v1.StorageListFilesResponse', null, global); -goog.exportSymbol('proto.nitric.storage.v1.StoragePreSignUrlRequest', null, global); -goog.exportSymbol('proto.nitric.storage.v1.StoragePreSignUrlRequest.Operation', null, global); -goog.exportSymbol('proto.nitric.storage.v1.StoragePreSignUrlResponse', null, global); -goog.exportSymbol('proto.nitric.storage.v1.StorageReadRequest', null, global); -goog.exportSymbol('proto.nitric.storage.v1.StorageReadResponse', null, global); -goog.exportSymbol('proto.nitric.storage.v1.StorageWriteRequest', null, global); -goog.exportSymbol('proto.nitric.storage.v1.StorageWriteResponse', 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.nitric.storage.v1.StorageWriteRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.storage.v1.StorageWriteRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.storage.v1.StorageWriteRequest.displayName = 'proto.nitric.storage.v1.StorageWriteRequest'; -} -/** - * 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.nitric.storage.v1.StorageWriteResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.storage.v1.StorageWriteResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.storage.v1.StorageWriteResponse.displayName = 'proto.nitric.storage.v1.StorageWriteResponse'; -} -/** - * 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.nitric.storage.v1.StorageReadRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.storage.v1.StorageReadRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.storage.v1.StorageReadRequest.displayName = 'proto.nitric.storage.v1.StorageReadRequest'; -} -/** - * 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.nitric.storage.v1.StorageReadResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.storage.v1.StorageReadResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.storage.v1.StorageReadResponse.displayName = 'proto.nitric.storage.v1.StorageReadResponse'; -} -/** - * 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.nitric.storage.v1.StorageDeleteRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.storage.v1.StorageDeleteRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.storage.v1.StorageDeleteRequest.displayName = 'proto.nitric.storage.v1.StorageDeleteRequest'; -} -/** - * 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.nitric.storage.v1.StorageDeleteResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.storage.v1.StorageDeleteResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.storage.v1.StorageDeleteResponse.displayName = 'proto.nitric.storage.v1.StorageDeleteResponse'; -} -/** - * 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.nitric.storage.v1.StoragePreSignUrlRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.storage.v1.StoragePreSignUrlRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.storage.v1.StoragePreSignUrlRequest.displayName = 'proto.nitric.storage.v1.StoragePreSignUrlRequest'; -} -/** - * 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.nitric.storage.v1.StoragePreSignUrlResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.storage.v1.StoragePreSignUrlResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.storage.v1.StoragePreSignUrlResponse.displayName = 'proto.nitric.storage.v1.StoragePreSignUrlResponse'; -} -/** - * 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.nitric.storage.v1.StorageListFilesRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.storage.v1.StorageListFilesRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.storage.v1.StorageListFilesRequest.displayName = 'proto.nitric.storage.v1.StorageListFilesRequest'; -} -/** - * 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.nitric.storage.v1.File = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.storage.v1.File, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.storage.v1.File.displayName = 'proto.nitric.storage.v1.File'; -} -/** - * 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.nitric.storage.v1.StorageListFilesResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.nitric.storage.v1.StorageListFilesResponse.repeatedFields_, null); -}; -goog.inherits(proto.nitric.storage.v1.StorageListFilesResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.storage.v1.StorageListFilesResponse.displayName = 'proto.nitric.storage.v1.StorageListFilesResponse'; -} -/** - * 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.nitric.storage.v1.StorageExistsRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.storage.v1.StorageExistsRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.storage.v1.StorageExistsRequest.displayName = 'proto.nitric.storage.v1.StorageExistsRequest'; -} -/** - * 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.nitric.storage.v1.StorageExistsResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.storage.v1.StorageExistsResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.storage.v1.StorageExistsResponse.displayName = 'proto.nitric.storage.v1.StorageExistsResponse'; -} - - - -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.nitric.storage.v1.StorageWriteRequest.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.storage.v1.StorageWriteRequest.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.nitric.storage.v1.StorageWriteRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.storage.v1.StorageWriteRequest.toObject = function(includeInstance, msg) { - var f, obj = { - bucketName: jspb.Message.getFieldWithDefault(msg, 1, ""), - key: jspb.Message.getFieldWithDefault(msg, 2, ""), - body: msg.getBody_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.nitric.storage.v1.StorageWriteRequest} - */ -proto.nitric.storage.v1.StorageWriteRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.storage.v1.StorageWriteRequest; - return proto.nitric.storage.v1.StorageWriteRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.storage.v1.StorageWriteRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.storage.v1.StorageWriteRequest} - */ -proto.nitric.storage.v1.StorageWriteRequest.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.setBucketName(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setKey(value); - break; - case 3: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setBody(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.storage.v1.StorageWriteRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.storage.v1.StorageWriteRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.storage.v1.StorageWriteRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.storage.v1.StorageWriteRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getBucketName(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getKey(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getBody_asU8(); - if (f.length > 0) { - writer.writeBytes( - 3, - f - ); - } -}; - - -/** - * optional string bucket_name = 1; - * @return {string} - */ -proto.nitric.storage.v1.StorageWriteRequest.prototype.getBucketName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.storage.v1.StorageWriteRequest} returns this - */ -proto.nitric.storage.v1.StorageWriteRequest.prototype.setBucketName = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string key = 2; - * @return {string} - */ -proto.nitric.storage.v1.StorageWriteRequest.prototype.getKey = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.storage.v1.StorageWriteRequest} returns this - */ -proto.nitric.storage.v1.StorageWriteRequest.prototype.setKey = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional bytes body = 3; - * @return {!(string|Uint8Array)} - */ -proto.nitric.storage.v1.StorageWriteRequest.prototype.getBody = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * optional bytes body = 3; - * This is a type-conversion wrapper around `getBody()` - * @return {string} - */ -proto.nitric.storage.v1.StorageWriteRequest.prototype.getBody_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getBody())); -}; - - -/** - * optional bytes body = 3; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getBody()` - * @return {!Uint8Array} - */ -proto.nitric.storage.v1.StorageWriteRequest.prototype.getBody_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getBody())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.nitric.storage.v1.StorageWriteRequest} returns this - */ -proto.nitric.storage.v1.StorageWriteRequest.prototype.setBody = function(value) { - return jspb.Message.setProto3BytesField(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.nitric.storage.v1.StorageWriteResponse.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.storage.v1.StorageWriteResponse.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.nitric.storage.v1.StorageWriteResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.storage.v1.StorageWriteResponse.toObject = function(includeInstance, msg) { - var f, obj = { - - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.storage.v1.StorageWriteResponse} - */ -proto.nitric.storage.v1.StorageWriteResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.storage.v1.StorageWriteResponse; - return proto.nitric.storage.v1.StorageWriteResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.storage.v1.StorageWriteResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.storage.v1.StorageWriteResponse} - */ -proto.nitric.storage.v1.StorageWriteResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.storage.v1.StorageWriteResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.storage.v1.StorageWriteResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.storage.v1.StorageWriteResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.storage.v1.StorageWriteResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; -}; - - - - - -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.nitric.storage.v1.StorageReadRequest.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.storage.v1.StorageReadRequest.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.nitric.storage.v1.StorageReadRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.storage.v1.StorageReadRequest.toObject = function(includeInstance, msg) { - var f, obj = { - bucketName: jspb.Message.getFieldWithDefault(msg, 1, ""), - key: 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.nitric.storage.v1.StorageReadRequest} - */ -proto.nitric.storage.v1.StorageReadRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.storage.v1.StorageReadRequest; - return proto.nitric.storage.v1.StorageReadRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.storage.v1.StorageReadRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.storage.v1.StorageReadRequest} - */ -proto.nitric.storage.v1.StorageReadRequest.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.setBucketName(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setKey(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.storage.v1.StorageReadRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.storage.v1.StorageReadRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.storage.v1.StorageReadRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.storage.v1.StorageReadRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getBucketName(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getKey(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional string bucket_name = 1; - * @return {string} - */ -proto.nitric.storage.v1.StorageReadRequest.prototype.getBucketName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.storage.v1.StorageReadRequest} returns this - */ -proto.nitric.storage.v1.StorageReadRequest.prototype.setBucketName = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string key = 2; - * @return {string} - */ -proto.nitric.storage.v1.StorageReadRequest.prototype.getKey = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.storage.v1.StorageReadRequest} returns this - */ -proto.nitric.storage.v1.StorageReadRequest.prototype.setKey = 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.nitric.storage.v1.StorageReadResponse.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.storage.v1.StorageReadResponse.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.nitric.storage.v1.StorageReadResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.storage.v1.StorageReadResponse.toObject = function(includeInstance, msg) { - var f, obj = { - body: msg.getBody_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.nitric.storage.v1.StorageReadResponse} - */ -proto.nitric.storage.v1.StorageReadResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.storage.v1.StorageReadResponse; - return proto.nitric.storage.v1.StorageReadResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.storage.v1.StorageReadResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.storage.v1.StorageReadResponse} - */ -proto.nitric.storage.v1.StorageReadResponse.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.setBody(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.storage.v1.StorageReadResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.storage.v1.StorageReadResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.storage.v1.StorageReadResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.storage.v1.StorageReadResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getBody_asU8(); - if (f.length > 0) { - writer.writeBytes( - 1, - f - ); - } -}; - - -/** - * optional bytes body = 1; - * @return {!(string|Uint8Array)} - */ -proto.nitric.storage.v1.StorageReadResponse.prototype.getBody = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * optional bytes body = 1; - * This is a type-conversion wrapper around `getBody()` - * @return {string} - */ -proto.nitric.storage.v1.StorageReadResponse.prototype.getBody_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getBody())); -}; - - -/** - * optional bytes body = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getBody()` - * @return {!Uint8Array} - */ -proto.nitric.storage.v1.StorageReadResponse.prototype.getBody_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getBody())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.nitric.storage.v1.StorageReadResponse} returns this - */ -proto.nitric.storage.v1.StorageReadResponse.prototype.setBody = 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.nitric.storage.v1.StorageDeleteRequest.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.storage.v1.StorageDeleteRequest.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.nitric.storage.v1.StorageDeleteRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.storage.v1.StorageDeleteRequest.toObject = function(includeInstance, msg) { - var f, obj = { - bucketName: jspb.Message.getFieldWithDefault(msg, 1, ""), - key: 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.nitric.storage.v1.StorageDeleteRequest} - */ -proto.nitric.storage.v1.StorageDeleteRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.storage.v1.StorageDeleteRequest; - return proto.nitric.storage.v1.StorageDeleteRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.storage.v1.StorageDeleteRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.storage.v1.StorageDeleteRequest} - */ -proto.nitric.storage.v1.StorageDeleteRequest.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.setBucketName(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setKey(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.storage.v1.StorageDeleteRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.storage.v1.StorageDeleteRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.storage.v1.StorageDeleteRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.storage.v1.StorageDeleteRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getBucketName(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getKey(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional string bucket_name = 1; - * @return {string} - */ -proto.nitric.storage.v1.StorageDeleteRequest.prototype.getBucketName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.storage.v1.StorageDeleteRequest} returns this - */ -proto.nitric.storage.v1.StorageDeleteRequest.prototype.setBucketName = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string key = 2; - * @return {string} - */ -proto.nitric.storage.v1.StorageDeleteRequest.prototype.getKey = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.storage.v1.StorageDeleteRequest} returns this - */ -proto.nitric.storage.v1.StorageDeleteRequest.prototype.setKey = 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.nitric.storage.v1.StorageDeleteResponse.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.storage.v1.StorageDeleteResponse.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.nitric.storage.v1.StorageDeleteResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.storage.v1.StorageDeleteResponse.toObject = function(includeInstance, msg) { - var f, obj = { - - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.storage.v1.StorageDeleteResponse} - */ -proto.nitric.storage.v1.StorageDeleteResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.storage.v1.StorageDeleteResponse; - return proto.nitric.storage.v1.StorageDeleteResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.storage.v1.StorageDeleteResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.storage.v1.StorageDeleteResponse} - */ -proto.nitric.storage.v1.StorageDeleteResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.storage.v1.StorageDeleteResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.storage.v1.StorageDeleteResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.storage.v1.StorageDeleteResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.storage.v1.StorageDeleteResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; -}; - - - - - -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.nitric.storage.v1.StoragePreSignUrlRequest.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.storage.v1.StoragePreSignUrlRequest.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.nitric.storage.v1.StoragePreSignUrlRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.storage.v1.StoragePreSignUrlRequest.toObject = function(includeInstance, msg) { - var f, obj = { - bucketName: jspb.Message.getFieldWithDefault(msg, 1, ""), - key: jspb.Message.getFieldWithDefault(msg, 2, ""), - operation: jspb.Message.getFieldWithDefault(msg, 3, 0), - expiry: 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.nitric.storage.v1.StoragePreSignUrlRequest} - */ -proto.nitric.storage.v1.StoragePreSignUrlRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.storage.v1.StoragePreSignUrlRequest; - return proto.nitric.storage.v1.StoragePreSignUrlRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.storage.v1.StoragePreSignUrlRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.storage.v1.StoragePreSignUrlRequest} - */ -proto.nitric.storage.v1.StoragePreSignUrlRequest.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.setBucketName(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setKey(value); - break; - case 3: - var value = /** @type {!proto.nitric.storage.v1.StoragePreSignUrlRequest.Operation} */ (reader.readEnum()); - msg.setOperation(value); - break; - case 4: - var value = /** @type {number} */ (reader.readUint32()); - msg.setExpiry(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.storage.v1.StoragePreSignUrlRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.storage.v1.StoragePreSignUrlRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.storage.v1.StoragePreSignUrlRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.storage.v1.StoragePreSignUrlRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getBucketName(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getKey(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getOperation(); - if (f !== 0.0) { - writer.writeEnum( - 3, - f - ); - } - f = message.getExpiry(); - if (f !== 0) { - writer.writeUint32( - 4, - f - ); - } -}; - - -/** - * @enum {number} - */ -proto.nitric.storage.v1.StoragePreSignUrlRequest.Operation = { - READ: 0, - WRITE: 1 -}; - -/** - * optional string bucket_name = 1; - * @return {string} - */ -proto.nitric.storage.v1.StoragePreSignUrlRequest.prototype.getBucketName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.storage.v1.StoragePreSignUrlRequest} returns this - */ -proto.nitric.storage.v1.StoragePreSignUrlRequest.prototype.setBucketName = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string key = 2; - * @return {string} - */ -proto.nitric.storage.v1.StoragePreSignUrlRequest.prototype.getKey = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.storage.v1.StoragePreSignUrlRequest} returns this - */ -proto.nitric.storage.v1.StoragePreSignUrlRequest.prototype.setKey = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional Operation operation = 3; - * @return {!proto.nitric.storage.v1.StoragePreSignUrlRequest.Operation} - */ -proto.nitric.storage.v1.StoragePreSignUrlRequest.prototype.getOperation = function() { - return /** @type {!proto.nitric.storage.v1.StoragePreSignUrlRequest.Operation} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); -}; - - -/** - * @param {!proto.nitric.storage.v1.StoragePreSignUrlRequest.Operation} value - * @return {!proto.nitric.storage.v1.StoragePreSignUrlRequest} returns this - */ -proto.nitric.storage.v1.StoragePreSignUrlRequest.prototype.setOperation = function(value) { - return jspb.Message.setProto3EnumField(this, 3, value); -}; - - -/** - * optional uint32 expiry = 4; - * @return {number} - */ -proto.nitric.storage.v1.StoragePreSignUrlRequest.prototype.getExpiry = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.nitric.storage.v1.StoragePreSignUrlRequest} returns this - */ -proto.nitric.storage.v1.StoragePreSignUrlRequest.prototype.setExpiry = 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.nitric.storage.v1.StoragePreSignUrlResponse.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.storage.v1.StoragePreSignUrlResponse.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.nitric.storage.v1.StoragePreSignUrlResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.storage.v1.StoragePreSignUrlResponse.toObject = function(includeInstance, msg) { - var f, obj = { - url: 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.nitric.storage.v1.StoragePreSignUrlResponse} - */ -proto.nitric.storage.v1.StoragePreSignUrlResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.storage.v1.StoragePreSignUrlResponse; - return proto.nitric.storage.v1.StoragePreSignUrlResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.storage.v1.StoragePreSignUrlResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.storage.v1.StoragePreSignUrlResponse} - */ -proto.nitric.storage.v1.StoragePreSignUrlResponse.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.setUrl(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.storage.v1.StoragePreSignUrlResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.storage.v1.StoragePreSignUrlResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.storage.v1.StoragePreSignUrlResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.storage.v1.StoragePreSignUrlResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getUrl(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string url = 1; - * @return {string} - */ -proto.nitric.storage.v1.StoragePreSignUrlResponse.prototype.getUrl = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.storage.v1.StoragePreSignUrlResponse} returns this - */ -proto.nitric.storage.v1.StoragePreSignUrlResponse.prototype.setUrl = 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.nitric.storage.v1.StorageListFilesRequest.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.storage.v1.StorageListFilesRequest.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.nitric.storage.v1.StorageListFilesRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.storage.v1.StorageListFilesRequest.toObject = function(includeInstance, msg) { - var f, obj = { - bucketName: jspb.Message.getFieldWithDefault(msg, 1, ""), - prefix: 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.nitric.storage.v1.StorageListFilesRequest} - */ -proto.nitric.storage.v1.StorageListFilesRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.storage.v1.StorageListFilesRequest; - return proto.nitric.storage.v1.StorageListFilesRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.storage.v1.StorageListFilesRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.storage.v1.StorageListFilesRequest} - */ -proto.nitric.storage.v1.StorageListFilesRequest.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.setBucketName(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setPrefix(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.storage.v1.StorageListFilesRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.storage.v1.StorageListFilesRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.storage.v1.StorageListFilesRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.storage.v1.StorageListFilesRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getBucketName(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getPrefix(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional string bucket_name = 1; - * @return {string} - */ -proto.nitric.storage.v1.StorageListFilesRequest.prototype.getBucketName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.storage.v1.StorageListFilesRequest} returns this - */ -proto.nitric.storage.v1.StorageListFilesRequest.prototype.setBucketName = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string prefix = 2; - * @return {string} - */ -proto.nitric.storage.v1.StorageListFilesRequest.prototype.getPrefix = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.storage.v1.StorageListFilesRequest} returns this - */ -proto.nitric.storage.v1.StorageListFilesRequest.prototype.setPrefix = 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.nitric.storage.v1.File.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.storage.v1.File.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.nitric.storage.v1.File} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.storage.v1.File.toObject = function(includeInstance, msg) { - var f, obj = { - key: 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.nitric.storage.v1.File} - */ -proto.nitric.storage.v1.File.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.storage.v1.File; - return proto.nitric.storage.v1.File.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.storage.v1.File} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.storage.v1.File} - */ -proto.nitric.storage.v1.File.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; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.storage.v1.File.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.storage.v1.File.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.storage.v1.File} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.storage.v1.File.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getKey(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string key = 1; - * @return {string} - */ -proto.nitric.storage.v1.File.prototype.getKey = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.storage.v1.File} returns this - */ -proto.nitric.storage.v1.File.prototype.setKey = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.nitric.storage.v1.StorageListFilesResponse.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.nitric.storage.v1.StorageListFilesResponse.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.storage.v1.StorageListFilesResponse.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.nitric.storage.v1.StorageListFilesResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.storage.v1.StorageListFilesResponse.toObject = function(includeInstance, msg) { - var f, obj = { - filesList: jspb.Message.toObjectList(msg.getFilesList(), - proto.nitric.storage.v1.File.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.nitric.storage.v1.StorageListFilesResponse} - */ -proto.nitric.storage.v1.StorageListFilesResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.storage.v1.StorageListFilesResponse; - return proto.nitric.storage.v1.StorageListFilesResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.storage.v1.StorageListFilesResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.storage.v1.StorageListFilesResponse} - */ -proto.nitric.storage.v1.StorageListFilesResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.nitric.storage.v1.File; - reader.readMessage(value,proto.nitric.storage.v1.File.deserializeBinaryFromReader); - msg.addFiles(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.storage.v1.StorageListFilesResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.storage.v1.StorageListFilesResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.storage.v1.StorageListFilesResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.storage.v1.StorageListFilesResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getFilesList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.nitric.storage.v1.File.serializeBinaryToWriter - ); - } -}; - - -/** - * repeated File files = 1; - * @return {!Array} - */ -proto.nitric.storage.v1.StorageListFilesResponse.prototype.getFilesList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.nitric.storage.v1.File, 1)); -}; - - -/** - * @param {!Array} value - * @return {!proto.nitric.storage.v1.StorageListFilesResponse} returns this -*/ -proto.nitric.storage.v1.StorageListFilesResponse.prototype.setFilesList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 1, value); -}; - - -/** - * @param {!proto.nitric.storage.v1.File=} opt_value - * @param {number=} opt_index - * @return {!proto.nitric.storage.v1.File} - */ -proto.nitric.storage.v1.StorageListFilesResponse.prototype.addFiles = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.nitric.storage.v1.File, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.nitric.storage.v1.StorageListFilesResponse} returns this - */ -proto.nitric.storage.v1.StorageListFilesResponse.prototype.clearFilesList = function() { - return this.setFilesList([]); -}; - - - - - -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.nitric.storage.v1.StorageExistsRequest.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.storage.v1.StorageExistsRequest.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.nitric.storage.v1.StorageExistsRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.storage.v1.StorageExistsRequest.toObject = function(includeInstance, msg) { - var f, obj = { - bucket: jspb.Message.getFieldWithDefault(msg, 1, ""), - key: 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.nitric.storage.v1.StorageExistsRequest} - */ -proto.nitric.storage.v1.StorageExistsRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.storage.v1.StorageExistsRequest; - return proto.nitric.storage.v1.StorageExistsRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.storage.v1.StorageExistsRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.storage.v1.StorageExistsRequest} - */ -proto.nitric.storage.v1.StorageExistsRequest.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.setBucket(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setKey(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.storage.v1.StorageExistsRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.storage.v1.StorageExistsRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.storage.v1.StorageExistsRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.storage.v1.StorageExistsRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getBucket(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getKey(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional string bucket = 1; - * @return {string} - */ -proto.nitric.storage.v1.StorageExistsRequest.prototype.getBucket = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.storage.v1.StorageExistsRequest} returns this - */ -proto.nitric.storage.v1.StorageExistsRequest.prototype.setBucket = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string key = 2; - * @return {string} - */ -proto.nitric.storage.v1.StorageExistsRequest.prototype.getKey = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.storage.v1.StorageExistsRequest} returns this - */ -proto.nitric.storage.v1.StorageExistsRequest.prototype.setKey = 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.nitric.storage.v1.StorageExistsResponse.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.storage.v1.StorageExistsResponse.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.nitric.storage.v1.StorageExistsResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.storage.v1.StorageExistsResponse.toObject = function(includeInstance, msg) { - var f, obj = { - exists: 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.nitric.storage.v1.StorageExistsResponse} - */ -proto.nitric.storage.v1.StorageExistsResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.storage.v1.StorageExistsResponse; - return proto.nitric.storage.v1.StorageExistsResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.storage.v1.StorageExistsResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.storage.v1.StorageExistsResponse} - */ -proto.nitric.storage.v1.StorageExistsResponse.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.setExists(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.storage.v1.StorageExistsResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.storage.v1.StorageExistsResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.storage.v1.StorageExistsResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.storage.v1.StorageExistsResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getExists(); - if (f) { - writer.writeBool( - 1, - f - ); - } -}; - - -/** - * optional bool exists = 1; - * @return {boolean} - */ -proto.nitric.storage.v1.StorageExistsResponse.prototype.getExists = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.nitric.storage.v1.StorageExistsResponse} returns this - */ -proto.nitric.storage.v1.StorageExistsResponse.prototype.setExists = function(value) { - return jspb.Message.setProto3BooleanField(this, 1, value); -}; - - -goog.object.extend(exports, proto.nitric.storage.v1); diff --git a/src/gen/proto/websocket/v1/websocket_grpc_pb.d.ts b/src/gen/proto/websocket/v1/websocket_grpc_pb.d.ts deleted file mode 100644 index bc1ca7cf..00000000 --- a/src/gen/proto/websocket/v1/websocket_grpc_pb.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -// GENERATED CODE -- DO NOT EDIT! - -// package: nitric.websocket.v1 -// file: proto/websocket/v1/websocket.proto - -import * as proto_websocket_v1_websocket_pb from "../../../proto/websocket/v1/websocket_pb"; -import * as grpc from "@grpc/grpc-js"; - -interface IWebsocketServiceService extends grpc.ServiceDefinition { - send: grpc.MethodDefinition; - close: grpc.MethodDefinition; -} - -export const WebsocketServiceService: IWebsocketServiceService; - -export interface IWebsocketServiceServer extends grpc.UntypedServiceImplementation { - send: grpc.handleUnaryCall; - close: grpc.handleUnaryCall; -} - -export class WebsocketServiceClient extends grpc.Client { - constructor(address: string, credentials: grpc.ChannelCredentials, options?: object); - send(argument: proto_websocket_v1_websocket_pb.WebsocketSendRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; - send(argument: proto_websocket_v1_websocket_pb.WebsocketSendRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - send(argument: proto_websocket_v1_websocket_pb.WebsocketSendRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - close(argument: proto_websocket_v1_websocket_pb.WebsocketCloseRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; - close(argument: proto_websocket_v1_websocket_pb.WebsocketCloseRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; - close(argument: proto_websocket_v1_websocket_pb.WebsocketCloseRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; -} diff --git a/src/gen/proto/websocket/v1/websocket_grpc_pb.js b/src/gen/proto/websocket/v1/websocket_grpc_pb.js deleted file mode 100644 index d0cd6611..00000000 --- a/src/gen/proto/websocket/v1/websocket_grpc_pb.js +++ /dev/null @@ -1,81 +0,0 @@ -// GENERATED CODE -- DO NOT EDIT! - -'use strict'; -var grpc = require('@grpc/grpc-js'); -var proto_websocket_v1_websocket_pb = require('../../../proto/websocket/v1/websocket_pb.js'); -var validate_validate_pb = require('../../../validate/validate_pb.js'); - -function serialize_nitric_websocket_v1_WebsocketCloseRequest(arg) { - if (!(arg instanceof proto_websocket_v1_websocket_pb.WebsocketCloseRequest)) { - throw new Error('Expected argument of type nitric.websocket.v1.WebsocketCloseRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_websocket_v1_WebsocketCloseRequest(buffer_arg) { - return proto_websocket_v1_websocket_pb.WebsocketCloseRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_websocket_v1_WebsocketCloseResponse(arg) { - if (!(arg instanceof proto_websocket_v1_websocket_pb.WebsocketCloseResponse)) { - throw new Error('Expected argument of type nitric.websocket.v1.WebsocketCloseResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_websocket_v1_WebsocketCloseResponse(buffer_arg) { - return proto_websocket_v1_websocket_pb.WebsocketCloseResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_websocket_v1_WebsocketSendRequest(arg) { - if (!(arg instanceof proto_websocket_v1_websocket_pb.WebsocketSendRequest)) { - throw new Error('Expected argument of type nitric.websocket.v1.WebsocketSendRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_websocket_v1_WebsocketSendRequest(buffer_arg) { - return proto_websocket_v1_websocket_pb.WebsocketSendRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_nitric_websocket_v1_WebsocketSendResponse(arg) { - if (!(arg instanceof proto_websocket_v1_websocket_pb.WebsocketSendResponse)) { - throw new Error('Expected argument of type nitric.websocket.v1.WebsocketSendResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_nitric_websocket_v1_WebsocketSendResponse(buffer_arg) { - return proto_websocket_v1_websocket_pb.WebsocketSendResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - - -var WebsocketServiceService = exports.WebsocketServiceService = { - // Send a messages to a websocket -send: { - path: '/nitric.websocket.v1.WebsocketService/Send', - requestStream: false, - responseStream: false, - requestType: proto_websocket_v1_websocket_pb.WebsocketSendRequest, - responseType: proto_websocket_v1_websocket_pb.WebsocketSendResponse, - requestSerialize: serialize_nitric_websocket_v1_WebsocketSendRequest, - requestDeserialize: deserialize_nitric_websocket_v1_WebsocketSendRequest, - responseSerialize: serialize_nitric_websocket_v1_WebsocketSendResponse, - responseDeserialize: deserialize_nitric_websocket_v1_WebsocketSendResponse, - }, - // Close a websocket connection -// This can be used to force a client to disconnect -close: { - path: '/nitric.websocket.v1.WebsocketService/Close', - requestStream: false, - responseStream: false, - requestType: proto_websocket_v1_websocket_pb.WebsocketCloseRequest, - responseType: proto_websocket_v1_websocket_pb.WebsocketCloseResponse, - requestSerialize: serialize_nitric_websocket_v1_WebsocketCloseRequest, - requestDeserialize: deserialize_nitric_websocket_v1_WebsocketCloseRequest, - responseSerialize: serialize_nitric_websocket_v1_WebsocketCloseResponse, - responseDeserialize: deserialize_nitric_websocket_v1_WebsocketCloseResponse, - }, -}; - -exports.WebsocketServiceClient = grpc.makeGenericClientConstructor(WebsocketServiceService); diff --git a/src/gen/proto/websocket/v1/websocket_pb.d.ts b/src/gen/proto/websocket/v1/websocket_pb.d.ts deleted file mode 100644 index 113af5ed..00000000 --- a/src/gen/proto/websocket/v1/websocket_pb.d.ts +++ /dev/null @@ -1,92 +0,0 @@ -// package: nitric.websocket.v1 -// file: proto/websocket/v1/websocket.proto - -import * as jspb from "google-protobuf"; -import * as validate_validate_pb from "../../../validate/validate_pb"; - -export class WebsocketSendRequest extends jspb.Message { - getSocket(): string; - setSocket(value: string): void; - - getConnectionId(): string; - setConnectionId(value: string): void; - - getData(): Uint8Array | string; - getData_asU8(): Uint8Array; - getData_asB64(): string; - setData(value: Uint8Array | string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): WebsocketSendRequest.AsObject; - static toObject(includeInstance: boolean, msg: WebsocketSendRequest): WebsocketSendRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: WebsocketSendRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): WebsocketSendRequest; - static deserializeBinaryFromReader(message: WebsocketSendRequest, reader: jspb.BinaryReader): WebsocketSendRequest; -} - -export namespace WebsocketSendRequest { - export type AsObject = { - socket: string, - connectionId: string, - data: Uint8Array | string, - } -} - -export class WebsocketSendResponse extends jspb.Message { - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): WebsocketSendResponse.AsObject; - static toObject(includeInstance: boolean, msg: WebsocketSendResponse): WebsocketSendResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: WebsocketSendResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): WebsocketSendResponse; - static deserializeBinaryFromReader(message: WebsocketSendResponse, reader: jspb.BinaryReader): WebsocketSendResponse; -} - -export namespace WebsocketSendResponse { - export type AsObject = { - } -} - -export class WebsocketCloseRequest extends jspb.Message { - getSocket(): string; - setSocket(value: string): void; - - getConnectionId(): string; - setConnectionId(value: string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): WebsocketCloseRequest.AsObject; - static toObject(includeInstance: boolean, msg: WebsocketCloseRequest): WebsocketCloseRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: WebsocketCloseRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): WebsocketCloseRequest; - static deserializeBinaryFromReader(message: WebsocketCloseRequest, reader: jspb.BinaryReader): WebsocketCloseRequest; -} - -export namespace WebsocketCloseRequest { - export type AsObject = { - socket: string, - connectionId: string, - } -} - -export class WebsocketCloseResponse extends jspb.Message { - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): WebsocketCloseResponse.AsObject; - static toObject(includeInstance: boolean, msg: WebsocketCloseResponse): WebsocketCloseResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: WebsocketCloseResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): WebsocketCloseResponse; - static deserializeBinaryFromReader(message: WebsocketCloseResponse, reader: jspb.BinaryReader): WebsocketCloseResponse; -} - -export namespace WebsocketCloseResponse { - export type AsObject = { - } -} - diff --git a/src/gen/proto/websocket/v1/websocket_pb.js b/src/gen/proto/websocket/v1/websocket_pb.js deleted file mode 100644 index 526cbfaf..00000000 --- a/src/gen/proto/websocket/v1/websocket_pb.js +++ /dev/null @@ -1,690 +0,0 @@ -// source: proto/websocket/v1/websocket.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() { - if (this) { return this; } - if (typeof window !== 'undefined') { return window; } - if (typeof global !== 'undefined') { return global; } - if (typeof self !== 'undefined') { return self; } - return Function('return this')(); -}.call(null)); - -var validate_validate_pb = require('../../../validate/validate_pb.js'); -goog.object.extend(proto, validate_validate_pb); -goog.exportSymbol('proto.nitric.websocket.v1.WebsocketCloseRequest', null, global); -goog.exportSymbol('proto.nitric.websocket.v1.WebsocketCloseResponse', null, global); -goog.exportSymbol('proto.nitric.websocket.v1.WebsocketSendRequest', null, global); -goog.exportSymbol('proto.nitric.websocket.v1.WebsocketSendResponse', 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.nitric.websocket.v1.WebsocketSendRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.websocket.v1.WebsocketSendRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.websocket.v1.WebsocketSendRequest.displayName = 'proto.nitric.websocket.v1.WebsocketSendRequest'; -} -/** - * 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.nitric.websocket.v1.WebsocketSendResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.websocket.v1.WebsocketSendResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.websocket.v1.WebsocketSendResponse.displayName = 'proto.nitric.websocket.v1.WebsocketSendResponse'; -} -/** - * 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.nitric.websocket.v1.WebsocketCloseRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.websocket.v1.WebsocketCloseRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.websocket.v1.WebsocketCloseRequest.displayName = 'proto.nitric.websocket.v1.WebsocketCloseRequest'; -} -/** - * 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.nitric.websocket.v1.WebsocketCloseResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.nitric.websocket.v1.WebsocketCloseResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.nitric.websocket.v1.WebsocketCloseResponse.displayName = 'proto.nitric.websocket.v1.WebsocketCloseResponse'; -} - - - -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.nitric.websocket.v1.WebsocketSendRequest.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.websocket.v1.WebsocketSendRequest.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.nitric.websocket.v1.WebsocketSendRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.websocket.v1.WebsocketSendRequest.toObject = function(includeInstance, msg) { - var f, obj = { - socket: jspb.Message.getFieldWithDefault(msg, 1, ""), - connectionId: jspb.Message.getFieldWithDefault(msg, 2, ""), - 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.nitric.websocket.v1.WebsocketSendRequest} - */ -proto.nitric.websocket.v1.WebsocketSendRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.websocket.v1.WebsocketSendRequest; - return proto.nitric.websocket.v1.WebsocketSendRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.websocket.v1.WebsocketSendRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.websocket.v1.WebsocketSendRequest} - */ -proto.nitric.websocket.v1.WebsocketSendRequest.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.setSocket(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setConnectionId(value); - break; - case 3: - 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.nitric.websocket.v1.WebsocketSendRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.websocket.v1.WebsocketSendRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.websocket.v1.WebsocketSendRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.websocket.v1.WebsocketSendRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getSocket(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getConnectionId(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getData_asU8(); - if (f.length > 0) { - writer.writeBytes( - 3, - f - ); - } -}; - - -/** - * optional string socket = 1; - * @return {string} - */ -proto.nitric.websocket.v1.WebsocketSendRequest.prototype.getSocket = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.websocket.v1.WebsocketSendRequest} returns this - */ -proto.nitric.websocket.v1.WebsocketSendRequest.prototype.setSocket = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string connection_id = 2; - * @return {string} - */ -proto.nitric.websocket.v1.WebsocketSendRequest.prototype.getConnectionId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.websocket.v1.WebsocketSendRequest} returns this - */ -proto.nitric.websocket.v1.WebsocketSendRequest.prototype.setConnectionId = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional bytes data = 3; - * @return {!(string|Uint8Array)} - */ -proto.nitric.websocket.v1.WebsocketSendRequest.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.nitric.websocket.v1.WebsocketSendRequest.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.nitric.websocket.v1.WebsocketSendRequest.prototype.getData_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getData())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.nitric.websocket.v1.WebsocketSendRequest} returns this - */ -proto.nitric.websocket.v1.WebsocketSendRequest.prototype.setData = function(value) { - return jspb.Message.setProto3BytesField(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.nitric.websocket.v1.WebsocketSendResponse.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.websocket.v1.WebsocketSendResponse.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.nitric.websocket.v1.WebsocketSendResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.websocket.v1.WebsocketSendResponse.toObject = function(includeInstance, msg) { - var f, obj = { - - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.websocket.v1.WebsocketSendResponse} - */ -proto.nitric.websocket.v1.WebsocketSendResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.websocket.v1.WebsocketSendResponse; - return proto.nitric.websocket.v1.WebsocketSendResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.websocket.v1.WebsocketSendResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.websocket.v1.WebsocketSendResponse} - */ -proto.nitric.websocket.v1.WebsocketSendResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.websocket.v1.WebsocketSendResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.websocket.v1.WebsocketSendResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.websocket.v1.WebsocketSendResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.websocket.v1.WebsocketSendResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; -}; - - - - - -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.nitric.websocket.v1.WebsocketCloseRequest.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.websocket.v1.WebsocketCloseRequest.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.nitric.websocket.v1.WebsocketCloseRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.websocket.v1.WebsocketCloseRequest.toObject = function(includeInstance, msg) { - var f, obj = { - socket: jspb.Message.getFieldWithDefault(msg, 1, ""), - connectionId: 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.nitric.websocket.v1.WebsocketCloseRequest} - */ -proto.nitric.websocket.v1.WebsocketCloseRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.websocket.v1.WebsocketCloseRequest; - return proto.nitric.websocket.v1.WebsocketCloseRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.websocket.v1.WebsocketCloseRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.websocket.v1.WebsocketCloseRequest} - */ -proto.nitric.websocket.v1.WebsocketCloseRequest.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.setSocket(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setConnectionId(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.websocket.v1.WebsocketCloseRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.websocket.v1.WebsocketCloseRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.websocket.v1.WebsocketCloseRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.websocket.v1.WebsocketCloseRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getSocket(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getConnectionId(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional string socket = 1; - * @return {string} - */ -proto.nitric.websocket.v1.WebsocketCloseRequest.prototype.getSocket = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.websocket.v1.WebsocketCloseRequest} returns this - */ -proto.nitric.websocket.v1.WebsocketCloseRequest.prototype.setSocket = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string connection_id = 2; - * @return {string} - */ -proto.nitric.websocket.v1.WebsocketCloseRequest.prototype.getConnectionId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.nitric.websocket.v1.WebsocketCloseRequest} returns this - */ -proto.nitric.websocket.v1.WebsocketCloseRequest.prototype.setConnectionId = 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.nitric.websocket.v1.WebsocketCloseResponse.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.websocket.v1.WebsocketCloseResponse.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.nitric.websocket.v1.WebsocketCloseResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.websocket.v1.WebsocketCloseResponse.toObject = function(includeInstance, msg) { - var f, obj = { - - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.websocket.v1.WebsocketCloseResponse} - */ -proto.nitric.websocket.v1.WebsocketCloseResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.websocket.v1.WebsocketCloseResponse; - return proto.nitric.websocket.v1.WebsocketCloseResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.nitric.websocket.v1.WebsocketCloseResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.websocket.v1.WebsocketCloseResponse} - */ -proto.nitric.websocket.v1.WebsocketCloseResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.nitric.websocket.v1.WebsocketCloseResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.websocket.v1.WebsocketCloseResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.nitric.websocket.v1.WebsocketCloseResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.nitric.websocket.v1.WebsocketCloseResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; -}; - - -goog.object.extend(exports, proto.nitric.websocket.v1); diff --git a/src/gen/validate/validate_grpc_pb.d.ts b/src/gen/validate/validate_grpc_pb.d.ts deleted file mode 100644 index 51b4d695..00000000 --- a/src/gen/validate/validate_grpc_pb.d.ts +++ /dev/null @@ -1 +0,0 @@ -// GENERATED CODE -- NO SERVICES IN PROTO diff --git a/src/gen/validate/validate_grpc_pb.js b/src/gen/validate/validate_grpc_pb.js deleted file mode 100644 index 97b3a246..00000000 --- a/src/gen/validate/validate_grpc_pb.js +++ /dev/null @@ -1 +0,0 @@ -// GENERATED CODE -- NO SERVICES IN PROTO \ No newline at end of file diff --git a/src/gen/validate/validate_pb.d.ts b/src/gen/validate/validate_pb.d.ts deleted file mode 100644 index c192a50a..00000000 --- a/src/gen/validate/validate_pb.d.ts +++ /dev/null @@ -1,1629 +0,0 @@ -// package: validate -// file: validate/validate.proto - -import * as jspb from "google-protobuf"; -import * as google_protobuf_descriptor_pb from "google-protobuf/google/protobuf/descriptor_pb"; -import * as google_protobuf_duration_pb from "google-protobuf/google/protobuf/duration_pb"; -import * as google_protobuf_timestamp_pb from "google-protobuf/google/protobuf/timestamp_pb"; - -export class FieldRules extends jspb.Message { - hasMessage(): boolean; - clearMessage(): void; - getMessage(): MessageRules | undefined; - setMessage(value?: MessageRules): void; - - hasFloat(): boolean; - clearFloat(): void; - getFloat(): FloatRules | undefined; - setFloat(value?: FloatRules): void; - - hasDouble(): boolean; - clearDouble(): void; - getDouble(): DoubleRules | undefined; - setDouble(value?: DoubleRules): void; - - hasInt32(): boolean; - clearInt32(): void; - getInt32(): Int32Rules | undefined; - setInt32(value?: Int32Rules): void; - - hasInt64(): boolean; - clearInt64(): void; - getInt64(): Int64Rules | undefined; - setInt64(value?: Int64Rules): void; - - hasUint32(): boolean; - clearUint32(): void; - getUint32(): UInt32Rules | undefined; - setUint32(value?: UInt32Rules): void; - - hasUint64(): boolean; - clearUint64(): void; - getUint64(): UInt64Rules | undefined; - setUint64(value?: UInt64Rules): void; - - hasSint32(): boolean; - clearSint32(): void; - getSint32(): SInt32Rules | undefined; - setSint32(value?: SInt32Rules): void; - - hasSint64(): boolean; - clearSint64(): void; - getSint64(): SInt64Rules | undefined; - setSint64(value?: SInt64Rules): void; - - hasFixed32(): boolean; - clearFixed32(): void; - getFixed32(): Fixed32Rules | undefined; - setFixed32(value?: Fixed32Rules): void; - - hasFixed64(): boolean; - clearFixed64(): void; - getFixed64(): Fixed64Rules | undefined; - setFixed64(value?: Fixed64Rules): void; - - hasSfixed32(): boolean; - clearSfixed32(): void; - getSfixed32(): SFixed32Rules | undefined; - setSfixed32(value?: SFixed32Rules): void; - - hasSfixed64(): boolean; - clearSfixed64(): void; - getSfixed64(): SFixed64Rules | undefined; - setSfixed64(value?: SFixed64Rules): void; - - hasBool(): boolean; - clearBool(): void; - getBool(): BoolRules | undefined; - setBool(value?: BoolRules): void; - - hasString(): boolean; - clearString(): void; - getString(): StringRules | undefined; - setString(value?: StringRules): void; - - hasBytes(): boolean; - clearBytes(): void; - getBytes(): BytesRules | undefined; - setBytes(value?: BytesRules): void; - - hasEnum(): boolean; - clearEnum(): void; - getEnum(): EnumRules | undefined; - setEnum(value?: EnumRules): void; - - hasRepeated(): boolean; - clearRepeated(): void; - getRepeated(): RepeatedRules | undefined; - setRepeated(value?: RepeatedRules): void; - - hasMap(): boolean; - clearMap(): void; - getMap(): MapRules | undefined; - setMap(value?: MapRules): void; - - hasAny(): boolean; - clearAny(): void; - getAny(): AnyRules | undefined; - setAny(value?: AnyRules): void; - - hasDuration(): boolean; - clearDuration(): void; - getDuration(): DurationRules | undefined; - setDuration(value?: DurationRules): void; - - hasTimestamp(): boolean; - clearTimestamp(): void; - getTimestamp(): TimestampRules | undefined; - setTimestamp(value?: TimestampRules): void; - - getTypeCase(): FieldRules.TypeCase; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): FieldRules.AsObject; - static toObject(includeInstance: boolean, msg: FieldRules): FieldRules.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: FieldRules, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): FieldRules; - static deserializeBinaryFromReader(message: FieldRules, reader: jspb.BinaryReader): FieldRules; -} - -export namespace FieldRules { - export type AsObject = { - message?: MessageRules.AsObject, - pb_float?: FloatRules.AsObject, - pb_double?: DoubleRules.AsObject, - int32?: Int32Rules.AsObject, - int64?: Int64Rules.AsObject, - uint32?: UInt32Rules.AsObject, - uint64?: UInt64Rules.AsObject, - sint32?: SInt32Rules.AsObject, - sint64?: SInt64Rules.AsObject, - fixed32?: Fixed32Rules.AsObject, - fixed64?: Fixed64Rules.AsObject, - sfixed32?: SFixed32Rules.AsObject, - sfixed64?: SFixed64Rules.AsObject, - bool?: BoolRules.AsObject, - string?: StringRules.AsObject, - bytes?: BytesRules.AsObject, - pb_enum?: EnumRules.AsObject, - repeated?: RepeatedRules.AsObject, - map?: MapRules.AsObject, - any?: AnyRules.AsObject, - duration?: DurationRules.AsObject, - timestamp?: TimestampRules.AsObject, - } - - export enum TypeCase { - TYPE_NOT_SET = 0, - FLOAT = 1, - DOUBLE = 2, - INT32 = 3, - INT64 = 4, - UINT32 = 5, - UINT64 = 6, - SINT32 = 7, - SINT64 = 8, - FIXED32 = 9, - FIXED64 = 10, - SFIXED32 = 11, - SFIXED64 = 12, - BOOL = 13, - STRING = 14, - BYTES = 15, - ENUM = 16, - REPEATED = 18, - MAP = 19, - ANY = 20, - DURATION = 21, - TIMESTAMP = 22, - } -} - -export class FloatRules extends jspb.Message { - hasConst(): boolean; - clearConst(): void; - getConst(): number | undefined; - setConst(value: number): void; - - hasLt(): boolean; - clearLt(): void; - getLt(): number | undefined; - setLt(value: number): void; - - hasLte(): boolean; - clearLte(): void; - getLte(): number | undefined; - setLte(value: number): void; - - hasGt(): boolean; - clearGt(): void; - getGt(): number | undefined; - setGt(value: number): void; - - hasGte(): boolean; - clearGte(): void; - getGte(): number | undefined; - setGte(value: number): void; - - clearInList(): void; - getInList(): Array; - setInList(value: Array): void; - addIn(value: number, index?: number): number; - - clearNotInList(): void; - getNotInList(): Array; - setNotInList(value: Array): void; - addNotIn(value: number, index?: number): number; - - hasIgnoreEmpty(): boolean; - clearIgnoreEmpty(): void; - getIgnoreEmpty(): boolean | undefined; - setIgnoreEmpty(value: boolean): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): FloatRules.AsObject; - static toObject(includeInstance: boolean, msg: FloatRules): FloatRules.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: FloatRules, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): FloatRules; - static deserializeBinaryFromReader(message: FloatRules, reader: jspb.BinaryReader): FloatRules; -} - -export namespace FloatRules { - export type AsObject = { - pb_const?: number, - lt?: number, - lte?: number, - gt?: number, - gte?: number, - inList: Array, - notInList: Array, - ignoreEmpty?: boolean, - } -} - -export class DoubleRules extends jspb.Message { - hasConst(): boolean; - clearConst(): void; - getConst(): number | undefined; - setConst(value: number): void; - - hasLt(): boolean; - clearLt(): void; - getLt(): number | undefined; - setLt(value: number): void; - - hasLte(): boolean; - clearLte(): void; - getLte(): number | undefined; - setLte(value: number): void; - - hasGt(): boolean; - clearGt(): void; - getGt(): number | undefined; - setGt(value: number): void; - - hasGte(): boolean; - clearGte(): void; - getGte(): number | undefined; - setGte(value: number): void; - - clearInList(): void; - getInList(): Array; - setInList(value: Array): void; - addIn(value: number, index?: number): number; - - clearNotInList(): void; - getNotInList(): Array; - setNotInList(value: Array): void; - addNotIn(value: number, index?: number): number; - - hasIgnoreEmpty(): boolean; - clearIgnoreEmpty(): void; - getIgnoreEmpty(): boolean | undefined; - setIgnoreEmpty(value: boolean): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): DoubleRules.AsObject; - static toObject(includeInstance: boolean, msg: DoubleRules): DoubleRules.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: DoubleRules, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): DoubleRules; - static deserializeBinaryFromReader(message: DoubleRules, reader: jspb.BinaryReader): DoubleRules; -} - -export namespace DoubleRules { - export type AsObject = { - pb_const?: number, - lt?: number, - lte?: number, - gt?: number, - gte?: number, - inList: Array, - notInList: Array, - ignoreEmpty?: boolean, - } -} - -export class Int32Rules extends jspb.Message { - hasConst(): boolean; - clearConst(): void; - getConst(): number | undefined; - setConst(value: number): void; - - hasLt(): boolean; - clearLt(): void; - getLt(): number | undefined; - setLt(value: number): void; - - hasLte(): boolean; - clearLte(): void; - getLte(): number | undefined; - setLte(value: number): void; - - hasGt(): boolean; - clearGt(): void; - getGt(): number | undefined; - setGt(value: number): void; - - hasGte(): boolean; - clearGte(): void; - getGte(): number | undefined; - setGte(value: number): void; - - clearInList(): void; - getInList(): Array; - setInList(value: Array): void; - addIn(value: number, index?: number): number; - - clearNotInList(): void; - getNotInList(): Array; - setNotInList(value: Array): void; - addNotIn(value: number, index?: number): number; - - hasIgnoreEmpty(): boolean; - clearIgnoreEmpty(): void; - getIgnoreEmpty(): boolean | undefined; - setIgnoreEmpty(value: boolean): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Int32Rules.AsObject; - static toObject(includeInstance: boolean, msg: Int32Rules): Int32Rules.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Int32Rules, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Int32Rules; - static deserializeBinaryFromReader(message: Int32Rules, reader: jspb.BinaryReader): Int32Rules; -} - -export namespace Int32Rules { - export type AsObject = { - pb_const?: number, - lt?: number, - lte?: number, - gt?: number, - gte?: number, - inList: Array, - notInList: Array, - ignoreEmpty?: boolean, - } -} - -export class Int64Rules extends jspb.Message { - hasConst(): boolean; - clearConst(): void; - getConst(): number | undefined; - setConst(value: number): void; - - hasLt(): boolean; - clearLt(): void; - getLt(): number | undefined; - setLt(value: number): void; - - hasLte(): boolean; - clearLte(): void; - getLte(): number | undefined; - setLte(value: number): void; - - hasGt(): boolean; - clearGt(): void; - getGt(): number | undefined; - setGt(value: number): void; - - hasGte(): boolean; - clearGte(): void; - getGte(): number | undefined; - setGte(value: number): void; - - clearInList(): void; - getInList(): Array; - setInList(value: Array): void; - addIn(value: number, index?: number): number; - - clearNotInList(): void; - getNotInList(): Array; - setNotInList(value: Array): void; - addNotIn(value: number, index?: number): number; - - hasIgnoreEmpty(): boolean; - clearIgnoreEmpty(): void; - getIgnoreEmpty(): boolean | undefined; - setIgnoreEmpty(value: boolean): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Int64Rules.AsObject; - static toObject(includeInstance: boolean, msg: Int64Rules): Int64Rules.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Int64Rules, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Int64Rules; - static deserializeBinaryFromReader(message: Int64Rules, reader: jspb.BinaryReader): Int64Rules; -} - -export namespace Int64Rules { - export type AsObject = { - pb_const?: number, - lt?: number, - lte?: number, - gt?: number, - gte?: number, - inList: Array, - notInList: Array, - ignoreEmpty?: boolean, - } -} - -export class UInt32Rules extends jspb.Message { - hasConst(): boolean; - clearConst(): void; - getConst(): number | undefined; - setConst(value: number): void; - - hasLt(): boolean; - clearLt(): void; - getLt(): number | undefined; - setLt(value: number): void; - - hasLte(): boolean; - clearLte(): void; - getLte(): number | undefined; - setLte(value: number): void; - - hasGt(): boolean; - clearGt(): void; - getGt(): number | undefined; - setGt(value: number): void; - - hasGte(): boolean; - clearGte(): void; - getGte(): number | undefined; - setGte(value: number): void; - - clearInList(): void; - getInList(): Array; - setInList(value: Array): void; - addIn(value: number, index?: number): number; - - clearNotInList(): void; - getNotInList(): Array; - setNotInList(value: Array): void; - addNotIn(value: number, index?: number): number; - - hasIgnoreEmpty(): boolean; - clearIgnoreEmpty(): void; - getIgnoreEmpty(): boolean | undefined; - setIgnoreEmpty(value: boolean): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): UInt32Rules.AsObject; - static toObject(includeInstance: boolean, msg: UInt32Rules): UInt32Rules.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: UInt32Rules, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): UInt32Rules; - static deserializeBinaryFromReader(message: UInt32Rules, reader: jspb.BinaryReader): UInt32Rules; -} - -export namespace UInt32Rules { - export type AsObject = { - pb_const?: number, - lt?: number, - lte?: number, - gt?: number, - gte?: number, - inList: Array, - notInList: Array, - ignoreEmpty?: boolean, - } -} - -export class UInt64Rules extends jspb.Message { - hasConst(): boolean; - clearConst(): void; - getConst(): number | undefined; - setConst(value: number): void; - - hasLt(): boolean; - clearLt(): void; - getLt(): number | undefined; - setLt(value: number): void; - - hasLte(): boolean; - clearLte(): void; - getLte(): number | undefined; - setLte(value: number): void; - - hasGt(): boolean; - clearGt(): void; - getGt(): number | undefined; - setGt(value: number): void; - - hasGte(): boolean; - clearGte(): void; - getGte(): number | undefined; - setGte(value: number): void; - - clearInList(): void; - getInList(): Array; - setInList(value: Array): void; - addIn(value: number, index?: number): number; - - clearNotInList(): void; - getNotInList(): Array; - setNotInList(value: Array): void; - addNotIn(value: number, index?: number): number; - - hasIgnoreEmpty(): boolean; - clearIgnoreEmpty(): void; - getIgnoreEmpty(): boolean | undefined; - setIgnoreEmpty(value: boolean): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): UInt64Rules.AsObject; - static toObject(includeInstance: boolean, msg: UInt64Rules): UInt64Rules.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: UInt64Rules, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): UInt64Rules; - static deserializeBinaryFromReader(message: UInt64Rules, reader: jspb.BinaryReader): UInt64Rules; -} - -export namespace UInt64Rules { - export type AsObject = { - pb_const?: number, - lt?: number, - lte?: number, - gt?: number, - gte?: number, - inList: Array, - notInList: Array, - ignoreEmpty?: boolean, - } -} - -export class SInt32Rules extends jspb.Message { - hasConst(): boolean; - clearConst(): void; - getConst(): number | undefined; - setConst(value: number): void; - - hasLt(): boolean; - clearLt(): void; - getLt(): number | undefined; - setLt(value: number): void; - - hasLte(): boolean; - clearLte(): void; - getLte(): number | undefined; - setLte(value: number): void; - - hasGt(): boolean; - clearGt(): void; - getGt(): number | undefined; - setGt(value: number): void; - - hasGte(): boolean; - clearGte(): void; - getGte(): number | undefined; - setGte(value: number): void; - - clearInList(): void; - getInList(): Array; - setInList(value: Array): void; - addIn(value: number, index?: number): number; - - clearNotInList(): void; - getNotInList(): Array; - setNotInList(value: Array): void; - addNotIn(value: number, index?: number): number; - - hasIgnoreEmpty(): boolean; - clearIgnoreEmpty(): void; - getIgnoreEmpty(): boolean | undefined; - setIgnoreEmpty(value: boolean): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): SInt32Rules.AsObject; - static toObject(includeInstance: boolean, msg: SInt32Rules): SInt32Rules.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: SInt32Rules, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): SInt32Rules; - static deserializeBinaryFromReader(message: SInt32Rules, reader: jspb.BinaryReader): SInt32Rules; -} - -export namespace SInt32Rules { - export type AsObject = { - pb_const?: number, - lt?: number, - lte?: number, - gt?: number, - gte?: number, - inList: Array, - notInList: Array, - ignoreEmpty?: boolean, - } -} - -export class SInt64Rules extends jspb.Message { - hasConst(): boolean; - clearConst(): void; - getConst(): number | undefined; - setConst(value: number): void; - - hasLt(): boolean; - clearLt(): void; - getLt(): number | undefined; - setLt(value: number): void; - - hasLte(): boolean; - clearLte(): void; - getLte(): number | undefined; - setLte(value: number): void; - - hasGt(): boolean; - clearGt(): void; - getGt(): number | undefined; - setGt(value: number): void; - - hasGte(): boolean; - clearGte(): void; - getGte(): number | undefined; - setGte(value: number): void; - - clearInList(): void; - getInList(): Array; - setInList(value: Array): void; - addIn(value: number, index?: number): number; - - clearNotInList(): void; - getNotInList(): Array; - setNotInList(value: Array): void; - addNotIn(value: number, index?: number): number; - - hasIgnoreEmpty(): boolean; - clearIgnoreEmpty(): void; - getIgnoreEmpty(): boolean | undefined; - setIgnoreEmpty(value: boolean): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): SInt64Rules.AsObject; - static toObject(includeInstance: boolean, msg: SInt64Rules): SInt64Rules.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: SInt64Rules, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): SInt64Rules; - static deserializeBinaryFromReader(message: SInt64Rules, reader: jspb.BinaryReader): SInt64Rules; -} - -export namespace SInt64Rules { - export type AsObject = { - pb_const?: number, - lt?: number, - lte?: number, - gt?: number, - gte?: number, - inList: Array, - notInList: Array, - ignoreEmpty?: boolean, - } -} - -export class Fixed32Rules extends jspb.Message { - hasConst(): boolean; - clearConst(): void; - getConst(): number | undefined; - setConst(value: number): void; - - hasLt(): boolean; - clearLt(): void; - getLt(): number | undefined; - setLt(value: number): void; - - hasLte(): boolean; - clearLte(): void; - getLte(): number | undefined; - setLte(value: number): void; - - hasGt(): boolean; - clearGt(): void; - getGt(): number | undefined; - setGt(value: number): void; - - hasGte(): boolean; - clearGte(): void; - getGte(): number | undefined; - setGte(value: number): void; - - clearInList(): void; - getInList(): Array; - setInList(value: Array): void; - addIn(value: number, index?: number): number; - - clearNotInList(): void; - getNotInList(): Array; - setNotInList(value: Array): void; - addNotIn(value: number, index?: number): number; - - hasIgnoreEmpty(): boolean; - clearIgnoreEmpty(): void; - getIgnoreEmpty(): boolean | undefined; - setIgnoreEmpty(value: boolean): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Fixed32Rules.AsObject; - static toObject(includeInstance: boolean, msg: Fixed32Rules): Fixed32Rules.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Fixed32Rules, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Fixed32Rules; - static deserializeBinaryFromReader(message: Fixed32Rules, reader: jspb.BinaryReader): Fixed32Rules; -} - -export namespace Fixed32Rules { - export type AsObject = { - pb_const?: number, - lt?: number, - lte?: number, - gt?: number, - gte?: number, - inList: Array, - notInList: Array, - ignoreEmpty?: boolean, - } -} - -export class Fixed64Rules extends jspb.Message { - hasConst(): boolean; - clearConst(): void; - getConst(): number | undefined; - setConst(value: number): void; - - hasLt(): boolean; - clearLt(): void; - getLt(): number | undefined; - setLt(value: number): void; - - hasLte(): boolean; - clearLte(): void; - getLte(): number | undefined; - setLte(value: number): void; - - hasGt(): boolean; - clearGt(): void; - getGt(): number | undefined; - setGt(value: number): void; - - hasGte(): boolean; - clearGte(): void; - getGte(): number | undefined; - setGte(value: number): void; - - clearInList(): void; - getInList(): Array; - setInList(value: Array): void; - addIn(value: number, index?: number): number; - - clearNotInList(): void; - getNotInList(): Array; - setNotInList(value: Array): void; - addNotIn(value: number, index?: number): number; - - hasIgnoreEmpty(): boolean; - clearIgnoreEmpty(): void; - getIgnoreEmpty(): boolean | undefined; - setIgnoreEmpty(value: boolean): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Fixed64Rules.AsObject; - static toObject(includeInstance: boolean, msg: Fixed64Rules): Fixed64Rules.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Fixed64Rules, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Fixed64Rules; - static deserializeBinaryFromReader(message: Fixed64Rules, reader: jspb.BinaryReader): Fixed64Rules; -} - -export namespace Fixed64Rules { - export type AsObject = { - pb_const?: number, - lt?: number, - lte?: number, - gt?: number, - gte?: number, - inList: Array, - notInList: Array, - ignoreEmpty?: boolean, - } -} - -export class SFixed32Rules extends jspb.Message { - hasConst(): boolean; - clearConst(): void; - getConst(): number | undefined; - setConst(value: number): void; - - hasLt(): boolean; - clearLt(): void; - getLt(): number | undefined; - setLt(value: number): void; - - hasLte(): boolean; - clearLte(): void; - getLte(): number | undefined; - setLte(value: number): void; - - hasGt(): boolean; - clearGt(): void; - getGt(): number | undefined; - setGt(value: number): void; - - hasGte(): boolean; - clearGte(): void; - getGte(): number | undefined; - setGte(value: number): void; - - clearInList(): void; - getInList(): Array; - setInList(value: Array): void; - addIn(value: number, index?: number): number; - - clearNotInList(): void; - getNotInList(): Array; - setNotInList(value: Array): void; - addNotIn(value: number, index?: number): number; - - hasIgnoreEmpty(): boolean; - clearIgnoreEmpty(): void; - getIgnoreEmpty(): boolean | undefined; - setIgnoreEmpty(value: boolean): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): SFixed32Rules.AsObject; - static toObject(includeInstance: boolean, msg: SFixed32Rules): SFixed32Rules.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: SFixed32Rules, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): SFixed32Rules; - static deserializeBinaryFromReader(message: SFixed32Rules, reader: jspb.BinaryReader): SFixed32Rules; -} - -export namespace SFixed32Rules { - export type AsObject = { - pb_const?: number, - lt?: number, - lte?: number, - gt?: number, - gte?: number, - inList: Array, - notInList: Array, - ignoreEmpty?: boolean, - } -} - -export class SFixed64Rules extends jspb.Message { - hasConst(): boolean; - clearConst(): void; - getConst(): number | undefined; - setConst(value: number): void; - - hasLt(): boolean; - clearLt(): void; - getLt(): number | undefined; - setLt(value: number): void; - - hasLte(): boolean; - clearLte(): void; - getLte(): number | undefined; - setLte(value: number): void; - - hasGt(): boolean; - clearGt(): void; - getGt(): number | undefined; - setGt(value: number): void; - - hasGte(): boolean; - clearGte(): void; - getGte(): number | undefined; - setGte(value: number): void; - - clearInList(): void; - getInList(): Array; - setInList(value: Array): void; - addIn(value: number, index?: number): number; - - clearNotInList(): void; - getNotInList(): Array; - setNotInList(value: Array): void; - addNotIn(value: number, index?: number): number; - - hasIgnoreEmpty(): boolean; - clearIgnoreEmpty(): void; - getIgnoreEmpty(): boolean | undefined; - setIgnoreEmpty(value: boolean): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): SFixed64Rules.AsObject; - static toObject(includeInstance: boolean, msg: SFixed64Rules): SFixed64Rules.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: SFixed64Rules, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): SFixed64Rules; - static deserializeBinaryFromReader(message: SFixed64Rules, reader: jspb.BinaryReader): SFixed64Rules; -} - -export namespace SFixed64Rules { - export type AsObject = { - pb_const?: number, - lt?: number, - lte?: number, - gt?: number, - gte?: number, - inList: Array, - notInList: Array, - ignoreEmpty?: boolean, - } -} - -export class BoolRules extends jspb.Message { - hasConst(): boolean; - clearConst(): void; - getConst(): boolean | undefined; - setConst(value: boolean): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): BoolRules.AsObject; - static toObject(includeInstance: boolean, msg: BoolRules): BoolRules.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: BoolRules, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): BoolRules; - static deserializeBinaryFromReader(message: BoolRules, reader: jspb.BinaryReader): BoolRules; -} - -export namespace BoolRules { - export type AsObject = { - pb_const?: boolean, - } -} - -export class StringRules extends jspb.Message { - hasConst(): boolean; - clearConst(): void; - getConst(): string | undefined; - setConst(value: string): void; - - hasLen(): boolean; - clearLen(): void; - getLen(): number | undefined; - setLen(value: number): void; - - hasMinLen(): boolean; - clearMinLen(): void; - getMinLen(): number | undefined; - setMinLen(value: number): void; - - hasMaxLen(): boolean; - clearMaxLen(): void; - getMaxLen(): number | undefined; - setMaxLen(value: number): void; - - hasLenBytes(): boolean; - clearLenBytes(): void; - getLenBytes(): number | undefined; - setLenBytes(value: number): void; - - hasMinBytes(): boolean; - clearMinBytes(): void; - getMinBytes(): number | undefined; - setMinBytes(value: number): void; - - hasMaxBytes(): boolean; - clearMaxBytes(): void; - getMaxBytes(): number | undefined; - setMaxBytes(value: number): void; - - hasPattern(): boolean; - clearPattern(): void; - getPattern(): string | undefined; - setPattern(value: string): void; - - hasPrefix(): boolean; - clearPrefix(): void; - getPrefix(): string | undefined; - setPrefix(value: string): void; - - hasSuffix(): boolean; - clearSuffix(): void; - getSuffix(): string | undefined; - setSuffix(value: string): void; - - hasContains(): boolean; - clearContains(): void; - getContains(): string | undefined; - setContains(value: string): void; - - hasNotContains(): boolean; - clearNotContains(): void; - getNotContains(): string | undefined; - setNotContains(value: string): void; - - clearInList(): void; - getInList(): Array; - setInList(value: Array): void; - addIn(value: string, index?: number): string; - - clearNotInList(): void; - getNotInList(): Array; - setNotInList(value: Array): void; - addNotIn(value: string, index?: number): string; - - hasEmail(): boolean; - clearEmail(): void; - getEmail(): boolean | undefined; - setEmail(value: boolean): void; - - hasHostname(): boolean; - clearHostname(): void; - getHostname(): boolean | undefined; - setHostname(value: boolean): void; - - hasIp(): boolean; - clearIp(): void; - getIp(): boolean | undefined; - setIp(value: boolean): void; - - hasIpv4(): boolean; - clearIpv4(): void; - getIpv4(): boolean | undefined; - setIpv4(value: boolean): void; - - hasIpv6(): boolean; - clearIpv6(): void; - getIpv6(): boolean | undefined; - setIpv6(value: boolean): void; - - hasUri(): boolean; - clearUri(): void; - getUri(): boolean | undefined; - setUri(value: boolean): void; - - hasUriRef(): boolean; - clearUriRef(): void; - getUriRef(): boolean | undefined; - setUriRef(value: boolean): void; - - hasAddress(): boolean; - clearAddress(): void; - getAddress(): boolean | undefined; - setAddress(value: boolean): void; - - hasUuid(): boolean; - clearUuid(): void; - getUuid(): boolean | undefined; - setUuid(value: boolean): void; - - hasWellKnownRegex(): boolean; - clearWellKnownRegex(): void; - getWellKnownRegex(): KnownRegexMap[keyof KnownRegexMap] | undefined; - setWellKnownRegex(value: KnownRegexMap[keyof KnownRegexMap]): void; - - hasStrict(): boolean; - clearStrict(): void; - getStrict(): boolean | undefined; - setStrict(value: boolean): void; - - hasIgnoreEmpty(): boolean; - clearIgnoreEmpty(): void; - getIgnoreEmpty(): boolean | undefined; - setIgnoreEmpty(value: boolean): void; - - getWellKnownCase(): StringRules.WellKnownCase; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): StringRules.AsObject; - static toObject(includeInstance: boolean, msg: StringRules): StringRules.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: StringRules, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): StringRules; - static deserializeBinaryFromReader(message: StringRules, reader: jspb.BinaryReader): StringRules; -} - -export namespace StringRules { - export type AsObject = { - pb_const?: string, - len?: number, - minLen?: number, - maxLen?: number, - lenBytes?: number, - minBytes?: number, - maxBytes?: number, - pattern?: string, - prefix?: string, - suffix?: string, - contains?: string, - notContains?: string, - inList: Array, - notInList: Array, - email?: boolean, - hostname?: boolean, - ip?: boolean, - ipv4?: boolean, - ipv6?: boolean, - uri?: boolean, - uriRef?: boolean, - address?: boolean, - uuid?: boolean, - wellKnownRegex?: KnownRegexMap[keyof KnownRegexMap], - strict?: boolean, - ignoreEmpty?: boolean, - } - - export enum WellKnownCase { - WELL_KNOWN_NOT_SET = 0, - EMAIL = 12, - HOSTNAME = 13, - IP = 14, - IPV4 = 15, - IPV6 = 16, - URI = 17, - URI_REF = 18, - ADDRESS = 21, - UUID = 22, - WELL_KNOWN_REGEX = 24, - } -} - -export class BytesRules extends jspb.Message { - hasConst(): boolean; - clearConst(): void; - getConst(): Uint8Array | string; - getConst_asU8(): Uint8Array; - getConst_asB64(): string; - setConst(value: Uint8Array | string): void; - - hasLen(): boolean; - clearLen(): void; - getLen(): number | undefined; - setLen(value: number): void; - - hasMinLen(): boolean; - clearMinLen(): void; - getMinLen(): number | undefined; - setMinLen(value: number): void; - - hasMaxLen(): boolean; - clearMaxLen(): void; - getMaxLen(): number | undefined; - setMaxLen(value: number): void; - - hasPattern(): boolean; - clearPattern(): void; - getPattern(): string | undefined; - setPattern(value: string): void; - - hasPrefix(): boolean; - clearPrefix(): void; - getPrefix(): Uint8Array | string; - getPrefix_asU8(): Uint8Array; - getPrefix_asB64(): string; - setPrefix(value: Uint8Array | string): void; - - hasSuffix(): boolean; - clearSuffix(): void; - getSuffix(): Uint8Array | string; - getSuffix_asU8(): Uint8Array; - getSuffix_asB64(): string; - setSuffix(value: Uint8Array | string): void; - - hasContains(): boolean; - clearContains(): void; - getContains(): Uint8Array | string; - getContains_asU8(): Uint8Array; - getContains_asB64(): string; - setContains(value: Uint8Array | string): void; - - clearInList(): void; - getInList(): Array; - getInList_asU8(): Array; - getInList_asB64(): Array; - setInList(value: Array): void; - addIn(value: Uint8Array | string, index?: number): Uint8Array | string; - - clearNotInList(): void; - getNotInList(): Array; - getNotInList_asU8(): Array; - getNotInList_asB64(): Array; - setNotInList(value: Array): void; - addNotIn(value: Uint8Array | string, index?: number): Uint8Array | string; - - hasIp(): boolean; - clearIp(): void; - getIp(): boolean | undefined; - setIp(value: boolean): void; - - hasIpv4(): boolean; - clearIpv4(): void; - getIpv4(): boolean | undefined; - setIpv4(value: boolean): void; - - hasIpv6(): boolean; - clearIpv6(): void; - getIpv6(): boolean | undefined; - setIpv6(value: boolean): void; - - hasIgnoreEmpty(): boolean; - clearIgnoreEmpty(): void; - getIgnoreEmpty(): boolean | undefined; - setIgnoreEmpty(value: boolean): void; - - getWellKnownCase(): BytesRules.WellKnownCase; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): BytesRules.AsObject; - static toObject(includeInstance: boolean, msg: BytesRules): BytesRules.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: BytesRules, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): BytesRules; - static deserializeBinaryFromReader(message: BytesRules, reader: jspb.BinaryReader): BytesRules; -} - -export namespace BytesRules { - export type AsObject = { - const: Uint8Array | string, - len?: number, - minLen?: number, - maxLen?: number, - pattern?: string, - prefix: Uint8Array | string, - suffix: Uint8Array | string, - contains: Uint8Array | string, - inList: Array, - notInList: Array, - ip?: boolean, - ipv4?: boolean, - ipv6?: boolean, - ignoreEmpty?: boolean, - } - - export enum WellKnownCase { - WELL_KNOWN_NOT_SET = 0, - IP = 10, - IPV4 = 11, - IPV6 = 12, - } -} - -export class EnumRules extends jspb.Message { - hasConst(): boolean; - clearConst(): void; - getConst(): number | undefined; - setConst(value: number): void; - - hasDefinedOnly(): boolean; - clearDefinedOnly(): void; - getDefinedOnly(): boolean | undefined; - setDefinedOnly(value: boolean): void; - - clearInList(): void; - getInList(): Array; - setInList(value: Array): void; - addIn(value: number, index?: number): number; - - clearNotInList(): void; - getNotInList(): Array; - setNotInList(value: Array): void; - addNotIn(value: number, index?: number): number; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): EnumRules.AsObject; - static toObject(includeInstance: boolean, msg: EnumRules): EnumRules.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: EnumRules, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): EnumRules; - static deserializeBinaryFromReader(message: EnumRules, reader: jspb.BinaryReader): EnumRules; -} - -export namespace EnumRules { - export type AsObject = { - pb_const?: number, - definedOnly?: boolean, - inList: Array, - notInList: Array, - } -} - -export class MessageRules extends jspb.Message { - hasSkip(): boolean; - clearSkip(): void; - getSkip(): boolean | undefined; - setSkip(value: boolean): void; - - hasRequired(): boolean; - clearRequired(): void; - getRequired(): boolean | undefined; - setRequired(value: boolean): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): MessageRules.AsObject; - static toObject(includeInstance: boolean, msg: MessageRules): MessageRules.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: MessageRules, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): MessageRules; - static deserializeBinaryFromReader(message: MessageRules, reader: jspb.BinaryReader): MessageRules; -} - -export namespace MessageRules { - export type AsObject = { - skip?: boolean, - required?: boolean, - } -} - -export class RepeatedRules extends jspb.Message { - hasMinItems(): boolean; - clearMinItems(): void; - getMinItems(): number | undefined; - setMinItems(value: number): void; - - hasMaxItems(): boolean; - clearMaxItems(): void; - getMaxItems(): number | undefined; - setMaxItems(value: number): void; - - hasUnique(): boolean; - clearUnique(): void; - getUnique(): boolean | undefined; - setUnique(value: boolean): void; - - hasItems(): boolean; - clearItems(): void; - getItems(): FieldRules | undefined; - setItems(value?: FieldRules): void; - - hasIgnoreEmpty(): boolean; - clearIgnoreEmpty(): void; - getIgnoreEmpty(): boolean | undefined; - setIgnoreEmpty(value: boolean): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): RepeatedRules.AsObject; - static toObject(includeInstance: boolean, msg: RepeatedRules): RepeatedRules.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: RepeatedRules, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): RepeatedRules; - static deserializeBinaryFromReader(message: RepeatedRules, reader: jspb.BinaryReader): RepeatedRules; -} - -export namespace RepeatedRules { - export type AsObject = { - minItems?: number, - maxItems?: number, - unique?: boolean, - items?: FieldRules.AsObject, - ignoreEmpty?: boolean, - } -} - -export class MapRules extends jspb.Message { - hasMinPairs(): boolean; - clearMinPairs(): void; - getMinPairs(): number | undefined; - setMinPairs(value: number): void; - - hasMaxPairs(): boolean; - clearMaxPairs(): void; - getMaxPairs(): number | undefined; - setMaxPairs(value: number): void; - - hasNoSparse(): boolean; - clearNoSparse(): void; - getNoSparse(): boolean | undefined; - setNoSparse(value: boolean): void; - - hasKeys(): boolean; - clearKeys(): void; - getKeys(): FieldRules | undefined; - setKeys(value?: FieldRules): void; - - hasValues(): boolean; - clearValues(): void; - getValues(): FieldRules | undefined; - setValues(value?: FieldRules): void; - - hasIgnoreEmpty(): boolean; - clearIgnoreEmpty(): void; - getIgnoreEmpty(): boolean | undefined; - setIgnoreEmpty(value: boolean): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): MapRules.AsObject; - static toObject(includeInstance: boolean, msg: MapRules): MapRules.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: MapRules, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): MapRules; - static deserializeBinaryFromReader(message: MapRules, reader: jspb.BinaryReader): MapRules; -} - -export namespace MapRules { - export type AsObject = { - minPairs?: number, - maxPairs?: number, - noSparse?: boolean, - keys?: FieldRules.AsObject, - values?: FieldRules.AsObject, - ignoreEmpty?: boolean, - } -} - -export class AnyRules extends jspb.Message { - hasRequired(): boolean; - clearRequired(): void; - getRequired(): boolean | undefined; - setRequired(value: boolean): void; - - clearInList(): void; - getInList(): Array; - setInList(value: Array): void; - addIn(value: string, index?: number): string; - - clearNotInList(): void; - getNotInList(): Array; - setNotInList(value: Array): void; - addNotIn(value: string, index?: number): string; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): AnyRules.AsObject; - static toObject(includeInstance: boolean, msg: AnyRules): AnyRules.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: AnyRules, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): AnyRules; - static deserializeBinaryFromReader(message: AnyRules, reader: jspb.BinaryReader): AnyRules; -} - -export namespace AnyRules { - export type AsObject = { - required?: boolean, - inList: Array, - notInList: Array, - } -} - -export class DurationRules extends jspb.Message { - hasRequired(): boolean; - clearRequired(): void; - getRequired(): boolean | undefined; - setRequired(value: boolean): void; - - hasConst(): boolean; - clearConst(): void; - getConst(): google_protobuf_duration_pb.Duration | undefined; - setConst(value?: google_protobuf_duration_pb.Duration): void; - - hasLt(): boolean; - clearLt(): void; - getLt(): google_protobuf_duration_pb.Duration | undefined; - setLt(value?: google_protobuf_duration_pb.Duration): void; - - hasLte(): boolean; - clearLte(): void; - getLte(): google_protobuf_duration_pb.Duration | undefined; - setLte(value?: google_protobuf_duration_pb.Duration): void; - - hasGt(): boolean; - clearGt(): void; - getGt(): google_protobuf_duration_pb.Duration | undefined; - setGt(value?: google_protobuf_duration_pb.Duration): void; - - hasGte(): boolean; - clearGte(): void; - getGte(): google_protobuf_duration_pb.Duration | undefined; - setGte(value?: google_protobuf_duration_pb.Duration): void; - - clearInList(): void; - getInList(): Array; - setInList(value: Array): void; - addIn(value?: google_protobuf_duration_pb.Duration, index?: number): google_protobuf_duration_pb.Duration; - - clearNotInList(): void; - getNotInList(): Array; - setNotInList(value: Array): void; - addNotIn(value?: google_protobuf_duration_pb.Duration, index?: number): google_protobuf_duration_pb.Duration; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): DurationRules.AsObject; - static toObject(includeInstance: boolean, msg: DurationRules): DurationRules.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: DurationRules, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): DurationRules; - static deserializeBinaryFromReader(message: DurationRules, reader: jspb.BinaryReader): DurationRules; -} - -export namespace DurationRules { - export type AsObject = { - required?: boolean, - pb_const?: google_protobuf_duration_pb.Duration.AsObject, - lt?: google_protobuf_duration_pb.Duration.AsObject, - lte?: google_protobuf_duration_pb.Duration.AsObject, - gt?: google_protobuf_duration_pb.Duration.AsObject, - gte?: google_protobuf_duration_pb.Duration.AsObject, - inList: Array, - notInList: Array, - } -} - -export class TimestampRules extends jspb.Message { - hasRequired(): boolean; - clearRequired(): void; - getRequired(): boolean | undefined; - setRequired(value: boolean): void; - - hasConst(): boolean; - clearConst(): void; - getConst(): google_protobuf_timestamp_pb.Timestamp | undefined; - setConst(value?: google_protobuf_timestamp_pb.Timestamp): void; - - hasLt(): boolean; - clearLt(): void; - getLt(): google_protobuf_timestamp_pb.Timestamp | undefined; - setLt(value?: google_protobuf_timestamp_pb.Timestamp): void; - - hasLte(): boolean; - clearLte(): void; - getLte(): google_protobuf_timestamp_pb.Timestamp | undefined; - setLte(value?: google_protobuf_timestamp_pb.Timestamp): void; - - hasGt(): boolean; - clearGt(): void; - getGt(): google_protobuf_timestamp_pb.Timestamp | undefined; - setGt(value?: google_protobuf_timestamp_pb.Timestamp): void; - - hasGte(): boolean; - clearGte(): void; - getGte(): google_protobuf_timestamp_pb.Timestamp | undefined; - setGte(value?: google_protobuf_timestamp_pb.Timestamp): void; - - hasLtNow(): boolean; - clearLtNow(): void; - getLtNow(): boolean | undefined; - setLtNow(value: boolean): void; - - hasGtNow(): boolean; - clearGtNow(): void; - getGtNow(): boolean | undefined; - setGtNow(value: boolean): void; - - hasWithin(): boolean; - clearWithin(): void; - getWithin(): google_protobuf_duration_pb.Duration | undefined; - setWithin(value?: google_protobuf_duration_pb.Duration): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): TimestampRules.AsObject; - static toObject(includeInstance: boolean, msg: TimestampRules): TimestampRules.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: TimestampRules, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): TimestampRules; - static deserializeBinaryFromReader(message: TimestampRules, reader: jspb.BinaryReader): TimestampRules; -} - -export namespace TimestampRules { - export type AsObject = { - required?: boolean, - pb_const?: google_protobuf_timestamp_pb.Timestamp.AsObject, - lt?: google_protobuf_timestamp_pb.Timestamp.AsObject, - lte?: google_protobuf_timestamp_pb.Timestamp.AsObject, - gt?: google_protobuf_timestamp_pb.Timestamp.AsObject, - gte?: google_protobuf_timestamp_pb.Timestamp.AsObject, - ltNow?: boolean, - gtNow?: boolean, - within?: google_protobuf_duration_pb.Duration.AsObject, - } -} - - export const disabled: jspb.ExtensionFieldInfo; - - export const ignored: jspb.ExtensionFieldInfo; - - export const required: jspb.ExtensionFieldInfo; - - export const rules: jspb.ExtensionFieldInfo; - -export interface KnownRegexMap { - UNKNOWN: 0; - HTTP_HEADER_NAME: 1; - HTTP_HEADER_VALUE: 2; -} - -export const KnownRegex: KnownRegexMap; - diff --git a/src/gen/validate/validate_pb.js b/src/gen/validate/validate_pb.js deleted file mode 100644 index 8baa65f9..00000000 --- a/src/gen/validate/validate_pb.js +++ /dev/null @@ -1,12932 +0,0 @@ -// source: validate/validate.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() { - if (this) { return this; } - if (typeof window !== 'undefined') { return window; } - if (typeof global !== 'undefined') { return global; } - if (typeof self !== 'undefined') { return self; } - return Function('return this')(); -}.call(null)); - -var google_protobuf_descriptor_pb = require('google-protobuf/google/protobuf/descriptor_pb.js'); -goog.object.extend(proto, google_protobuf_descriptor_pb); -var google_protobuf_duration_pb = require('google-protobuf/google/protobuf/duration_pb.js'); -goog.object.extend(proto, google_protobuf_duration_pb); -var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js'); -goog.object.extend(proto, google_protobuf_timestamp_pb); -goog.exportSymbol('proto.validate.AnyRules', null, global); -goog.exportSymbol('proto.validate.BoolRules', null, global); -goog.exportSymbol('proto.validate.BytesRules', null, global); -goog.exportSymbol('proto.validate.BytesRules.WellKnownCase', null, global); -goog.exportSymbol('proto.validate.DoubleRules', null, global); -goog.exportSymbol('proto.validate.DurationRules', null, global); -goog.exportSymbol('proto.validate.EnumRules', null, global); -goog.exportSymbol('proto.validate.FieldRules', null, global); -goog.exportSymbol('proto.validate.FieldRules.TypeCase', null, global); -goog.exportSymbol('proto.validate.Fixed32Rules', null, global); -goog.exportSymbol('proto.validate.Fixed64Rules', null, global); -goog.exportSymbol('proto.validate.FloatRules', null, global); -goog.exportSymbol('proto.validate.Int32Rules', null, global); -goog.exportSymbol('proto.validate.Int64Rules', null, global); -goog.exportSymbol('proto.validate.KnownRegex', null, global); -goog.exportSymbol('proto.validate.MapRules', null, global); -goog.exportSymbol('proto.validate.MessageRules', null, global); -goog.exportSymbol('proto.validate.RepeatedRules', null, global); -goog.exportSymbol('proto.validate.SFixed32Rules', null, global); -goog.exportSymbol('proto.validate.SFixed64Rules', null, global); -goog.exportSymbol('proto.validate.SInt32Rules', null, global); -goog.exportSymbol('proto.validate.SInt64Rules', null, global); -goog.exportSymbol('proto.validate.StringRules', null, global); -goog.exportSymbol('proto.validate.StringRules.WellKnownCase', null, global); -goog.exportSymbol('proto.validate.TimestampRules', null, global); -goog.exportSymbol('proto.validate.UInt32Rules', null, global); -goog.exportSymbol('proto.validate.UInt64Rules', null, global); -goog.exportSymbol('proto.validate.disabled', null, global); -goog.exportSymbol('proto.validate.ignored', null, global); -goog.exportSymbol('proto.validate.required', null, global); -goog.exportSymbol('proto.validate.rules', 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.validate.FieldRules = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.validate.FieldRules.oneofGroups_); -}; -goog.inherits(proto.validate.FieldRules, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.validate.FieldRules.displayName = 'proto.validate.FieldRules'; -} -/** - * 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.validate.FloatRules = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.validate.FloatRules.repeatedFields_, null); -}; -goog.inherits(proto.validate.FloatRules, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.validate.FloatRules.displayName = 'proto.validate.FloatRules'; -} -/** - * 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.validate.DoubleRules = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.validate.DoubleRules.repeatedFields_, null); -}; -goog.inherits(proto.validate.DoubleRules, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.validate.DoubleRules.displayName = 'proto.validate.DoubleRules'; -} -/** - * 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.validate.Int32Rules = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.validate.Int32Rules.repeatedFields_, null); -}; -goog.inherits(proto.validate.Int32Rules, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.validate.Int32Rules.displayName = 'proto.validate.Int32Rules'; -} -/** - * 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.validate.Int64Rules = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.validate.Int64Rules.repeatedFields_, null); -}; -goog.inherits(proto.validate.Int64Rules, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.validate.Int64Rules.displayName = 'proto.validate.Int64Rules'; -} -/** - * 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.validate.UInt32Rules = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.validate.UInt32Rules.repeatedFields_, null); -}; -goog.inherits(proto.validate.UInt32Rules, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.validate.UInt32Rules.displayName = 'proto.validate.UInt32Rules'; -} -/** - * 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.validate.UInt64Rules = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.validate.UInt64Rules.repeatedFields_, null); -}; -goog.inherits(proto.validate.UInt64Rules, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.validate.UInt64Rules.displayName = 'proto.validate.UInt64Rules'; -} -/** - * 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.validate.SInt32Rules = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.validate.SInt32Rules.repeatedFields_, null); -}; -goog.inherits(proto.validate.SInt32Rules, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.validate.SInt32Rules.displayName = 'proto.validate.SInt32Rules'; -} -/** - * 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.validate.SInt64Rules = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.validate.SInt64Rules.repeatedFields_, null); -}; -goog.inherits(proto.validate.SInt64Rules, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.validate.SInt64Rules.displayName = 'proto.validate.SInt64Rules'; -} -/** - * 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.validate.Fixed32Rules = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.validate.Fixed32Rules.repeatedFields_, null); -}; -goog.inherits(proto.validate.Fixed32Rules, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.validate.Fixed32Rules.displayName = 'proto.validate.Fixed32Rules'; -} -/** - * 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.validate.Fixed64Rules = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.validate.Fixed64Rules.repeatedFields_, null); -}; -goog.inherits(proto.validate.Fixed64Rules, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.validate.Fixed64Rules.displayName = 'proto.validate.Fixed64Rules'; -} -/** - * 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.validate.SFixed32Rules = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.validate.SFixed32Rules.repeatedFields_, null); -}; -goog.inherits(proto.validate.SFixed32Rules, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.validate.SFixed32Rules.displayName = 'proto.validate.SFixed32Rules'; -} -/** - * 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.validate.SFixed64Rules = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.validate.SFixed64Rules.repeatedFields_, null); -}; -goog.inherits(proto.validate.SFixed64Rules, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.validate.SFixed64Rules.displayName = 'proto.validate.SFixed64Rules'; -} -/** - * 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.validate.BoolRules = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.validate.BoolRules, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.validate.BoolRules.displayName = 'proto.validate.BoolRules'; -} -/** - * 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.validate.StringRules = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.validate.StringRules.repeatedFields_, proto.validate.StringRules.oneofGroups_); -}; -goog.inherits(proto.validate.StringRules, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.validate.StringRules.displayName = 'proto.validate.StringRules'; -} -/** - * 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.validate.BytesRules = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.validate.BytesRules.repeatedFields_, proto.validate.BytesRules.oneofGroups_); -}; -goog.inherits(proto.validate.BytesRules, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.validate.BytesRules.displayName = 'proto.validate.BytesRules'; -} -/** - * 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.validate.EnumRules = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.validate.EnumRules.repeatedFields_, null); -}; -goog.inherits(proto.validate.EnumRules, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.validate.EnumRules.displayName = 'proto.validate.EnumRules'; -} -/** - * 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.validate.MessageRules = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.validate.MessageRules, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.validate.MessageRules.displayName = 'proto.validate.MessageRules'; -} -/** - * 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.validate.RepeatedRules = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.validate.RepeatedRules, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.validate.RepeatedRules.displayName = 'proto.validate.RepeatedRules'; -} -/** - * 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.validate.MapRules = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.validate.MapRules, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.validate.MapRules.displayName = 'proto.validate.MapRules'; -} -/** - * 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.validate.AnyRules = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.validate.AnyRules.repeatedFields_, null); -}; -goog.inherits(proto.validate.AnyRules, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.validate.AnyRules.displayName = 'proto.validate.AnyRules'; -} -/** - * 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.validate.DurationRules = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.validate.DurationRules.repeatedFields_, null); -}; -goog.inherits(proto.validate.DurationRules, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.validate.DurationRules.displayName = 'proto.validate.DurationRules'; -} -/** - * 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.validate.TimestampRules = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.validate.TimestampRules, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.validate.TimestampRules.displayName = 'proto.validate.TimestampRules'; -} - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.validate.FieldRules.oneofGroups_ = [[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,19,20,21,22]]; - -/** - * @enum {number} - */ -proto.validate.FieldRules.TypeCase = { - TYPE_NOT_SET: 0, - FLOAT: 1, - DOUBLE: 2, - INT32: 3, - INT64: 4, - UINT32: 5, - UINT64: 6, - SINT32: 7, - SINT64: 8, - FIXED32: 9, - FIXED64: 10, - SFIXED32: 11, - SFIXED64: 12, - BOOL: 13, - STRING: 14, - BYTES: 15, - ENUM: 16, - REPEATED: 18, - MAP: 19, - ANY: 20, - DURATION: 21, - TIMESTAMP: 22 -}; - -/** - * @return {proto.validate.FieldRules.TypeCase} - */ -proto.validate.FieldRules.prototype.getTypeCase = function() { - return /** @type {proto.validate.FieldRules.TypeCase} */(jspb.Message.computeOneofCase(this, proto.validate.FieldRules.oneofGroups_[0])); -}; - - - -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.validate.FieldRules.prototype.toObject = function(opt_includeInstance) { - return proto.validate.FieldRules.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.validate.FieldRules} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.FieldRules.toObject = function(includeInstance, msg) { - var f, obj = { - message: (f = msg.getMessage()) && proto.validate.MessageRules.toObject(includeInstance, f), - pb_float: (f = msg.getFloat()) && proto.validate.FloatRules.toObject(includeInstance, f), - pb_double: (f = msg.getDouble()) && proto.validate.DoubleRules.toObject(includeInstance, f), - int32: (f = msg.getInt32()) && proto.validate.Int32Rules.toObject(includeInstance, f), - int64: (f = msg.getInt64()) && proto.validate.Int64Rules.toObject(includeInstance, f), - uint32: (f = msg.getUint32()) && proto.validate.UInt32Rules.toObject(includeInstance, f), - uint64: (f = msg.getUint64()) && proto.validate.UInt64Rules.toObject(includeInstance, f), - sint32: (f = msg.getSint32()) && proto.validate.SInt32Rules.toObject(includeInstance, f), - sint64: (f = msg.getSint64()) && proto.validate.SInt64Rules.toObject(includeInstance, f), - fixed32: (f = msg.getFixed32()) && proto.validate.Fixed32Rules.toObject(includeInstance, f), - fixed64: (f = msg.getFixed64()) && proto.validate.Fixed64Rules.toObject(includeInstance, f), - sfixed32: (f = msg.getSfixed32()) && proto.validate.SFixed32Rules.toObject(includeInstance, f), - sfixed64: (f = msg.getSfixed64()) && proto.validate.SFixed64Rules.toObject(includeInstance, f), - bool: (f = msg.getBool()) && proto.validate.BoolRules.toObject(includeInstance, f), - string: (f = msg.getString()) && proto.validate.StringRules.toObject(includeInstance, f), - bytes: (f = msg.getBytes()) && proto.validate.BytesRules.toObject(includeInstance, f), - pb_enum: (f = msg.getEnum()) && proto.validate.EnumRules.toObject(includeInstance, f), - repeated: (f = msg.getRepeated()) && proto.validate.RepeatedRules.toObject(includeInstance, f), - map: (f = msg.getMap()) && proto.validate.MapRules.toObject(includeInstance, f), - any: (f = msg.getAny()) && proto.validate.AnyRules.toObject(includeInstance, f), - duration: (f = msg.getDuration()) && proto.validate.DurationRules.toObject(includeInstance, f), - timestamp: (f = msg.getTimestamp()) && proto.validate.TimestampRules.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.validate.FieldRules} - */ -proto.validate.FieldRules.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.validate.FieldRules; - return proto.validate.FieldRules.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.validate.FieldRules} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.validate.FieldRules} - */ -proto.validate.FieldRules.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 17: - var value = new proto.validate.MessageRules; - reader.readMessage(value,proto.validate.MessageRules.deserializeBinaryFromReader); - msg.setMessage(value); - break; - case 1: - var value = new proto.validate.FloatRules; - reader.readMessage(value,proto.validate.FloatRules.deserializeBinaryFromReader); - msg.setFloat(value); - break; - case 2: - var value = new proto.validate.DoubleRules; - reader.readMessage(value,proto.validate.DoubleRules.deserializeBinaryFromReader); - msg.setDouble(value); - break; - case 3: - var value = new proto.validate.Int32Rules; - reader.readMessage(value,proto.validate.Int32Rules.deserializeBinaryFromReader); - msg.setInt32(value); - break; - case 4: - var value = new proto.validate.Int64Rules; - reader.readMessage(value,proto.validate.Int64Rules.deserializeBinaryFromReader); - msg.setInt64(value); - break; - case 5: - var value = new proto.validate.UInt32Rules; - reader.readMessage(value,proto.validate.UInt32Rules.deserializeBinaryFromReader); - msg.setUint32(value); - break; - case 6: - var value = new proto.validate.UInt64Rules; - reader.readMessage(value,proto.validate.UInt64Rules.deserializeBinaryFromReader); - msg.setUint64(value); - break; - case 7: - var value = new proto.validate.SInt32Rules; - reader.readMessage(value,proto.validate.SInt32Rules.deserializeBinaryFromReader); - msg.setSint32(value); - break; - case 8: - var value = new proto.validate.SInt64Rules; - reader.readMessage(value,proto.validate.SInt64Rules.deserializeBinaryFromReader); - msg.setSint64(value); - break; - case 9: - var value = new proto.validate.Fixed32Rules; - reader.readMessage(value,proto.validate.Fixed32Rules.deserializeBinaryFromReader); - msg.setFixed32(value); - break; - case 10: - var value = new proto.validate.Fixed64Rules; - reader.readMessage(value,proto.validate.Fixed64Rules.deserializeBinaryFromReader); - msg.setFixed64(value); - break; - case 11: - var value = new proto.validate.SFixed32Rules; - reader.readMessage(value,proto.validate.SFixed32Rules.deserializeBinaryFromReader); - msg.setSfixed32(value); - break; - case 12: - var value = new proto.validate.SFixed64Rules; - reader.readMessage(value,proto.validate.SFixed64Rules.deserializeBinaryFromReader); - msg.setSfixed64(value); - break; - case 13: - var value = new proto.validate.BoolRules; - reader.readMessage(value,proto.validate.BoolRules.deserializeBinaryFromReader); - msg.setBool(value); - break; - case 14: - var value = new proto.validate.StringRules; - reader.readMessage(value,proto.validate.StringRules.deserializeBinaryFromReader); - msg.setString(value); - break; - case 15: - var value = new proto.validate.BytesRules; - reader.readMessage(value,proto.validate.BytesRules.deserializeBinaryFromReader); - msg.setBytes(value); - break; - case 16: - var value = new proto.validate.EnumRules; - reader.readMessage(value,proto.validate.EnumRules.deserializeBinaryFromReader); - msg.setEnum(value); - break; - case 18: - var value = new proto.validate.RepeatedRules; - reader.readMessage(value,proto.validate.RepeatedRules.deserializeBinaryFromReader); - msg.setRepeated(value); - break; - case 19: - var value = new proto.validate.MapRules; - reader.readMessage(value,proto.validate.MapRules.deserializeBinaryFromReader); - msg.setMap(value); - break; - case 20: - var value = new proto.validate.AnyRules; - reader.readMessage(value,proto.validate.AnyRules.deserializeBinaryFromReader); - msg.setAny(value); - break; - case 21: - var value = new proto.validate.DurationRules; - reader.readMessage(value,proto.validate.DurationRules.deserializeBinaryFromReader); - msg.setDuration(value); - break; - case 22: - var value = new proto.validate.TimestampRules; - reader.readMessage(value,proto.validate.TimestampRules.deserializeBinaryFromReader); - msg.setTimestamp(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.validate.FieldRules.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.validate.FieldRules.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.validate.FieldRules} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.FieldRules.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getMessage(); - if (f != null) { - writer.writeMessage( - 17, - f, - proto.validate.MessageRules.serializeBinaryToWriter - ); - } - f = message.getFloat(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.validate.FloatRules.serializeBinaryToWriter - ); - } - f = message.getDouble(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.validate.DoubleRules.serializeBinaryToWriter - ); - } - f = message.getInt32(); - if (f != null) { - writer.writeMessage( - 3, - f, - proto.validate.Int32Rules.serializeBinaryToWriter - ); - } - f = message.getInt64(); - if (f != null) { - writer.writeMessage( - 4, - f, - proto.validate.Int64Rules.serializeBinaryToWriter - ); - } - f = message.getUint32(); - if (f != null) { - writer.writeMessage( - 5, - f, - proto.validate.UInt32Rules.serializeBinaryToWriter - ); - } - f = message.getUint64(); - if (f != null) { - writer.writeMessage( - 6, - f, - proto.validate.UInt64Rules.serializeBinaryToWriter - ); - } - f = message.getSint32(); - if (f != null) { - writer.writeMessage( - 7, - f, - proto.validate.SInt32Rules.serializeBinaryToWriter - ); - } - f = message.getSint64(); - if (f != null) { - writer.writeMessage( - 8, - f, - proto.validate.SInt64Rules.serializeBinaryToWriter - ); - } - f = message.getFixed32(); - if (f != null) { - writer.writeMessage( - 9, - f, - proto.validate.Fixed32Rules.serializeBinaryToWriter - ); - } - f = message.getFixed64(); - if (f != null) { - writer.writeMessage( - 10, - f, - proto.validate.Fixed64Rules.serializeBinaryToWriter - ); - } - f = message.getSfixed32(); - if (f != null) { - writer.writeMessage( - 11, - f, - proto.validate.SFixed32Rules.serializeBinaryToWriter - ); - } - f = message.getSfixed64(); - if (f != null) { - writer.writeMessage( - 12, - f, - proto.validate.SFixed64Rules.serializeBinaryToWriter - ); - } - f = message.getBool(); - if (f != null) { - writer.writeMessage( - 13, - f, - proto.validate.BoolRules.serializeBinaryToWriter - ); - } - f = message.getString(); - if (f != null) { - writer.writeMessage( - 14, - f, - proto.validate.StringRules.serializeBinaryToWriter - ); - } - f = message.getBytes(); - if (f != null) { - writer.writeMessage( - 15, - f, - proto.validate.BytesRules.serializeBinaryToWriter - ); - } - f = message.getEnum(); - if (f != null) { - writer.writeMessage( - 16, - f, - proto.validate.EnumRules.serializeBinaryToWriter - ); - } - f = message.getRepeated(); - if (f != null) { - writer.writeMessage( - 18, - f, - proto.validate.RepeatedRules.serializeBinaryToWriter - ); - } - f = message.getMap(); - if (f != null) { - writer.writeMessage( - 19, - f, - proto.validate.MapRules.serializeBinaryToWriter - ); - } - f = message.getAny(); - if (f != null) { - writer.writeMessage( - 20, - f, - proto.validate.AnyRules.serializeBinaryToWriter - ); - } - f = message.getDuration(); - if (f != null) { - writer.writeMessage( - 21, - f, - proto.validate.DurationRules.serializeBinaryToWriter - ); - } - f = message.getTimestamp(); - if (f != null) { - writer.writeMessage( - 22, - f, - proto.validate.TimestampRules.serializeBinaryToWriter - ); - } -}; - - -/** - * optional MessageRules message = 17; - * @return {?proto.validate.MessageRules} - */ -proto.validate.FieldRules.prototype.getMessage = function() { - return /** @type{?proto.validate.MessageRules} */ ( - jspb.Message.getWrapperField(this, proto.validate.MessageRules, 17)); -}; - - -/** - * @param {?proto.validate.MessageRules|undefined} value - * @return {!proto.validate.FieldRules} returns this -*/ -proto.validate.FieldRules.prototype.setMessage = function(value) { - return jspb.Message.setWrapperField(this, 17, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.FieldRules} returns this - */ -proto.validate.FieldRules.prototype.clearMessage = function() { - return this.setMessage(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.FieldRules.prototype.hasMessage = function() { - return jspb.Message.getField(this, 17) != null; -}; - - -/** - * optional FloatRules float = 1; - * @return {?proto.validate.FloatRules} - */ -proto.validate.FieldRules.prototype.getFloat = function() { - return /** @type{?proto.validate.FloatRules} */ ( - jspb.Message.getWrapperField(this, proto.validate.FloatRules, 1)); -}; - - -/** - * @param {?proto.validate.FloatRules|undefined} value - * @return {!proto.validate.FieldRules} returns this -*/ -proto.validate.FieldRules.prototype.setFloat = function(value) { - return jspb.Message.setOneofWrapperField(this, 1, proto.validate.FieldRules.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.FieldRules} returns this - */ -proto.validate.FieldRules.prototype.clearFloat = function() { - return this.setFloat(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.FieldRules.prototype.hasFloat = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional DoubleRules double = 2; - * @return {?proto.validate.DoubleRules} - */ -proto.validate.FieldRules.prototype.getDouble = function() { - return /** @type{?proto.validate.DoubleRules} */ ( - jspb.Message.getWrapperField(this, proto.validate.DoubleRules, 2)); -}; - - -/** - * @param {?proto.validate.DoubleRules|undefined} value - * @return {!proto.validate.FieldRules} returns this -*/ -proto.validate.FieldRules.prototype.setDouble = function(value) { - return jspb.Message.setOneofWrapperField(this, 2, proto.validate.FieldRules.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.FieldRules} returns this - */ -proto.validate.FieldRules.prototype.clearDouble = function() { - return this.setDouble(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.FieldRules.prototype.hasDouble = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional Int32Rules int32 = 3; - * @return {?proto.validate.Int32Rules} - */ -proto.validate.FieldRules.prototype.getInt32 = function() { - return /** @type{?proto.validate.Int32Rules} */ ( - jspb.Message.getWrapperField(this, proto.validate.Int32Rules, 3)); -}; - - -/** - * @param {?proto.validate.Int32Rules|undefined} value - * @return {!proto.validate.FieldRules} returns this -*/ -proto.validate.FieldRules.prototype.setInt32 = function(value) { - return jspb.Message.setOneofWrapperField(this, 3, proto.validate.FieldRules.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.FieldRules} returns this - */ -proto.validate.FieldRules.prototype.clearInt32 = function() { - return this.setInt32(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.FieldRules.prototype.hasInt32 = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * optional Int64Rules int64 = 4; - * @return {?proto.validate.Int64Rules} - */ -proto.validate.FieldRules.prototype.getInt64 = function() { - return /** @type{?proto.validate.Int64Rules} */ ( - jspb.Message.getWrapperField(this, proto.validate.Int64Rules, 4)); -}; - - -/** - * @param {?proto.validate.Int64Rules|undefined} value - * @return {!proto.validate.FieldRules} returns this -*/ -proto.validate.FieldRules.prototype.setInt64 = function(value) { - return jspb.Message.setOneofWrapperField(this, 4, proto.validate.FieldRules.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.FieldRules} returns this - */ -proto.validate.FieldRules.prototype.clearInt64 = function() { - return this.setInt64(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.FieldRules.prototype.hasInt64 = function() { - return jspb.Message.getField(this, 4) != null; -}; - - -/** - * optional UInt32Rules uint32 = 5; - * @return {?proto.validate.UInt32Rules} - */ -proto.validate.FieldRules.prototype.getUint32 = function() { - return /** @type{?proto.validate.UInt32Rules} */ ( - jspb.Message.getWrapperField(this, proto.validate.UInt32Rules, 5)); -}; - - -/** - * @param {?proto.validate.UInt32Rules|undefined} value - * @return {!proto.validate.FieldRules} returns this -*/ -proto.validate.FieldRules.prototype.setUint32 = function(value) { - return jspb.Message.setOneofWrapperField(this, 5, proto.validate.FieldRules.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.FieldRules} returns this - */ -proto.validate.FieldRules.prototype.clearUint32 = function() { - return this.setUint32(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.FieldRules.prototype.hasUint32 = function() { - return jspb.Message.getField(this, 5) != null; -}; - - -/** - * optional UInt64Rules uint64 = 6; - * @return {?proto.validate.UInt64Rules} - */ -proto.validate.FieldRules.prototype.getUint64 = function() { - return /** @type{?proto.validate.UInt64Rules} */ ( - jspb.Message.getWrapperField(this, proto.validate.UInt64Rules, 6)); -}; - - -/** - * @param {?proto.validate.UInt64Rules|undefined} value - * @return {!proto.validate.FieldRules} returns this -*/ -proto.validate.FieldRules.prototype.setUint64 = function(value) { - return jspb.Message.setOneofWrapperField(this, 6, proto.validate.FieldRules.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.FieldRules} returns this - */ -proto.validate.FieldRules.prototype.clearUint64 = function() { - return this.setUint64(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.FieldRules.prototype.hasUint64 = function() { - return jspb.Message.getField(this, 6) != null; -}; - - -/** - * optional SInt32Rules sint32 = 7; - * @return {?proto.validate.SInt32Rules} - */ -proto.validate.FieldRules.prototype.getSint32 = function() { - return /** @type{?proto.validate.SInt32Rules} */ ( - jspb.Message.getWrapperField(this, proto.validate.SInt32Rules, 7)); -}; - - -/** - * @param {?proto.validate.SInt32Rules|undefined} value - * @return {!proto.validate.FieldRules} returns this -*/ -proto.validate.FieldRules.prototype.setSint32 = function(value) { - return jspb.Message.setOneofWrapperField(this, 7, proto.validate.FieldRules.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.FieldRules} returns this - */ -proto.validate.FieldRules.prototype.clearSint32 = function() { - return this.setSint32(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.FieldRules.prototype.hasSint32 = function() { - return jspb.Message.getField(this, 7) != null; -}; - - -/** - * optional SInt64Rules sint64 = 8; - * @return {?proto.validate.SInt64Rules} - */ -proto.validate.FieldRules.prototype.getSint64 = function() { - return /** @type{?proto.validate.SInt64Rules} */ ( - jspb.Message.getWrapperField(this, proto.validate.SInt64Rules, 8)); -}; - - -/** - * @param {?proto.validate.SInt64Rules|undefined} value - * @return {!proto.validate.FieldRules} returns this -*/ -proto.validate.FieldRules.prototype.setSint64 = function(value) { - return jspb.Message.setOneofWrapperField(this, 8, proto.validate.FieldRules.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.FieldRules} returns this - */ -proto.validate.FieldRules.prototype.clearSint64 = function() { - return this.setSint64(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.FieldRules.prototype.hasSint64 = function() { - return jspb.Message.getField(this, 8) != null; -}; - - -/** - * optional Fixed32Rules fixed32 = 9; - * @return {?proto.validate.Fixed32Rules} - */ -proto.validate.FieldRules.prototype.getFixed32 = function() { - return /** @type{?proto.validate.Fixed32Rules} */ ( - jspb.Message.getWrapperField(this, proto.validate.Fixed32Rules, 9)); -}; - - -/** - * @param {?proto.validate.Fixed32Rules|undefined} value - * @return {!proto.validate.FieldRules} returns this -*/ -proto.validate.FieldRules.prototype.setFixed32 = function(value) { - return jspb.Message.setOneofWrapperField(this, 9, proto.validate.FieldRules.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.FieldRules} returns this - */ -proto.validate.FieldRules.prototype.clearFixed32 = function() { - return this.setFixed32(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.FieldRules.prototype.hasFixed32 = function() { - return jspb.Message.getField(this, 9) != null; -}; - - -/** - * optional Fixed64Rules fixed64 = 10; - * @return {?proto.validate.Fixed64Rules} - */ -proto.validate.FieldRules.prototype.getFixed64 = function() { - return /** @type{?proto.validate.Fixed64Rules} */ ( - jspb.Message.getWrapperField(this, proto.validate.Fixed64Rules, 10)); -}; - - -/** - * @param {?proto.validate.Fixed64Rules|undefined} value - * @return {!proto.validate.FieldRules} returns this -*/ -proto.validate.FieldRules.prototype.setFixed64 = function(value) { - return jspb.Message.setOneofWrapperField(this, 10, proto.validate.FieldRules.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.FieldRules} returns this - */ -proto.validate.FieldRules.prototype.clearFixed64 = function() { - return this.setFixed64(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.FieldRules.prototype.hasFixed64 = function() { - return jspb.Message.getField(this, 10) != null; -}; - - -/** - * optional SFixed32Rules sfixed32 = 11; - * @return {?proto.validate.SFixed32Rules} - */ -proto.validate.FieldRules.prototype.getSfixed32 = function() { - return /** @type{?proto.validate.SFixed32Rules} */ ( - jspb.Message.getWrapperField(this, proto.validate.SFixed32Rules, 11)); -}; - - -/** - * @param {?proto.validate.SFixed32Rules|undefined} value - * @return {!proto.validate.FieldRules} returns this -*/ -proto.validate.FieldRules.prototype.setSfixed32 = function(value) { - return jspb.Message.setOneofWrapperField(this, 11, proto.validate.FieldRules.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.FieldRules} returns this - */ -proto.validate.FieldRules.prototype.clearSfixed32 = function() { - return this.setSfixed32(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.FieldRules.prototype.hasSfixed32 = function() { - return jspb.Message.getField(this, 11) != null; -}; - - -/** - * optional SFixed64Rules sfixed64 = 12; - * @return {?proto.validate.SFixed64Rules} - */ -proto.validate.FieldRules.prototype.getSfixed64 = function() { - return /** @type{?proto.validate.SFixed64Rules} */ ( - jspb.Message.getWrapperField(this, proto.validate.SFixed64Rules, 12)); -}; - - -/** - * @param {?proto.validate.SFixed64Rules|undefined} value - * @return {!proto.validate.FieldRules} returns this -*/ -proto.validate.FieldRules.prototype.setSfixed64 = function(value) { - return jspb.Message.setOneofWrapperField(this, 12, proto.validate.FieldRules.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.FieldRules} returns this - */ -proto.validate.FieldRules.prototype.clearSfixed64 = function() { - return this.setSfixed64(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.FieldRules.prototype.hasSfixed64 = function() { - return jspb.Message.getField(this, 12) != null; -}; - - -/** - * optional BoolRules bool = 13; - * @return {?proto.validate.BoolRules} - */ -proto.validate.FieldRules.prototype.getBool = function() { - return /** @type{?proto.validate.BoolRules} */ ( - jspb.Message.getWrapperField(this, proto.validate.BoolRules, 13)); -}; - - -/** - * @param {?proto.validate.BoolRules|undefined} value - * @return {!proto.validate.FieldRules} returns this -*/ -proto.validate.FieldRules.prototype.setBool = function(value) { - return jspb.Message.setOneofWrapperField(this, 13, proto.validate.FieldRules.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.FieldRules} returns this - */ -proto.validate.FieldRules.prototype.clearBool = function() { - return this.setBool(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.FieldRules.prototype.hasBool = function() { - return jspb.Message.getField(this, 13) != null; -}; - - -/** - * optional StringRules string = 14; - * @return {?proto.validate.StringRules} - */ -proto.validate.FieldRules.prototype.getString = function() { - return /** @type{?proto.validate.StringRules} */ ( - jspb.Message.getWrapperField(this, proto.validate.StringRules, 14)); -}; - - -/** - * @param {?proto.validate.StringRules|undefined} value - * @return {!proto.validate.FieldRules} returns this -*/ -proto.validate.FieldRules.prototype.setString = function(value) { - return jspb.Message.setOneofWrapperField(this, 14, proto.validate.FieldRules.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.FieldRules} returns this - */ -proto.validate.FieldRules.prototype.clearString = function() { - return this.setString(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.FieldRules.prototype.hasString = function() { - return jspb.Message.getField(this, 14) != null; -}; - - -/** - * optional BytesRules bytes = 15; - * @return {?proto.validate.BytesRules} - */ -proto.validate.FieldRules.prototype.getBytes = function() { - return /** @type{?proto.validate.BytesRules} */ ( - jspb.Message.getWrapperField(this, proto.validate.BytesRules, 15)); -}; - - -/** - * @param {?proto.validate.BytesRules|undefined} value - * @return {!proto.validate.FieldRules} returns this -*/ -proto.validate.FieldRules.prototype.setBytes = function(value) { - return jspb.Message.setOneofWrapperField(this, 15, proto.validate.FieldRules.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.FieldRules} returns this - */ -proto.validate.FieldRules.prototype.clearBytes = function() { - return this.setBytes(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.FieldRules.prototype.hasBytes = function() { - return jspb.Message.getField(this, 15) != null; -}; - - -/** - * optional EnumRules enum = 16; - * @return {?proto.validate.EnumRules} - */ -proto.validate.FieldRules.prototype.getEnum = function() { - return /** @type{?proto.validate.EnumRules} */ ( - jspb.Message.getWrapperField(this, proto.validate.EnumRules, 16)); -}; - - -/** - * @param {?proto.validate.EnumRules|undefined} value - * @return {!proto.validate.FieldRules} returns this -*/ -proto.validate.FieldRules.prototype.setEnum = function(value) { - return jspb.Message.setOneofWrapperField(this, 16, proto.validate.FieldRules.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.FieldRules} returns this - */ -proto.validate.FieldRules.prototype.clearEnum = function() { - return this.setEnum(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.FieldRules.prototype.hasEnum = function() { - return jspb.Message.getField(this, 16) != null; -}; - - -/** - * optional RepeatedRules repeated = 18; - * @return {?proto.validate.RepeatedRules} - */ -proto.validate.FieldRules.prototype.getRepeated = function() { - return /** @type{?proto.validate.RepeatedRules} */ ( - jspb.Message.getWrapperField(this, proto.validate.RepeatedRules, 18)); -}; - - -/** - * @param {?proto.validate.RepeatedRules|undefined} value - * @return {!proto.validate.FieldRules} returns this -*/ -proto.validate.FieldRules.prototype.setRepeated = function(value) { - return jspb.Message.setOneofWrapperField(this, 18, proto.validate.FieldRules.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.FieldRules} returns this - */ -proto.validate.FieldRules.prototype.clearRepeated = function() { - return this.setRepeated(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.FieldRules.prototype.hasRepeated = function() { - return jspb.Message.getField(this, 18) != null; -}; - - -/** - * optional MapRules map = 19; - * @return {?proto.validate.MapRules} - */ -proto.validate.FieldRules.prototype.getMap = function() { - return /** @type{?proto.validate.MapRules} */ ( - jspb.Message.getWrapperField(this, proto.validate.MapRules, 19)); -}; - - -/** - * @param {?proto.validate.MapRules|undefined} value - * @return {!proto.validate.FieldRules} returns this -*/ -proto.validate.FieldRules.prototype.setMap = function(value) { - return jspb.Message.setOneofWrapperField(this, 19, proto.validate.FieldRules.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.FieldRules} returns this - */ -proto.validate.FieldRules.prototype.clearMap = function() { - return this.setMap(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.FieldRules.prototype.hasMap = function() { - return jspb.Message.getField(this, 19) != null; -}; - - -/** - * optional AnyRules any = 20; - * @return {?proto.validate.AnyRules} - */ -proto.validate.FieldRules.prototype.getAny = function() { - return /** @type{?proto.validate.AnyRules} */ ( - jspb.Message.getWrapperField(this, proto.validate.AnyRules, 20)); -}; - - -/** - * @param {?proto.validate.AnyRules|undefined} value - * @return {!proto.validate.FieldRules} returns this -*/ -proto.validate.FieldRules.prototype.setAny = function(value) { - return jspb.Message.setOneofWrapperField(this, 20, proto.validate.FieldRules.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.FieldRules} returns this - */ -proto.validate.FieldRules.prototype.clearAny = function() { - return this.setAny(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.FieldRules.prototype.hasAny = function() { - return jspb.Message.getField(this, 20) != null; -}; - - -/** - * optional DurationRules duration = 21; - * @return {?proto.validate.DurationRules} - */ -proto.validate.FieldRules.prototype.getDuration = function() { - return /** @type{?proto.validate.DurationRules} */ ( - jspb.Message.getWrapperField(this, proto.validate.DurationRules, 21)); -}; - - -/** - * @param {?proto.validate.DurationRules|undefined} value - * @return {!proto.validate.FieldRules} returns this -*/ -proto.validate.FieldRules.prototype.setDuration = function(value) { - return jspb.Message.setOneofWrapperField(this, 21, proto.validate.FieldRules.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.FieldRules} returns this - */ -proto.validate.FieldRules.prototype.clearDuration = function() { - return this.setDuration(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.FieldRules.prototype.hasDuration = function() { - return jspb.Message.getField(this, 21) != null; -}; - - -/** - * optional TimestampRules timestamp = 22; - * @return {?proto.validate.TimestampRules} - */ -proto.validate.FieldRules.prototype.getTimestamp = function() { - return /** @type{?proto.validate.TimestampRules} */ ( - jspb.Message.getWrapperField(this, proto.validate.TimestampRules, 22)); -}; - - -/** - * @param {?proto.validate.TimestampRules|undefined} value - * @return {!proto.validate.FieldRules} returns this -*/ -proto.validate.FieldRules.prototype.setTimestamp = function(value) { - return jspb.Message.setOneofWrapperField(this, 22, proto.validate.FieldRules.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.FieldRules} returns this - */ -proto.validate.FieldRules.prototype.clearTimestamp = function() { - return this.setTimestamp(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.FieldRules.prototype.hasTimestamp = function() { - return jspb.Message.getField(this, 22) != null; -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.validate.FloatRules.repeatedFields_ = [6,7]; - - - -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.validate.FloatRules.prototype.toObject = function(opt_includeInstance) { - return proto.validate.FloatRules.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.validate.FloatRules} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.FloatRules.toObject = function(includeInstance, msg) { - var f, obj = { - pb_const: (f = jspb.Message.getOptionalFloatingPointField(msg, 1)) == null ? undefined : f, - lt: (f = jspb.Message.getOptionalFloatingPointField(msg, 2)) == null ? undefined : f, - lte: (f = jspb.Message.getOptionalFloatingPointField(msg, 3)) == null ? undefined : f, - gt: (f = jspb.Message.getOptionalFloatingPointField(msg, 4)) == null ? undefined : f, - gte: (f = jspb.Message.getOptionalFloatingPointField(msg, 5)) == null ? undefined : f, - inList: (f = jspb.Message.getRepeatedFloatingPointField(msg, 6)) == null ? undefined : f, - notInList: (f = jspb.Message.getRepeatedFloatingPointField(msg, 7)) == null ? undefined : f, - ignoreEmpty: (f = jspb.Message.getBooleanField(msg, 8)) == 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.validate.FloatRules} - */ -proto.validate.FloatRules.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.validate.FloatRules; - return proto.validate.FloatRules.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.validate.FloatRules} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.validate.FloatRules} - */ -proto.validate.FloatRules.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readFloat()); - msg.setConst(value); - break; - case 2: - var value = /** @type {number} */ (reader.readFloat()); - msg.setLt(value); - break; - case 3: - var value = /** @type {number} */ (reader.readFloat()); - msg.setLte(value); - break; - case 4: - var value = /** @type {number} */ (reader.readFloat()); - msg.setGt(value); - break; - case 5: - var value = /** @type {number} */ (reader.readFloat()); - msg.setGte(value); - break; - case 6: - var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedFloat() : [reader.readFloat()]); - for (var i = 0; i < values.length; i++) { - msg.addIn(values[i]); - } - break; - case 7: - var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedFloat() : [reader.readFloat()]); - for (var i = 0; i < values.length; i++) { - msg.addNotIn(values[i]); - } - break; - case 8: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setIgnoreEmpty(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.validate.FloatRules.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.validate.FloatRules.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.validate.FloatRules} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.FloatRules.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {number} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeFloat( - 1, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 2)); - if (f != null) { - writer.writeFloat( - 2, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 3)); - if (f != null) { - writer.writeFloat( - 3, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 4)); - if (f != null) { - writer.writeFloat( - 4, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 5)); - if (f != null) { - writer.writeFloat( - 5, - f - ); - } - f = message.getInList(); - if (f.length > 0) { - writer.writeRepeatedFloat( - 6, - f - ); - } - f = message.getNotInList(); - if (f.length > 0) { - writer.writeRepeatedFloat( - 7, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 8)); - if (f != null) { - writer.writeBool( - 8, - f - ); - } -}; - - -/** - * optional float const = 1; - * @return {number} - */ -proto.validate.FloatRules.prototype.getConst = function() { - return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 1, 0.0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.FloatRules} returns this - */ -proto.validate.FloatRules.prototype.setConst = function(value) { - return jspb.Message.setField(this, 1, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.FloatRules} returns this - */ -proto.validate.FloatRules.prototype.clearConst = function() { - return jspb.Message.setField(this, 1, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.FloatRules.prototype.hasConst = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional float lt = 2; - * @return {number} - */ -proto.validate.FloatRules.prototype.getLt = function() { - return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 2, 0.0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.FloatRules} returns this - */ -proto.validate.FloatRules.prototype.setLt = function(value) { - return jspb.Message.setField(this, 2, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.FloatRules} returns this - */ -proto.validate.FloatRules.prototype.clearLt = function() { - return jspb.Message.setField(this, 2, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.FloatRules.prototype.hasLt = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional float lte = 3; - * @return {number} - */ -proto.validate.FloatRules.prototype.getLte = function() { - return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 3, 0.0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.FloatRules} returns this - */ -proto.validate.FloatRules.prototype.setLte = function(value) { - return jspb.Message.setField(this, 3, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.FloatRules} returns this - */ -proto.validate.FloatRules.prototype.clearLte = function() { - return jspb.Message.setField(this, 3, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.FloatRules.prototype.hasLte = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * optional float gt = 4; - * @return {number} - */ -proto.validate.FloatRules.prototype.getGt = function() { - return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 4, 0.0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.FloatRules} returns this - */ -proto.validate.FloatRules.prototype.setGt = function(value) { - return jspb.Message.setField(this, 4, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.FloatRules} returns this - */ -proto.validate.FloatRules.prototype.clearGt = function() { - return jspb.Message.setField(this, 4, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.FloatRules.prototype.hasGt = function() { - return jspb.Message.getField(this, 4) != null; -}; - - -/** - * optional float gte = 5; - * @return {number} - */ -proto.validate.FloatRules.prototype.getGte = function() { - return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 5, 0.0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.FloatRules} returns this - */ -proto.validate.FloatRules.prototype.setGte = function(value) { - return jspb.Message.setField(this, 5, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.FloatRules} returns this - */ -proto.validate.FloatRules.prototype.clearGte = function() { - return jspb.Message.setField(this, 5, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.FloatRules.prototype.hasGte = function() { - return jspb.Message.getField(this, 5) != null; -}; - - -/** - * repeated float in = 6; - * @return {!Array} - */ -proto.validate.FloatRules.prototype.getInList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedFloatingPointField(this, 6)); -}; - - -/** - * @param {!Array} value - * @return {!proto.validate.FloatRules} returns this - */ -proto.validate.FloatRules.prototype.setInList = function(value) { - return jspb.Message.setField(this, 6, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - * @return {!proto.validate.FloatRules} returns this - */ -proto.validate.FloatRules.prototype.addIn = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 6, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.validate.FloatRules} returns this - */ -proto.validate.FloatRules.prototype.clearInList = function() { - return this.setInList([]); -}; - - -/** - * repeated float not_in = 7; - * @return {!Array} - */ -proto.validate.FloatRules.prototype.getNotInList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedFloatingPointField(this, 7)); -}; - - -/** - * @param {!Array} value - * @return {!proto.validate.FloatRules} returns this - */ -proto.validate.FloatRules.prototype.setNotInList = function(value) { - return jspb.Message.setField(this, 7, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - * @return {!proto.validate.FloatRules} returns this - */ -proto.validate.FloatRules.prototype.addNotIn = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 7, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.validate.FloatRules} returns this - */ -proto.validate.FloatRules.prototype.clearNotInList = function() { - return this.setNotInList([]); -}; - - -/** - * optional bool ignore_empty = 8; - * @return {boolean} - */ -proto.validate.FloatRules.prototype.getIgnoreEmpty = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.FloatRules} returns this - */ -proto.validate.FloatRules.prototype.setIgnoreEmpty = function(value) { - return jspb.Message.setField(this, 8, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.FloatRules} returns this - */ -proto.validate.FloatRules.prototype.clearIgnoreEmpty = function() { - return jspb.Message.setField(this, 8, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.FloatRules.prototype.hasIgnoreEmpty = function() { - return jspb.Message.getField(this, 8) != null; -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.validate.DoubleRules.repeatedFields_ = [6,7]; - - - -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.validate.DoubleRules.prototype.toObject = function(opt_includeInstance) { - return proto.validate.DoubleRules.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.validate.DoubleRules} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.DoubleRules.toObject = function(includeInstance, msg) { - var f, obj = { - pb_const: (f = jspb.Message.getOptionalFloatingPointField(msg, 1)) == null ? undefined : f, - lt: (f = jspb.Message.getOptionalFloatingPointField(msg, 2)) == null ? undefined : f, - lte: (f = jspb.Message.getOptionalFloatingPointField(msg, 3)) == null ? undefined : f, - gt: (f = jspb.Message.getOptionalFloatingPointField(msg, 4)) == null ? undefined : f, - gte: (f = jspb.Message.getOptionalFloatingPointField(msg, 5)) == null ? undefined : f, - inList: (f = jspb.Message.getRepeatedFloatingPointField(msg, 6)) == null ? undefined : f, - notInList: (f = jspb.Message.getRepeatedFloatingPointField(msg, 7)) == null ? undefined : f, - ignoreEmpty: (f = jspb.Message.getBooleanField(msg, 8)) == 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.validate.DoubleRules} - */ -proto.validate.DoubleRules.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.validate.DoubleRules; - return proto.validate.DoubleRules.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.validate.DoubleRules} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.validate.DoubleRules} - */ -proto.validate.DoubleRules.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readDouble()); - msg.setConst(value); - break; - case 2: - var value = /** @type {number} */ (reader.readDouble()); - msg.setLt(value); - break; - case 3: - var value = /** @type {number} */ (reader.readDouble()); - msg.setLte(value); - break; - case 4: - var value = /** @type {number} */ (reader.readDouble()); - msg.setGt(value); - break; - case 5: - var value = /** @type {number} */ (reader.readDouble()); - msg.setGte(value); - break; - case 6: - var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedDouble() : [reader.readDouble()]); - for (var i = 0; i < values.length; i++) { - msg.addIn(values[i]); - } - break; - case 7: - var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedDouble() : [reader.readDouble()]); - for (var i = 0; i < values.length; i++) { - msg.addNotIn(values[i]); - } - break; - case 8: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setIgnoreEmpty(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.validate.DoubleRules.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.validate.DoubleRules.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.validate.DoubleRules} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.DoubleRules.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {number} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeDouble( - 1, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 2)); - if (f != null) { - writer.writeDouble( - 2, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 3)); - if (f != null) { - writer.writeDouble( - 3, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 4)); - if (f != null) { - writer.writeDouble( - 4, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 5)); - if (f != null) { - writer.writeDouble( - 5, - f - ); - } - f = message.getInList(); - if (f.length > 0) { - writer.writeRepeatedDouble( - 6, - f - ); - } - f = message.getNotInList(); - if (f.length > 0) { - writer.writeRepeatedDouble( - 7, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 8)); - if (f != null) { - writer.writeBool( - 8, - f - ); - } -}; - - -/** - * optional double const = 1; - * @return {number} - */ -proto.validate.DoubleRules.prototype.getConst = function() { - return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 1, 0.0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.DoubleRules} returns this - */ -proto.validate.DoubleRules.prototype.setConst = function(value) { - return jspb.Message.setField(this, 1, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.DoubleRules} returns this - */ -proto.validate.DoubleRules.prototype.clearConst = function() { - return jspb.Message.setField(this, 1, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.DoubleRules.prototype.hasConst = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional double lt = 2; - * @return {number} - */ -proto.validate.DoubleRules.prototype.getLt = function() { - return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 2, 0.0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.DoubleRules} returns this - */ -proto.validate.DoubleRules.prototype.setLt = function(value) { - return jspb.Message.setField(this, 2, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.DoubleRules} returns this - */ -proto.validate.DoubleRules.prototype.clearLt = function() { - return jspb.Message.setField(this, 2, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.DoubleRules.prototype.hasLt = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional double lte = 3; - * @return {number} - */ -proto.validate.DoubleRules.prototype.getLte = function() { - return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 3, 0.0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.DoubleRules} returns this - */ -proto.validate.DoubleRules.prototype.setLte = function(value) { - return jspb.Message.setField(this, 3, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.DoubleRules} returns this - */ -proto.validate.DoubleRules.prototype.clearLte = function() { - return jspb.Message.setField(this, 3, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.DoubleRules.prototype.hasLte = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * optional double gt = 4; - * @return {number} - */ -proto.validate.DoubleRules.prototype.getGt = function() { - return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 4, 0.0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.DoubleRules} returns this - */ -proto.validate.DoubleRules.prototype.setGt = function(value) { - return jspb.Message.setField(this, 4, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.DoubleRules} returns this - */ -proto.validate.DoubleRules.prototype.clearGt = function() { - return jspb.Message.setField(this, 4, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.DoubleRules.prototype.hasGt = function() { - return jspb.Message.getField(this, 4) != null; -}; - - -/** - * optional double gte = 5; - * @return {number} - */ -proto.validate.DoubleRules.prototype.getGte = function() { - return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 5, 0.0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.DoubleRules} returns this - */ -proto.validate.DoubleRules.prototype.setGte = function(value) { - return jspb.Message.setField(this, 5, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.DoubleRules} returns this - */ -proto.validate.DoubleRules.prototype.clearGte = function() { - return jspb.Message.setField(this, 5, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.DoubleRules.prototype.hasGte = function() { - return jspb.Message.getField(this, 5) != null; -}; - - -/** - * repeated double in = 6; - * @return {!Array} - */ -proto.validate.DoubleRules.prototype.getInList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedFloatingPointField(this, 6)); -}; - - -/** - * @param {!Array} value - * @return {!proto.validate.DoubleRules} returns this - */ -proto.validate.DoubleRules.prototype.setInList = function(value) { - return jspb.Message.setField(this, 6, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - * @return {!proto.validate.DoubleRules} returns this - */ -proto.validate.DoubleRules.prototype.addIn = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 6, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.validate.DoubleRules} returns this - */ -proto.validate.DoubleRules.prototype.clearInList = function() { - return this.setInList([]); -}; - - -/** - * repeated double not_in = 7; - * @return {!Array} - */ -proto.validate.DoubleRules.prototype.getNotInList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedFloatingPointField(this, 7)); -}; - - -/** - * @param {!Array} value - * @return {!proto.validate.DoubleRules} returns this - */ -proto.validate.DoubleRules.prototype.setNotInList = function(value) { - return jspb.Message.setField(this, 7, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - * @return {!proto.validate.DoubleRules} returns this - */ -proto.validate.DoubleRules.prototype.addNotIn = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 7, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.validate.DoubleRules} returns this - */ -proto.validate.DoubleRules.prototype.clearNotInList = function() { - return this.setNotInList([]); -}; - - -/** - * optional bool ignore_empty = 8; - * @return {boolean} - */ -proto.validate.DoubleRules.prototype.getIgnoreEmpty = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.DoubleRules} returns this - */ -proto.validate.DoubleRules.prototype.setIgnoreEmpty = function(value) { - return jspb.Message.setField(this, 8, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.DoubleRules} returns this - */ -proto.validate.DoubleRules.prototype.clearIgnoreEmpty = function() { - return jspb.Message.setField(this, 8, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.DoubleRules.prototype.hasIgnoreEmpty = function() { - return jspb.Message.getField(this, 8) != null; -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.validate.Int32Rules.repeatedFields_ = [6,7]; - - - -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.validate.Int32Rules.prototype.toObject = function(opt_includeInstance) { - return proto.validate.Int32Rules.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.validate.Int32Rules} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.Int32Rules.toObject = function(includeInstance, msg) { - var f, obj = { - pb_const: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, - lt: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f, - lte: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f, - gt: (f = jspb.Message.getField(msg, 4)) == null ? undefined : f, - gte: (f = jspb.Message.getField(msg, 5)) == null ? undefined : f, - inList: (f = jspb.Message.getRepeatedField(msg, 6)) == null ? undefined : f, - notInList: (f = jspb.Message.getRepeatedField(msg, 7)) == null ? undefined : f, - ignoreEmpty: (f = jspb.Message.getBooleanField(msg, 8)) == 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.validate.Int32Rules} - */ -proto.validate.Int32Rules.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.validate.Int32Rules; - return proto.validate.Int32Rules.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.validate.Int32Rules} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.validate.Int32Rules} - */ -proto.validate.Int32Rules.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readInt32()); - msg.setConst(value); - break; - case 2: - var value = /** @type {number} */ (reader.readInt32()); - msg.setLt(value); - break; - case 3: - var value = /** @type {number} */ (reader.readInt32()); - msg.setLte(value); - break; - case 4: - var value = /** @type {number} */ (reader.readInt32()); - msg.setGt(value); - break; - case 5: - var value = /** @type {number} */ (reader.readInt32()); - msg.setGte(value); - break; - case 6: - var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedInt32() : [reader.readInt32()]); - for (var i = 0; i < values.length; i++) { - msg.addIn(values[i]); - } - break; - case 7: - var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedInt32() : [reader.readInt32()]); - for (var i = 0; i < values.length; i++) { - msg.addNotIn(values[i]); - } - break; - case 8: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setIgnoreEmpty(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.validate.Int32Rules.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.validate.Int32Rules.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.validate.Int32Rules} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.Int32Rules.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {number} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeInt32( - 1, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 2)); - if (f != null) { - writer.writeInt32( - 2, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 3)); - if (f != null) { - writer.writeInt32( - 3, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 4)); - if (f != null) { - writer.writeInt32( - 4, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 5)); - if (f != null) { - writer.writeInt32( - 5, - f - ); - } - f = message.getInList(); - if (f.length > 0) { - writer.writeRepeatedInt32( - 6, - f - ); - } - f = message.getNotInList(); - if (f.length > 0) { - writer.writeRepeatedInt32( - 7, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 8)); - if (f != null) { - writer.writeBool( - 8, - f - ); - } -}; - - -/** - * optional int32 const = 1; - * @return {number} - */ -proto.validate.Int32Rules.prototype.getConst = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.Int32Rules} returns this - */ -proto.validate.Int32Rules.prototype.setConst = function(value) { - return jspb.Message.setField(this, 1, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.Int32Rules} returns this - */ -proto.validate.Int32Rules.prototype.clearConst = function() { - return jspb.Message.setField(this, 1, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.Int32Rules.prototype.hasConst = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional int32 lt = 2; - * @return {number} - */ -proto.validate.Int32Rules.prototype.getLt = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.Int32Rules} returns this - */ -proto.validate.Int32Rules.prototype.setLt = function(value) { - return jspb.Message.setField(this, 2, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.Int32Rules} returns this - */ -proto.validate.Int32Rules.prototype.clearLt = function() { - return jspb.Message.setField(this, 2, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.Int32Rules.prototype.hasLt = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional int32 lte = 3; - * @return {number} - */ -proto.validate.Int32Rules.prototype.getLte = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.Int32Rules} returns this - */ -proto.validate.Int32Rules.prototype.setLte = function(value) { - return jspb.Message.setField(this, 3, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.Int32Rules} returns this - */ -proto.validate.Int32Rules.prototype.clearLte = function() { - return jspb.Message.setField(this, 3, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.Int32Rules.prototype.hasLte = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * optional int32 gt = 4; - * @return {number} - */ -proto.validate.Int32Rules.prototype.getGt = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.Int32Rules} returns this - */ -proto.validate.Int32Rules.prototype.setGt = function(value) { - return jspb.Message.setField(this, 4, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.Int32Rules} returns this - */ -proto.validate.Int32Rules.prototype.clearGt = function() { - return jspb.Message.setField(this, 4, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.Int32Rules.prototype.hasGt = function() { - return jspb.Message.getField(this, 4) != null; -}; - - -/** - * optional int32 gte = 5; - * @return {number} - */ -proto.validate.Int32Rules.prototype.getGte = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.Int32Rules} returns this - */ -proto.validate.Int32Rules.prototype.setGte = function(value) { - return jspb.Message.setField(this, 5, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.Int32Rules} returns this - */ -proto.validate.Int32Rules.prototype.clearGte = function() { - return jspb.Message.setField(this, 5, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.Int32Rules.prototype.hasGte = function() { - return jspb.Message.getField(this, 5) != null; -}; - - -/** - * repeated int32 in = 6; - * @return {!Array} - */ -proto.validate.Int32Rules.prototype.getInList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 6)); -}; - - -/** - * @param {!Array} value - * @return {!proto.validate.Int32Rules} returns this - */ -proto.validate.Int32Rules.prototype.setInList = function(value) { - return jspb.Message.setField(this, 6, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - * @return {!proto.validate.Int32Rules} returns this - */ -proto.validate.Int32Rules.prototype.addIn = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 6, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.validate.Int32Rules} returns this - */ -proto.validate.Int32Rules.prototype.clearInList = function() { - return this.setInList([]); -}; - - -/** - * repeated int32 not_in = 7; - * @return {!Array} - */ -proto.validate.Int32Rules.prototype.getNotInList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 7)); -}; - - -/** - * @param {!Array} value - * @return {!proto.validate.Int32Rules} returns this - */ -proto.validate.Int32Rules.prototype.setNotInList = function(value) { - return jspb.Message.setField(this, 7, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - * @return {!proto.validate.Int32Rules} returns this - */ -proto.validate.Int32Rules.prototype.addNotIn = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 7, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.validate.Int32Rules} returns this - */ -proto.validate.Int32Rules.prototype.clearNotInList = function() { - return this.setNotInList([]); -}; - - -/** - * optional bool ignore_empty = 8; - * @return {boolean} - */ -proto.validate.Int32Rules.prototype.getIgnoreEmpty = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.Int32Rules} returns this - */ -proto.validate.Int32Rules.prototype.setIgnoreEmpty = function(value) { - return jspb.Message.setField(this, 8, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.Int32Rules} returns this - */ -proto.validate.Int32Rules.prototype.clearIgnoreEmpty = function() { - return jspb.Message.setField(this, 8, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.Int32Rules.prototype.hasIgnoreEmpty = function() { - return jspb.Message.getField(this, 8) != null; -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.validate.Int64Rules.repeatedFields_ = [6,7]; - - - -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.validate.Int64Rules.prototype.toObject = function(opt_includeInstance) { - return proto.validate.Int64Rules.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.validate.Int64Rules} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.Int64Rules.toObject = function(includeInstance, msg) { - var f, obj = { - pb_const: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, - lt: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f, - lte: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f, - gt: (f = jspb.Message.getField(msg, 4)) == null ? undefined : f, - gte: (f = jspb.Message.getField(msg, 5)) == null ? undefined : f, - inList: (f = jspb.Message.getRepeatedField(msg, 6)) == null ? undefined : f, - notInList: (f = jspb.Message.getRepeatedField(msg, 7)) == null ? undefined : f, - ignoreEmpty: (f = jspb.Message.getBooleanField(msg, 8)) == 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.validate.Int64Rules} - */ -proto.validate.Int64Rules.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.validate.Int64Rules; - return proto.validate.Int64Rules.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.validate.Int64Rules} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.validate.Int64Rules} - */ -proto.validate.Int64Rules.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readInt64()); - msg.setConst(value); - break; - case 2: - var value = /** @type {number} */ (reader.readInt64()); - msg.setLt(value); - break; - case 3: - var value = /** @type {number} */ (reader.readInt64()); - msg.setLte(value); - break; - case 4: - var value = /** @type {number} */ (reader.readInt64()); - msg.setGt(value); - break; - case 5: - var value = /** @type {number} */ (reader.readInt64()); - msg.setGte(value); - break; - case 6: - var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedInt64() : [reader.readInt64()]); - for (var i = 0; i < values.length; i++) { - msg.addIn(values[i]); - } - break; - case 7: - var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedInt64() : [reader.readInt64()]); - for (var i = 0; i < values.length; i++) { - msg.addNotIn(values[i]); - } - break; - case 8: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setIgnoreEmpty(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.validate.Int64Rules.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.validate.Int64Rules.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.validate.Int64Rules} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.Int64Rules.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {number} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeInt64( - 1, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 2)); - if (f != null) { - writer.writeInt64( - 2, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 3)); - if (f != null) { - writer.writeInt64( - 3, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 4)); - if (f != null) { - writer.writeInt64( - 4, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 5)); - if (f != null) { - writer.writeInt64( - 5, - f - ); - } - f = message.getInList(); - if (f.length > 0) { - writer.writeRepeatedInt64( - 6, - f - ); - } - f = message.getNotInList(); - if (f.length > 0) { - writer.writeRepeatedInt64( - 7, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 8)); - if (f != null) { - writer.writeBool( - 8, - f - ); - } -}; - - -/** - * optional int64 const = 1; - * @return {number} - */ -proto.validate.Int64Rules.prototype.getConst = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.Int64Rules} returns this - */ -proto.validate.Int64Rules.prototype.setConst = function(value) { - return jspb.Message.setField(this, 1, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.Int64Rules} returns this - */ -proto.validate.Int64Rules.prototype.clearConst = function() { - return jspb.Message.setField(this, 1, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.Int64Rules.prototype.hasConst = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional int64 lt = 2; - * @return {number} - */ -proto.validate.Int64Rules.prototype.getLt = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.Int64Rules} returns this - */ -proto.validate.Int64Rules.prototype.setLt = function(value) { - return jspb.Message.setField(this, 2, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.Int64Rules} returns this - */ -proto.validate.Int64Rules.prototype.clearLt = function() { - return jspb.Message.setField(this, 2, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.Int64Rules.prototype.hasLt = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional int64 lte = 3; - * @return {number} - */ -proto.validate.Int64Rules.prototype.getLte = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.Int64Rules} returns this - */ -proto.validate.Int64Rules.prototype.setLte = function(value) { - return jspb.Message.setField(this, 3, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.Int64Rules} returns this - */ -proto.validate.Int64Rules.prototype.clearLte = function() { - return jspb.Message.setField(this, 3, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.Int64Rules.prototype.hasLte = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * optional int64 gt = 4; - * @return {number} - */ -proto.validate.Int64Rules.prototype.getGt = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.Int64Rules} returns this - */ -proto.validate.Int64Rules.prototype.setGt = function(value) { - return jspb.Message.setField(this, 4, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.Int64Rules} returns this - */ -proto.validate.Int64Rules.prototype.clearGt = function() { - return jspb.Message.setField(this, 4, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.Int64Rules.prototype.hasGt = function() { - return jspb.Message.getField(this, 4) != null; -}; - - -/** - * optional int64 gte = 5; - * @return {number} - */ -proto.validate.Int64Rules.prototype.getGte = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.Int64Rules} returns this - */ -proto.validate.Int64Rules.prototype.setGte = function(value) { - return jspb.Message.setField(this, 5, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.Int64Rules} returns this - */ -proto.validate.Int64Rules.prototype.clearGte = function() { - return jspb.Message.setField(this, 5, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.Int64Rules.prototype.hasGte = function() { - return jspb.Message.getField(this, 5) != null; -}; - - -/** - * repeated int64 in = 6; - * @return {!Array} - */ -proto.validate.Int64Rules.prototype.getInList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 6)); -}; - - -/** - * @param {!Array} value - * @return {!proto.validate.Int64Rules} returns this - */ -proto.validate.Int64Rules.prototype.setInList = function(value) { - return jspb.Message.setField(this, 6, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - * @return {!proto.validate.Int64Rules} returns this - */ -proto.validate.Int64Rules.prototype.addIn = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 6, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.validate.Int64Rules} returns this - */ -proto.validate.Int64Rules.prototype.clearInList = function() { - return this.setInList([]); -}; - - -/** - * repeated int64 not_in = 7; - * @return {!Array} - */ -proto.validate.Int64Rules.prototype.getNotInList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 7)); -}; - - -/** - * @param {!Array} value - * @return {!proto.validate.Int64Rules} returns this - */ -proto.validate.Int64Rules.prototype.setNotInList = function(value) { - return jspb.Message.setField(this, 7, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - * @return {!proto.validate.Int64Rules} returns this - */ -proto.validate.Int64Rules.prototype.addNotIn = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 7, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.validate.Int64Rules} returns this - */ -proto.validate.Int64Rules.prototype.clearNotInList = function() { - return this.setNotInList([]); -}; - - -/** - * optional bool ignore_empty = 8; - * @return {boolean} - */ -proto.validate.Int64Rules.prototype.getIgnoreEmpty = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.Int64Rules} returns this - */ -proto.validate.Int64Rules.prototype.setIgnoreEmpty = function(value) { - return jspb.Message.setField(this, 8, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.Int64Rules} returns this - */ -proto.validate.Int64Rules.prototype.clearIgnoreEmpty = function() { - return jspb.Message.setField(this, 8, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.Int64Rules.prototype.hasIgnoreEmpty = function() { - return jspb.Message.getField(this, 8) != null; -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.validate.UInt32Rules.repeatedFields_ = [6,7]; - - - -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.validate.UInt32Rules.prototype.toObject = function(opt_includeInstance) { - return proto.validate.UInt32Rules.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.validate.UInt32Rules} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.UInt32Rules.toObject = function(includeInstance, msg) { - var f, obj = { - pb_const: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, - lt: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f, - lte: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f, - gt: (f = jspb.Message.getField(msg, 4)) == null ? undefined : f, - gte: (f = jspb.Message.getField(msg, 5)) == null ? undefined : f, - inList: (f = jspb.Message.getRepeatedField(msg, 6)) == null ? undefined : f, - notInList: (f = jspb.Message.getRepeatedField(msg, 7)) == null ? undefined : f, - ignoreEmpty: (f = jspb.Message.getBooleanField(msg, 8)) == 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.validate.UInt32Rules} - */ -proto.validate.UInt32Rules.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.validate.UInt32Rules; - return proto.validate.UInt32Rules.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.validate.UInt32Rules} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.validate.UInt32Rules} - */ -proto.validate.UInt32Rules.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readUint32()); - msg.setConst(value); - break; - case 2: - var value = /** @type {number} */ (reader.readUint32()); - msg.setLt(value); - break; - case 3: - var value = /** @type {number} */ (reader.readUint32()); - msg.setLte(value); - break; - case 4: - var value = /** @type {number} */ (reader.readUint32()); - msg.setGt(value); - break; - case 5: - var value = /** @type {number} */ (reader.readUint32()); - msg.setGte(value); - break; - case 6: - var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedUint32() : [reader.readUint32()]); - for (var i = 0; i < values.length; i++) { - msg.addIn(values[i]); - } - break; - case 7: - var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedUint32() : [reader.readUint32()]); - for (var i = 0; i < values.length; i++) { - msg.addNotIn(values[i]); - } - break; - case 8: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setIgnoreEmpty(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.validate.UInt32Rules.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.validate.UInt32Rules.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.validate.UInt32Rules} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.UInt32Rules.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {number} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeUint32( - 1, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 2)); - if (f != null) { - writer.writeUint32( - 2, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 3)); - if (f != null) { - writer.writeUint32( - 3, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 4)); - if (f != null) { - writer.writeUint32( - 4, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 5)); - if (f != null) { - writer.writeUint32( - 5, - f - ); - } - f = message.getInList(); - if (f.length > 0) { - writer.writeRepeatedUint32( - 6, - f - ); - } - f = message.getNotInList(); - if (f.length > 0) { - writer.writeRepeatedUint32( - 7, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 8)); - if (f != null) { - writer.writeBool( - 8, - f - ); - } -}; - - -/** - * optional uint32 const = 1; - * @return {number} - */ -proto.validate.UInt32Rules.prototype.getConst = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.UInt32Rules} returns this - */ -proto.validate.UInt32Rules.prototype.setConst = function(value) { - return jspb.Message.setField(this, 1, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.UInt32Rules} returns this - */ -proto.validate.UInt32Rules.prototype.clearConst = function() { - return jspb.Message.setField(this, 1, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.UInt32Rules.prototype.hasConst = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional uint32 lt = 2; - * @return {number} - */ -proto.validate.UInt32Rules.prototype.getLt = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.UInt32Rules} returns this - */ -proto.validate.UInt32Rules.prototype.setLt = function(value) { - return jspb.Message.setField(this, 2, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.UInt32Rules} returns this - */ -proto.validate.UInt32Rules.prototype.clearLt = function() { - return jspb.Message.setField(this, 2, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.UInt32Rules.prototype.hasLt = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional uint32 lte = 3; - * @return {number} - */ -proto.validate.UInt32Rules.prototype.getLte = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.UInt32Rules} returns this - */ -proto.validate.UInt32Rules.prototype.setLte = function(value) { - return jspb.Message.setField(this, 3, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.UInt32Rules} returns this - */ -proto.validate.UInt32Rules.prototype.clearLte = function() { - return jspb.Message.setField(this, 3, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.UInt32Rules.prototype.hasLte = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * optional uint32 gt = 4; - * @return {number} - */ -proto.validate.UInt32Rules.prototype.getGt = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.UInt32Rules} returns this - */ -proto.validate.UInt32Rules.prototype.setGt = function(value) { - return jspb.Message.setField(this, 4, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.UInt32Rules} returns this - */ -proto.validate.UInt32Rules.prototype.clearGt = function() { - return jspb.Message.setField(this, 4, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.UInt32Rules.prototype.hasGt = function() { - return jspb.Message.getField(this, 4) != null; -}; - - -/** - * optional uint32 gte = 5; - * @return {number} - */ -proto.validate.UInt32Rules.prototype.getGte = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.UInt32Rules} returns this - */ -proto.validate.UInt32Rules.prototype.setGte = function(value) { - return jspb.Message.setField(this, 5, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.UInt32Rules} returns this - */ -proto.validate.UInt32Rules.prototype.clearGte = function() { - return jspb.Message.setField(this, 5, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.UInt32Rules.prototype.hasGte = function() { - return jspb.Message.getField(this, 5) != null; -}; - - -/** - * repeated uint32 in = 6; - * @return {!Array} - */ -proto.validate.UInt32Rules.prototype.getInList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 6)); -}; - - -/** - * @param {!Array} value - * @return {!proto.validate.UInt32Rules} returns this - */ -proto.validate.UInt32Rules.prototype.setInList = function(value) { - return jspb.Message.setField(this, 6, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - * @return {!proto.validate.UInt32Rules} returns this - */ -proto.validate.UInt32Rules.prototype.addIn = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 6, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.validate.UInt32Rules} returns this - */ -proto.validate.UInt32Rules.prototype.clearInList = function() { - return this.setInList([]); -}; - - -/** - * repeated uint32 not_in = 7; - * @return {!Array} - */ -proto.validate.UInt32Rules.prototype.getNotInList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 7)); -}; - - -/** - * @param {!Array} value - * @return {!proto.validate.UInt32Rules} returns this - */ -proto.validate.UInt32Rules.prototype.setNotInList = function(value) { - return jspb.Message.setField(this, 7, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - * @return {!proto.validate.UInt32Rules} returns this - */ -proto.validate.UInt32Rules.prototype.addNotIn = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 7, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.validate.UInt32Rules} returns this - */ -proto.validate.UInt32Rules.prototype.clearNotInList = function() { - return this.setNotInList([]); -}; - - -/** - * optional bool ignore_empty = 8; - * @return {boolean} - */ -proto.validate.UInt32Rules.prototype.getIgnoreEmpty = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.UInt32Rules} returns this - */ -proto.validate.UInt32Rules.prototype.setIgnoreEmpty = function(value) { - return jspb.Message.setField(this, 8, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.UInt32Rules} returns this - */ -proto.validate.UInt32Rules.prototype.clearIgnoreEmpty = function() { - return jspb.Message.setField(this, 8, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.UInt32Rules.prototype.hasIgnoreEmpty = function() { - return jspb.Message.getField(this, 8) != null; -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.validate.UInt64Rules.repeatedFields_ = [6,7]; - - - -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.validate.UInt64Rules.prototype.toObject = function(opt_includeInstance) { - return proto.validate.UInt64Rules.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.validate.UInt64Rules} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.UInt64Rules.toObject = function(includeInstance, msg) { - var f, obj = { - pb_const: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, - lt: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f, - lte: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f, - gt: (f = jspb.Message.getField(msg, 4)) == null ? undefined : f, - gte: (f = jspb.Message.getField(msg, 5)) == null ? undefined : f, - inList: (f = jspb.Message.getRepeatedField(msg, 6)) == null ? undefined : f, - notInList: (f = jspb.Message.getRepeatedField(msg, 7)) == null ? undefined : f, - ignoreEmpty: (f = jspb.Message.getBooleanField(msg, 8)) == 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.validate.UInt64Rules} - */ -proto.validate.UInt64Rules.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.validate.UInt64Rules; - return proto.validate.UInt64Rules.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.validate.UInt64Rules} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.validate.UInt64Rules} - */ -proto.validate.UInt64Rules.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readUint64()); - msg.setConst(value); - break; - case 2: - var value = /** @type {number} */ (reader.readUint64()); - msg.setLt(value); - break; - case 3: - var value = /** @type {number} */ (reader.readUint64()); - msg.setLte(value); - break; - case 4: - var value = /** @type {number} */ (reader.readUint64()); - msg.setGt(value); - break; - case 5: - var value = /** @type {number} */ (reader.readUint64()); - msg.setGte(value); - break; - case 6: - var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedUint64() : [reader.readUint64()]); - for (var i = 0; i < values.length; i++) { - msg.addIn(values[i]); - } - break; - case 7: - var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedUint64() : [reader.readUint64()]); - for (var i = 0; i < values.length; i++) { - msg.addNotIn(values[i]); - } - break; - case 8: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setIgnoreEmpty(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.validate.UInt64Rules.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.validate.UInt64Rules.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.validate.UInt64Rules} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.UInt64Rules.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {number} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeUint64( - 1, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 2)); - if (f != null) { - writer.writeUint64( - 2, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 3)); - if (f != null) { - writer.writeUint64( - 3, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 4)); - if (f != null) { - writer.writeUint64( - 4, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 5)); - if (f != null) { - writer.writeUint64( - 5, - f - ); - } - f = message.getInList(); - if (f.length > 0) { - writer.writeRepeatedUint64( - 6, - f - ); - } - f = message.getNotInList(); - if (f.length > 0) { - writer.writeRepeatedUint64( - 7, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 8)); - if (f != null) { - writer.writeBool( - 8, - f - ); - } -}; - - -/** - * optional uint64 const = 1; - * @return {number} - */ -proto.validate.UInt64Rules.prototype.getConst = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.UInt64Rules} returns this - */ -proto.validate.UInt64Rules.prototype.setConst = function(value) { - return jspb.Message.setField(this, 1, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.UInt64Rules} returns this - */ -proto.validate.UInt64Rules.prototype.clearConst = function() { - return jspb.Message.setField(this, 1, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.UInt64Rules.prototype.hasConst = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional uint64 lt = 2; - * @return {number} - */ -proto.validate.UInt64Rules.prototype.getLt = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.UInt64Rules} returns this - */ -proto.validate.UInt64Rules.prototype.setLt = function(value) { - return jspb.Message.setField(this, 2, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.UInt64Rules} returns this - */ -proto.validate.UInt64Rules.prototype.clearLt = function() { - return jspb.Message.setField(this, 2, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.UInt64Rules.prototype.hasLt = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional uint64 lte = 3; - * @return {number} - */ -proto.validate.UInt64Rules.prototype.getLte = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.UInt64Rules} returns this - */ -proto.validate.UInt64Rules.prototype.setLte = function(value) { - return jspb.Message.setField(this, 3, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.UInt64Rules} returns this - */ -proto.validate.UInt64Rules.prototype.clearLte = function() { - return jspb.Message.setField(this, 3, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.UInt64Rules.prototype.hasLte = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * optional uint64 gt = 4; - * @return {number} - */ -proto.validate.UInt64Rules.prototype.getGt = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.UInt64Rules} returns this - */ -proto.validate.UInt64Rules.prototype.setGt = function(value) { - return jspb.Message.setField(this, 4, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.UInt64Rules} returns this - */ -proto.validate.UInt64Rules.prototype.clearGt = function() { - return jspb.Message.setField(this, 4, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.UInt64Rules.prototype.hasGt = function() { - return jspb.Message.getField(this, 4) != null; -}; - - -/** - * optional uint64 gte = 5; - * @return {number} - */ -proto.validate.UInt64Rules.prototype.getGte = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.UInt64Rules} returns this - */ -proto.validate.UInt64Rules.prototype.setGte = function(value) { - return jspb.Message.setField(this, 5, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.UInt64Rules} returns this - */ -proto.validate.UInt64Rules.prototype.clearGte = function() { - return jspb.Message.setField(this, 5, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.UInt64Rules.prototype.hasGte = function() { - return jspb.Message.getField(this, 5) != null; -}; - - -/** - * repeated uint64 in = 6; - * @return {!Array} - */ -proto.validate.UInt64Rules.prototype.getInList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 6)); -}; - - -/** - * @param {!Array} value - * @return {!proto.validate.UInt64Rules} returns this - */ -proto.validate.UInt64Rules.prototype.setInList = function(value) { - return jspb.Message.setField(this, 6, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - * @return {!proto.validate.UInt64Rules} returns this - */ -proto.validate.UInt64Rules.prototype.addIn = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 6, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.validate.UInt64Rules} returns this - */ -proto.validate.UInt64Rules.prototype.clearInList = function() { - return this.setInList([]); -}; - - -/** - * repeated uint64 not_in = 7; - * @return {!Array} - */ -proto.validate.UInt64Rules.prototype.getNotInList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 7)); -}; - - -/** - * @param {!Array} value - * @return {!proto.validate.UInt64Rules} returns this - */ -proto.validate.UInt64Rules.prototype.setNotInList = function(value) { - return jspb.Message.setField(this, 7, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - * @return {!proto.validate.UInt64Rules} returns this - */ -proto.validate.UInt64Rules.prototype.addNotIn = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 7, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.validate.UInt64Rules} returns this - */ -proto.validate.UInt64Rules.prototype.clearNotInList = function() { - return this.setNotInList([]); -}; - - -/** - * optional bool ignore_empty = 8; - * @return {boolean} - */ -proto.validate.UInt64Rules.prototype.getIgnoreEmpty = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.UInt64Rules} returns this - */ -proto.validate.UInt64Rules.prototype.setIgnoreEmpty = function(value) { - return jspb.Message.setField(this, 8, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.UInt64Rules} returns this - */ -proto.validate.UInt64Rules.prototype.clearIgnoreEmpty = function() { - return jspb.Message.setField(this, 8, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.UInt64Rules.prototype.hasIgnoreEmpty = function() { - return jspb.Message.getField(this, 8) != null; -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.validate.SInt32Rules.repeatedFields_ = [6,7]; - - - -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.validate.SInt32Rules.prototype.toObject = function(opt_includeInstance) { - return proto.validate.SInt32Rules.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.validate.SInt32Rules} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.SInt32Rules.toObject = function(includeInstance, msg) { - var f, obj = { - pb_const: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, - lt: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f, - lte: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f, - gt: (f = jspb.Message.getField(msg, 4)) == null ? undefined : f, - gte: (f = jspb.Message.getField(msg, 5)) == null ? undefined : f, - inList: (f = jspb.Message.getRepeatedField(msg, 6)) == null ? undefined : f, - notInList: (f = jspb.Message.getRepeatedField(msg, 7)) == null ? undefined : f, - ignoreEmpty: (f = jspb.Message.getBooleanField(msg, 8)) == 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.validate.SInt32Rules} - */ -proto.validate.SInt32Rules.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.validate.SInt32Rules; - return proto.validate.SInt32Rules.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.validate.SInt32Rules} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.validate.SInt32Rules} - */ -proto.validate.SInt32Rules.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readSint32()); - msg.setConst(value); - break; - case 2: - var value = /** @type {number} */ (reader.readSint32()); - msg.setLt(value); - break; - case 3: - var value = /** @type {number} */ (reader.readSint32()); - msg.setLte(value); - break; - case 4: - var value = /** @type {number} */ (reader.readSint32()); - msg.setGt(value); - break; - case 5: - var value = /** @type {number} */ (reader.readSint32()); - msg.setGte(value); - break; - case 6: - var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedSint32() : [reader.readSint32()]); - for (var i = 0; i < values.length; i++) { - msg.addIn(values[i]); - } - break; - case 7: - var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedSint32() : [reader.readSint32()]); - for (var i = 0; i < values.length; i++) { - msg.addNotIn(values[i]); - } - break; - case 8: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setIgnoreEmpty(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.validate.SInt32Rules.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.validate.SInt32Rules.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.validate.SInt32Rules} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.SInt32Rules.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {number} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeSint32( - 1, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 2)); - if (f != null) { - writer.writeSint32( - 2, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 3)); - if (f != null) { - writer.writeSint32( - 3, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 4)); - if (f != null) { - writer.writeSint32( - 4, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 5)); - if (f != null) { - writer.writeSint32( - 5, - f - ); - } - f = message.getInList(); - if (f.length > 0) { - writer.writeRepeatedSint32( - 6, - f - ); - } - f = message.getNotInList(); - if (f.length > 0) { - writer.writeRepeatedSint32( - 7, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 8)); - if (f != null) { - writer.writeBool( - 8, - f - ); - } -}; - - -/** - * optional sint32 const = 1; - * @return {number} - */ -proto.validate.SInt32Rules.prototype.getConst = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.SInt32Rules} returns this - */ -proto.validate.SInt32Rules.prototype.setConst = function(value) { - return jspb.Message.setField(this, 1, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.SInt32Rules} returns this - */ -proto.validate.SInt32Rules.prototype.clearConst = function() { - return jspb.Message.setField(this, 1, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.SInt32Rules.prototype.hasConst = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional sint32 lt = 2; - * @return {number} - */ -proto.validate.SInt32Rules.prototype.getLt = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.SInt32Rules} returns this - */ -proto.validate.SInt32Rules.prototype.setLt = function(value) { - return jspb.Message.setField(this, 2, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.SInt32Rules} returns this - */ -proto.validate.SInt32Rules.prototype.clearLt = function() { - return jspb.Message.setField(this, 2, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.SInt32Rules.prototype.hasLt = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional sint32 lte = 3; - * @return {number} - */ -proto.validate.SInt32Rules.prototype.getLte = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.SInt32Rules} returns this - */ -proto.validate.SInt32Rules.prototype.setLte = function(value) { - return jspb.Message.setField(this, 3, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.SInt32Rules} returns this - */ -proto.validate.SInt32Rules.prototype.clearLte = function() { - return jspb.Message.setField(this, 3, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.SInt32Rules.prototype.hasLte = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * optional sint32 gt = 4; - * @return {number} - */ -proto.validate.SInt32Rules.prototype.getGt = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.SInt32Rules} returns this - */ -proto.validate.SInt32Rules.prototype.setGt = function(value) { - return jspb.Message.setField(this, 4, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.SInt32Rules} returns this - */ -proto.validate.SInt32Rules.prototype.clearGt = function() { - return jspb.Message.setField(this, 4, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.SInt32Rules.prototype.hasGt = function() { - return jspb.Message.getField(this, 4) != null; -}; - - -/** - * optional sint32 gte = 5; - * @return {number} - */ -proto.validate.SInt32Rules.prototype.getGte = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.SInt32Rules} returns this - */ -proto.validate.SInt32Rules.prototype.setGte = function(value) { - return jspb.Message.setField(this, 5, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.SInt32Rules} returns this - */ -proto.validate.SInt32Rules.prototype.clearGte = function() { - return jspb.Message.setField(this, 5, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.SInt32Rules.prototype.hasGte = function() { - return jspb.Message.getField(this, 5) != null; -}; - - -/** - * repeated sint32 in = 6; - * @return {!Array} - */ -proto.validate.SInt32Rules.prototype.getInList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 6)); -}; - - -/** - * @param {!Array} value - * @return {!proto.validate.SInt32Rules} returns this - */ -proto.validate.SInt32Rules.prototype.setInList = function(value) { - return jspb.Message.setField(this, 6, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - * @return {!proto.validate.SInt32Rules} returns this - */ -proto.validate.SInt32Rules.prototype.addIn = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 6, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.validate.SInt32Rules} returns this - */ -proto.validate.SInt32Rules.prototype.clearInList = function() { - return this.setInList([]); -}; - - -/** - * repeated sint32 not_in = 7; - * @return {!Array} - */ -proto.validate.SInt32Rules.prototype.getNotInList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 7)); -}; - - -/** - * @param {!Array} value - * @return {!proto.validate.SInt32Rules} returns this - */ -proto.validate.SInt32Rules.prototype.setNotInList = function(value) { - return jspb.Message.setField(this, 7, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - * @return {!proto.validate.SInt32Rules} returns this - */ -proto.validate.SInt32Rules.prototype.addNotIn = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 7, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.validate.SInt32Rules} returns this - */ -proto.validate.SInt32Rules.prototype.clearNotInList = function() { - return this.setNotInList([]); -}; - - -/** - * optional bool ignore_empty = 8; - * @return {boolean} - */ -proto.validate.SInt32Rules.prototype.getIgnoreEmpty = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.SInt32Rules} returns this - */ -proto.validate.SInt32Rules.prototype.setIgnoreEmpty = function(value) { - return jspb.Message.setField(this, 8, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.SInt32Rules} returns this - */ -proto.validate.SInt32Rules.prototype.clearIgnoreEmpty = function() { - return jspb.Message.setField(this, 8, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.SInt32Rules.prototype.hasIgnoreEmpty = function() { - return jspb.Message.getField(this, 8) != null; -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.validate.SInt64Rules.repeatedFields_ = [6,7]; - - - -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.validate.SInt64Rules.prototype.toObject = function(opt_includeInstance) { - return proto.validate.SInt64Rules.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.validate.SInt64Rules} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.SInt64Rules.toObject = function(includeInstance, msg) { - var f, obj = { - pb_const: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, - lt: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f, - lte: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f, - gt: (f = jspb.Message.getField(msg, 4)) == null ? undefined : f, - gte: (f = jspb.Message.getField(msg, 5)) == null ? undefined : f, - inList: (f = jspb.Message.getRepeatedField(msg, 6)) == null ? undefined : f, - notInList: (f = jspb.Message.getRepeatedField(msg, 7)) == null ? undefined : f, - ignoreEmpty: (f = jspb.Message.getBooleanField(msg, 8)) == 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.validate.SInt64Rules} - */ -proto.validate.SInt64Rules.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.validate.SInt64Rules; - return proto.validate.SInt64Rules.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.validate.SInt64Rules} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.validate.SInt64Rules} - */ -proto.validate.SInt64Rules.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readSint64()); - msg.setConst(value); - break; - case 2: - var value = /** @type {number} */ (reader.readSint64()); - msg.setLt(value); - break; - case 3: - var value = /** @type {number} */ (reader.readSint64()); - msg.setLte(value); - break; - case 4: - var value = /** @type {number} */ (reader.readSint64()); - msg.setGt(value); - break; - case 5: - var value = /** @type {number} */ (reader.readSint64()); - msg.setGte(value); - break; - case 6: - var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedSint64() : [reader.readSint64()]); - for (var i = 0; i < values.length; i++) { - msg.addIn(values[i]); - } - break; - case 7: - var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedSint64() : [reader.readSint64()]); - for (var i = 0; i < values.length; i++) { - msg.addNotIn(values[i]); - } - break; - case 8: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setIgnoreEmpty(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.validate.SInt64Rules.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.validate.SInt64Rules.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.validate.SInt64Rules} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.SInt64Rules.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {number} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeSint64( - 1, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 2)); - if (f != null) { - writer.writeSint64( - 2, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 3)); - if (f != null) { - writer.writeSint64( - 3, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 4)); - if (f != null) { - writer.writeSint64( - 4, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 5)); - if (f != null) { - writer.writeSint64( - 5, - f - ); - } - f = message.getInList(); - if (f.length > 0) { - writer.writeRepeatedSint64( - 6, - f - ); - } - f = message.getNotInList(); - if (f.length > 0) { - writer.writeRepeatedSint64( - 7, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 8)); - if (f != null) { - writer.writeBool( - 8, - f - ); - } -}; - - -/** - * optional sint64 const = 1; - * @return {number} - */ -proto.validate.SInt64Rules.prototype.getConst = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.SInt64Rules} returns this - */ -proto.validate.SInt64Rules.prototype.setConst = function(value) { - return jspb.Message.setField(this, 1, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.SInt64Rules} returns this - */ -proto.validate.SInt64Rules.prototype.clearConst = function() { - return jspb.Message.setField(this, 1, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.SInt64Rules.prototype.hasConst = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional sint64 lt = 2; - * @return {number} - */ -proto.validate.SInt64Rules.prototype.getLt = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.SInt64Rules} returns this - */ -proto.validate.SInt64Rules.prototype.setLt = function(value) { - return jspb.Message.setField(this, 2, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.SInt64Rules} returns this - */ -proto.validate.SInt64Rules.prototype.clearLt = function() { - return jspb.Message.setField(this, 2, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.SInt64Rules.prototype.hasLt = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional sint64 lte = 3; - * @return {number} - */ -proto.validate.SInt64Rules.prototype.getLte = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.SInt64Rules} returns this - */ -proto.validate.SInt64Rules.prototype.setLte = function(value) { - return jspb.Message.setField(this, 3, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.SInt64Rules} returns this - */ -proto.validate.SInt64Rules.prototype.clearLte = function() { - return jspb.Message.setField(this, 3, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.SInt64Rules.prototype.hasLte = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * optional sint64 gt = 4; - * @return {number} - */ -proto.validate.SInt64Rules.prototype.getGt = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.SInt64Rules} returns this - */ -proto.validate.SInt64Rules.prototype.setGt = function(value) { - return jspb.Message.setField(this, 4, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.SInt64Rules} returns this - */ -proto.validate.SInt64Rules.prototype.clearGt = function() { - return jspb.Message.setField(this, 4, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.SInt64Rules.prototype.hasGt = function() { - return jspb.Message.getField(this, 4) != null; -}; - - -/** - * optional sint64 gte = 5; - * @return {number} - */ -proto.validate.SInt64Rules.prototype.getGte = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.SInt64Rules} returns this - */ -proto.validate.SInt64Rules.prototype.setGte = function(value) { - return jspb.Message.setField(this, 5, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.SInt64Rules} returns this - */ -proto.validate.SInt64Rules.prototype.clearGte = function() { - return jspb.Message.setField(this, 5, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.SInt64Rules.prototype.hasGte = function() { - return jspb.Message.getField(this, 5) != null; -}; - - -/** - * repeated sint64 in = 6; - * @return {!Array} - */ -proto.validate.SInt64Rules.prototype.getInList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 6)); -}; - - -/** - * @param {!Array} value - * @return {!proto.validate.SInt64Rules} returns this - */ -proto.validate.SInt64Rules.prototype.setInList = function(value) { - return jspb.Message.setField(this, 6, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - * @return {!proto.validate.SInt64Rules} returns this - */ -proto.validate.SInt64Rules.prototype.addIn = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 6, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.validate.SInt64Rules} returns this - */ -proto.validate.SInt64Rules.prototype.clearInList = function() { - return this.setInList([]); -}; - - -/** - * repeated sint64 not_in = 7; - * @return {!Array} - */ -proto.validate.SInt64Rules.prototype.getNotInList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 7)); -}; - - -/** - * @param {!Array} value - * @return {!proto.validate.SInt64Rules} returns this - */ -proto.validate.SInt64Rules.prototype.setNotInList = function(value) { - return jspb.Message.setField(this, 7, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - * @return {!proto.validate.SInt64Rules} returns this - */ -proto.validate.SInt64Rules.prototype.addNotIn = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 7, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.validate.SInt64Rules} returns this - */ -proto.validate.SInt64Rules.prototype.clearNotInList = function() { - return this.setNotInList([]); -}; - - -/** - * optional bool ignore_empty = 8; - * @return {boolean} - */ -proto.validate.SInt64Rules.prototype.getIgnoreEmpty = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.SInt64Rules} returns this - */ -proto.validate.SInt64Rules.prototype.setIgnoreEmpty = function(value) { - return jspb.Message.setField(this, 8, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.SInt64Rules} returns this - */ -proto.validate.SInt64Rules.prototype.clearIgnoreEmpty = function() { - return jspb.Message.setField(this, 8, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.SInt64Rules.prototype.hasIgnoreEmpty = function() { - return jspb.Message.getField(this, 8) != null; -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.validate.Fixed32Rules.repeatedFields_ = [6,7]; - - - -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.validate.Fixed32Rules.prototype.toObject = function(opt_includeInstance) { - return proto.validate.Fixed32Rules.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.validate.Fixed32Rules} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.Fixed32Rules.toObject = function(includeInstance, msg) { - var f, obj = { - pb_const: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, - lt: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f, - lte: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f, - gt: (f = jspb.Message.getField(msg, 4)) == null ? undefined : f, - gte: (f = jspb.Message.getField(msg, 5)) == null ? undefined : f, - inList: (f = jspb.Message.getRepeatedField(msg, 6)) == null ? undefined : f, - notInList: (f = jspb.Message.getRepeatedField(msg, 7)) == null ? undefined : f, - ignoreEmpty: (f = jspb.Message.getBooleanField(msg, 8)) == 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.validate.Fixed32Rules} - */ -proto.validate.Fixed32Rules.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.validate.Fixed32Rules; - return proto.validate.Fixed32Rules.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.validate.Fixed32Rules} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.validate.Fixed32Rules} - */ -proto.validate.Fixed32Rules.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readFixed32()); - msg.setConst(value); - break; - case 2: - var value = /** @type {number} */ (reader.readFixed32()); - msg.setLt(value); - break; - case 3: - var value = /** @type {number} */ (reader.readFixed32()); - msg.setLte(value); - break; - case 4: - var value = /** @type {number} */ (reader.readFixed32()); - msg.setGt(value); - break; - case 5: - var value = /** @type {number} */ (reader.readFixed32()); - msg.setGte(value); - break; - case 6: - var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedFixed32() : [reader.readFixed32()]); - for (var i = 0; i < values.length; i++) { - msg.addIn(values[i]); - } - break; - case 7: - var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedFixed32() : [reader.readFixed32()]); - for (var i = 0; i < values.length; i++) { - msg.addNotIn(values[i]); - } - break; - case 8: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setIgnoreEmpty(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.validate.Fixed32Rules.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.validate.Fixed32Rules.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.validate.Fixed32Rules} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.Fixed32Rules.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {number} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeFixed32( - 1, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 2)); - if (f != null) { - writer.writeFixed32( - 2, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 3)); - if (f != null) { - writer.writeFixed32( - 3, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 4)); - if (f != null) { - writer.writeFixed32( - 4, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 5)); - if (f != null) { - writer.writeFixed32( - 5, - f - ); - } - f = message.getInList(); - if (f.length > 0) { - writer.writeRepeatedFixed32( - 6, - f - ); - } - f = message.getNotInList(); - if (f.length > 0) { - writer.writeRepeatedFixed32( - 7, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 8)); - if (f != null) { - writer.writeBool( - 8, - f - ); - } -}; - - -/** - * optional fixed32 const = 1; - * @return {number} - */ -proto.validate.Fixed32Rules.prototype.getConst = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.Fixed32Rules} returns this - */ -proto.validate.Fixed32Rules.prototype.setConst = function(value) { - return jspb.Message.setField(this, 1, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.Fixed32Rules} returns this - */ -proto.validate.Fixed32Rules.prototype.clearConst = function() { - return jspb.Message.setField(this, 1, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.Fixed32Rules.prototype.hasConst = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional fixed32 lt = 2; - * @return {number} - */ -proto.validate.Fixed32Rules.prototype.getLt = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.Fixed32Rules} returns this - */ -proto.validate.Fixed32Rules.prototype.setLt = function(value) { - return jspb.Message.setField(this, 2, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.Fixed32Rules} returns this - */ -proto.validate.Fixed32Rules.prototype.clearLt = function() { - return jspb.Message.setField(this, 2, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.Fixed32Rules.prototype.hasLt = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional fixed32 lte = 3; - * @return {number} - */ -proto.validate.Fixed32Rules.prototype.getLte = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.Fixed32Rules} returns this - */ -proto.validate.Fixed32Rules.prototype.setLte = function(value) { - return jspb.Message.setField(this, 3, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.Fixed32Rules} returns this - */ -proto.validate.Fixed32Rules.prototype.clearLte = function() { - return jspb.Message.setField(this, 3, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.Fixed32Rules.prototype.hasLte = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * optional fixed32 gt = 4; - * @return {number} - */ -proto.validate.Fixed32Rules.prototype.getGt = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.Fixed32Rules} returns this - */ -proto.validate.Fixed32Rules.prototype.setGt = function(value) { - return jspb.Message.setField(this, 4, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.Fixed32Rules} returns this - */ -proto.validate.Fixed32Rules.prototype.clearGt = function() { - return jspb.Message.setField(this, 4, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.Fixed32Rules.prototype.hasGt = function() { - return jspb.Message.getField(this, 4) != null; -}; - - -/** - * optional fixed32 gte = 5; - * @return {number} - */ -proto.validate.Fixed32Rules.prototype.getGte = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.Fixed32Rules} returns this - */ -proto.validate.Fixed32Rules.prototype.setGte = function(value) { - return jspb.Message.setField(this, 5, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.Fixed32Rules} returns this - */ -proto.validate.Fixed32Rules.prototype.clearGte = function() { - return jspb.Message.setField(this, 5, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.Fixed32Rules.prototype.hasGte = function() { - return jspb.Message.getField(this, 5) != null; -}; - - -/** - * repeated fixed32 in = 6; - * @return {!Array} - */ -proto.validate.Fixed32Rules.prototype.getInList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 6)); -}; - - -/** - * @param {!Array} value - * @return {!proto.validate.Fixed32Rules} returns this - */ -proto.validate.Fixed32Rules.prototype.setInList = function(value) { - return jspb.Message.setField(this, 6, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - * @return {!proto.validate.Fixed32Rules} returns this - */ -proto.validate.Fixed32Rules.prototype.addIn = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 6, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.validate.Fixed32Rules} returns this - */ -proto.validate.Fixed32Rules.prototype.clearInList = function() { - return this.setInList([]); -}; - - -/** - * repeated fixed32 not_in = 7; - * @return {!Array} - */ -proto.validate.Fixed32Rules.prototype.getNotInList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 7)); -}; - - -/** - * @param {!Array} value - * @return {!proto.validate.Fixed32Rules} returns this - */ -proto.validate.Fixed32Rules.prototype.setNotInList = function(value) { - return jspb.Message.setField(this, 7, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - * @return {!proto.validate.Fixed32Rules} returns this - */ -proto.validate.Fixed32Rules.prototype.addNotIn = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 7, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.validate.Fixed32Rules} returns this - */ -proto.validate.Fixed32Rules.prototype.clearNotInList = function() { - return this.setNotInList([]); -}; - - -/** - * optional bool ignore_empty = 8; - * @return {boolean} - */ -proto.validate.Fixed32Rules.prototype.getIgnoreEmpty = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.Fixed32Rules} returns this - */ -proto.validate.Fixed32Rules.prototype.setIgnoreEmpty = function(value) { - return jspb.Message.setField(this, 8, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.Fixed32Rules} returns this - */ -proto.validate.Fixed32Rules.prototype.clearIgnoreEmpty = function() { - return jspb.Message.setField(this, 8, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.Fixed32Rules.prototype.hasIgnoreEmpty = function() { - return jspb.Message.getField(this, 8) != null; -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.validate.Fixed64Rules.repeatedFields_ = [6,7]; - - - -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.validate.Fixed64Rules.prototype.toObject = function(opt_includeInstance) { - return proto.validate.Fixed64Rules.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.validate.Fixed64Rules} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.Fixed64Rules.toObject = function(includeInstance, msg) { - var f, obj = { - pb_const: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, - lt: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f, - lte: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f, - gt: (f = jspb.Message.getField(msg, 4)) == null ? undefined : f, - gte: (f = jspb.Message.getField(msg, 5)) == null ? undefined : f, - inList: (f = jspb.Message.getRepeatedField(msg, 6)) == null ? undefined : f, - notInList: (f = jspb.Message.getRepeatedField(msg, 7)) == null ? undefined : f, - ignoreEmpty: (f = jspb.Message.getBooleanField(msg, 8)) == 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.validate.Fixed64Rules} - */ -proto.validate.Fixed64Rules.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.validate.Fixed64Rules; - return proto.validate.Fixed64Rules.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.validate.Fixed64Rules} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.validate.Fixed64Rules} - */ -proto.validate.Fixed64Rules.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readFixed64()); - msg.setConst(value); - break; - case 2: - var value = /** @type {number} */ (reader.readFixed64()); - msg.setLt(value); - break; - case 3: - var value = /** @type {number} */ (reader.readFixed64()); - msg.setLte(value); - break; - case 4: - var value = /** @type {number} */ (reader.readFixed64()); - msg.setGt(value); - break; - case 5: - var value = /** @type {number} */ (reader.readFixed64()); - msg.setGte(value); - break; - case 6: - var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedFixed64() : [reader.readFixed64()]); - for (var i = 0; i < values.length; i++) { - msg.addIn(values[i]); - } - break; - case 7: - var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedFixed64() : [reader.readFixed64()]); - for (var i = 0; i < values.length; i++) { - msg.addNotIn(values[i]); - } - break; - case 8: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setIgnoreEmpty(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.validate.Fixed64Rules.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.validate.Fixed64Rules.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.validate.Fixed64Rules} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.Fixed64Rules.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {number} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeFixed64( - 1, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 2)); - if (f != null) { - writer.writeFixed64( - 2, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 3)); - if (f != null) { - writer.writeFixed64( - 3, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 4)); - if (f != null) { - writer.writeFixed64( - 4, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 5)); - if (f != null) { - writer.writeFixed64( - 5, - f - ); - } - f = message.getInList(); - if (f.length > 0) { - writer.writeRepeatedFixed64( - 6, - f - ); - } - f = message.getNotInList(); - if (f.length > 0) { - writer.writeRepeatedFixed64( - 7, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 8)); - if (f != null) { - writer.writeBool( - 8, - f - ); - } -}; - - -/** - * optional fixed64 const = 1; - * @return {number} - */ -proto.validate.Fixed64Rules.prototype.getConst = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.Fixed64Rules} returns this - */ -proto.validate.Fixed64Rules.prototype.setConst = function(value) { - return jspb.Message.setField(this, 1, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.Fixed64Rules} returns this - */ -proto.validate.Fixed64Rules.prototype.clearConst = function() { - return jspb.Message.setField(this, 1, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.Fixed64Rules.prototype.hasConst = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional fixed64 lt = 2; - * @return {number} - */ -proto.validate.Fixed64Rules.prototype.getLt = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.Fixed64Rules} returns this - */ -proto.validate.Fixed64Rules.prototype.setLt = function(value) { - return jspb.Message.setField(this, 2, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.Fixed64Rules} returns this - */ -proto.validate.Fixed64Rules.prototype.clearLt = function() { - return jspb.Message.setField(this, 2, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.Fixed64Rules.prototype.hasLt = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional fixed64 lte = 3; - * @return {number} - */ -proto.validate.Fixed64Rules.prototype.getLte = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.Fixed64Rules} returns this - */ -proto.validate.Fixed64Rules.prototype.setLte = function(value) { - return jspb.Message.setField(this, 3, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.Fixed64Rules} returns this - */ -proto.validate.Fixed64Rules.prototype.clearLte = function() { - return jspb.Message.setField(this, 3, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.Fixed64Rules.prototype.hasLte = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * optional fixed64 gt = 4; - * @return {number} - */ -proto.validate.Fixed64Rules.prototype.getGt = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.Fixed64Rules} returns this - */ -proto.validate.Fixed64Rules.prototype.setGt = function(value) { - return jspb.Message.setField(this, 4, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.Fixed64Rules} returns this - */ -proto.validate.Fixed64Rules.prototype.clearGt = function() { - return jspb.Message.setField(this, 4, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.Fixed64Rules.prototype.hasGt = function() { - return jspb.Message.getField(this, 4) != null; -}; - - -/** - * optional fixed64 gte = 5; - * @return {number} - */ -proto.validate.Fixed64Rules.prototype.getGte = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.Fixed64Rules} returns this - */ -proto.validate.Fixed64Rules.prototype.setGte = function(value) { - return jspb.Message.setField(this, 5, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.Fixed64Rules} returns this - */ -proto.validate.Fixed64Rules.prototype.clearGte = function() { - return jspb.Message.setField(this, 5, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.Fixed64Rules.prototype.hasGte = function() { - return jspb.Message.getField(this, 5) != null; -}; - - -/** - * repeated fixed64 in = 6; - * @return {!Array} - */ -proto.validate.Fixed64Rules.prototype.getInList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 6)); -}; - - -/** - * @param {!Array} value - * @return {!proto.validate.Fixed64Rules} returns this - */ -proto.validate.Fixed64Rules.prototype.setInList = function(value) { - return jspb.Message.setField(this, 6, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - * @return {!proto.validate.Fixed64Rules} returns this - */ -proto.validate.Fixed64Rules.prototype.addIn = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 6, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.validate.Fixed64Rules} returns this - */ -proto.validate.Fixed64Rules.prototype.clearInList = function() { - return this.setInList([]); -}; - - -/** - * repeated fixed64 not_in = 7; - * @return {!Array} - */ -proto.validate.Fixed64Rules.prototype.getNotInList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 7)); -}; - - -/** - * @param {!Array} value - * @return {!proto.validate.Fixed64Rules} returns this - */ -proto.validate.Fixed64Rules.prototype.setNotInList = function(value) { - return jspb.Message.setField(this, 7, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - * @return {!proto.validate.Fixed64Rules} returns this - */ -proto.validate.Fixed64Rules.prototype.addNotIn = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 7, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.validate.Fixed64Rules} returns this - */ -proto.validate.Fixed64Rules.prototype.clearNotInList = function() { - return this.setNotInList([]); -}; - - -/** - * optional bool ignore_empty = 8; - * @return {boolean} - */ -proto.validate.Fixed64Rules.prototype.getIgnoreEmpty = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.Fixed64Rules} returns this - */ -proto.validate.Fixed64Rules.prototype.setIgnoreEmpty = function(value) { - return jspb.Message.setField(this, 8, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.Fixed64Rules} returns this - */ -proto.validate.Fixed64Rules.prototype.clearIgnoreEmpty = function() { - return jspb.Message.setField(this, 8, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.Fixed64Rules.prototype.hasIgnoreEmpty = function() { - return jspb.Message.getField(this, 8) != null; -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.validate.SFixed32Rules.repeatedFields_ = [6,7]; - - - -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.validate.SFixed32Rules.prototype.toObject = function(opt_includeInstance) { - return proto.validate.SFixed32Rules.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.validate.SFixed32Rules} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.SFixed32Rules.toObject = function(includeInstance, msg) { - var f, obj = { - pb_const: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, - lt: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f, - lte: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f, - gt: (f = jspb.Message.getField(msg, 4)) == null ? undefined : f, - gte: (f = jspb.Message.getField(msg, 5)) == null ? undefined : f, - inList: (f = jspb.Message.getRepeatedField(msg, 6)) == null ? undefined : f, - notInList: (f = jspb.Message.getRepeatedField(msg, 7)) == null ? undefined : f, - ignoreEmpty: (f = jspb.Message.getBooleanField(msg, 8)) == 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.validate.SFixed32Rules} - */ -proto.validate.SFixed32Rules.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.validate.SFixed32Rules; - return proto.validate.SFixed32Rules.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.validate.SFixed32Rules} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.validate.SFixed32Rules} - */ -proto.validate.SFixed32Rules.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readSfixed32()); - msg.setConst(value); - break; - case 2: - var value = /** @type {number} */ (reader.readSfixed32()); - msg.setLt(value); - break; - case 3: - var value = /** @type {number} */ (reader.readSfixed32()); - msg.setLte(value); - break; - case 4: - var value = /** @type {number} */ (reader.readSfixed32()); - msg.setGt(value); - break; - case 5: - var value = /** @type {number} */ (reader.readSfixed32()); - msg.setGte(value); - break; - case 6: - var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedSfixed32() : [reader.readSfixed32()]); - for (var i = 0; i < values.length; i++) { - msg.addIn(values[i]); - } - break; - case 7: - var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedSfixed32() : [reader.readSfixed32()]); - for (var i = 0; i < values.length; i++) { - msg.addNotIn(values[i]); - } - break; - case 8: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setIgnoreEmpty(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.validate.SFixed32Rules.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.validate.SFixed32Rules.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.validate.SFixed32Rules} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.SFixed32Rules.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {number} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeSfixed32( - 1, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 2)); - if (f != null) { - writer.writeSfixed32( - 2, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 3)); - if (f != null) { - writer.writeSfixed32( - 3, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 4)); - if (f != null) { - writer.writeSfixed32( - 4, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 5)); - if (f != null) { - writer.writeSfixed32( - 5, - f - ); - } - f = message.getInList(); - if (f.length > 0) { - writer.writeRepeatedSfixed32( - 6, - f - ); - } - f = message.getNotInList(); - if (f.length > 0) { - writer.writeRepeatedSfixed32( - 7, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 8)); - if (f != null) { - writer.writeBool( - 8, - f - ); - } -}; - - -/** - * optional sfixed32 const = 1; - * @return {number} - */ -proto.validate.SFixed32Rules.prototype.getConst = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.SFixed32Rules} returns this - */ -proto.validate.SFixed32Rules.prototype.setConst = function(value) { - return jspb.Message.setField(this, 1, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.SFixed32Rules} returns this - */ -proto.validate.SFixed32Rules.prototype.clearConst = function() { - return jspb.Message.setField(this, 1, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.SFixed32Rules.prototype.hasConst = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional sfixed32 lt = 2; - * @return {number} - */ -proto.validate.SFixed32Rules.prototype.getLt = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.SFixed32Rules} returns this - */ -proto.validate.SFixed32Rules.prototype.setLt = function(value) { - return jspb.Message.setField(this, 2, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.SFixed32Rules} returns this - */ -proto.validate.SFixed32Rules.prototype.clearLt = function() { - return jspb.Message.setField(this, 2, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.SFixed32Rules.prototype.hasLt = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional sfixed32 lte = 3; - * @return {number} - */ -proto.validate.SFixed32Rules.prototype.getLte = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.SFixed32Rules} returns this - */ -proto.validate.SFixed32Rules.prototype.setLte = function(value) { - return jspb.Message.setField(this, 3, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.SFixed32Rules} returns this - */ -proto.validate.SFixed32Rules.prototype.clearLte = function() { - return jspb.Message.setField(this, 3, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.SFixed32Rules.prototype.hasLte = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * optional sfixed32 gt = 4; - * @return {number} - */ -proto.validate.SFixed32Rules.prototype.getGt = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.SFixed32Rules} returns this - */ -proto.validate.SFixed32Rules.prototype.setGt = function(value) { - return jspb.Message.setField(this, 4, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.SFixed32Rules} returns this - */ -proto.validate.SFixed32Rules.prototype.clearGt = function() { - return jspb.Message.setField(this, 4, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.SFixed32Rules.prototype.hasGt = function() { - return jspb.Message.getField(this, 4) != null; -}; - - -/** - * optional sfixed32 gte = 5; - * @return {number} - */ -proto.validate.SFixed32Rules.prototype.getGte = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.SFixed32Rules} returns this - */ -proto.validate.SFixed32Rules.prototype.setGte = function(value) { - return jspb.Message.setField(this, 5, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.SFixed32Rules} returns this - */ -proto.validate.SFixed32Rules.prototype.clearGte = function() { - return jspb.Message.setField(this, 5, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.SFixed32Rules.prototype.hasGte = function() { - return jspb.Message.getField(this, 5) != null; -}; - - -/** - * repeated sfixed32 in = 6; - * @return {!Array} - */ -proto.validate.SFixed32Rules.prototype.getInList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 6)); -}; - - -/** - * @param {!Array} value - * @return {!proto.validate.SFixed32Rules} returns this - */ -proto.validate.SFixed32Rules.prototype.setInList = function(value) { - return jspb.Message.setField(this, 6, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - * @return {!proto.validate.SFixed32Rules} returns this - */ -proto.validate.SFixed32Rules.prototype.addIn = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 6, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.validate.SFixed32Rules} returns this - */ -proto.validate.SFixed32Rules.prototype.clearInList = function() { - return this.setInList([]); -}; - - -/** - * repeated sfixed32 not_in = 7; - * @return {!Array} - */ -proto.validate.SFixed32Rules.prototype.getNotInList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 7)); -}; - - -/** - * @param {!Array} value - * @return {!proto.validate.SFixed32Rules} returns this - */ -proto.validate.SFixed32Rules.prototype.setNotInList = function(value) { - return jspb.Message.setField(this, 7, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - * @return {!proto.validate.SFixed32Rules} returns this - */ -proto.validate.SFixed32Rules.prototype.addNotIn = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 7, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.validate.SFixed32Rules} returns this - */ -proto.validate.SFixed32Rules.prototype.clearNotInList = function() { - return this.setNotInList([]); -}; - - -/** - * optional bool ignore_empty = 8; - * @return {boolean} - */ -proto.validate.SFixed32Rules.prototype.getIgnoreEmpty = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.SFixed32Rules} returns this - */ -proto.validate.SFixed32Rules.prototype.setIgnoreEmpty = function(value) { - return jspb.Message.setField(this, 8, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.SFixed32Rules} returns this - */ -proto.validate.SFixed32Rules.prototype.clearIgnoreEmpty = function() { - return jspb.Message.setField(this, 8, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.SFixed32Rules.prototype.hasIgnoreEmpty = function() { - return jspb.Message.getField(this, 8) != null; -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.validate.SFixed64Rules.repeatedFields_ = [6,7]; - - - -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.validate.SFixed64Rules.prototype.toObject = function(opt_includeInstance) { - return proto.validate.SFixed64Rules.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.validate.SFixed64Rules} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.SFixed64Rules.toObject = function(includeInstance, msg) { - var f, obj = { - pb_const: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, - lt: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f, - lte: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f, - gt: (f = jspb.Message.getField(msg, 4)) == null ? undefined : f, - gte: (f = jspb.Message.getField(msg, 5)) == null ? undefined : f, - inList: (f = jspb.Message.getRepeatedField(msg, 6)) == null ? undefined : f, - notInList: (f = jspb.Message.getRepeatedField(msg, 7)) == null ? undefined : f, - ignoreEmpty: (f = jspb.Message.getBooleanField(msg, 8)) == 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.validate.SFixed64Rules} - */ -proto.validate.SFixed64Rules.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.validate.SFixed64Rules; - return proto.validate.SFixed64Rules.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.validate.SFixed64Rules} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.validate.SFixed64Rules} - */ -proto.validate.SFixed64Rules.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readSfixed64()); - msg.setConst(value); - break; - case 2: - var value = /** @type {number} */ (reader.readSfixed64()); - msg.setLt(value); - break; - case 3: - var value = /** @type {number} */ (reader.readSfixed64()); - msg.setLte(value); - break; - case 4: - var value = /** @type {number} */ (reader.readSfixed64()); - msg.setGt(value); - break; - case 5: - var value = /** @type {number} */ (reader.readSfixed64()); - msg.setGte(value); - break; - case 6: - var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedSfixed64() : [reader.readSfixed64()]); - for (var i = 0; i < values.length; i++) { - msg.addIn(values[i]); - } - break; - case 7: - var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedSfixed64() : [reader.readSfixed64()]); - for (var i = 0; i < values.length; i++) { - msg.addNotIn(values[i]); - } - break; - case 8: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setIgnoreEmpty(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.validate.SFixed64Rules.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.validate.SFixed64Rules.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.validate.SFixed64Rules} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.SFixed64Rules.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {number} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeSfixed64( - 1, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 2)); - if (f != null) { - writer.writeSfixed64( - 2, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 3)); - if (f != null) { - writer.writeSfixed64( - 3, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 4)); - if (f != null) { - writer.writeSfixed64( - 4, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 5)); - if (f != null) { - writer.writeSfixed64( - 5, - f - ); - } - f = message.getInList(); - if (f.length > 0) { - writer.writeRepeatedSfixed64( - 6, - f - ); - } - f = message.getNotInList(); - if (f.length > 0) { - writer.writeRepeatedSfixed64( - 7, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 8)); - if (f != null) { - writer.writeBool( - 8, - f - ); - } -}; - - -/** - * optional sfixed64 const = 1; - * @return {number} - */ -proto.validate.SFixed64Rules.prototype.getConst = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.SFixed64Rules} returns this - */ -proto.validate.SFixed64Rules.prototype.setConst = function(value) { - return jspb.Message.setField(this, 1, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.SFixed64Rules} returns this - */ -proto.validate.SFixed64Rules.prototype.clearConst = function() { - return jspb.Message.setField(this, 1, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.SFixed64Rules.prototype.hasConst = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional sfixed64 lt = 2; - * @return {number} - */ -proto.validate.SFixed64Rules.prototype.getLt = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.SFixed64Rules} returns this - */ -proto.validate.SFixed64Rules.prototype.setLt = function(value) { - return jspb.Message.setField(this, 2, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.SFixed64Rules} returns this - */ -proto.validate.SFixed64Rules.prototype.clearLt = function() { - return jspb.Message.setField(this, 2, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.SFixed64Rules.prototype.hasLt = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional sfixed64 lte = 3; - * @return {number} - */ -proto.validate.SFixed64Rules.prototype.getLte = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.SFixed64Rules} returns this - */ -proto.validate.SFixed64Rules.prototype.setLte = function(value) { - return jspb.Message.setField(this, 3, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.SFixed64Rules} returns this - */ -proto.validate.SFixed64Rules.prototype.clearLte = function() { - return jspb.Message.setField(this, 3, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.SFixed64Rules.prototype.hasLte = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * optional sfixed64 gt = 4; - * @return {number} - */ -proto.validate.SFixed64Rules.prototype.getGt = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.SFixed64Rules} returns this - */ -proto.validate.SFixed64Rules.prototype.setGt = function(value) { - return jspb.Message.setField(this, 4, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.SFixed64Rules} returns this - */ -proto.validate.SFixed64Rules.prototype.clearGt = function() { - return jspb.Message.setField(this, 4, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.SFixed64Rules.prototype.hasGt = function() { - return jspb.Message.getField(this, 4) != null; -}; - - -/** - * optional sfixed64 gte = 5; - * @return {number} - */ -proto.validate.SFixed64Rules.prototype.getGte = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.SFixed64Rules} returns this - */ -proto.validate.SFixed64Rules.prototype.setGte = function(value) { - return jspb.Message.setField(this, 5, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.SFixed64Rules} returns this - */ -proto.validate.SFixed64Rules.prototype.clearGte = function() { - return jspb.Message.setField(this, 5, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.SFixed64Rules.prototype.hasGte = function() { - return jspb.Message.getField(this, 5) != null; -}; - - -/** - * repeated sfixed64 in = 6; - * @return {!Array} - */ -proto.validate.SFixed64Rules.prototype.getInList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 6)); -}; - - -/** - * @param {!Array} value - * @return {!proto.validate.SFixed64Rules} returns this - */ -proto.validate.SFixed64Rules.prototype.setInList = function(value) { - return jspb.Message.setField(this, 6, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - * @return {!proto.validate.SFixed64Rules} returns this - */ -proto.validate.SFixed64Rules.prototype.addIn = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 6, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.validate.SFixed64Rules} returns this - */ -proto.validate.SFixed64Rules.prototype.clearInList = function() { - return this.setInList([]); -}; - - -/** - * repeated sfixed64 not_in = 7; - * @return {!Array} - */ -proto.validate.SFixed64Rules.prototype.getNotInList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 7)); -}; - - -/** - * @param {!Array} value - * @return {!proto.validate.SFixed64Rules} returns this - */ -proto.validate.SFixed64Rules.prototype.setNotInList = function(value) { - return jspb.Message.setField(this, 7, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - * @return {!proto.validate.SFixed64Rules} returns this - */ -proto.validate.SFixed64Rules.prototype.addNotIn = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 7, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.validate.SFixed64Rules} returns this - */ -proto.validate.SFixed64Rules.prototype.clearNotInList = function() { - return this.setNotInList([]); -}; - - -/** - * optional bool ignore_empty = 8; - * @return {boolean} - */ -proto.validate.SFixed64Rules.prototype.getIgnoreEmpty = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.SFixed64Rules} returns this - */ -proto.validate.SFixed64Rules.prototype.setIgnoreEmpty = function(value) { - return jspb.Message.setField(this, 8, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.SFixed64Rules} returns this - */ -proto.validate.SFixed64Rules.prototype.clearIgnoreEmpty = function() { - return jspb.Message.setField(this, 8, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.SFixed64Rules.prototype.hasIgnoreEmpty = function() { - return jspb.Message.getField(this, 8) != 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.validate.BoolRules.prototype.toObject = function(opt_includeInstance) { - return proto.validate.BoolRules.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.validate.BoolRules} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.BoolRules.toObject = function(includeInstance, msg) { - var f, obj = { - pb_const: (f = jspb.Message.getBooleanField(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.validate.BoolRules} - */ -proto.validate.BoolRules.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.validate.BoolRules; - return proto.validate.BoolRules.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.validate.BoolRules} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.validate.BoolRules} - */ -proto.validate.BoolRules.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.setConst(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.validate.BoolRules.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.validate.BoolRules.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.validate.BoolRules} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.BoolRules.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {boolean} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeBool( - 1, - f - ); - } -}; - - -/** - * optional bool const = 1; - * @return {boolean} - */ -proto.validate.BoolRules.prototype.getConst = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.BoolRules} returns this - */ -proto.validate.BoolRules.prototype.setConst = function(value) { - return jspb.Message.setField(this, 1, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.BoolRules} returns this - */ -proto.validate.BoolRules.prototype.clearConst = function() { - return jspb.Message.setField(this, 1, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.BoolRules.prototype.hasConst = function() { - return jspb.Message.getField(this, 1) != null; -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.validate.StringRules.repeatedFields_ = [10,11]; - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.validate.StringRules.oneofGroups_ = [[12,13,14,15,16,17,18,21,22,24]]; - -/** - * @enum {number} - */ -proto.validate.StringRules.WellKnownCase = { - WELL_KNOWN_NOT_SET: 0, - EMAIL: 12, - HOSTNAME: 13, - IP: 14, - IPV4: 15, - IPV6: 16, - URI: 17, - URI_REF: 18, - ADDRESS: 21, - UUID: 22, - WELL_KNOWN_REGEX: 24 -}; - -/** - * @return {proto.validate.StringRules.WellKnownCase} - */ -proto.validate.StringRules.prototype.getWellKnownCase = function() { - return /** @type {proto.validate.StringRules.WellKnownCase} */(jspb.Message.computeOneofCase(this, proto.validate.StringRules.oneofGroups_[0])); -}; - - - -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.validate.StringRules.prototype.toObject = function(opt_includeInstance) { - return proto.validate.StringRules.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.validate.StringRules} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.StringRules.toObject = function(includeInstance, msg) { - var f, obj = { - pb_const: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, - len: (f = jspb.Message.getField(msg, 19)) == null ? undefined : f, - minLen: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f, - maxLen: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f, - lenBytes: (f = jspb.Message.getField(msg, 20)) == null ? undefined : f, - minBytes: (f = jspb.Message.getField(msg, 4)) == null ? undefined : f, - maxBytes: (f = jspb.Message.getField(msg, 5)) == null ? undefined : f, - pattern: (f = jspb.Message.getField(msg, 6)) == null ? undefined : f, - prefix: (f = jspb.Message.getField(msg, 7)) == null ? undefined : f, - suffix: (f = jspb.Message.getField(msg, 8)) == null ? undefined : f, - contains: (f = jspb.Message.getField(msg, 9)) == null ? undefined : f, - notContains: (f = jspb.Message.getField(msg, 23)) == null ? undefined : f, - inList: (f = jspb.Message.getRepeatedField(msg, 10)) == null ? undefined : f, - notInList: (f = jspb.Message.getRepeatedField(msg, 11)) == null ? undefined : f, - email: (f = jspb.Message.getBooleanField(msg, 12)) == null ? undefined : f, - hostname: (f = jspb.Message.getBooleanField(msg, 13)) == null ? undefined : f, - ip: (f = jspb.Message.getBooleanField(msg, 14)) == null ? undefined : f, - ipv4: (f = jspb.Message.getBooleanField(msg, 15)) == null ? undefined : f, - ipv6: (f = jspb.Message.getBooleanField(msg, 16)) == null ? undefined : f, - uri: (f = jspb.Message.getBooleanField(msg, 17)) == null ? undefined : f, - uriRef: (f = jspb.Message.getBooleanField(msg, 18)) == null ? undefined : f, - address: (f = jspb.Message.getBooleanField(msg, 21)) == null ? undefined : f, - uuid: (f = jspb.Message.getBooleanField(msg, 22)) == null ? undefined : f, - wellKnownRegex: (f = jspb.Message.getField(msg, 24)) == null ? undefined : f, - strict: jspb.Message.getBooleanFieldWithDefault(msg, 25, true), - ignoreEmpty: (f = jspb.Message.getBooleanField(msg, 26)) == 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.validate.StringRules} - */ -proto.validate.StringRules.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.validate.StringRules; - return proto.validate.StringRules.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.validate.StringRules} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.validate.StringRules} - */ -proto.validate.StringRules.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.setConst(value); - break; - case 19: - var value = /** @type {number} */ (reader.readUint64()); - msg.setLen(value); - break; - case 2: - var value = /** @type {number} */ (reader.readUint64()); - msg.setMinLen(value); - break; - case 3: - var value = /** @type {number} */ (reader.readUint64()); - msg.setMaxLen(value); - break; - case 20: - var value = /** @type {number} */ (reader.readUint64()); - msg.setLenBytes(value); - break; - case 4: - var value = /** @type {number} */ (reader.readUint64()); - msg.setMinBytes(value); - break; - case 5: - var value = /** @type {number} */ (reader.readUint64()); - msg.setMaxBytes(value); - break; - case 6: - var value = /** @type {string} */ (reader.readString()); - msg.setPattern(value); - break; - case 7: - var value = /** @type {string} */ (reader.readString()); - msg.setPrefix(value); - break; - case 8: - var value = /** @type {string} */ (reader.readString()); - msg.setSuffix(value); - break; - case 9: - var value = /** @type {string} */ (reader.readString()); - msg.setContains(value); - break; - case 23: - var value = /** @type {string} */ (reader.readString()); - msg.setNotContains(value); - break; - case 10: - var value = /** @type {string} */ (reader.readString()); - msg.addIn(value); - break; - case 11: - var value = /** @type {string} */ (reader.readString()); - msg.addNotIn(value); - break; - case 12: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setEmail(value); - break; - case 13: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setHostname(value); - break; - case 14: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setIp(value); - break; - case 15: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setIpv4(value); - break; - case 16: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setIpv6(value); - break; - case 17: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setUri(value); - break; - case 18: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setUriRef(value); - break; - case 21: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setAddress(value); - break; - case 22: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setUuid(value); - break; - case 24: - var value = /** @type {!proto.validate.KnownRegex} */ (reader.readEnum()); - msg.setWellKnownRegex(value); - break; - case 25: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setStrict(value); - break; - case 26: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setIgnoreEmpty(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.validate.StringRules.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.validate.StringRules.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.validate.StringRules} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.StringRules.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {string} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeString( - 1, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 19)); - if (f != null) { - writer.writeUint64( - 19, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 2)); - if (f != null) { - writer.writeUint64( - 2, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 3)); - if (f != null) { - writer.writeUint64( - 3, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 20)); - if (f != null) { - writer.writeUint64( - 20, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 4)); - if (f != null) { - writer.writeUint64( - 4, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 5)); - if (f != null) { - writer.writeUint64( - 5, - f - ); - } - f = /** @type {string} */ (jspb.Message.getField(message, 6)); - if (f != null) { - writer.writeString( - 6, - f - ); - } - f = /** @type {string} */ (jspb.Message.getField(message, 7)); - if (f != null) { - writer.writeString( - 7, - f - ); - } - f = /** @type {string} */ (jspb.Message.getField(message, 8)); - if (f != null) { - writer.writeString( - 8, - f - ); - } - f = /** @type {string} */ (jspb.Message.getField(message, 9)); - if (f != null) { - writer.writeString( - 9, - f - ); - } - f = /** @type {string} */ (jspb.Message.getField(message, 23)); - if (f != null) { - writer.writeString( - 23, - f - ); - } - f = message.getInList(); - if (f.length > 0) { - writer.writeRepeatedString( - 10, - f - ); - } - f = message.getNotInList(); - if (f.length > 0) { - writer.writeRepeatedString( - 11, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 12)); - if (f != null) { - writer.writeBool( - 12, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 13)); - if (f != null) { - writer.writeBool( - 13, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 14)); - if (f != null) { - writer.writeBool( - 14, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 15)); - if (f != null) { - writer.writeBool( - 15, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 16)); - if (f != null) { - writer.writeBool( - 16, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 17)); - if (f != null) { - writer.writeBool( - 17, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 18)); - if (f != null) { - writer.writeBool( - 18, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 21)); - if (f != null) { - writer.writeBool( - 21, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 22)); - if (f != null) { - writer.writeBool( - 22, - f - ); - } - f = /** @type {!proto.validate.KnownRegex} */ (jspb.Message.getField(message, 24)); - if (f != null) { - writer.writeEnum( - 24, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 25)); - if (f != null) { - writer.writeBool( - 25, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 26)); - if (f != null) { - writer.writeBool( - 26, - f - ); - } -}; - - -/** - * optional string const = 1; - * @return {string} - */ -proto.validate.StringRules.prototype.getConst = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.setConst = function(value) { - return jspb.Message.setField(this, 1, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.clearConst = function() { - return jspb.Message.setField(this, 1, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.StringRules.prototype.hasConst = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional uint64 len = 19; - * @return {number} - */ -proto.validate.StringRules.prototype.getLen = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 19, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.setLen = function(value) { - return jspb.Message.setField(this, 19, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.clearLen = function() { - return jspb.Message.setField(this, 19, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.StringRules.prototype.hasLen = function() { - return jspb.Message.getField(this, 19) != null; -}; - - -/** - * optional uint64 min_len = 2; - * @return {number} - */ -proto.validate.StringRules.prototype.getMinLen = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.setMinLen = function(value) { - return jspb.Message.setField(this, 2, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.clearMinLen = function() { - return jspb.Message.setField(this, 2, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.StringRules.prototype.hasMinLen = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional uint64 max_len = 3; - * @return {number} - */ -proto.validate.StringRules.prototype.getMaxLen = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.setMaxLen = function(value) { - return jspb.Message.setField(this, 3, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.clearMaxLen = function() { - return jspb.Message.setField(this, 3, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.StringRules.prototype.hasMaxLen = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * optional uint64 len_bytes = 20; - * @return {number} - */ -proto.validate.StringRules.prototype.getLenBytes = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 20, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.setLenBytes = function(value) { - return jspb.Message.setField(this, 20, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.clearLenBytes = function() { - return jspb.Message.setField(this, 20, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.StringRules.prototype.hasLenBytes = function() { - return jspb.Message.getField(this, 20) != null; -}; - - -/** - * optional uint64 min_bytes = 4; - * @return {number} - */ -proto.validate.StringRules.prototype.getMinBytes = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.setMinBytes = function(value) { - return jspb.Message.setField(this, 4, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.clearMinBytes = function() { - return jspb.Message.setField(this, 4, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.StringRules.prototype.hasMinBytes = function() { - return jspb.Message.getField(this, 4) != null; -}; - - -/** - * optional uint64 max_bytes = 5; - * @return {number} - */ -proto.validate.StringRules.prototype.getMaxBytes = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.setMaxBytes = function(value) { - return jspb.Message.setField(this, 5, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.clearMaxBytes = function() { - return jspb.Message.setField(this, 5, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.StringRules.prototype.hasMaxBytes = function() { - return jspb.Message.getField(this, 5) != null; -}; - - -/** - * optional string pattern = 6; - * @return {string} - */ -proto.validate.StringRules.prototype.getPattern = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); -}; - - -/** - * @param {string} value - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.setPattern = function(value) { - return jspb.Message.setField(this, 6, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.clearPattern = function() { - return jspb.Message.setField(this, 6, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.StringRules.prototype.hasPattern = function() { - return jspb.Message.getField(this, 6) != null; -}; - - -/** - * optional string prefix = 7; - * @return {string} - */ -proto.validate.StringRules.prototype.getPrefix = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); -}; - - -/** - * @param {string} value - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.setPrefix = function(value) { - return jspb.Message.setField(this, 7, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.clearPrefix = function() { - return jspb.Message.setField(this, 7, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.StringRules.prototype.hasPrefix = function() { - return jspb.Message.getField(this, 7) != null; -}; - - -/** - * optional string suffix = 8; - * @return {string} - */ -proto.validate.StringRules.prototype.getSuffix = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, "")); -}; - - -/** - * @param {string} value - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.setSuffix = function(value) { - return jspb.Message.setField(this, 8, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.clearSuffix = function() { - return jspb.Message.setField(this, 8, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.StringRules.prototype.hasSuffix = function() { - return jspb.Message.getField(this, 8) != null; -}; - - -/** - * optional string contains = 9; - * @return {string} - */ -proto.validate.StringRules.prototype.getContains = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, "")); -}; - - -/** - * @param {string} value - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.setContains = function(value) { - return jspb.Message.setField(this, 9, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.clearContains = function() { - return jspb.Message.setField(this, 9, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.StringRules.prototype.hasContains = function() { - return jspb.Message.getField(this, 9) != null; -}; - - -/** - * optional string not_contains = 23; - * @return {string} - */ -proto.validate.StringRules.prototype.getNotContains = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 23, "")); -}; - - -/** - * @param {string} value - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.setNotContains = function(value) { - return jspb.Message.setField(this, 23, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.clearNotContains = function() { - return jspb.Message.setField(this, 23, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.StringRules.prototype.hasNotContains = function() { - return jspb.Message.getField(this, 23) != null; -}; - - -/** - * repeated string in = 10; - * @return {!Array} - */ -proto.validate.StringRules.prototype.getInList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 10)); -}; - - -/** - * @param {!Array} value - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.setInList = function(value) { - return jspb.Message.setField(this, 10, value || []); -}; - - -/** - * @param {string} value - * @param {number=} opt_index - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.addIn = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 10, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.clearInList = function() { - return this.setInList([]); -}; - - -/** - * repeated string not_in = 11; - * @return {!Array} - */ -proto.validate.StringRules.prototype.getNotInList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 11)); -}; - - -/** - * @param {!Array} value - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.setNotInList = function(value) { - return jspb.Message.setField(this, 11, value || []); -}; - - -/** - * @param {string} value - * @param {number=} opt_index - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.addNotIn = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 11, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.clearNotInList = function() { - return this.setNotInList([]); -}; - - -/** - * optional bool email = 12; - * @return {boolean} - */ -proto.validate.StringRules.prototype.getEmail = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 12, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.setEmail = function(value) { - return jspb.Message.setOneofField(this, 12, proto.validate.StringRules.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.clearEmail = function() { - return jspb.Message.setOneofField(this, 12, proto.validate.StringRules.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.StringRules.prototype.hasEmail = function() { - return jspb.Message.getField(this, 12) != null; -}; - - -/** - * optional bool hostname = 13; - * @return {boolean} - */ -proto.validate.StringRules.prototype.getHostname = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 13, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.setHostname = function(value) { - return jspb.Message.setOneofField(this, 13, proto.validate.StringRules.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.clearHostname = function() { - return jspb.Message.setOneofField(this, 13, proto.validate.StringRules.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.StringRules.prototype.hasHostname = function() { - return jspb.Message.getField(this, 13) != null; -}; - - -/** - * optional bool ip = 14; - * @return {boolean} - */ -proto.validate.StringRules.prototype.getIp = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 14, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.setIp = function(value) { - return jspb.Message.setOneofField(this, 14, proto.validate.StringRules.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.clearIp = function() { - return jspb.Message.setOneofField(this, 14, proto.validate.StringRules.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.StringRules.prototype.hasIp = function() { - return jspb.Message.getField(this, 14) != null; -}; - - -/** - * optional bool ipv4 = 15; - * @return {boolean} - */ -proto.validate.StringRules.prototype.getIpv4 = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 15, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.setIpv4 = function(value) { - return jspb.Message.setOneofField(this, 15, proto.validate.StringRules.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.clearIpv4 = function() { - return jspb.Message.setOneofField(this, 15, proto.validate.StringRules.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.StringRules.prototype.hasIpv4 = function() { - return jspb.Message.getField(this, 15) != null; -}; - - -/** - * optional bool ipv6 = 16; - * @return {boolean} - */ -proto.validate.StringRules.prototype.getIpv6 = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 16, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.setIpv6 = function(value) { - return jspb.Message.setOneofField(this, 16, proto.validate.StringRules.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.clearIpv6 = function() { - return jspb.Message.setOneofField(this, 16, proto.validate.StringRules.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.StringRules.prototype.hasIpv6 = function() { - return jspb.Message.getField(this, 16) != null; -}; - - -/** - * optional bool uri = 17; - * @return {boolean} - */ -proto.validate.StringRules.prototype.getUri = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 17, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.setUri = function(value) { - return jspb.Message.setOneofField(this, 17, proto.validate.StringRules.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.clearUri = function() { - return jspb.Message.setOneofField(this, 17, proto.validate.StringRules.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.StringRules.prototype.hasUri = function() { - return jspb.Message.getField(this, 17) != null; -}; - - -/** - * optional bool uri_ref = 18; - * @return {boolean} - */ -proto.validate.StringRules.prototype.getUriRef = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 18, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.setUriRef = function(value) { - return jspb.Message.setOneofField(this, 18, proto.validate.StringRules.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.clearUriRef = function() { - return jspb.Message.setOneofField(this, 18, proto.validate.StringRules.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.StringRules.prototype.hasUriRef = function() { - return jspb.Message.getField(this, 18) != null; -}; - - -/** - * optional bool address = 21; - * @return {boolean} - */ -proto.validate.StringRules.prototype.getAddress = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 21, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.setAddress = function(value) { - return jspb.Message.setOneofField(this, 21, proto.validate.StringRules.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.clearAddress = function() { - return jspb.Message.setOneofField(this, 21, proto.validate.StringRules.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.StringRules.prototype.hasAddress = function() { - return jspb.Message.getField(this, 21) != null; -}; - - -/** - * optional bool uuid = 22; - * @return {boolean} - */ -proto.validate.StringRules.prototype.getUuid = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 22, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.setUuid = function(value) { - return jspb.Message.setOneofField(this, 22, proto.validate.StringRules.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.clearUuid = function() { - return jspb.Message.setOneofField(this, 22, proto.validate.StringRules.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.StringRules.prototype.hasUuid = function() { - return jspb.Message.getField(this, 22) != null; -}; - - -/** - * optional KnownRegex well_known_regex = 24; - * @return {!proto.validate.KnownRegex} - */ -proto.validate.StringRules.prototype.getWellKnownRegex = function() { - return /** @type {!proto.validate.KnownRegex} */ (jspb.Message.getFieldWithDefault(this, 24, 0)); -}; - - -/** - * @param {!proto.validate.KnownRegex} value - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.setWellKnownRegex = function(value) { - return jspb.Message.setOneofField(this, 24, proto.validate.StringRules.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.clearWellKnownRegex = function() { - return jspb.Message.setOneofField(this, 24, proto.validate.StringRules.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.StringRules.prototype.hasWellKnownRegex = function() { - return jspb.Message.getField(this, 24) != null; -}; - - -/** - * optional bool strict = 25; - * @return {boolean} - */ -proto.validate.StringRules.prototype.getStrict = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 25, true)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.setStrict = function(value) { - return jspb.Message.setField(this, 25, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.clearStrict = function() { - return jspb.Message.setField(this, 25, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.StringRules.prototype.hasStrict = function() { - return jspb.Message.getField(this, 25) != null; -}; - - -/** - * optional bool ignore_empty = 26; - * @return {boolean} - */ -proto.validate.StringRules.prototype.getIgnoreEmpty = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 26, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.setIgnoreEmpty = function(value) { - return jspb.Message.setField(this, 26, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.StringRules} returns this - */ -proto.validate.StringRules.prototype.clearIgnoreEmpty = function() { - return jspb.Message.setField(this, 26, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.StringRules.prototype.hasIgnoreEmpty = function() { - return jspb.Message.getField(this, 26) != null; -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.validate.BytesRules.repeatedFields_ = [8,9]; - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.validate.BytesRules.oneofGroups_ = [[10,11,12]]; - -/** - * @enum {number} - */ -proto.validate.BytesRules.WellKnownCase = { - WELL_KNOWN_NOT_SET: 0, - IP: 10, - IPV4: 11, - IPV6: 12 -}; - -/** - * @return {proto.validate.BytesRules.WellKnownCase} - */ -proto.validate.BytesRules.prototype.getWellKnownCase = function() { - return /** @type {proto.validate.BytesRules.WellKnownCase} */(jspb.Message.computeOneofCase(this, proto.validate.BytesRules.oneofGroups_[0])); -}; - - - -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.validate.BytesRules.prototype.toObject = function(opt_includeInstance) { - return proto.validate.BytesRules.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.validate.BytesRules} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.BytesRules.toObject = function(includeInstance, msg) { - var f, obj = { - pb_const: msg.getConst_asB64(), - len: (f = jspb.Message.getField(msg, 13)) == null ? undefined : f, - minLen: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f, - maxLen: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f, - pattern: (f = jspb.Message.getField(msg, 4)) == null ? undefined : f, - prefix: msg.getPrefix_asB64(), - suffix: msg.getSuffix_asB64(), - contains: msg.getContains_asB64(), - inList: msg.getInList_asB64(), - notInList: msg.getNotInList_asB64(), - ip: (f = jspb.Message.getBooleanField(msg, 10)) == null ? undefined : f, - ipv4: (f = jspb.Message.getBooleanField(msg, 11)) == null ? undefined : f, - ipv6: (f = jspb.Message.getBooleanField(msg, 12)) == null ? undefined : f, - ignoreEmpty: (f = jspb.Message.getBooleanField(msg, 14)) == 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.validate.BytesRules} - */ -proto.validate.BytesRules.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.validate.BytesRules; - return proto.validate.BytesRules.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.validate.BytesRules} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.validate.BytesRules} - */ -proto.validate.BytesRules.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.setConst(value); - break; - case 13: - var value = /** @type {number} */ (reader.readUint64()); - msg.setLen(value); - break; - case 2: - var value = /** @type {number} */ (reader.readUint64()); - msg.setMinLen(value); - break; - case 3: - var value = /** @type {number} */ (reader.readUint64()); - msg.setMaxLen(value); - break; - case 4: - var value = /** @type {string} */ (reader.readString()); - msg.setPattern(value); - break; - case 5: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setPrefix(value); - break; - case 6: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setSuffix(value); - break; - case 7: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setContains(value); - break; - case 8: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.addIn(value); - break; - case 9: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.addNotIn(value); - break; - case 10: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setIp(value); - break; - case 11: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setIpv4(value); - break; - case 12: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setIpv6(value); - break; - case 14: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setIgnoreEmpty(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.validate.BytesRules.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.validate.BytesRules.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.validate.BytesRules} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.BytesRules.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeBytes( - 1, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 13)); - if (f != null) { - writer.writeUint64( - 13, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 2)); - if (f != null) { - writer.writeUint64( - 2, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 3)); - if (f != null) { - writer.writeUint64( - 3, - f - ); - } - f = /** @type {string} */ (jspb.Message.getField(message, 4)); - if (f != null) { - writer.writeString( - 4, - f - ); - } - f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 5)); - if (f != null) { - writer.writeBytes( - 5, - f - ); - } - f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 6)); - if (f != null) { - writer.writeBytes( - 6, - f - ); - } - f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 7)); - if (f != null) { - writer.writeBytes( - 7, - f - ); - } - f = message.getInList_asU8(); - if (f.length > 0) { - writer.writeRepeatedBytes( - 8, - f - ); - } - f = message.getNotInList_asU8(); - if (f.length > 0) { - writer.writeRepeatedBytes( - 9, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 10)); - if (f != null) { - writer.writeBool( - 10, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 11)); - if (f != null) { - writer.writeBool( - 11, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 12)); - if (f != null) { - writer.writeBool( - 12, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 14)); - if (f != null) { - writer.writeBool( - 14, - f - ); - } -}; - - -/** - * optional bytes const = 1; - * @return {!(string|Uint8Array)} - */ -proto.validate.BytesRules.prototype.getConst = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * optional bytes const = 1; - * This is a type-conversion wrapper around `getConst()` - * @return {string} - */ -proto.validate.BytesRules.prototype.getConst_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getConst())); -}; - - -/** - * optional bytes const = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getConst()` - * @return {!Uint8Array} - */ -proto.validate.BytesRules.prototype.getConst_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getConst())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.validate.BytesRules} returns this - */ -proto.validate.BytesRules.prototype.setConst = function(value) { - return jspb.Message.setField(this, 1, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.BytesRules} returns this - */ -proto.validate.BytesRules.prototype.clearConst = function() { - return jspb.Message.setField(this, 1, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.BytesRules.prototype.hasConst = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional uint64 len = 13; - * @return {number} - */ -proto.validate.BytesRules.prototype.getLen = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 13, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.BytesRules} returns this - */ -proto.validate.BytesRules.prototype.setLen = function(value) { - return jspb.Message.setField(this, 13, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.BytesRules} returns this - */ -proto.validate.BytesRules.prototype.clearLen = function() { - return jspb.Message.setField(this, 13, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.BytesRules.prototype.hasLen = function() { - return jspb.Message.getField(this, 13) != null; -}; - - -/** - * optional uint64 min_len = 2; - * @return {number} - */ -proto.validate.BytesRules.prototype.getMinLen = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.BytesRules} returns this - */ -proto.validate.BytesRules.prototype.setMinLen = function(value) { - return jspb.Message.setField(this, 2, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.BytesRules} returns this - */ -proto.validate.BytesRules.prototype.clearMinLen = function() { - return jspb.Message.setField(this, 2, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.BytesRules.prototype.hasMinLen = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional uint64 max_len = 3; - * @return {number} - */ -proto.validate.BytesRules.prototype.getMaxLen = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.BytesRules} returns this - */ -proto.validate.BytesRules.prototype.setMaxLen = function(value) { - return jspb.Message.setField(this, 3, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.BytesRules} returns this - */ -proto.validate.BytesRules.prototype.clearMaxLen = function() { - return jspb.Message.setField(this, 3, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.BytesRules.prototype.hasMaxLen = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * optional string pattern = 4; - * @return {string} - */ -proto.validate.BytesRules.prototype.getPattern = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); -}; - - -/** - * @param {string} value - * @return {!proto.validate.BytesRules} returns this - */ -proto.validate.BytesRules.prototype.setPattern = function(value) { - return jspb.Message.setField(this, 4, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.BytesRules} returns this - */ -proto.validate.BytesRules.prototype.clearPattern = function() { - return jspb.Message.setField(this, 4, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.BytesRules.prototype.hasPattern = function() { - return jspb.Message.getField(this, 4) != null; -}; - - -/** - * optional bytes prefix = 5; - * @return {!(string|Uint8Array)} - */ -proto.validate.BytesRules.prototype.getPrefix = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 5, "")); -}; - - -/** - * optional bytes prefix = 5; - * This is a type-conversion wrapper around `getPrefix()` - * @return {string} - */ -proto.validate.BytesRules.prototype.getPrefix_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getPrefix())); -}; - - -/** - * optional bytes prefix = 5; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getPrefix()` - * @return {!Uint8Array} - */ -proto.validate.BytesRules.prototype.getPrefix_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getPrefix())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.validate.BytesRules} returns this - */ -proto.validate.BytesRules.prototype.setPrefix = function(value) { - return jspb.Message.setField(this, 5, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.BytesRules} returns this - */ -proto.validate.BytesRules.prototype.clearPrefix = function() { - return jspb.Message.setField(this, 5, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.BytesRules.prototype.hasPrefix = function() { - return jspb.Message.getField(this, 5) != null; -}; - - -/** - * optional bytes suffix = 6; - * @return {!(string|Uint8Array)} - */ -proto.validate.BytesRules.prototype.getSuffix = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 6, "")); -}; - - -/** - * optional bytes suffix = 6; - * This is a type-conversion wrapper around `getSuffix()` - * @return {string} - */ -proto.validate.BytesRules.prototype.getSuffix_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getSuffix())); -}; - - -/** - * optional bytes suffix = 6; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getSuffix()` - * @return {!Uint8Array} - */ -proto.validate.BytesRules.prototype.getSuffix_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getSuffix())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.validate.BytesRules} returns this - */ -proto.validate.BytesRules.prototype.setSuffix = function(value) { - return jspb.Message.setField(this, 6, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.BytesRules} returns this - */ -proto.validate.BytesRules.prototype.clearSuffix = function() { - return jspb.Message.setField(this, 6, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.BytesRules.prototype.hasSuffix = function() { - return jspb.Message.getField(this, 6) != null; -}; - - -/** - * optional bytes contains = 7; - * @return {!(string|Uint8Array)} - */ -proto.validate.BytesRules.prototype.getContains = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 7, "")); -}; - - -/** - * optional bytes contains = 7; - * This is a type-conversion wrapper around `getContains()` - * @return {string} - */ -proto.validate.BytesRules.prototype.getContains_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getContains())); -}; - - -/** - * optional bytes contains = 7; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getContains()` - * @return {!Uint8Array} - */ -proto.validate.BytesRules.prototype.getContains_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getContains())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.validate.BytesRules} returns this - */ -proto.validate.BytesRules.prototype.setContains = function(value) { - return jspb.Message.setField(this, 7, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.BytesRules} returns this - */ -proto.validate.BytesRules.prototype.clearContains = function() { - return jspb.Message.setField(this, 7, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.BytesRules.prototype.hasContains = function() { - return jspb.Message.getField(this, 7) != null; -}; - - -/** - * repeated bytes in = 8; - * @return {!(Array|Array)} - */ -proto.validate.BytesRules.prototype.getInList = function() { - return /** @type {!(Array|Array)} */ (jspb.Message.getRepeatedField(this, 8)); -}; - - -/** - * repeated bytes in = 8; - * This is a type-conversion wrapper around `getInList()` - * @return {!Array} - */ -proto.validate.BytesRules.prototype.getInList_asB64 = function() { - return /** @type {!Array} */ (jspb.Message.bytesListAsB64( - this.getInList())); -}; - - -/** - * repeated bytes in = 8; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getInList()` - * @return {!Array} - */ -proto.validate.BytesRules.prototype.getInList_asU8 = function() { - return /** @type {!Array} */ (jspb.Message.bytesListAsU8( - this.getInList())); -}; - - -/** - * @param {!(Array|Array)} value - * @return {!proto.validate.BytesRules} returns this - */ -proto.validate.BytesRules.prototype.setInList = function(value) { - return jspb.Message.setField(this, 8, value || []); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @param {number=} opt_index - * @return {!proto.validate.BytesRules} returns this - */ -proto.validate.BytesRules.prototype.addIn = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 8, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.validate.BytesRules} returns this - */ -proto.validate.BytesRules.prototype.clearInList = function() { - return this.setInList([]); -}; - - -/** - * repeated bytes not_in = 9; - * @return {!(Array|Array)} - */ -proto.validate.BytesRules.prototype.getNotInList = function() { - return /** @type {!(Array|Array)} */ (jspb.Message.getRepeatedField(this, 9)); -}; - - -/** - * repeated bytes not_in = 9; - * This is a type-conversion wrapper around `getNotInList()` - * @return {!Array} - */ -proto.validate.BytesRules.prototype.getNotInList_asB64 = function() { - return /** @type {!Array} */ (jspb.Message.bytesListAsB64( - this.getNotInList())); -}; - - -/** - * repeated bytes not_in = 9; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getNotInList()` - * @return {!Array} - */ -proto.validate.BytesRules.prototype.getNotInList_asU8 = function() { - return /** @type {!Array} */ (jspb.Message.bytesListAsU8( - this.getNotInList())); -}; - - -/** - * @param {!(Array|Array)} value - * @return {!proto.validate.BytesRules} returns this - */ -proto.validate.BytesRules.prototype.setNotInList = function(value) { - return jspb.Message.setField(this, 9, value || []); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @param {number=} opt_index - * @return {!proto.validate.BytesRules} returns this - */ -proto.validate.BytesRules.prototype.addNotIn = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 9, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.validate.BytesRules} returns this - */ -proto.validate.BytesRules.prototype.clearNotInList = function() { - return this.setNotInList([]); -}; - - -/** - * optional bool ip = 10; - * @return {boolean} - */ -proto.validate.BytesRules.prototype.getIp = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 10, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.BytesRules} returns this - */ -proto.validate.BytesRules.prototype.setIp = function(value) { - return jspb.Message.setOneofField(this, 10, proto.validate.BytesRules.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.BytesRules} returns this - */ -proto.validate.BytesRules.prototype.clearIp = function() { - return jspb.Message.setOneofField(this, 10, proto.validate.BytesRules.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.BytesRules.prototype.hasIp = function() { - return jspb.Message.getField(this, 10) != null; -}; - - -/** - * optional bool ipv4 = 11; - * @return {boolean} - */ -proto.validate.BytesRules.prototype.getIpv4 = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 11, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.BytesRules} returns this - */ -proto.validate.BytesRules.prototype.setIpv4 = function(value) { - return jspb.Message.setOneofField(this, 11, proto.validate.BytesRules.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.BytesRules} returns this - */ -proto.validate.BytesRules.prototype.clearIpv4 = function() { - return jspb.Message.setOneofField(this, 11, proto.validate.BytesRules.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.BytesRules.prototype.hasIpv4 = function() { - return jspb.Message.getField(this, 11) != null; -}; - - -/** - * optional bool ipv6 = 12; - * @return {boolean} - */ -proto.validate.BytesRules.prototype.getIpv6 = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 12, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.BytesRules} returns this - */ -proto.validate.BytesRules.prototype.setIpv6 = function(value) { - return jspb.Message.setOneofField(this, 12, proto.validate.BytesRules.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.BytesRules} returns this - */ -proto.validate.BytesRules.prototype.clearIpv6 = function() { - return jspb.Message.setOneofField(this, 12, proto.validate.BytesRules.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.BytesRules.prototype.hasIpv6 = function() { - return jspb.Message.getField(this, 12) != null; -}; - - -/** - * optional bool ignore_empty = 14; - * @return {boolean} - */ -proto.validate.BytesRules.prototype.getIgnoreEmpty = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 14, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.BytesRules} returns this - */ -proto.validate.BytesRules.prototype.setIgnoreEmpty = function(value) { - return jspb.Message.setField(this, 14, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.BytesRules} returns this - */ -proto.validate.BytesRules.prototype.clearIgnoreEmpty = function() { - return jspb.Message.setField(this, 14, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.BytesRules.prototype.hasIgnoreEmpty = function() { - return jspb.Message.getField(this, 14) != null; -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.validate.EnumRules.repeatedFields_ = [3,4]; - - - -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.validate.EnumRules.prototype.toObject = function(opt_includeInstance) { - return proto.validate.EnumRules.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.validate.EnumRules} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.EnumRules.toObject = function(includeInstance, msg) { - var f, obj = { - pb_const: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, - definedOnly: (f = jspb.Message.getBooleanField(msg, 2)) == null ? undefined : f, - inList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f, - notInList: (f = jspb.Message.getRepeatedField(msg, 4)) == 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.validate.EnumRules} - */ -proto.validate.EnumRules.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.validate.EnumRules; - return proto.validate.EnumRules.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.validate.EnumRules} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.validate.EnumRules} - */ -proto.validate.EnumRules.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readInt32()); - msg.setConst(value); - break; - case 2: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setDefinedOnly(value); - break; - case 3: - var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedInt32() : [reader.readInt32()]); - for (var i = 0; i < values.length; i++) { - msg.addIn(values[i]); - } - break; - case 4: - var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedInt32() : [reader.readInt32()]); - for (var i = 0; i < values.length; i++) { - msg.addNotIn(values[i]); - } - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.validate.EnumRules.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.validate.EnumRules.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.validate.EnumRules} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.EnumRules.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {number} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeInt32( - 1, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 2)); - if (f != null) { - writer.writeBool( - 2, - f - ); - } - f = message.getInList(); - if (f.length > 0) { - writer.writeRepeatedInt32( - 3, - f - ); - } - f = message.getNotInList(); - if (f.length > 0) { - writer.writeRepeatedInt32( - 4, - f - ); - } -}; - - -/** - * optional int32 const = 1; - * @return {number} - */ -proto.validate.EnumRules.prototype.getConst = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.EnumRules} returns this - */ -proto.validate.EnumRules.prototype.setConst = function(value) { - return jspb.Message.setField(this, 1, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.EnumRules} returns this - */ -proto.validate.EnumRules.prototype.clearConst = function() { - return jspb.Message.setField(this, 1, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.EnumRules.prototype.hasConst = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional bool defined_only = 2; - * @return {boolean} - */ -proto.validate.EnumRules.prototype.getDefinedOnly = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.EnumRules} returns this - */ -proto.validate.EnumRules.prototype.setDefinedOnly = function(value) { - return jspb.Message.setField(this, 2, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.EnumRules} returns this - */ -proto.validate.EnumRules.prototype.clearDefinedOnly = function() { - return jspb.Message.setField(this, 2, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.EnumRules.prototype.hasDefinedOnly = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * repeated int32 in = 3; - * @return {!Array} - */ -proto.validate.EnumRules.prototype.getInList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 3)); -}; - - -/** - * @param {!Array} value - * @return {!proto.validate.EnumRules} returns this - */ -proto.validate.EnumRules.prototype.setInList = function(value) { - return jspb.Message.setField(this, 3, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - * @return {!proto.validate.EnumRules} returns this - */ -proto.validate.EnumRules.prototype.addIn = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 3, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.validate.EnumRules} returns this - */ -proto.validate.EnumRules.prototype.clearInList = function() { - return this.setInList([]); -}; - - -/** - * repeated int32 not_in = 4; - * @return {!Array} - */ -proto.validate.EnumRules.prototype.getNotInList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 4)); -}; - - -/** - * @param {!Array} value - * @return {!proto.validate.EnumRules} returns this - */ -proto.validate.EnumRules.prototype.setNotInList = function(value) { - return jspb.Message.setField(this, 4, value || []); -}; - - -/** - * @param {number} value - * @param {number=} opt_index - * @return {!proto.validate.EnumRules} returns this - */ -proto.validate.EnumRules.prototype.addNotIn = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 4, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.validate.EnumRules} returns this - */ -proto.validate.EnumRules.prototype.clearNotInList = function() { - return this.setNotInList([]); -}; - - - - - -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.validate.MessageRules.prototype.toObject = function(opt_includeInstance) { - return proto.validate.MessageRules.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.validate.MessageRules} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.MessageRules.toObject = function(includeInstance, msg) { - var f, obj = { - skip: (f = jspb.Message.getBooleanField(msg, 1)) == null ? undefined : f, - required: (f = jspb.Message.getBooleanField(msg, 2)) == 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.validate.MessageRules} - */ -proto.validate.MessageRules.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.validate.MessageRules; - return proto.validate.MessageRules.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.validate.MessageRules} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.validate.MessageRules} - */ -proto.validate.MessageRules.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.setSkip(value); - break; - case 2: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setRequired(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.validate.MessageRules.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.validate.MessageRules.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.validate.MessageRules} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.MessageRules.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {boolean} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeBool( - 1, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 2)); - if (f != null) { - writer.writeBool( - 2, - f - ); - } -}; - - -/** - * optional bool skip = 1; - * @return {boolean} - */ -proto.validate.MessageRules.prototype.getSkip = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.MessageRules} returns this - */ -proto.validate.MessageRules.prototype.setSkip = function(value) { - return jspb.Message.setField(this, 1, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.MessageRules} returns this - */ -proto.validate.MessageRules.prototype.clearSkip = function() { - return jspb.Message.setField(this, 1, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.MessageRules.prototype.hasSkip = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional bool required = 2; - * @return {boolean} - */ -proto.validate.MessageRules.prototype.getRequired = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.MessageRules} returns this - */ -proto.validate.MessageRules.prototype.setRequired = function(value) { - return jspb.Message.setField(this, 2, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.MessageRules} returns this - */ -proto.validate.MessageRules.prototype.clearRequired = function() { - return jspb.Message.setField(this, 2, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.MessageRules.prototype.hasRequired = 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.validate.RepeatedRules.prototype.toObject = function(opt_includeInstance) { - return proto.validate.RepeatedRules.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.validate.RepeatedRules} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.RepeatedRules.toObject = function(includeInstance, msg) { - var f, obj = { - minItems: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, - maxItems: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f, - unique: (f = jspb.Message.getBooleanField(msg, 3)) == null ? undefined : f, - items: (f = msg.getItems()) && proto.validate.FieldRules.toObject(includeInstance, f), - ignoreEmpty: (f = jspb.Message.getBooleanField(msg, 5)) == 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.validate.RepeatedRules} - */ -proto.validate.RepeatedRules.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.validate.RepeatedRules; - return proto.validate.RepeatedRules.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.validate.RepeatedRules} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.validate.RepeatedRules} - */ -proto.validate.RepeatedRules.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readUint64()); - msg.setMinItems(value); - break; - case 2: - var value = /** @type {number} */ (reader.readUint64()); - msg.setMaxItems(value); - break; - case 3: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setUnique(value); - break; - case 4: - var value = new proto.validate.FieldRules; - reader.readMessage(value,proto.validate.FieldRules.deserializeBinaryFromReader); - msg.setItems(value); - break; - case 5: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setIgnoreEmpty(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.validate.RepeatedRules.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.validate.RepeatedRules.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.validate.RepeatedRules} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.RepeatedRules.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {number} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeUint64( - 1, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 2)); - if (f != null) { - writer.writeUint64( - 2, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 3)); - if (f != null) { - writer.writeBool( - 3, - f - ); - } - f = message.getItems(); - if (f != null) { - writer.writeMessage( - 4, - f, - proto.validate.FieldRules.serializeBinaryToWriter - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 5)); - if (f != null) { - writer.writeBool( - 5, - f - ); - } -}; - - -/** - * optional uint64 min_items = 1; - * @return {number} - */ -proto.validate.RepeatedRules.prototype.getMinItems = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.RepeatedRules} returns this - */ -proto.validate.RepeatedRules.prototype.setMinItems = function(value) { - return jspb.Message.setField(this, 1, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.RepeatedRules} returns this - */ -proto.validate.RepeatedRules.prototype.clearMinItems = function() { - return jspb.Message.setField(this, 1, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.RepeatedRules.prototype.hasMinItems = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional uint64 max_items = 2; - * @return {number} - */ -proto.validate.RepeatedRules.prototype.getMaxItems = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.RepeatedRules} returns this - */ -proto.validate.RepeatedRules.prototype.setMaxItems = function(value) { - return jspb.Message.setField(this, 2, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.RepeatedRules} returns this - */ -proto.validate.RepeatedRules.prototype.clearMaxItems = function() { - return jspb.Message.setField(this, 2, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.RepeatedRules.prototype.hasMaxItems = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional bool unique = 3; - * @return {boolean} - */ -proto.validate.RepeatedRules.prototype.getUnique = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.RepeatedRules} returns this - */ -proto.validate.RepeatedRules.prototype.setUnique = function(value) { - return jspb.Message.setField(this, 3, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.RepeatedRules} returns this - */ -proto.validate.RepeatedRules.prototype.clearUnique = function() { - return jspb.Message.setField(this, 3, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.RepeatedRules.prototype.hasUnique = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * optional FieldRules items = 4; - * @return {?proto.validate.FieldRules} - */ -proto.validate.RepeatedRules.prototype.getItems = function() { - return /** @type{?proto.validate.FieldRules} */ ( - jspb.Message.getWrapperField(this, proto.validate.FieldRules, 4)); -}; - - -/** - * @param {?proto.validate.FieldRules|undefined} value - * @return {!proto.validate.RepeatedRules} returns this -*/ -proto.validate.RepeatedRules.prototype.setItems = function(value) { - return jspb.Message.setWrapperField(this, 4, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.RepeatedRules} returns this - */ -proto.validate.RepeatedRules.prototype.clearItems = function() { - return this.setItems(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.RepeatedRules.prototype.hasItems = function() { - return jspb.Message.getField(this, 4) != null; -}; - - -/** - * optional bool ignore_empty = 5; - * @return {boolean} - */ -proto.validate.RepeatedRules.prototype.getIgnoreEmpty = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.RepeatedRules} returns this - */ -proto.validate.RepeatedRules.prototype.setIgnoreEmpty = function(value) { - return jspb.Message.setField(this, 5, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.RepeatedRules} returns this - */ -proto.validate.RepeatedRules.prototype.clearIgnoreEmpty = function() { - return jspb.Message.setField(this, 5, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.RepeatedRules.prototype.hasIgnoreEmpty = 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.validate.MapRules.prototype.toObject = function(opt_includeInstance) { - return proto.validate.MapRules.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.validate.MapRules} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.MapRules.toObject = function(includeInstance, msg) { - var f, obj = { - minPairs: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f, - maxPairs: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f, - noSparse: (f = jspb.Message.getBooleanField(msg, 3)) == null ? undefined : f, - keys: (f = msg.getKeys()) && proto.validate.FieldRules.toObject(includeInstance, f), - values: (f = msg.getValues()) && proto.validate.FieldRules.toObject(includeInstance, f), - ignoreEmpty: (f = jspb.Message.getBooleanField(msg, 6)) == 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.validate.MapRules} - */ -proto.validate.MapRules.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.validate.MapRules; - return proto.validate.MapRules.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.validate.MapRules} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.validate.MapRules} - */ -proto.validate.MapRules.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readUint64()); - msg.setMinPairs(value); - break; - case 2: - var value = /** @type {number} */ (reader.readUint64()); - msg.setMaxPairs(value); - break; - case 3: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setNoSparse(value); - break; - case 4: - var value = new proto.validate.FieldRules; - reader.readMessage(value,proto.validate.FieldRules.deserializeBinaryFromReader); - msg.setKeys(value); - break; - case 5: - var value = new proto.validate.FieldRules; - reader.readMessage(value,proto.validate.FieldRules.deserializeBinaryFromReader); - msg.setValues(value); - break; - case 6: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setIgnoreEmpty(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.validate.MapRules.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.validate.MapRules.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.validate.MapRules} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.MapRules.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {number} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeUint64( - 1, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 2)); - if (f != null) { - writer.writeUint64( - 2, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 3)); - if (f != null) { - writer.writeBool( - 3, - f - ); - } - f = message.getKeys(); - if (f != null) { - writer.writeMessage( - 4, - f, - proto.validate.FieldRules.serializeBinaryToWriter - ); - } - f = message.getValues(); - if (f != null) { - writer.writeMessage( - 5, - f, - proto.validate.FieldRules.serializeBinaryToWriter - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 6)); - if (f != null) { - writer.writeBool( - 6, - f - ); - } -}; - - -/** - * optional uint64 min_pairs = 1; - * @return {number} - */ -proto.validate.MapRules.prototype.getMinPairs = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.MapRules} returns this - */ -proto.validate.MapRules.prototype.setMinPairs = function(value) { - return jspb.Message.setField(this, 1, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.MapRules} returns this - */ -proto.validate.MapRules.prototype.clearMinPairs = function() { - return jspb.Message.setField(this, 1, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.MapRules.prototype.hasMinPairs = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional uint64 max_pairs = 2; - * @return {number} - */ -proto.validate.MapRules.prototype.getMaxPairs = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.validate.MapRules} returns this - */ -proto.validate.MapRules.prototype.setMaxPairs = function(value) { - return jspb.Message.setField(this, 2, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.MapRules} returns this - */ -proto.validate.MapRules.prototype.clearMaxPairs = function() { - return jspb.Message.setField(this, 2, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.MapRules.prototype.hasMaxPairs = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional bool no_sparse = 3; - * @return {boolean} - */ -proto.validate.MapRules.prototype.getNoSparse = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.MapRules} returns this - */ -proto.validate.MapRules.prototype.setNoSparse = function(value) { - return jspb.Message.setField(this, 3, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.MapRules} returns this - */ -proto.validate.MapRules.prototype.clearNoSparse = function() { - return jspb.Message.setField(this, 3, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.MapRules.prototype.hasNoSparse = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * optional FieldRules keys = 4; - * @return {?proto.validate.FieldRules} - */ -proto.validate.MapRules.prototype.getKeys = function() { - return /** @type{?proto.validate.FieldRules} */ ( - jspb.Message.getWrapperField(this, proto.validate.FieldRules, 4)); -}; - - -/** - * @param {?proto.validate.FieldRules|undefined} value - * @return {!proto.validate.MapRules} returns this -*/ -proto.validate.MapRules.prototype.setKeys = function(value) { - return jspb.Message.setWrapperField(this, 4, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.MapRules} returns this - */ -proto.validate.MapRules.prototype.clearKeys = function() { - return this.setKeys(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.MapRules.prototype.hasKeys = function() { - return jspb.Message.getField(this, 4) != null; -}; - - -/** - * optional FieldRules values = 5; - * @return {?proto.validate.FieldRules} - */ -proto.validate.MapRules.prototype.getValues = function() { - return /** @type{?proto.validate.FieldRules} */ ( - jspb.Message.getWrapperField(this, proto.validate.FieldRules, 5)); -}; - - -/** - * @param {?proto.validate.FieldRules|undefined} value - * @return {!proto.validate.MapRules} returns this -*/ -proto.validate.MapRules.prototype.setValues = function(value) { - return jspb.Message.setWrapperField(this, 5, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.MapRules} returns this - */ -proto.validate.MapRules.prototype.clearValues = function() { - return this.setValues(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.MapRules.prototype.hasValues = function() { - return jspb.Message.getField(this, 5) != null; -}; - - -/** - * optional bool ignore_empty = 6; - * @return {boolean} - */ -proto.validate.MapRules.prototype.getIgnoreEmpty = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 6, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.MapRules} returns this - */ -proto.validate.MapRules.prototype.setIgnoreEmpty = function(value) { - return jspb.Message.setField(this, 6, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.MapRules} returns this - */ -proto.validate.MapRules.prototype.clearIgnoreEmpty = function() { - return jspb.Message.setField(this, 6, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.MapRules.prototype.hasIgnoreEmpty = function() { - return jspb.Message.getField(this, 6) != null; -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.validate.AnyRules.repeatedFields_ = [2,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.validate.AnyRules.prototype.toObject = function(opt_includeInstance) { - return proto.validate.AnyRules.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.validate.AnyRules} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.AnyRules.toObject = function(includeInstance, msg) { - var f, obj = { - required: (f = jspb.Message.getBooleanField(msg, 1)) == null ? undefined : f, - inList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f, - notInList: (f = jspb.Message.getRepeatedField(msg, 3)) == 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.validate.AnyRules} - */ -proto.validate.AnyRules.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.validate.AnyRules; - return proto.validate.AnyRules.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.validate.AnyRules} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.validate.AnyRules} - */ -proto.validate.AnyRules.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.setRequired(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.addIn(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.addNotIn(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.validate.AnyRules.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.validate.AnyRules.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.validate.AnyRules} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.AnyRules.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {boolean} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeBool( - 1, - f - ); - } - f = message.getInList(); - if (f.length > 0) { - writer.writeRepeatedString( - 2, - f - ); - } - f = message.getNotInList(); - if (f.length > 0) { - writer.writeRepeatedString( - 3, - f - ); - } -}; - - -/** - * optional bool required = 1; - * @return {boolean} - */ -proto.validate.AnyRules.prototype.getRequired = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.AnyRules} returns this - */ -proto.validate.AnyRules.prototype.setRequired = function(value) { - return jspb.Message.setField(this, 1, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.AnyRules} returns this - */ -proto.validate.AnyRules.prototype.clearRequired = function() { - return jspb.Message.setField(this, 1, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.AnyRules.prototype.hasRequired = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * repeated string in = 2; - * @return {!Array} - */ -proto.validate.AnyRules.prototype.getInList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 2)); -}; - - -/** - * @param {!Array} value - * @return {!proto.validate.AnyRules} returns this - */ -proto.validate.AnyRules.prototype.setInList = function(value) { - return jspb.Message.setField(this, 2, value || []); -}; - - -/** - * @param {string} value - * @param {number=} opt_index - * @return {!proto.validate.AnyRules} returns this - */ -proto.validate.AnyRules.prototype.addIn = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 2, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.validate.AnyRules} returns this - */ -proto.validate.AnyRules.prototype.clearInList = function() { - return this.setInList([]); -}; - - -/** - * repeated string not_in = 3; - * @return {!Array} - */ -proto.validate.AnyRules.prototype.getNotInList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 3)); -}; - - -/** - * @param {!Array} value - * @return {!proto.validate.AnyRules} returns this - */ -proto.validate.AnyRules.prototype.setNotInList = function(value) { - return jspb.Message.setField(this, 3, value || []); -}; - - -/** - * @param {string} value - * @param {number=} opt_index - * @return {!proto.validate.AnyRules} returns this - */ -proto.validate.AnyRules.prototype.addNotIn = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 3, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.validate.AnyRules} returns this - */ -proto.validate.AnyRules.prototype.clearNotInList = function() { - return this.setNotInList([]); -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.validate.DurationRules.repeatedFields_ = [7,8]; - - - -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.validate.DurationRules.prototype.toObject = function(opt_includeInstance) { - return proto.validate.DurationRules.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.validate.DurationRules} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.DurationRules.toObject = function(includeInstance, msg) { - var f, obj = { - required: (f = jspb.Message.getBooleanField(msg, 1)) == null ? undefined : f, - pb_const: (f = msg.getConst()) && google_protobuf_duration_pb.Duration.toObject(includeInstance, f), - lt: (f = msg.getLt()) && google_protobuf_duration_pb.Duration.toObject(includeInstance, f), - lte: (f = msg.getLte()) && google_protobuf_duration_pb.Duration.toObject(includeInstance, f), - gt: (f = msg.getGt()) && google_protobuf_duration_pb.Duration.toObject(includeInstance, f), - gte: (f = msg.getGte()) && google_protobuf_duration_pb.Duration.toObject(includeInstance, f), - inList: jspb.Message.toObjectList(msg.getInList(), - google_protobuf_duration_pb.Duration.toObject, includeInstance), - notInList: jspb.Message.toObjectList(msg.getNotInList(), - google_protobuf_duration_pb.Duration.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.validate.DurationRules} - */ -proto.validate.DurationRules.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.validate.DurationRules; - return proto.validate.DurationRules.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.validate.DurationRules} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.validate.DurationRules} - */ -proto.validate.DurationRules.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.setRequired(value); - break; - case 2: - var value = new google_protobuf_duration_pb.Duration; - reader.readMessage(value,google_protobuf_duration_pb.Duration.deserializeBinaryFromReader); - msg.setConst(value); - break; - case 3: - var value = new google_protobuf_duration_pb.Duration; - reader.readMessage(value,google_protobuf_duration_pb.Duration.deserializeBinaryFromReader); - msg.setLt(value); - break; - case 4: - var value = new google_protobuf_duration_pb.Duration; - reader.readMessage(value,google_protobuf_duration_pb.Duration.deserializeBinaryFromReader); - msg.setLte(value); - break; - case 5: - var value = new google_protobuf_duration_pb.Duration; - reader.readMessage(value,google_protobuf_duration_pb.Duration.deserializeBinaryFromReader); - msg.setGt(value); - break; - case 6: - var value = new google_protobuf_duration_pb.Duration; - reader.readMessage(value,google_protobuf_duration_pb.Duration.deserializeBinaryFromReader); - msg.setGte(value); - break; - case 7: - var value = new google_protobuf_duration_pb.Duration; - reader.readMessage(value,google_protobuf_duration_pb.Duration.deserializeBinaryFromReader); - msg.addIn(value); - break; - case 8: - var value = new google_protobuf_duration_pb.Duration; - reader.readMessage(value,google_protobuf_duration_pb.Duration.deserializeBinaryFromReader); - msg.addNotIn(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.validate.DurationRules.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.validate.DurationRules.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.validate.DurationRules} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.DurationRules.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {boolean} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeBool( - 1, - f - ); - } - f = message.getConst(); - if (f != null) { - writer.writeMessage( - 2, - f, - google_protobuf_duration_pb.Duration.serializeBinaryToWriter - ); - } - f = message.getLt(); - if (f != null) { - writer.writeMessage( - 3, - f, - google_protobuf_duration_pb.Duration.serializeBinaryToWriter - ); - } - f = message.getLte(); - if (f != null) { - writer.writeMessage( - 4, - f, - google_protobuf_duration_pb.Duration.serializeBinaryToWriter - ); - } - f = message.getGt(); - if (f != null) { - writer.writeMessage( - 5, - f, - google_protobuf_duration_pb.Duration.serializeBinaryToWriter - ); - } - f = message.getGte(); - if (f != null) { - writer.writeMessage( - 6, - f, - google_protobuf_duration_pb.Duration.serializeBinaryToWriter - ); - } - f = message.getInList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 7, - f, - google_protobuf_duration_pb.Duration.serializeBinaryToWriter - ); - } - f = message.getNotInList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 8, - f, - google_protobuf_duration_pb.Duration.serializeBinaryToWriter - ); - } -}; - - -/** - * optional bool required = 1; - * @return {boolean} - */ -proto.validate.DurationRules.prototype.getRequired = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.DurationRules} returns this - */ -proto.validate.DurationRules.prototype.setRequired = function(value) { - return jspb.Message.setField(this, 1, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.DurationRules} returns this - */ -proto.validate.DurationRules.prototype.clearRequired = function() { - return jspb.Message.setField(this, 1, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.DurationRules.prototype.hasRequired = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional google.protobuf.Duration const = 2; - * @return {?proto.google.protobuf.Duration} - */ -proto.validate.DurationRules.prototype.getConst = function() { - return /** @type{?proto.google.protobuf.Duration} */ ( - jspb.Message.getWrapperField(this, google_protobuf_duration_pb.Duration, 2)); -}; - - -/** - * @param {?proto.google.protobuf.Duration|undefined} value - * @return {!proto.validate.DurationRules} returns this -*/ -proto.validate.DurationRules.prototype.setConst = function(value) { - return jspb.Message.setWrapperField(this, 2, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.DurationRules} returns this - */ -proto.validate.DurationRules.prototype.clearConst = function() { - return this.setConst(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.DurationRules.prototype.hasConst = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional google.protobuf.Duration lt = 3; - * @return {?proto.google.protobuf.Duration} - */ -proto.validate.DurationRules.prototype.getLt = function() { - return /** @type{?proto.google.protobuf.Duration} */ ( - jspb.Message.getWrapperField(this, google_protobuf_duration_pb.Duration, 3)); -}; - - -/** - * @param {?proto.google.protobuf.Duration|undefined} value - * @return {!proto.validate.DurationRules} returns this -*/ -proto.validate.DurationRules.prototype.setLt = function(value) { - return jspb.Message.setWrapperField(this, 3, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.DurationRules} returns this - */ -proto.validate.DurationRules.prototype.clearLt = function() { - return this.setLt(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.DurationRules.prototype.hasLt = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * optional google.protobuf.Duration lte = 4; - * @return {?proto.google.protobuf.Duration} - */ -proto.validate.DurationRules.prototype.getLte = function() { - return /** @type{?proto.google.protobuf.Duration} */ ( - jspb.Message.getWrapperField(this, google_protobuf_duration_pb.Duration, 4)); -}; - - -/** - * @param {?proto.google.protobuf.Duration|undefined} value - * @return {!proto.validate.DurationRules} returns this -*/ -proto.validate.DurationRules.prototype.setLte = function(value) { - return jspb.Message.setWrapperField(this, 4, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.DurationRules} returns this - */ -proto.validate.DurationRules.prototype.clearLte = function() { - return this.setLte(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.DurationRules.prototype.hasLte = function() { - return jspb.Message.getField(this, 4) != null; -}; - - -/** - * optional google.protobuf.Duration gt = 5; - * @return {?proto.google.protobuf.Duration} - */ -proto.validate.DurationRules.prototype.getGt = function() { - return /** @type{?proto.google.protobuf.Duration} */ ( - jspb.Message.getWrapperField(this, google_protobuf_duration_pb.Duration, 5)); -}; - - -/** - * @param {?proto.google.protobuf.Duration|undefined} value - * @return {!proto.validate.DurationRules} returns this -*/ -proto.validate.DurationRules.prototype.setGt = function(value) { - return jspb.Message.setWrapperField(this, 5, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.DurationRules} returns this - */ -proto.validate.DurationRules.prototype.clearGt = function() { - return this.setGt(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.DurationRules.prototype.hasGt = function() { - return jspb.Message.getField(this, 5) != null; -}; - - -/** - * optional google.protobuf.Duration gte = 6; - * @return {?proto.google.protobuf.Duration} - */ -proto.validate.DurationRules.prototype.getGte = function() { - return /** @type{?proto.google.protobuf.Duration} */ ( - jspb.Message.getWrapperField(this, google_protobuf_duration_pb.Duration, 6)); -}; - - -/** - * @param {?proto.google.protobuf.Duration|undefined} value - * @return {!proto.validate.DurationRules} returns this -*/ -proto.validate.DurationRules.prototype.setGte = function(value) { - return jspb.Message.setWrapperField(this, 6, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.DurationRules} returns this - */ -proto.validate.DurationRules.prototype.clearGte = function() { - return this.setGte(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.DurationRules.prototype.hasGte = function() { - return jspb.Message.getField(this, 6) != null; -}; - - -/** - * repeated google.protobuf.Duration in = 7; - * @return {!Array} - */ -proto.validate.DurationRules.prototype.getInList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, google_protobuf_duration_pb.Duration, 7)); -}; - - -/** - * @param {!Array} value - * @return {!proto.validate.DurationRules} returns this -*/ -proto.validate.DurationRules.prototype.setInList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 7, value); -}; - - -/** - * @param {!proto.google.protobuf.Duration=} opt_value - * @param {number=} opt_index - * @return {!proto.google.protobuf.Duration} - */ -proto.validate.DurationRules.prototype.addIn = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 7, opt_value, proto.google.protobuf.Duration, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.validate.DurationRules} returns this - */ -proto.validate.DurationRules.prototype.clearInList = function() { - return this.setInList([]); -}; - - -/** - * repeated google.protobuf.Duration not_in = 8; - * @return {!Array} - */ -proto.validate.DurationRules.prototype.getNotInList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, google_protobuf_duration_pb.Duration, 8)); -}; - - -/** - * @param {!Array} value - * @return {!proto.validate.DurationRules} returns this -*/ -proto.validate.DurationRules.prototype.setNotInList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 8, value); -}; - - -/** - * @param {!proto.google.protobuf.Duration=} opt_value - * @param {number=} opt_index - * @return {!proto.google.protobuf.Duration} - */ -proto.validate.DurationRules.prototype.addNotIn = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 8, opt_value, proto.google.protobuf.Duration, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.validate.DurationRules} returns this - */ -proto.validate.DurationRules.prototype.clearNotInList = function() { - return this.setNotInList([]); -}; - - - - - -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.validate.TimestampRules.prototype.toObject = function(opt_includeInstance) { - return proto.validate.TimestampRules.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.validate.TimestampRules} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.TimestampRules.toObject = function(includeInstance, msg) { - var f, obj = { - required: (f = jspb.Message.getBooleanField(msg, 1)) == null ? undefined : f, - pb_const: (f = msg.getConst()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f), - lt: (f = msg.getLt()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f), - lte: (f = msg.getLte()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f), - gt: (f = msg.getGt()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f), - gte: (f = msg.getGte()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f), - ltNow: (f = jspb.Message.getBooleanField(msg, 7)) == null ? undefined : f, - gtNow: (f = jspb.Message.getBooleanField(msg, 8)) == null ? undefined : f, - within: (f = msg.getWithin()) && google_protobuf_duration_pb.Duration.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.validate.TimestampRules} - */ -proto.validate.TimestampRules.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.validate.TimestampRules; - return proto.validate.TimestampRules.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.validate.TimestampRules} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.validate.TimestampRules} - */ -proto.validate.TimestampRules.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.setRequired(value); - break; - case 2: - var value = new google_protobuf_timestamp_pb.Timestamp; - reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader); - msg.setConst(value); - break; - case 3: - var value = new google_protobuf_timestamp_pb.Timestamp; - reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader); - msg.setLt(value); - break; - case 4: - var value = new google_protobuf_timestamp_pb.Timestamp; - reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader); - msg.setLte(value); - break; - case 5: - var value = new google_protobuf_timestamp_pb.Timestamp; - reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader); - msg.setGt(value); - break; - case 6: - var value = new google_protobuf_timestamp_pb.Timestamp; - reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader); - msg.setGte(value); - break; - case 7: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setLtNow(value); - break; - case 8: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setGtNow(value); - break; - case 9: - var value = new google_protobuf_duration_pb.Duration; - reader.readMessage(value,google_protobuf_duration_pb.Duration.deserializeBinaryFromReader); - msg.setWithin(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.validate.TimestampRules.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.validate.TimestampRules.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.validate.TimestampRules} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.validate.TimestampRules.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {boolean} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeBool( - 1, - f - ); - } - f = message.getConst(); - if (f != null) { - writer.writeMessage( - 2, - f, - google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter - ); - } - f = message.getLt(); - if (f != null) { - writer.writeMessage( - 3, - f, - google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter - ); - } - f = message.getLte(); - if (f != null) { - writer.writeMessage( - 4, - f, - google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter - ); - } - f = message.getGt(); - if (f != null) { - writer.writeMessage( - 5, - f, - google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter - ); - } - f = message.getGte(); - if (f != null) { - writer.writeMessage( - 6, - f, - google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 7)); - if (f != null) { - writer.writeBool( - 7, - f - ); - } - f = /** @type {boolean} */ (jspb.Message.getField(message, 8)); - if (f != null) { - writer.writeBool( - 8, - f - ); - } - f = message.getWithin(); - if (f != null) { - writer.writeMessage( - 9, - f, - google_protobuf_duration_pb.Duration.serializeBinaryToWriter - ); - } -}; - - -/** - * optional bool required = 1; - * @return {boolean} - */ -proto.validate.TimestampRules.prototype.getRequired = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.TimestampRules} returns this - */ -proto.validate.TimestampRules.prototype.setRequired = function(value) { - return jspb.Message.setField(this, 1, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.TimestampRules} returns this - */ -proto.validate.TimestampRules.prototype.clearRequired = function() { - return jspb.Message.setField(this, 1, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.TimestampRules.prototype.hasRequired = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional google.protobuf.Timestamp const = 2; - * @return {?proto.google.protobuf.Timestamp} - */ -proto.validate.TimestampRules.prototype.getConst = function() { - return /** @type{?proto.google.protobuf.Timestamp} */ ( - jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 2)); -}; - - -/** - * @param {?proto.google.protobuf.Timestamp|undefined} value - * @return {!proto.validate.TimestampRules} returns this -*/ -proto.validate.TimestampRules.prototype.setConst = function(value) { - return jspb.Message.setWrapperField(this, 2, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.TimestampRules} returns this - */ -proto.validate.TimestampRules.prototype.clearConst = function() { - return this.setConst(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.TimestampRules.prototype.hasConst = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional google.protobuf.Timestamp lt = 3; - * @return {?proto.google.protobuf.Timestamp} - */ -proto.validate.TimestampRules.prototype.getLt = function() { - return /** @type{?proto.google.protobuf.Timestamp} */ ( - jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 3)); -}; - - -/** - * @param {?proto.google.protobuf.Timestamp|undefined} value - * @return {!proto.validate.TimestampRules} returns this -*/ -proto.validate.TimestampRules.prototype.setLt = function(value) { - return jspb.Message.setWrapperField(this, 3, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.TimestampRules} returns this - */ -proto.validate.TimestampRules.prototype.clearLt = function() { - return this.setLt(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.TimestampRules.prototype.hasLt = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * optional google.protobuf.Timestamp lte = 4; - * @return {?proto.google.protobuf.Timestamp} - */ -proto.validate.TimestampRules.prototype.getLte = function() { - return /** @type{?proto.google.protobuf.Timestamp} */ ( - jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 4)); -}; - - -/** - * @param {?proto.google.protobuf.Timestamp|undefined} value - * @return {!proto.validate.TimestampRules} returns this -*/ -proto.validate.TimestampRules.prototype.setLte = function(value) { - return jspb.Message.setWrapperField(this, 4, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.TimestampRules} returns this - */ -proto.validate.TimestampRules.prototype.clearLte = function() { - return this.setLte(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.TimestampRules.prototype.hasLte = function() { - return jspb.Message.getField(this, 4) != null; -}; - - -/** - * optional google.protobuf.Timestamp gt = 5; - * @return {?proto.google.protobuf.Timestamp} - */ -proto.validate.TimestampRules.prototype.getGt = function() { - return /** @type{?proto.google.protobuf.Timestamp} */ ( - jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 5)); -}; - - -/** - * @param {?proto.google.protobuf.Timestamp|undefined} value - * @return {!proto.validate.TimestampRules} returns this -*/ -proto.validate.TimestampRules.prototype.setGt = function(value) { - return jspb.Message.setWrapperField(this, 5, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.TimestampRules} returns this - */ -proto.validate.TimestampRules.prototype.clearGt = function() { - return this.setGt(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.TimestampRules.prototype.hasGt = function() { - return jspb.Message.getField(this, 5) != null; -}; - - -/** - * optional google.protobuf.Timestamp gte = 6; - * @return {?proto.google.protobuf.Timestamp} - */ -proto.validate.TimestampRules.prototype.getGte = function() { - return /** @type{?proto.google.protobuf.Timestamp} */ ( - jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 6)); -}; - - -/** - * @param {?proto.google.protobuf.Timestamp|undefined} value - * @return {!proto.validate.TimestampRules} returns this -*/ -proto.validate.TimestampRules.prototype.setGte = function(value) { - return jspb.Message.setWrapperField(this, 6, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.TimestampRules} returns this - */ -proto.validate.TimestampRules.prototype.clearGte = function() { - return this.setGte(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.TimestampRules.prototype.hasGte = function() { - return jspb.Message.getField(this, 6) != null; -}; - - -/** - * optional bool lt_now = 7; - * @return {boolean} - */ -proto.validate.TimestampRules.prototype.getLtNow = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 7, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.TimestampRules} returns this - */ -proto.validate.TimestampRules.prototype.setLtNow = function(value) { - return jspb.Message.setField(this, 7, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.TimestampRules} returns this - */ -proto.validate.TimestampRules.prototype.clearLtNow = function() { - return jspb.Message.setField(this, 7, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.TimestampRules.prototype.hasLtNow = function() { - return jspb.Message.getField(this, 7) != null; -}; - - -/** - * optional bool gt_now = 8; - * @return {boolean} - */ -proto.validate.TimestampRules.prototype.getGtNow = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.validate.TimestampRules} returns this - */ -proto.validate.TimestampRules.prototype.setGtNow = function(value) { - return jspb.Message.setField(this, 8, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.validate.TimestampRules} returns this - */ -proto.validate.TimestampRules.prototype.clearGtNow = function() { - return jspb.Message.setField(this, 8, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.TimestampRules.prototype.hasGtNow = function() { - return jspb.Message.getField(this, 8) != null; -}; - - -/** - * optional google.protobuf.Duration within = 9; - * @return {?proto.google.protobuf.Duration} - */ -proto.validate.TimestampRules.prototype.getWithin = function() { - return /** @type{?proto.google.protobuf.Duration} */ ( - jspb.Message.getWrapperField(this, google_protobuf_duration_pb.Duration, 9)); -}; - - -/** - * @param {?proto.google.protobuf.Duration|undefined} value - * @return {!proto.validate.TimestampRules} returns this -*/ -proto.validate.TimestampRules.prototype.setWithin = function(value) { - return jspb.Message.setWrapperField(this, 9, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.validate.TimestampRules} returns this - */ -proto.validate.TimestampRules.prototype.clearWithin = function() { - return this.setWithin(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.validate.TimestampRules.prototype.hasWithin = function() { - return jspb.Message.getField(this, 9) != null; -}; - - -/** - * @enum {number} - */ -proto.validate.KnownRegex = { - UNKNOWN: 0, - HTTP_HEADER_NAME: 1, - HTTP_HEADER_VALUE: 2 -}; - - -/** - * A tuple of {field number, class constructor} for the extension - * field named `disabled`. - * @type {!jspb.ExtensionFieldInfo} - */ -proto.validate.disabled = new jspb.ExtensionFieldInfo( - 1071, - {disabled: 0}, - null, - /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( - null), - 0); - -google_protobuf_descriptor_pb.MessageOptions.extensionsBinary[1071] = new jspb.ExtensionFieldBinaryInfo( - proto.validate.disabled, - jspb.BinaryReader.prototype.readBool, - jspb.BinaryWriter.prototype.writeBool, - undefined, - undefined, - false); -// This registers the extension field with the extended class, so that -// toObject() will function correctly. -google_protobuf_descriptor_pb.MessageOptions.extensions[1071] = proto.validate.disabled; - - -/** - * A tuple of {field number, class constructor} for the extension - * field named `ignored`. - * @type {!jspb.ExtensionFieldInfo} - */ -proto.validate.ignored = new jspb.ExtensionFieldInfo( - 1072, - {ignored: 0}, - null, - /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( - null), - 0); - -google_protobuf_descriptor_pb.MessageOptions.extensionsBinary[1072] = new jspb.ExtensionFieldBinaryInfo( - proto.validate.ignored, - jspb.BinaryReader.prototype.readBool, - jspb.BinaryWriter.prototype.writeBool, - undefined, - undefined, - false); -// This registers the extension field with the extended class, so that -// toObject() will function correctly. -google_protobuf_descriptor_pb.MessageOptions.extensions[1072] = proto.validate.ignored; - - -/** - * A tuple of {field number, class constructor} for the extension - * field named `required`. - * @type {!jspb.ExtensionFieldInfo} - */ -proto.validate.required = new jspb.ExtensionFieldInfo( - 1071, - {required: 0}, - null, - /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( - null), - 0); - -google_protobuf_descriptor_pb.OneofOptions.extensionsBinary[1071] = new jspb.ExtensionFieldBinaryInfo( - proto.validate.required, - jspb.BinaryReader.prototype.readBool, - jspb.BinaryWriter.prototype.writeBool, - undefined, - undefined, - false); -// This registers the extension field with the extended class, so that -// toObject() will function correctly. -google_protobuf_descriptor_pb.OneofOptions.extensions[1071] = proto.validate.required; - - -/** - * A tuple of {field number, class constructor} for the extension - * field named `rules`. - * @type {!jspb.ExtensionFieldInfo} - */ -proto.validate.rules = new jspb.ExtensionFieldInfo( - 1071, - {rules: 0}, - proto.validate.FieldRules, - /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( - proto.validate.FieldRules.toObject), - 0); - -google_protobuf_descriptor_pb.FieldOptions.extensionsBinary[1071] = new jspb.ExtensionFieldBinaryInfo( - proto.validate.rules, - jspb.BinaryReader.prototype.readMessage, - jspb.BinaryWriter.prototype.writeMessage, - proto.validate.FieldRules.serializeBinaryToWriter, - proto.validate.FieldRules.deserializeBinaryFromReader, - false); -// This registers the extension field with the extended class, so that -// toObject() will function correctly. -google_protobuf_descriptor_pb.FieldOptions.extensions[1071] = proto.validate.rules; - -goog.object.extend(exports, proto.validate); diff --git a/src/faas/v0/handler.test.ts b/src/handlers/handler.test.ts similarity index 100% rename from src/faas/v0/handler.test.ts rename to src/handlers/handler.test.ts diff --git a/src/faas/v0/handler.ts b/src/handlers/handler.ts similarity index 76% rename from src/faas/v0/handler.ts rename to src/handlers/handler.ts index a3b59cb2..2a19e4f0 100644 --- a/src/faas/v0/handler.ts +++ b/src/handlers/handler.ts @@ -11,42 +11,35 @@ // 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 { NitricEvent } from '../../types'; -import { - TriggerContext, - HttpContext, - EventContext, - BucketNotificationContext, - FileNotificationContext, - WebsocketNotificationContext, - JSONTypes, -} from '.'; + +import { BaseContext, JSONTypes } from '../context/base'; +import { BlobEventContext, BucketEventContext } from '../context/bucket'; +import { HttpContext } from '../context/http'; +import { IntervalContext } from '../context/interval'; +import { MessageContext } from '../context/message'; +import { WebsocketNotificationContext } from '../context/websocket'; export type GenericHandler = (ctx: Ctx) => Promise | Ctx; -export type TriggerHandler = GenericHandler; +export type TriggerHandler = GenericHandler; export type HttpHandler = GenericHandler; -export type EventHandler = GenericHandler< - EventContext ->; export type GenericMiddleware = ( ctx: Ctx, next?: GenericHandler ) => Promise | Ctx | void; -export type TriggerMiddleware = GenericMiddleware; +export type TriggerMiddleware = GenericMiddleware; export type HttpMiddleware = GenericMiddleware; export type WebsocketMiddleware> = GenericMiddleware>; -export type EventMiddleware< +export type MessageMiddleware< T extends Record = Record -> = GenericMiddleware>>; -export type ScheduleMiddleware = GenericMiddleware>; +> = GenericMiddleware>; +export type ScheduleMiddleware = GenericMiddleware; export type BucketNotificationMiddleware = - GenericMiddleware; -export type FileNotificationMiddleware = - GenericMiddleware; + GenericMiddleware; +export type FileNotificationMiddleware = GenericMiddleware; /** * createHandler @@ -58,7 +51,7 @@ export type FileNotificationMiddleware = * @param handlers one or more handler functions to be chained together into a single root function. * @returns - A root function composed of a chain of user provided functions */ -export const createHandler = ( +export const createHandler = ( ...handlers: GenericMiddleware[] ): GenericMiddleware => { const reversedHandlers = handlers.slice().reverse(); diff --git a/src/faas/v0/index.ts b/src/handlers/index.ts similarity index 92% rename from src/faas/v0/index.ts rename to src/handlers/index.ts index 468740e7..7d59064c 100644 --- a/src/faas/v0/index.ts +++ b/src/handlers/index.ts @@ -12,6 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. export * from './handler'; -export * from './context'; -export * from './start'; export * from './json'; diff --git a/src/faas/v0/json.ts b/src/handlers/json.ts similarity index 89% rename from src/faas/v0/json.ts rename to src/handlers/json.ts index b71719a4..5fdca842 100644 --- a/src/faas/v0/json.ts +++ b/src/handlers/json.ts @@ -11,7 +11,9 @@ // 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 { HttpContext, HttpMiddleware } from '.'; + +import { HttpContext } from '../context/http'; +import type { HttpMiddleware } from './handler'; const decodeData = (data: string | Uint8Array): string => { if (typeof data !== 'string') { @@ -38,7 +40,7 @@ export const json = (): HttpMiddleware => (ctx: HttpContext, next) => { */ export const jsonResponse = (ctx: HttpContext) => - (data: string | number | boolean | Record) => { + (data: string | number | boolean | Record): HttpContext => { ctx.res.body = new TextEncoder().encode(JSON.stringify(data)); ctx.res.headers['Content-Type'] = ['application/json']; diff --git a/src/index.ts b/src/index.ts index e8c031cc..ef898d53 100644 --- a/src/index.ts +++ b/src/index.ts @@ -12,8 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. export * from './api'; - -// Nitric Node FaaS library -export * as faas from './faas'; export * from './resources'; export * from './types'; +export * from './context'; +export * from './handlers'; diff --git a/src/resources/api.test.ts b/src/resources/api.test.ts index 3a3f5076..a09d27a2 100644 --- a/src/resources/api.test.ts +++ b/src/resources/api.test.ts @@ -11,24 +11,38 @@ // 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 faas from '../faas/index'; -import { api, ApiWorkerOptions } from '.'; -import { ResourceServiceClient } from '@nitric/api/proto/resource/v1/resource_grpc_pb'; -import { - ApiResourceDetails, - ResourceDetailsResponse, -} from '@nitric/api/proto/resource/v1/resource_pb'; - -jest.mock('../faas/index'); +import { api, Method } from '.'; +import { ResourcesClient } from '@nitric/proto/resources/v1/resources_grpc_pb'; +import { ApiDetailsResponse } from '../gen/nitric/proto/apis/v1/apis_pb'; +import { ApiClient } from '../gen/nitric/proto/apis/v1/apis_grpc_pb'; +import { status } from '@grpc/grpc-js'; describe('Api', () => { - const startSpy = jest - .spyOn(faas.Faas.prototype, 'start') - .mockReturnValue(Promise.resolve()); - const mockFn = jest.fn(); + const MOCK_ERROR = { + code: status.UNIMPLEMENTED, + message: 'UNIMPLEMENTED', + }; + + let declareSpy; + let startSpy; + let mockFn; + beforeAll(() => { + jest.spyOn(console, 'error').mockImplementation(() => {}); + declareSpy = jest + .spyOn(ResourcesClient.prototype, 'declare') + .mockImplementationOnce((request, callback: any) => { + callback(MOCK_ERROR, null); + + return null as any; + }); + startSpy = jest + .spyOn(Method.prototype as any, 'start') + .mockReturnValue(Promise.resolve()); + mockFn = jest.fn(); + }); afterAll(() => { - jest.clearAllMocks(); + jest.restoreAllMocks(); }); describe('when create a new route', () => { @@ -38,28 +52,12 @@ describe('Api', () => { const route = api('main').route('/newroute/'); - describe('when registing a catch all handler', () => { + describe('when registering a catch all handler', () => { beforeAll(async () => { await route.all(mockFn); }); - it('should create a new FaasClient', () => { - expect(faas.Faas).toBeCalledTimes(1); - }); - - it('should provide Faas with ApiWorkerOptions', () => { - const expectedOpts = new ApiWorkerOptions('main', '/newroute/', [ - 'GET', - 'POST', - 'PATCH', - 'PUT', - 'DELETE', - 'OPTIONS', - ]); - expect(faas.Faas).toBeCalledWith(expectedOpts); - }); - - it('should call FaasClient::start()', () => { + it('should call Method::start()', () => { expect(startSpy).toBeCalledTimes(1); }); }); @@ -82,22 +80,6 @@ describe('Api', () => { jest.resetAllMocks(); }); - it('should create a new FaasClient', () => { - expect(faas.Faas).toBeCalledTimes(1); - }); - - it('should provide Faas with ApiWorkerOptions', () => { - const expectedOpts = new ApiWorkerOptions( - 'main1', - '/v1/test/', - [method.toUpperCase() as any], - { - security: { test: [] }, - } - ); - expect(faas.Faas).toBeCalledWith(expectedOpts); - }); - it('should call FaasClient::start()', () => { expect(startSpy).toBeCalledTimes(1); }); @@ -112,16 +94,10 @@ describe('Api', () => { beforeAll(async () => { // mock the details api detailsSpy = jest - .spyOn(ResourceServiceClient.prototype, 'details') + .spyOn(ApiClient.prototype, 'apiDetails') .mockImplementationOnce((request, callback: any) => { - const resp = new ResourceDetailsResponse(); - resp.setId('mock-id'); - resp.setProvider('mock-provider'); - resp.setService('mock-service'); - - const api = new ApiResourceDetails(); - api.setUrl('http://localhost:9001/test'); - resp.setApi(api); + const resp = new ApiDetailsResponse(); + resp.setUrl('http://localhost:9001/test'); callback(null, resp); @@ -139,38 +115,5 @@ describe('Api', () => { await expect(a.url()).resolves.toBe('http://localhost:9001/test'); }); }); - - describe('when non api details are returned', () => { - let a; - let detailsSpy; - - beforeAll(async () => { - // mock the details api - detailsSpy = jest - .spyOn(ResourceServiceClient.prototype, 'details') - .mockImplementationOnce((request, callback: any) => { - const resp = new ResourceDetailsResponse(); - resp.setId('mock-id'); - resp.setProvider('mock-provider'); - resp.setService('mock-service'); - - callback(null, resp); - - return null as any; - }); - - a = await api('main'); - }); - - afterAll(() => { - jest.resetAllMocks(); - }); - - it('should throw an error', async () => { - await expect(a.url()).rejects.toThrowError( - 'Unexpected details in response. Expected API details' - ); - }); - }); }); }); diff --git a/src/resources/api.ts b/src/resources/api.ts index 77ddce85..c8b94f33 100644 --- a/src/resources/api.ts +++ b/src/resources/api.ts @@ -11,36 +11,52 @@ // 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 { HttpMiddleware, Faas } from '../faas'; +import * as grpc from '@grpc/grpc-js'; import { ApiResource, ApiScopes, - ApiSecurityDefinition, - ApiSecurityDefinitionJwt, - Resource, ResourceDeclareRequest, ResourceDeclareResponse, - ResourceDetailsResponse, + ResourceIdentifier, ResourceType, ResourceTypeMap, -} from '@nitric/api/proto/resource/v1/resource_pb'; -import { fromGrpcError } from '../api/errors'; +} from '@nitric/proto/resources/v1/resources_pb'; +import { ApiDetailsRequest } from '@nitric/proto/apis/v1/apis_pb'; +import { ApiClient } from '@nitric/proto/apis/v1/apis_grpc_pb'; import resourceClient from './client'; import { HttpMethod } from '../types'; -import { make, Resource as Base } from './common'; +import { make, Resource as Base, startStreamHandler } from './common'; import path from 'path'; +import { + ClientMessage, + RegistrationRequest, + ServerMessage, + ApiWorkerScopes, + HttpResponse, + HeaderValue, + ApiWorkerOptions as ApiWorkerOptionsPb, +} from '@nitric/proto/apis/v1/apis_pb'; +import { SERVICE_BIND } from '../constants'; +import { + GenericMiddleware, + HttpMiddleware, + createHandler, +} from '../handlers/handler'; +import { HttpContext } from '../context/http'; +import { fromGrpcError } from '../api/errors'; +import { attachOidc, OidcOptions } from './oidc'; export class ApiWorkerOptions { public readonly api: string; public readonly route: string; public readonly methods: HttpMethod[]; - public readonly opts: MethodOptions; + public readonly opts: MethodOptions; constructor( api: string, route: string, methods: HttpMethod[], - opts: MethodOptions = {} + opts: MethodOptions = {} ) { this.api = api; this.route = route; @@ -49,34 +65,130 @@ export class ApiWorkerOptions { } } -export interface MethodOptions { +export interface MethodOptions { /** * Optional security definitions for this method */ - security?: Partial>; + // security?: Partial>; + + security?: OidcOptions[]; } -class Method { - private readonly faas: Faas; - public readonly route: Route; +export class Method { + private readonly options: ApiWorkerOptions; + private readonly handler: GenericMiddleware; + public readonly route: Route; public readonly methods: HttpMethod[]; constructor( - route: Route, + route: Route, methods: HttpMethod[], - opts: MethodOptions, + opts: MethodOptions, ...middleware: HttpMiddleware[] ) { this.route = route; this.methods = methods; - this.faas = new Faas( - new ApiWorkerOptions(route.api.name, route.path, methods, opts) + this.options = new ApiWorkerOptions( + this.route.api.name, + this.route.path, + this.methods, + opts ); - this.faas.http(...middleware); + this.handler = createHandler(...middleware); } private async start(): Promise { - return this.faas.start(); + return startStreamHandler(async () => { + if (!this.handler) { + throw new Error( + `A handler function must be provided for ${this.route.path}.` + ); + } + + const apiClient = new ApiClient( + SERVICE_BIND, + grpc.ChannelCredentials.createInsecure() + ); + + // Begin Bi-Di streaming + const stream = apiClient.serve(); + + stream.on('data', async (message: ServerMessage) => { + // We have an init response from the membrane + if (message.hasRegistrationResponse()) { + // We got an init response from the membrane + // The client can configure itself with any information provided by the membrane.. + } else if (message.hasHttpRequest()) { + // We want to handle a function here... + const httpRequest = message.getHttpRequest(); + const responseMessage = new ClientMessage(); + + responseMessage.setId(message.getId()); + + try { + const httpResponse = new HttpResponse(); + httpResponse.setStatus(200); + httpResponse.setBody(''); + + const ctx = HttpContext.fromHttpRequest(httpRequest); + + const result = (await this.handler(ctx, async (ctx) => ctx)) || ctx; + responseMessage.setHttpResponse(HttpContext.toHttpResponse(result)); + } catch (e) { + // generic error handling + console.error(e); + const httpResponse = new HttpResponse(); + responseMessage.setHttpResponse(httpResponse); + httpResponse.setBody( + new TextEncoder().encode('Internal Server Error') + ); + httpResponse.setStatus(500); + + const headers = httpResponse.getHeadersMap(); + const contentTypeHeader = new HeaderValue(); + contentTypeHeader.addValue('text/plain'); + headers.set('Content-Type', contentTypeHeader); + } + // Send the response back to the membrane + stream.write(responseMessage); + } + }); + + // Let the membrane know we're ready to start + const initRequest = new RegistrationRequest(); + const initMessage = new ClientMessage(); + + if (this.options instanceof ApiWorkerOptions) { + initRequest.setApi(this.options.api); + initRequest.setMethodsList(this.options.methods); + initRequest.setPath(this.options.route); + + const opts = new ApiWorkerOptionsPb(); + if (this.options.opts && this.options.opts.security) { + if (this.options.opts.security.length == 0) { + // disable security if empty security is explicitly set + opts.setSecurityDisabled(true); + } else { + const methodOpts = this.options.opts; + methodOpts.security.forEach((opt) => { + attachOidc(this.options.api, opt); + + const scopes = new ApiWorkerScopes(); + scopes.setScopesList(opt.scopes); + opts.getSecurityMap().set(opt.name, scopes); + }); + } + } + + initRequest.setOptions(opts); + } + + //Original faas workers should return a blank InitRequest for compatibility. + initMessage.setRegistrationRequest(initRequest); + stream.write(initMessage); + + return stream; + }); } } @@ -87,16 +199,12 @@ export interface RouteOptions { middleware?: HttpMiddleware[] | HttpMiddleware; } -export class Route { - public readonly api: Api; +export class Route { + public readonly api: Api; public readonly path: string; public readonly middleware: HttpMiddleware[]; - constructor( - api: Api, - path: string, - options: RouteOptions = {} - ) { + constructor(api: Api, path: string, options: RouteOptions = {}) { this.api = api; this.path = path; const { middleware = [] } = options; @@ -105,7 +213,7 @@ export class Route { async method( methods: HttpMethod[], - options: MethodOptions, + options: MethodOptions, ...middleware: HttpMiddleware[] ): Promise { const getHandler = new Method( @@ -127,7 +235,7 @@ export class Route { */ async get( middleware: HttpMiddleware | HttpMiddleware[], - options: MethodOptions = {} + options: MethodOptions = {} ): Promise { return this.method(['GET'], options, ...composeMiddleware(middleware)); } @@ -141,7 +249,7 @@ export class Route { */ async post( middleware: HttpMiddleware | HttpMiddleware[], - options: MethodOptions = {} + options: MethodOptions = {} ): Promise { return this.method(['POST'], options, ...composeMiddleware(middleware)); } @@ -155,7 +263,7 @@ export class Route { */ async put( middleware: HttpMiddleware | HttpMiddleware[], - options: MethodOptions = {} + options: MethodOptions = {} ): Promise { return this.method(['PUT'], options, ...composeMiddleware(middleware)); } @@ -169,7 +277,7 @@ export class Route { */ async patch( middleware: HttpMiddleware | HttpMiddleware[], - options: MethodOptions = {} + options: MethodOptions = {} ): Promise { return this.method(['PATCH'], options, ...composeMiddleware(middleware)); } @@ -183,7 +291,7 @@ export class Route { */ async delete( middleware: HttpMiddleware | HttpMiddleware[], - options: MethodOptions = {} + options: MethodOptions = {} ): Promise { return this.method(['DELETE'], options, ...composeMiddleware(middleware)); } @@ -197,7 +305,7 @@ export class Route { */ async options( middleware: HttpMiddleware | HttpMiddleware[], - options: MethodOptions = {} + options: MethodOptions = {} ): Promise { return this.method(['OPTIONS'], options, ...composeMiddleware(middleware)); } @@ -211,7 +319,7 @@ export class Route { */ async all( middleware: HttpMiddleware | HttpMiddleware[], - options: MethodOptions = {} + options: MethodOptions = {} ): Promise { return this.method( ['GET', 'POST', 'PATCH', 'PUT', 'DELETE', 'OPTIONS'], @@ -230,10 +338,9 @@ export interface JwtSecurityDefinition extends BaseSecurityDefinition<'jwt'> { audiences: string[]; } -// TODO: Union type for multiple security definition mappings export type SecurityDefinition = JwtSecurityDefinition; -export interface ApiOptions { +export interface ApiOptions { /** * The base path for all routes in the API. * @@ -246,15 +353,10 @@ export interface ApiOptions { */ middleware?: HttpMiddleware[] | HttpMiddleware; - /** - * Optional security definitions for the API - */ - securityDefinitions?: Record; - /** * Optional root level security for the API */ - security?: Record; + security?: OidcOptions[]; } interface ApiDetails { @@ -266,30 +368,26 @@ interface ApiDetails { * * Represents an HTTP API, capable of routing and securing incoming HTTP requests to handlers. */ -export class Api extends Base { +export class Api extends Base { // public readonly name: string; public readonly path: string; public readonly middleware?: HttpMiddleware[]; - private readonly routes: Route[]; - private readonly securityDefinitions?: Record< - SecurityDefs, - SecurityDefinition - >; - private readonly security?: Record; - - constructor(name: string, options: ApiOptions = {}) { + private readonly routes: Route[]; + private readonly oidcOptions: OidcOptions[]; + + constructor(name: string, options: ApiOptions = {}) { super(name); const { middleware, path = '/', - securityDefinitions = null, - security = {} as Record, + // securityDefinitions = null, + security = [], } = options; // prepend / to path if its not there this.path = path.replace(/^\/?/, '/'); this.middleware = composeMiddleware(middleware); - this.securityDefinitions = securityDefinitions; - this.security = security; + // this.securityDefinitions = securityDefinitions; + this.oidcOptions = security; this.routes = []; } @@ -310,7 +408,7 @@ export class Api extends Base { * @param options route options such as setting middleware which applies to all methods in the route * @returns the route object, which can be used to register method handlers */ - route(match: string, options?: RouteOptions): Route { + route(match: string, options?: RouteOptions): Route { // ensure path seperator is always foward slash (for windows) const apiRoute = path.join(this.path, match).split(path.sep).join('/'); @@ -346,7 +444,7 @@ export class Api extends Base { async get( match: string, middleware: HttpMiddleware | HttpMiddleware[], - options: MethodOptions = {} + options: MethodOptions = {} ): Promise { return this.route(match).get(composeMiddleware(middleware), options); } @@ -362,7 +460,7 @@ export class Api extends Base { async post( match: string, middleware: HttpMiddleware | HttpMiddleware[], - options: MethodOptions = {} + options: MethodOptions = {} ): Promise { return this.route(match).post(composeMiddleware(middleware), options); } @@ -378,7 +476,7 @@ export class Api extends Base { async put( match: string, middleware: HttpMiddleware | HttpMiddleware[], - options: MethodOptions = {} + options: MethodOptions = {} ): Promise { return this.route(match).put(composeMiddleware(middleware), options); } @@ -394,7 +492,7 @@ export class Api extends Base { async patch( match: string, middleware: HttpMiddleware | HttpMiddleware[], - options: MethodOptions = {} + options: MethodOptions = {} ): Promise { return this.route(match).patch(composeMiddleware(middleware), options); } @@ -410,7 +508,7 @@ export class Api extends Base { async delete( match: string, middleware: HttpMiddleware | HttpMiddleware[], - options: MethodOptions = {} + options: MethodOptions = {} ): Promise { return this.route(match).delete(composeMiddleware(middleware), options); } @@ -426,7 +524,7 @@ export class Api extends Base { async options( match: string, middleware: HttpMiddleware | HttpMiddleware[], - options: MethodOptions = {} + options: MethodOptions = {} ): Promise { return this.route(match).options(composeMiddleware(middleware), options); } @@ -437,75 +535,65 @@ export class Api extends Base { * @returns Promise that returns the URL of this API */ async url(): Promise { - const { - details: { url }, - } = await this.details(); + const request = new ApiDetailsRequest(); + request.setApiName(this.name); + + const apiClient = new ApiClient( + SERVICE_BIND, + grpc.ChannelCredentials.createInsecure() + ); - return url; + const details = await new Promise((resolve, reject) => { + apiClient.apiDetails(request, (error, data) => { + if (error) { + reject(fromGrpcError(error)); + } else { + resolve({ + url: data.getUrl(), + }); + } + }); + }); + + return details.url; } protected resourceType(): ResourceTypeMap[keyof ResourceTypeMap] { return ResourceType.API; } - protected unwrapDetails(resp: ResourceDetailsResponse): ApiDetails { - if (resp.hasApi()) { - return { - url: resp.getApi().getUrl(), - }; - } - - throw new Error('Unexpected details in response. Expected API details'); - } - /** * Register this api as a required resource for the calling function/container. * * @returns a promise that resolves when the registration is complete */ - protected async register(): Promise { + protected async register(): Promise { const req = new ResourceDeclareRequest(); - const resource = new Resource(); + const resourceId = new ResourceIdentifier(); const apiResource = new ApiResource(); - const { security, securityDefinitions } = this; + const { oidcOptions } = this; - if (security) { - Object.keys(security).forEach((k) => { + if (oidcOptions && oidcOptions.length > 0) { + oidcOptions.forEach((opt) => { + attachOidc(this.name, opt); const scopes = new ApiScopes(); - scopes.setScopesList(security[k]); - apiResource.getSecurityMap().set(k, scopes); + scopes.setScopesList(opt.scopes); + apiResource.getSecurityMap().set(opt.name, scopes); }); } - resource.setName(this.name); - resource.setType(ResourceType.API); - - if (securityDefinitions) { - Object.keys(securityDefinitions).forEach((k) => { - const def = securityDefinitions[k] as SecurityDefinition; - const definition = new ApiSecurityDefinition(); - - if (def.kind === 'jwt') { - // Set it to a JWT definition - const secDef = new ApiSecurityDefinitionJwt(); - secDef.setIssuer(def.issuer); - secDef.setAudiencesList(def.audiences); - definition.setJwt(secDef); - } - - apiResource.getSecurityDefinitionsMap().set(k, definition); - }); - } + resourceId.setName(this.name); + resourceId.setType(ResourceType.API); req.setApi(apiResource); - req.setResource(resource); + req.setId(resourceId); - return new Promise((resolve, reject) => { + return new Promise((resolve, reject) => { resourceClient.declare(req, (error, _: ResourceDeclareResponse) => { if (error) { reject(fromGrpcError(error)); } else { - resolve(resource); + resolve(resourceId); } }); }); @@ -513,7 +601,7 @@ export class Api extends Base { } /** - * Register a new API Resource. + * Register an API Resource. If the API has already been registered, the existing API will be returned. * * The returned API object can be used to register Routes and Methods, with Handlers. * e.g. api.route('/customers').get(getCustomerHandler) @@ -522,22 +610,7 @@ export class Api extends Base { * @param options additional options for creating the API * @returns an API resource */ -export const api: ( - name: string, - options?: ApiOptions -) => Api = make(Api); - -/** - * Create a JWT security definition. - * - * @param options security definition options - * @returns the new security definition. - */ -export const jwt = ( - options: Omit -): JwtSecurityDefinition => { - return { kind: 'jwt', issuer: options.issuer, audiences: options.audiences }; -}; +export const api: (name: string, options?: ApiOptions) => Api = make(Api); const composeMiddleware = (middleware: HttpMiddleware | HttpMiddleware[]) => Array.isArray(middleware) ? middleware : middleware ? [middleware] : []; diff --git a/src/resources/bucket.test.ts b/src/resources/bucket.test.ts index e4459121..6a6247c2 100644 --- a/src/resources/bucket.test.ts +++ b/src/resources/bucket.test.ts @@ -12,15 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { ResourceServiceClient } from '@nitric/api/proto/resource/v1/resource_grpc_pb'; +import { ResourcesClient } from '@nitric/proto/resources/v1/resources_grpc_pb'; import { UnimplementedError } from '../api/errors'; import { bucket } from '.'; import { BucketResource, ResourceDeclareResponse, -} from '@nitric/api/proto/resource/v1/resource_pb'; +} from '@nitric/proto/resources/v1/resources_pb'; import { Resource } from './common'; import { Bucket } from '..'; +import { Metadata, status } from '@grpc/grpc-js'; // What we need to test about buckets // 1. register with the name @@ -32,7 +33,7 @@ describe('Registering bucket resources', () => { describe('Given the server is unimplemented', () => { describe('When a bucket is registered', () => { const MOCK_ERROR = { - code: 2, + code: status.UNIMPLEMENTED, message: 'UNIMPLEMENTED', }; @@ -40,8 +41,9 @@ describe('Registering bucket resources', () => { let declareSpy; beforeAll(() => { + jest.spyOn(console, 'error').mockImplementation(() => {}); declareSpy = jest - .spyOn(ResourceServiceClient.prototype, 'declare') + .spyOn(ResourcesClient.prototype, 'declare') .mockImplementationOnce((request, callback: any) => { callback(MOCK_ERROR, null); @@ -50,13 +52,13 @@ describe('Registering bucket resources', () => { }); afterAll(() => { - declareSpy.mockClear(); + jest.restoreAllMocks(); }); it('Should throw the error', async () => { - await expect(bucket(validName)['registerPromise']).rejects.toEqual( - new UnimplementedError('UNIMPLEMENTED') - ); + await expect( + bucket(validName)['registerPromise'] + ).rejects.toBeInstanceOf(UnimplementedError); }); it('Should call the resource server', () => { @@ -72,7 +74,7 @@ describe('Registering bucket resources', () => { beforeAll(() => { otherSpy = jest - .spyOn(ResourceServiceClient.prototype, 'declare') + .spyOn(ResourcesClient.prototype, 'declare') .mockImplementationOnce((request, callback: any) => { const response = new ResourceDeclareResponse(); callback(null, response); @@ -103,7 +105,7 @@ describe('Registering bucket resources', () => { beforeEach(() => { // ensure a success is returned and calls can be counted. existsSpy = jest - .spyOn(ResourceServiceClient.prototype, 'declare') + .spyOn(ResourcesClient.prototype, 'declare') .mockImplementation((request, callback: any) => { const response = new ResourceDeclareResponse(); callback(null, response); diff --git a/src/resources/bucket.ts b/src/resources/bucket.ts index 3179445f..e1c46209 100644 --- a/src/resources/bucket.ts +++ b/src/resources/bucket.ts @@ -13,22 +13,39 @@ // limitations under the License. import { Action, - Resource, + ResourceIdentifier, ResourceDeclareRequest, ResourceDeclareResponse, - ResourceDetailsResponse, ResourceType, -} from '@nitric/api/proto/resource/v1/resource_pb'; + ResourceTypeMap, + BucketResource as NitricBucketResource, +} from '@nitric/proto/resources/v1/resources_pb'; import resourceClient from './client'; import { storage, Bucket } from '../api/storage'; -import { ActionsList, make, SecureResource } from './common'; -import { fromGrpcError } from '../api/errors'; import { - Faas, + ActionsList, + make, + SecureResource, + startStreamHandler, +} from './common'; +import { + BlobEventType, + ClientMessage, + RegistrationRequest, + ServerMessage, + BlobEvent, + BlobEventResponse, +} from '@nitric/proto/storage/v1/storage_pb'; +import { StorageListenerClient } from '@nitric/proto/storage/v1/storage_grpc_pb'; +import * as grpc from '@grpc/grpc-js'; +import { SERVICE_BIND } from '../constants'; +import { BucketNotificationMiddleware, FileNotificationMiddleware, -} from '../faas'; -import { BucketNotificationType as ProtoBucketNotificationType } from '../gen/proto/faas/v1/faas_pb'; + createHandler, +} from '../handlers/handler'; +import { BlobEventContext, BucketEventContext } from '../context/bucket'; +import { fromGrpcError } from '../api/errors'; type BucketPermission = 'reading' | 'writing' | 'deleting'; @@ -38,7 +55,7 @@ export type BucketNotificationType = 'write' | 'delete'; export class BucketNotificationWorkerOptions { public readonly bucket: string; - public readonly notificationType: 0 | 1 | 2; + public readonly notificationType: 0 | 1; public readonly notificationPrefixFilter: string; constructor( @@ -52,12 +69,12 @@ export class BucketNotificationWorkerOptions { this.notificationPrefixFilter = notificationPrefixFilter; } - static toGrpcEvent(notificationType: BucketNotificationType): 0 | 1 | 2 { + static toGrpcEvent(notificationType: BucketNotificationType): 0 | 1 { switch (notificationType) { case 'write': - return ProtoBucketNotificationType.CREATED; + return BlobEventType.CREATED; case 'delete': - return ProtoBucketNotificationType.DELETED; + return BlobEventType.DELETED; default: throw new Error(`notification type ${notificationType} is unsupported`); } @@ -79,50 +96,119 @@ export class FileNotificationWorkerOptions extends BucketNotificationWorkerOptio } export class BucketNotification { - private readonly faas: Faas; + private readonly options: BucketNotificationWorkerOptions; + private readonly handler: BucketNotificationMiddleware; constructor( - bucket: string, + bucketName: string, notificationType: BucketNotificationType, - notificationPrefixFilter, + notificationPrefixFilter: string, ...middleware: BucketNotificationMiddleware[] ) { - this.faas = new Faas( - new BucketNotificationWorkerOptions( - bucket, - notificationType, - notificationPrefixFilter - ) + this.options = new BucketNotificationWorkerOptions( + bucketName, + notificationType, + notificationPrefixFilter ); - this.faas.bucketNotification(...middleware); + this.handler = createHandler(...middleware); } - private async start(): Promise { - return this.faas.start(); + private async start(bucket?: Bucket): Promise { + return startStreamHandler(async () => { + const storageListenerClient = new StorageListenerClient( + SERVICE_BIND, + grpc.ChannelCredentials.createInsecure() + ); + + // Begin Bi-Di streaming + const stream = storageListenerClient.listen(); + + stream.on('data', async (message: ServerMessage) => { + // We have an init response from the membrane + if (message.hasRegistrationResponse()) { + // We got an init response from the membrane + // The client can configure itself with any information provided by the membrane.. + } else if (message.hasBlobEventRequest()) { + // We want to handle a function here... + const blobEventRequest = message.getBlobEventRequest(); + const responseMessage = new ClientMessage(); + + responseMessage.setId(message.getId()); + + try { + blobEventRequest.setBucketName(this.options.bucket); + const blobEvent = new BlobEvent(); + blobEvent.setKey(this.options.notificationPrefixFilter); + blobEvent.setType(this.options.notificationType); + blobEventRequest.setBlobEvent(blobEvent); + + if (bucket) { + const ctx = BlobEventContext.fromRequest( + blobEventRequest, + bucket + ); + + const result = + (await this.handler(ctx, async (ctx) => ctx)) || ctx; + + responseMessage.setBlobEventResponse( + BlobEventContext.toResponse(result as BlobEventContext) + ); + } else { + const ctx = BucketEventContext.fromRequest(blobEventRequest); + + const result = + (await this.handler(ctx, async (ctx) => ctx)) || ctx; + responseMessage.setBlobEventResponse( + BucketEventContext.toResponse(result) + ); + } + } catch (e) { + // generic error handling + console.error(e); + const eventResponse = new BlobEventResponse(); + eventResponse.setSuccess(false); + responseMessage.setBlobEventResponse(eventResponse); + } + // Send the response back to the membrane + stream.write(responseMessage); + } + }); + + // Let the membrane know we're ready to start + const initRequest = new RegistrationRequest(); + const initMessage = new ClientMessage(); + + initRequest.setBucketName(this.options.bucket); + initRequest.setKeyPrefixFilter(this.options.notificationPrefixFilter); + initRequest.setBlobEventType(this.options.notificationType); + + //Original faas workers should return a blank InitRequest for compatibility. + initMessage.setRegistrationRequest(initRequest); + stream.write(initMessage); + + return stream; + }); } } -export class FileNotification { - private readonly faas: Faas; +export class FileNotification extends BucketNotification { + private readonly bucket: Bucket | undefined; constructor( bucket: Bucket, notificationType: BucketNotificationType, - notificationPrefixFilter, + notificationPrefixFilter: string, ...middleware: FileNotificationMiddleware[] ) { - this.faas = new Faas( - new FileNotificationWorkerOptions( - bucket, - notificationType, - notificationPrefixFilter - ) + super( + bucket.name, + notificationType, + notificationPrefixFilter, + ...middleware ); - this.faas.bucketNotification(...middleware); - } - private async start(): Promise { - return this.faas.start(); + this.bucket = bucket; } } @@ -135,15 +221,16 @@ export class BucketResource extends SecureResource { * * @returns a promise that resolves when the registration is complete */ - protected async register(): Promise { + protected async register(): Promise { const req = new ResourceDeclareRequest(); - const resource = new Resource(); + const resource = new ResourceIdentifier(); resource.setName(this.name); resource.setType(ResourceType.BUCKET); - req.setResource(resource); + req.setId(resource); + req.setBucket(new NitricBucketResource()); - return new Promise((resolve, reject) => { + return new Promise((resolve, reject) => { resourceClient.declare(req, (error, _: ResourceDeclareResponse) => { if (error) { reject(fromGrpcError(error)); @@ -195,20 +282,17 @@ export class BucketResource extends SecureResource { }, []); } - protected resourceType() { + protected resourceType(): ResourceTypeMap[keyof ResourceTypeMap] { return ResourceType.BUCKET; } - protected unwrapDetails(resp: ResourceDetailsResponse): never { - throw new Error('details unimplemented for bucket'); - } - /** * Return a bucket reference and register the permissions required by the currently scoped function for this resource. * * e.g. const imgs = resources.bucket('image').for('writing') * - * @param perms the required permission set + * @param perm the required permission set + * @param perms additional required permissions set * @returns a usable bucket reference */ public for(perm: BucketPermission, ...perms: BucketPermission[]): Bucket { @@ -218,4 +302,12 @@ export class BucketResource extends SecureResource { } } -export const bucket = make(BucketResource); +/** + * Create a reference to a named bucket in this project. + * + * If the bucket hasn't been referenced before this is a request for a new resource. Otherwise, the existing bucket with the same name will be used. + * + * @param name the name of the bucket. + * @returns a reference to the bucket. + */ +export const bucket: (name: string) => BucketResource = make(BucketResource); diff --git a/src/resources/client.ts b/src/resources/client.ts index 04e5db19..411be37a 100644 --- a/src/resources/client.ts +++ b/src/resources/client.ts @@ -11,11 +11,11 @@ // 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 { ResourceServiceClient } from '@nitric/api/proto/resource/v1/resource_grpc_pb'; +import { ResourcesClient } from '@nitric/proto/resources/v1/resources_grpc_pb'; import { SERVICE_BIND } from '../constants'; import * as grpc from '@grpc/grpc-js'; -const resourceClient = new ResourceServiceClient( +const resourceClient = new ResourcesClient( SERVICE_BIND, grpc.ChannelCredentials.createInsecure() ); diff --git a/src/resources/collection.ts b/src/resources/collection.ts deleted file mode 100644 index e00838da..00000000 --- a/src/resources/collection.ts +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright 2021, Nitric Technologies Pty Ltd. -// -// 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 { - Resource, - ResourceDeclareRequest, - ResourceDeclareResponse, - ResourceType, - Action, - ResourceDetailsResponse, -} from '@nitric/api/proto/resource/v1/resource_pb'; -import { fromGrpcError } from '../api/errors'; -import { documents } from '../api/documents'; -import resourceClient from './client'; -import { make, SecureResource } from './common'; -import { DocumentStructure } from '../api/documents/v0/document-ref'; - -type CollectionPermission = 'reading' | 'writing' | 'deleting'; - -const everything: CollectionPermission[] = ['reading', 'writing', 'deleting']; - -/** - * A document collection resources, such as a collection/table in a document database. - */ -export class CollectionResource< - T extends DocumentStructure -> extends SecureResource { - /** - * Register this collection as a required resource for the calling function/container - * - * @returns a promise that resolves when the registration is complete - */ - protected async register(): Promise { - const req = new ResourceDeclareRequest(); - - const resource = new Resource(); - resource.setName(this.name); - resource.setType(ResourceType.COLLECTION); - req.setResource(resource); - - return new Promise((resolve, reject) => { - resourceClient.declare( - req, - (error, response: ResourceDeclareResponse) => { - if (error) { - reject(fromGrpcError(error)); - } else { - resolve(resource); - } - } - ); - }); - } - - protected permsToActions(...perms: CollectionPermission[]) { - let actions = perms.reduce((actions, perm) => { - switch (perm) { - case 'reading': - return [ - ...actions, - Action.COLLECTIONDOCUMENTREAD, - Action.COLLECTIONQUERY, - ]; - case 'writing': - return [...actions, Action.COLLECTIONDOCUMENTWRITE]; - case 'deleting': - return [...actions, Action.COLLECTIONDOCUMENTDELETE]; - default: - throw new Error( - `unknown collection permission ${perm}, supported permissions are ${everything.join( - ', ' - )}` - ); - } - }, []); - - if (actions.length > 0) { - actions = [...actions, Action.COLLECTIONLIST]; - } - - return actions; - } - - protected resourceType() { - return ResourceType.COLLECTION; - } - - protected unwrapDetails(resp: ResourceDetailsResponse): never { - throw new Error('details unimplemented for collection'); - } - - /** - * Return a collection reference and register the permissions required by the currently scoped function for this resource. - * - * e.g. const customers = resources.collection('customers').for('reading', 'writing') - * - * @param perms the required permission set - * @returns a usable collection reference - */ - public for(perm: CollectionPermission, ...perms: CollectionPermission[]) { - this.registerPolicy(perm, ...perms); - - return documents().collection(this.name); - } -} - -const newCollection = make(CollectionResource); - -/** - * Create a reference to a named queue in this project. - * - * If the queue hasn't been referenced before, this is a request for a new resource. Otherwise, the existing queue with the same name will be used. - * - * @param name the name of the queue. - * @returns a reference to the queue. - */ -export function collection( - name: string -): CollectionResource { - return newCollection(name) as CollectionResource; -} diff --git a/src/resources/common.test.ts b/src/resources/common.test.ts index 026bc061..6e22971d 100644 --- a/src/resources/common.test.ts +++ b/src/resources/common.test.ts @@ -11,9 +11,7 @@ // 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 { ResourceServiceClient } from '@nitric/api/proto/resource/v1/resource_grpc_pb'; -import { ResourceDetailsResponse } from '@nitric/api/proto/resource/v1/resource_pb'; -import { Resource, make, ResourceDetails } from './common'; +import { Resource, make } from './common'; const MOCK_RESOURCE = 0; const MOCK_DETAILS = {}; @@ -48,52 +46,5 @@ describe('common', () => { expect(test1).toStrictEqual(test2); }); }); - - describe('when calling resource details', () => { - const test = res('same'); - - let detailsSpy; - let details: ResourceDetails; - - beforeAll(async () => { - detailsSpy = jest - .spyOn(ResourceServiceClient.prototype, 'details') - .mockImplementationOnce((request, callback: any) => { - const resp = new ResourceDetailsResponse(); - resp.setId('mock-id'); - resp.setProvider('mock-provider'); - resp.setService('mock-service'); - callback(null, resp); - - return null as any; - }); - - details = await test['details'](); - }); - - afterAll(() => { - detailsSpy.mockClear(); - }); - - it('should call gRPC details method', () => { - expect(detailsSpy).toBeCalledTimes(1); - }); - - it('should return unwrapped details', () => { - expect(details.details).toBe(MOCK_DETAILS); - }); - - it('should return the correct id', () => { - expect(details.id).toBe('mock-id'); - }); - - it('should return the correct provider', () => { - expect(details.provider).toBe('mock-provider'); - }); - - it('should return the correct service', () => { - expect(details.service).toBe('mock-service'); - }); - }); }); }); diff --git a/src/resources/common.ts b/src/resources/common.ts index 03add4c7..e21911e5 100644 --- a/src/resources/common.ts +++ b/src/resources/common.ts @@ -12,28 +12,21 @@ // See the License for the specific language governing permissions and // limitations under the License. import { - Resource as ProtoResource, + ResourceIdentifier as ProtoResource, ResourceType, PolicyResource, ResourceDeclareRequest, ActionMap, - ResourceDetailsRequest, - ResourceDetailsResponse, ResourceTypeMap, -} from '@nitric/api/proto/resource/v1/resource_pb'; +} from '@nitric/proto/resources/v1/resources_pb'; import resourceClient from './client'; +import { Duration } from 'google-protobuf/google/protobuf/duration_pb'; +import type { ClientDuplexStream } from '@grpc/grpc-js'; import { fromGrpcError } from '../api/errors'; export type ActionsList = ActionMap[keyof ActionMap][]; -export interface ResourceDetails { - id: string; - provider: string; - service: string; - details: T; -} - -export abstract class Resource { +export abstract class Resource { /** * Unique name for the resource by type within the stack. * @@ -57,36 +50,8 @@ export abstract class Resource { this._registerPromise = promise; } - /** - * Returns details of this - */ - protected async details(): Promise> { - const req = new ResourceDetailsRequest(); - const res = new ProtoResource(); - res.setName(this.name); - res.setType(this.resourceType()); - - req.setResource(res); - return new Promise>((resolve, reject) => { - resourceClient.details(req, (err, resp) => { - if (err) { - reject(fromGrpcError(err)); - } else { - resolve({ - id: resp.getId(), - provider: resp.getProvider(), - service: resp.getService(), - details: this.unwrapDetails(resp), - }); - } - }); - }); - } - protected abstract resourceType(): ResourceTypeMap[keyof ResourceTypeMap]; - protected abstract unwrapDetails(resp: ResourceDetailsResponse): Detail; - protected abstract register(): Promise; } @@ -101,14 +66,14 @@ export abstract class SecureResource

extends Resource { // Send an unnamed function as the principle. This is interpreted to mean the currently running function, making the request. const policy = new PolicyResource(); const defaultPrincipal = new ProtoResource(); - defaultPrincipal.setType(ResourceType.FUNCTION); + defaultPrincipal.setType(ResourceType.SERVICE); policy.setPrincipalsList([defaultPrincipal]); // Convert the permissions to an action set. const actions = this.permsToActions(...perms); policy.setActionsList(actions); - req.setResource(policyResource); + req.setId(policyResource); req.setPolicy(policy); this.registerPromise.then((resource) => { @@ -151,9 +116,31 @@ export const make = ( cache[typename][name]['registerPromise'] = prom; prom.catch((err) => { - console.log(err); + console.error(err); }); } return cache[typename][name] as T; }; }; + +export const toDuration = (seconds: number): Duration => { + const duration = new Duration(); + duration.setSeconds(seconds); + + return duration; +}; + +export const startStreamHandler = async ( + handler: () => Promise> +): Promise => { + const stream = await handler(); + + // Block until the stream has closed... + await new Promise((res) => { + // The server has determined this stream must close + stream.on('end', () => { + console.log('Membrane has terminated the trigger stream'); + res(); + }); + }); +}; diff --git a/src/resources/http.test.ts b/src/resources/http.test.ts index 31ec549c..1338d4a6 100644 --- a/src/resources/http.test.ts +++ b/src/resources/http.test.ts @@ -11,8 +11,8 @@ // 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 faas from '../faas/index'; import { HttpWorkerOptions, http } from '.'; +import { HttpClient } from '../gen/nitric/proto/http/v1/http_grpc_pb'; jest.mock('portfinder', () => { const originalModule = jest.requireActual('portfinder'); @@ -26,22 +26,24 @@ jest.mock('portfinder', () => { }; }); -jest.mock('../faas/index'); - -describe('HTTP Proxy', () => { - const startSpy = jest - .spyOn(faas.Faas.prototype, 'start') - .mockReturnValue(Promise.resolve()); +describe.skip('HTTP Proxy', () => { + const httpProxySpy = jest + .spyOn(HttpClient.prototype, 'proxy') + .mockReturnValue({} as any); const mockApp = { - listen: () => {}, + listen: () => { + return { + on: () => {}, + } as any; + }, }; afterAll(() => { jest.clearAllMocks(); }); - describe('when creating a new http proxy with an app', () => { + describe.skip('when creating a new http proxy with an app', () => { let error = undefined; afterAll(() => { jest.resetAllMocks(); @@ -60,7 +62,7 @@ describe('HTTP Proxy', () => { }); }); - describe(`when creating a new http proxy with an app and callback`, () => { + describe.skip(`when creating a new http proxy with an app and callback`, () => { const fakeCallback = () => {}; afterAll(() => { @@ -71,22 +73,17 @@ describe('HTTP Proxy', () => { http(mockApp, fakeCallback); }); - it('should create a new FaasClient', () => { - expect(faas.Faas).toBeCalledTimes(1); - }); - - it('should provide Faas with HttpWorkerOptions', () => { - const expectedOpts = new HttpWorkerOptions(mockApp, 1234, fakeCallback); - expect(faas.Faas).toBeCalledWith(expectedOpts); - }); - - it('should call FaasClient::start()', () => { - expect(startSpy).toBeCalledTimes(1); + it('should call HttpClient::proxy()', () => { + expect(httpProxySpy).toBeCalledTimes(1); }); }); - describe(`when creating a new http proxy with a bootstrap function`, () => { - const fakeFunc = () => {}; + describe.skip(`when creating a new http proxy with a bootstrap function`, () => { + const fakeFunc = () => { + return { + on: () => {}, + } as any; + }; const fakeCallback = () => {}; afterAll(() => { @@ -97,21 +94,8 @@ describe('HTTP Proxy', () => { http(fakeFunc, fakeCallback); }); - it('should create a new FaasClient', () => { - expect(faas.Faas).toBeCalledTimes(1); - }); - - it('should provide Faas with HttpWorkerOptions', () => { - const expectedOpts = new HttpWorkerOptions( - { listen: fakeFunc }, - 1234, - fakeCallback - ); - expect(faas.Faas).toBeCalledWith(expectedOpts); - }); - - it('should call FaasClient::start()', () => { - expect(startSpy).toBeCalledTimes(1); + it('should call HttpClient::proxy()', () => { + expect(httpProxySpy).toBeCalledTimes(1); }); }); }); diff --git a/src/resources/http.ts b/src/resources/http.ts index 775f3a5a..858f4fb8 100644 --- a/src/resources/http.ts +++ b/src/resources/http.ts @@ -13,11 +13,15 @@ // limitations under the License. import portfinder from 'portfinder'; -import { Faas } from '../faas'; +import { HttpClient } from '@nitric/proto/http/v1/http_grpc_pb'; +import { SERVICE_BIND } from '../constants'; +import * as grpc from '@grpc/grpc-js'; +import { ClientMessage, HttpProxyRequest } from '@nitric/proto/http/v1/http_pb'; +import { Server } from 'http'; type ListenerFunction = - | ((port: number, callback?: () => void) => void) - | ((port: number) => void); + | ((port: number, callback?: () => void) => Server) + | ((port: number) => Server); interface NodeApplication { listen: ListenerFunction; @@ -42,22 +46,50 @@ export class HttpWorkerOptions { } } -/** - * Creates a http worker - */ -class HttpWorker { - private readonly faas: Faas; +const createWorker = ( + app: NodeApplication, + port: number, + callback?: () => void +) => { + const httpClient = new HttpClient( + SERVICE_BIND, + grpc.ChannelCredentials.createInsecure() + ); + + const httpProxyRequest = new HttpProxyRequest(); + httpProxyRequest.setHost(`localhost:${port}`); + + const httpProxyStream = httpClient.proxy(); + + httpProxyStream.on('data', NO_OP); + + httpProxyStream.on('error', (err) => { + console.error('An error occurred:', err); + }); - constructor(app: NodeApplication, port: number, callback?: () => void) { - this.faas = new Faas(new HttpWorkerOptions(app, port, callback)); - this.faas.start(); + const clientMessage = new ClientMessage(); + clientMessage.setRequest(httpProxyRequest); + httpProxyStream.write(clientMessage); + // Start Node application that HTTP proxy sits on + if (process.env.NITRIC_ENVIRONMENT !== 'build') { + const srv = app.listen(port, callback); + + srv.on('close', () => { + httpProxyStream.cancel(); + }); } -} +}; +/** + * Register an HTTP Proxy to the provided application. + * + * @param app the http application to run behind the proxy + * @param callback an optional callback to run after the proxy has started + */ export const http = ( app: NodeApplication | ListenerFunction, callback?: () => void -) => { +): void => { const unknownApp = app as any; const nodeApp = @@ -77,11 +109,11 @@ export const http = ( ); } - new HttpWorker(nodeApp, port, callback); + createWorker(nodeApp, port, callback); }); return; } - new HttpWorker(nodeApp, port, callback); + createWorker(nodeApp, port, callback); }; diff --git a/src/resources/index.ts b/src/resources/index.ts index ab9df236..87fe222a 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -14,9 +14,10 @@ export * from './api'; export * from './topic'; export * from './queue'; -export * from './collection'; +export * from './keyvalue'; export * from './bucket'; export * from './schedule'; export * from './secret'; export * from './http'; export * from './websocket'; +export { oidcRule } from './oidc'; diff --git a/src/resources/collection.test.ts b/src/resources/keyvalue.test.ts similarity index 65% rename from src/resources/collection.test.ts rename to src/resources/keyvalue.test.ts index 77f46775..142fca99 100644 --- a/src/resources/collection.test.ts +++ b/src/resources/keyvalue.test.ts @@ -12,39 +12,41 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { ResourceServiceClient } from '@nitric/api/proto/resource/v1/resource_grpc_pb'; +import { status, ServiceError, Metadata } from '@grpc/grpc-js'; +import { ResourcesClient } from '@nitric/proto/resources/v1/resources_grpc_pb'; import { UnimplementedError } from '../api/errors'; -import { collection } from '.'; -import { ResourceDeclareResponse } from '@nitric/api/proto/resource/v1/resource_pb'; -import { CollectionRef } from '../api/documents/v0/collection-ref'; +import { kv } from '.'; +import { ResourceDeclareResponse } from '@nitric/proto/resources/v1/resources_pb'; +import { StoreRef } from '../api/keyvalue/v1/store'; -describe('Registering collection resources', () => { +describe('Registering key/value store resources', () => { describe('Given declare returns an error from the resource server', () => { const MOCK_ERROR = { - code: 2, + code: status.UNIMPLEMENTED, message: 'UNIMPLEMENTED', }; - const validName = 'my-collection'; + const validName = 'my-store'; let declareSpy; beforeAll(() => { + jest.spyOn(console, 'error').mockImplementation(() => {}); declareSpy = jest - .spyOn(ResourceServiceClient.prototype, 'declare') + .spyOn(ResourcesClient.prototype, 'declare') .mockImplementationOnce((request, callback: any) => { callback(MOCK_ERROR, null); - + 1; return null as any; }); }); afterAll(() => { - declareSpy.mockClear(); + jest.restoreAllMocks(); }); it('Should throw the error', async () => { - await expect(collection(validName)['registerPromise']).rejects.toEqual( - new UnimplementedError('UNIMPLEMENTED') + await expect(kv(validName)['registerPromise']).rejects.toBeInstanceOf( + UnimplementedError ); }); @@ -55,12 +57,12 @@ describe('Registering collection resources', () => { describe('Given declare succeeds on the resource server', () => { describe('When the service succeeds', () => { - const validName = 'my-collection2'; + const validName = 'my-store2'; let otherSpy; beforeAll(() => { otherSpy = jest - .spyOn(ResourceServiceClient.prototype, 'declare') + .spyOn(ResourcesClient.prototype, 'declare') .mockImplementationOnce((request, callback: any) => { const response = new ResourceDeclareResponse(); callback(null, response); @@ -73,9 +75,7 @@ describe('Registering collection resources', () => { }); it('Should succeed', async () => { - await expect( - collection(validName)['registerPromise'] - ).resolves.not.toBeNull(); + await expect(kv(validName)['registerPromise']).resolves.not.toBeNull(); }); it('Should call the resource server', () => { @@ -84,15 +84,15 @@ describe('Registering collection resources', () => { }); }); - describe('Given a collection is already registered', () => { - const collectionName = 'already-exists'; - let collectionResource; + describe('Given a store is already registered', () => { + const storeName = 'already-exists'; + let store; let existsSpy; beforeEach(() => { // ensure a success is returned and calls can be counted. existsSpy = jest - .spyOn(ResourceServiceClient.prototype, 'declare') + .spyOn(ResourcesClient.prototype, 'declare') .mockImplementation((request, callback: any) => { const response = new ResourceDeclareResponse(); callback(null, response); @@ -100,20 +100,20 @@ describe('Registering collection resources', () => { }); // register the resource for the first time - collectionResource = collection(collectionName); + store = kv(storeName); }); afterEach(() => { jest.resetAllMocks(); }); - describe('When registering a collection with the same name', () => { - let secondTopic; + describe('When registering a store with the same name', () => { + let secondStore; beforeEach(() => { // make sure the initial registration isn't counted for these tests. existsSpy.mockClear(); - secondTopic = collection(collectionName); + secondStore = kv(storeName); }); it('Should not call the server again', () => { @@ -121,14 +121,14 @@ describe('Registering collection resources', () => { }); it('Should return the same resource object', () => { - expect(collectionResource === secondTopic).toEqual(true); + expect(store === secondStore).toEqual(true); }); }); describe('When declaring usage', () => { - it('Should return a collection reference', () => { - const ref = collectionResource.for('reading'); - expect(ref).toBeInstanceOf(CollectionRef); + it('Should return a store reference', () => { + const ref = store.for('getting'); + expect(ref).toBeInstanceOf(StoreRef); }); }); }); diff --git a/src/resources/keyvalue.ts b/src/resources/keyvalue.ts new file mode 100644 index 00000000..0380c5bf --- /dev/null +++ b/src/resources/keyvalue.ts @@ -0,0 +1,123 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// 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 { + ResourceIdentifier, + ResourceDeclareRequest, + ResourceDeclareResponse, + ResourceType, + Action, + ResourceTypeMap, + ActionMap, + KeyValueStoreResource as NitricKeyValueStoreResource, +} from '@nitric/proto/resources/v1/resources_pb'; +import { keyvalue, ValueStructure } from '../api/keyvalue'; +import resourceClient from './client'; +import { make, SecureResource } from './common'; +import { fromGrpcError } from '../api/errors'; +import { StoreRef } from '../api/keyvalue/v1/store'; + +type StorePermission = 'getting' | 'setting' | 'deleting'; +const everything: StorePermission[] = ['getting', 'setting', 'deleting']; + +/** + * A key/value store resource. + */ +export class KeyValueStoreResource< + T extends ValueStructure +> extends SecureResource { + /** + * Register this key/value store as a required resource for the calling service + * + * @returns a promise that resolves when the registration is complete + */ + protected async register(): Promise { + const req = new ResourceDeclareRequest(); + + const resource = new ResourceIdentifier(); + resource.setName(this.name); + resource.setType(ResourceType.KEYVALUESTORE); + req.setId(resource); + + req.setKeyValueStore(new NitricKeyValueStoreResource()); + + return new Promise((resolve, reject) => { + resourceClient.declare( + req, + (error, _response: ResourceDeclareResponse) => { + if (error) { + reject(fromGrpcError(error)); + } else { + resolve(resource); + } + } + ); + }); + } + + protected permsToActions( + ...perms: StorePermission[] + ): ActionMap[keyof ActionMap][] { + const actions = perms.reduce((actions, perm) => { + switch (perm) { + case 'getting': + return [...actions, Action.KEYVALUESTOREREAD]; + case 'setting': + return [...actions, Action.KEYVALUESTOREWRITE]; + case 'deleting': + return [...actions, Action.KEYVALUESTOREDELETE]; + default: + throw new Error( + `unknown key/value store permission ${perm}, supported permissions are ${everything.join( + ', ' + )}` + ); + } + }, []); + + return actions; + } + + protected resourceType(): ResourceTypeMap[keyof ResourceTypeMap] { + return ResourceType.KEYVALUESTORE; + } + + /** + * Return a key/value store reference and register the permissions required by the currently scoped service for this resource. + * + * e.g. const customers = resources.kv('customers').for('getting', 'setting') + * + * @param perm the required permission set + * @param perms additional required permissions set + * @returns a usable key/value store reference + */ + public for(perm: StorePermission, ...perms: StorePermission[]): StoreRef { + this.registerPolicy(perm, ...perms); + + return keyvalue().store(this.name); + } +} + +/** + * Create a reference to a named key/value store in this project. + * + * If the key/value store hasn't been referenced before this is a request for a new resource. Otherwise, the existing store with the same name will be used. + * + * @param name the name of the key/value store. + * @returns a reference to the key/value store. + */ +export function kv( + name: string +): KeyValueStoreResource { + return make>(KeyValueStoreResource)(name); +} diff --git a/src/resources/oidc.ts b/src/resources/oidc.ts new file mode 100644 index 00000000..8278fdc3 --- /dev/null +++ b/src/resources/oidc.ts @@ -0,0 +1,134 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// 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 { + ResourceIdentifier, + ResourceDeclareRequest, + ResourceDeclareResponse, + ResourceType, + ResourceTypeMap, + ApiSecurityDefinitionResource, + ApiOpenIdConnectionDefinition, +} from '@nitric/proto/resources/v1/resources_pb'; +import resourceClient from './client'; +import { make, newer, Resource } from './common'; +import { fromGrpcError } from '../api/errors'; + +/** + * Cloud storage bucket resource for large file storage. + */ +export class OidcSecurityDefinition extends Resource { + private apiName: string; + private issuer: string; + private ruleName: string; + private audiences: string[]; + + constructor(name: string, apiName: string, options: UnscopedOicdOptions) { + super(name); + this.apiName = apiName; + this.issuer = options.issuer; + this.audiences = options.audiences; + this.ruleName = options.name; + } + + protected resourceType(): ResourceTypeMap[keyof ResourceTypeMap] { + return ResourceType.APISECURITYDEFINITION; + } + + /** + * Register this bucket as a required resource for the calling function/container. + * + * @returns a promise that resolves when the registration is complete + */ + protected async register(): Promise { + const req = new ResourceDeclareRequest(); + const resource = new ResourceIdentifier(); + resource.setName(this.ruleName); + resource.setType(ResourceType.APISECURITYDEFINITION); + + const securityDefinition = new ApiSecurityDefinitionResource(); + const oidcDefinition = new ApiOpenIdConnectionDefinition(); + + oidcDefinition.setAudiencesList(this.audiences); + oidcDefinition.setIssuer(this.issuer); + + securityDefinition.setApiName(this.apiName); + securityDefinition.setOidc(oidcDefinition); + + req.setId(resource); + req.setApiSecurityDefinition(securityDefinition); + + return new Promise((resolve, reject) => { + resourceClient.declare(req, (error, _: ResourceDeclareResponse) => { + if (error) { + reject(fromGrpcError(error)); + } else { + resolve(resource); + } + }); + }); + } +} + +export interface OidcOptions { + name: string; + issuer: string; + audiences: string[]; + scopes: string[]; +} + +export type UnscopedOicdOptions = Omit; + +export type SecurityOption = (...scopes: string[]) => OidcOptions; + +/** + * Constructs a new OpenID Connect (OIDC) security definition, which can be applied to APIs and their routes. + * + * This rule can be applied with various scopes, which are used to restrict access to the API. + * @param options - The options for the OIDC security definition. + * + * @param options.name - The name of the OIDC security definition. + * @param options.issuer - The OIDC issuer URL. + * @param options.audiences - The OIDC audiences. + * @returns SecurityOption + */ +export const oidcRule = ({ + name, + issuer, + audiences, +}: UnscopedOicdOptions): SecurityOption => { + return (...scopes: string[]): OidcOptions => { + return { + name, + issuer, + audiences, + scopes, + }; + }; +}; + +const baseMaker = make(OidcSecurityDefinition); + +/** + * + * @param apiName - The name of the API to attach the OIDC security definition to. + * @param options - The options for the OIDC security definition. + * + * @returns factory function for creating a new OIDC security definition + */ +export const attachOidc: newer = ( + apiName: string, + options: UnscopedOicdOptions +) => { + return baseMaker(`${options.name}-${apiName}`, apiName, options); +}; diff --git a/src/resources/queue.test.ts b/src/resources/queue.test.ts index 487ff9c2..21a1b7ba 100644 --- a/src/resources/queue.test.ts +++ b/src/resources/queue.test.ts @@ -12,16 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { ResourceServiceClient } from '@nitric/api/proto/resource/v1/resource_grpc_pb'; +import { ResourcesClient } from '@nitric/proto/resources/v1/resources_grpc_pb'; import { UnimplementedError } from '../api/errors'; import { Queue } from '../api'; import { queue, QueueResource } from '.'; -import { ResourceDeclareResponse } from '@nitric/api/proto/resource/v1/resource_pb'; +import { ResourceDeclareResponse } from '@nitric/proto/resources/v1/resources_pb'; +import { status } from '@grpc/grpc-js'; describe('Registering queue resources', () => { describe('Given declare returns an error from the resource server', () => { const MOCK_ERROR = { - code: 2, + code: status.UNIMPLEMENTED, message: 'UNIMPLEMENTED', }; @@ -29,8 +30,9 @@ describe('Registering queue resources', () => { let declareSpy; beforeAll(() => { + jest.spyOn(console, 'error').mockImplementation(() => {}); declareSpy = jest - .spyOn(ResourceServiceClient.prototype, 'declare') + .spyOn(ResourcesClient.prototype, 'declare') .mockImplementationOnce((request, callback: any) => { callback(MOCK_ERROR, null); @@ -39,12 +41,12 @@ describe('Registering queue resources', () => { }); afterAll(() => { - declareSpy.mockClear(); + jest.restoreAllMocks(); }); it('Should throw the error', async () => { - await expect(queue(validName)['registerPromise']).rejects.toEqual( - new UnimplementedError('UNIMPLEMENTED') + await expect(queue(validName)['registerPromise']).rejects.toBeInstanceOf( + UnimplementedError ); }); @@ -60,7 +62,7 @@ describe('Registering queue resources', () => { beforeAll(() => { otherSpy = jest - .spyOn(ResourceServiceClient.prototype, 'declare') + .spyOn(ResourcesClient.prototype, 'declare') .mockImplementationOnce((request, callback: any) => { const response = new ResourceDeclareResponse(); callback(null, response); @@ -92,7 +94,7 @@ describe('Registering queue resources', () => { beforeEach(() => { // ensure a success is returned and calls can be counted. existsSpy = jest - .spyOn(ResourceServiceClient.prototype, 'declare') + .spyOn(ResourcesClient.prototype, 'declare') .mockImplementation((request, callback: any) => { const response = new ResourceDeclareResponse(); callback(null, response); @@ -127,7 +129,7 @@ describe('Registering queue resources', () => { describe('When declaring usage', () => { it('Should return a topic reference', () => { - const ref = queueResource.for('receiving'); + const ref = queueResource.for('dequeue'); expect(ref).toBeInstanceOf(Queue); }); }); diff --git a/src/resources/queue.ts b/src/resources/queue.ts index ea581e6f..19295bc9 100644 --- a/src/resources/queue.ts +++ b/src/resources/queue.ts @@ -11,39 +11,43 @@ // 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 { Queue, queues } from '@nitric/sdk/api/queues'; import { - Resource, + ResourceIdentifier, ResourceDeclareRequest, + ResourceDeclareResponse, ResourceType, Action, - ResourceDeclareResponse, -} from '@nitric/api/proto/resource/v1/resource_pb'; + QueueResource as NitricQueueResource, +} from '@nitric/proto/resources/v1/resources_pb'; import resourceClient from './client'; -import { queues, Queue } from '../api/'; import { fromGrpcError } from '../api/errors'; import { ActionsList, make, SecureResource } from './common'; -export type QueuePermission = 'sending' | 'receiving'; +export type QueuePermission = 'enqueue' | 'dequeue'; + +const everything: QueuePermission[] = ['enqueue', 'dequeue']; /** - * Queue resource for async send/receive messaging + * Queue resource for async messaging */ export class QueueResource< T extends Record = Record > extends SecureResource { /** - * Register this queue as a required resource for the calling function/container. + * Register this queue as a required resource for the calling service/container. * * @returns a promise that resolves when the registration is complete */ - protected async register(): Promise { + protected async register(): Promise { const req = new ResourceDeclareRequest(); - const resource = new Resource(); + const resource = new ResourceIdentifier(); resource.setName(this.name); resource.setType(ResourceType.QUEUE); - req.setResource(resource); + req.setId(resource); + req.setQueue(new NitricQueueResource()); - return new Promise((resolve, reject) => { + return new Promise((resolve, reject) => { resourceClient.declare(req, (error) => { if (error) { reject(fromGrpcError(error)); @@ -55,24 +59,21 @@ export class QueueResource< } protected permsToActions(...perms: QueuePermission[]): ActionsList { - let actions: ActionsList = perms.reduce((actions, p) => { + const actions: ActionsList = perms.reduce((actions, p) => { switch (p) { - case 'sending': - return [...actions, Action.QUEUESEND]; - case 'receiving': - return [...actions, Action.QUEUERECEIVE]; + case 'enqueue': + return [...actions, Action.QUEUEENQUEUE]; + case 'dequeue': + return [...actions, Action.QUEUEDEQUEUE]; default: throw new Error( - `unknown permission ${p}, supported permissions is publishing.} + `unknown permission ${p}, supported permissions are ${everything.join( + ', ' )}` ); } }, []); - if (actions.length > 0) { - actions = [...actions, Action.QUEUELIST, Action.QUEUEDETAIL]; - } - return actions; } @@ -80,16 +81,17 @@ export class QueueResource< return ResourceType.QUEUE; } - protected unwrapDetails(resp: ResourceDeclareResponse): never { + protected unwrapDetails(_: ResourceDeclareResponse): never { throw new Error('details unimplemented for queue'); } /** * Return a queue reference and registers the permissions required by the currently scoped function for this resource. * - * e.g. const taskQueue = resources.queue('work').for('sending') + * e.g. const taskQueue = resources.queue('work').for('enqueue') * - * @param perms the access that the currently scoped function is requesting to this resource. + * @param perm - the access that the currently scoped function is requesting to this resource. + * @param perms - the access that the currently scoped function is requesting to this resource. * @returns a useable queue. */ public for(perm: QueuePermission, ...perms: QueuePermission[]): Queue { @@ -99,8 +101,22 @@ export class QueueResource< } } -export const queue = make(QueueResource) as < - T extends Record = Record ->( +// export const queue = make(QueueResource) as < +// T extends Record = Record +// >( +// name: string +// ) => QueueResource; + +/** + * Create a reference to a named queue in this project. + * + * If the queue hasn't been referenced before this is a request for a new resource. Otherwise, the existing queue with the same name will be used. + * + * @param name the name of the queue. + * @returns a reference to the queue. + */ +export function queue = Record>( name: string -) => QueueResource; +): QueueResource { + return make>(QueueResource)(name); +} diff --git a/src/resources/schedule.test.ts b/src/resources/schedule.test.ts index 59839da1..0f4308ae 100644 --- a/src/resources/schedule.test.ts +++ b/src/resources/schedule.test.ts @@ -11,55 +11,39 @@ // 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 faas from '../faas/index'; -import { schedule, RateWorkerOptions, Frequency } from '.'; -jest.mock('../faas/index'); +import { schedule, Frequency, Rate, Cron, Schedule } from '.'; -describe('Schedule', () => { +describe('Rate Schedules', () => { const startSpy = jest - .spyOn(faas.Faas.prototype, 'start') - .mockReturnValue(Promise.resolve()); + .spyOn(Rate.prototype as any, 'start') + .mockResolvedValue(undefined as never); const mockFn = jest.fn(); afterAll(() => { jest.clearAllMocks(); }); - describe('when creating a new schedule with cron expression', () => { - let error = undefined; - afterAll(() => { - jest.resetAllMocks(); - }); - - beforeAll(async () => { - try { - await schedule('main').cron('0 10 * * *', mockFn); - } catch (err) { - error = err; - } - }); - - it('should not return an error', () => { - expect(error).toBe(undefined); - }); - }); - describe('when creating a new schedule with an invalid rate', () => { let error = undefined; afterAll(() => { jest.resetAllMocks(); }); - beforeAll(async () => { - try { - await schedule('main').every('fleventy days', mockFn); - } catch (err) { - error = err; - } - }); + // beforeAll(async () => { + // try { + // await schedule('main').every('fleventy days', mockFn); + // } catch (err) { + // error = err; + // } + // }); - it('should return an error', () => { - expect(error).not.toBe(undefined); + it('should return an error', async () => { + await expect(async () => { + await schedule('main').every('fleventy days', mockFn); + }).rejects.toThrowError( + 'invalid rate expression, expression must begin with a number' + ); + // expect(error).not.toBe(undefined); }); }); @@ -83,7 +67,7 @@ describe('Schedule', () => { }); ['day', 'hour', 'minute'].forEach((rate: Frequency) => { - describe(`when create a new schedule with rate ${rate}`, () => { + describe(`when creating a new schedule with rate ${rate}`, () => { afterAll(() => { jest.resetAllMocks(); }); @@ -92,47 +76,43 @@ describe('Schedule', () => { await schedule('main').every(rate, mockFn); }); - it('should create a new FaasClient', () => { - expect(faas.Faas).toBeCalledTimes(1); - }); - - it('should provide Faas with RateWorkerOptions', () => { - const expectedOpts = new RateWorkerOptions( - 'main', - 1, - `${rate}s` as Frequency - ); - expect(faas.Faas).toBeCalledWith(expectedOpts); - }); - - it('should call FaasClient::start()', () => { + it('should call Rate start()', () => { expect(startSpy).toBeCalledTimes(1); }); }); }); +}); - ['days', 'hours', 'minutes'].forEach((rate: Frequency) => { - describe(`when create a new schedule with rate ${rate}`, () => { - afterAll(() => { - jest.resetAllMocks(); - }); +describe('Cron Schedules', () => { + const cronSpy = jest + .spyOn(Cron.prototype as any, 'start') + .mockResolvedValue(undefined as never); + const mockFn = jest.fn(); - beforeAll(async () => { - await schedule('main').every(`7 ${rate}`, mockFn); - }); + afterAll(() => { + jest.clearAllMocks(); + }); - it('should create a new FaasClient', () => { - expect(faas.Faas).toBeCalledTimes(1); - }); + describe('when creating a new schedule with cron expression', () => { + let error = undefined; + afterAll(() => { + jest.resetAllMocks(); + }); - it('should provide Faas with RateWorkerOptions', () => { - const expectedOpts = new RateWorkerOptions('main', 7, rate); - expect(faas.Faas).toBeCalledWith(expectedOpts); - }); + beforeAll(async () => { + try { + await schedule('main').cron('0 10 * * *', mockFn); + } catch (err) { + error = err; + } + }); - it('should call FaasClient::start()', () => { - expect(startSpy).toBeCalledTimes(1); - }); + it('should call Cron start()', () => { + expect(cronSpy).toBeCalledTimes(1); + }); + + it('should not return an error', () => { + expect(error).toBe(undefined); }); }); }); diff --git a/src/resources/schedule.ts b/src/resources/schedule.ts index 495f48ce..2ca0ddf3 100644 --- a/src/resources/schedule.ts +++ b/src/resources/schedule.ts @@ -11,42 +11,95 @@ // 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 { EventMiddleware, Faas, ScheduleMiddleware } from '../faas'; +import { SchedulesClient } from '@nitric/proto/schedules/v1/schedules_grpc_pb'; +import { startStreamHandler } from './common'; +import { SERVICE_BIND } from '../constants'; +import * as grpc from '@grpc/grpc-js'; +import { + ClientMessage, + RegistrationRequest, + ScheduleCron, + ScheduleEvery, + ServerMessage, +} from '@nitric/proto/schedules/v1/schedules_pb'; +import { ScheduleMiddleware, createHandler } from '../handlers/handler'; +import { IntervalContext } from '../context/interval'; const Frequencies = ['days', 'hours', 'minutes'] as const; export type Frequency = (typeof Frequencies)[number]; -export class RateWorkerOptions { - public readonly description: string; - public readonly rate: number; - public readonly frequency: Frequency; +const handleStart = (schedule: Rate | Cron) => + startStreamHandler(async () => { + const scheduleClient = new SchedulesClient( + SERVICE_BIND, + grpc.ChannelCredentials.createInsecure() + ); - constructor(description: string, rate: number, freq: Frequency) { - this.description = description; - this.rate = rate; - this.frequency = freq; - } -} + // Begin Bi-Di streaming + const stream = scheduleClient.schedule(); + + stream.on('data', async (message: ServerMessage) => { + // We have an init response from the membrane + if (message.hasRegistrationResponse()) { + // We got an init response from the membrane + // The client can configure itself with any information provided by the membrane.. + } else if (message.hasIntervalRequest()) { + // We want to handle a function here... + const intervalRequest = message.getIntervalRequest(); + const responseMessage = new ClientMessage(); + + responseMessage.setId(message.getId()); + + try { + const ctx = IntervalContext.fromRequest(intervalRequest); + const handler = schedule['handler']; + const result = (await handler(ctx, async (ctx) => ctx)) || ctx; + responseMessage.setIntervalResponse( + IntervalContext.toResponse(result) + ); + } catch (e) { + // generic error handling + console.error(e); + } + // Send the response back to the membrane + stream.write(responseMessage); + } + }); + + // Let the membrane know we're ready to start + const initRequest = new RegistrationRequest(); + const initMessage = new ClientMessage(); + + if (schedule instanceof Rate) { + initRequest.setScheduleName(schedule.scheduleName); + const rate = new ScheduleEvery(); + rate.setRate(schedule.rate); + initRequest.setEvery(rate); + } else if (schedule instanceof Cron) { + initRequest.setScheduleName(schedule.scheduleName); + const cron = new ScheduleCron(); + cron.setExpression(schedule.cron); + initRequest.setCron(cron); + } -export class CronWorkerOptions { - public readonly description: string; - public readonly cron: string; + //Original faas workers should return a blank InitRequest for compatibility. + initMessage.setRegistrationRequest(initRequest); + stream.write(initMessage); - constructor(description: string, cron: string) { - this.description = description; - this.cron = cron; - } -} + return stream; + }); /** * Provides a rate based schedule * * Rates provide a simple expressive way to define schedules */ -class Rate { - public readonly schedule: Schedule; - private readonly faas: Faas; +export class Rate { + public readonly scheduleName: string; + public readonly rate: string; + public readonly frequency: Frequency; + public readonly handler: ScheduleMiddleware | undefined; constructor( schedule: Schedule, @@ -56,7 +109,7 @@ class Rate { const [, frequency] = rate.split(' '); const normalizedFrequency = frequency.toLocaleLowerCase() as Frequency; - // This will automatically parse the int off of a valid rate expression e.g. "10 minutes" === 10 + // // This will automatically parse the int off of a valid rate expression e.g. "10 minutes" === 10 const rateNum = parseInt(rate); if (isNaN(rateNum)) { @@ -73,52 +126,62 @@ class Rate { ); } - this.schedule = schedule; - this.faas = new Faas( - new RateWorkerOptions( - schedule['description'], - rateNum, - normalizedFrequency - ) - ); - this.faas.event(...middleware); + this.scheduleName = schedule['name']; + this.rate = rate; + this.frequency = normalizedFrequency; + + this.handler = createHandler(...middleware); } private async start(): Promise { - return this.faas.start(); + if (!this.handler) { + throw new Error( + `A handler function must be provided for schedule ${this.scheduleName}.` + ); + } + + return handleStart(this); } } /** * Provides a cron based schedule */ -class Cron { - public readonly schedule: Schedule; - private readonly faas: Faas; +export class Cron { + public readonly cron: string; + public readonly scheduleName: string; + public readonly handler: ScheduleMiddleware | undefined; constructor( schedule: Schedule, cron: string, ...middleware: ScheduleMiddleware[] ) { - this.schedule = schedule; - this.faas = new Faas(new CronWorkerOptions(schedule['description'], cron)); - this.faas.event(...middleware); + this.scheduleName = schedule['name']; + this.cron = cron; + + this.handler = createHandler(...middleware); } private async start(): Promise { - return this.faas.start(); + if (!this.handler) { + throw new Error( + `A handler function must be provided for schedule ${this.scheduleName}.` + ); + } + + return handleStart(this); } } /** * Providers a scheduled worker. */ -class Schedule { - private readonly description: string; +export class Schedule { + private readonly name: string; - constructor(description: string) { - this.description = description; + constructor(name: string) { + this.name = name; } /** @@ -163,9 +226,11 @@ class Schedule { /** * Provides a new schedule, which can be configured with a rate/cron and a callback to run on the schedule. * - * @param description of the schedule, e.g. "Nightly" - * @returns a named schedule. + * The schedule name must be unique within the project. + * + * @param name of the schedule, e.g. "Nightly" + * @returns a named schedule builder. */ -export const schedule = (description: string): Schedule => { - return new Schedule(description); +export const schedule = (name: string): Schedule => { + return new Schedule(name); }; diff --git a/src/resources/secret.test.ts b/src/resources/secret.test.ts index 88931f2d..bc086708 100644 --- a/src/resources/secret.test.ts +++ b/src/resources/secret.test.ts @@ -12,17 +12,18 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { ResourceServiceClient } from '@nitric/api/proto/resource/v1/resource_grpc_pb'; +import { ResourcesClient } from '@nitric/proto/resources/v1/resources_grpc_pb'; import { UnimplementedError } from '../api/errors'; import { secret } from '.'; -import { ResourceDeclareResponse } from '@nitric/api/proto/resource/v1/resource_pb'; +import { ResourceDeclareResponse } from '@nitric/proto/resources/v1/resources_pb'; import { Secret } from '..'; +import { status } from '@grpc/grpc-js'; describe('Registering secret resources', () => { describe('Given the server is unimplemented', () => { describe('When a secret is registered', () => { const MOCK_ERROR = { - code: 2, + code: status.UNIMPLEMENTED, message: 'UNIMPLEMENTED', }; @@ -30,8 +31,9 @@ describe('Registering secret resources', () => { let declareSpy; beforeAll(() => { + jest.spyOn(console, 'error').mockImplementation(() => {}); declareSpy = jest - .spyOn(ResourceServiceClient.prototype, 'declare') + .spyOn(ResourcesClient.prototype, 'declare') .mockImplementationOnce((request, callback: any) => { callback(MOCK_ERROR, null); @@ -40,13 +42,13 @@ describe('Registering secret resources', () => { }); afterAll(() => { - declareSpy.mockClear(); + jest.restoreAllMocks(); }); it('Should throw the error', async () => { - await expect(secret(validName)['registerPromise']).rejects.toEqual( - new UnimplementedError('UNIMPLEMENTED') - ); + await expect( + secret(validName)['registerPromise'] + ).rejects.toBeInstanceOf(UnimplementedError); }); it('Should call the resource server', () => { @@ -62,7 +64,7 @@ describe('Registering secret resources', () => { beforeAll(() => { otherSpy = jest - .spyOn(ResourceServiceClient.prototype, 'declare') + .spyOn(ResourcesClient.prototype, 'declare') .mockImplementationOnce((request, callback: any) => { const response = new ResourceDeclareResponse(); callback(null, response); @@ -94,7 +96,7 @@ describe('Registering secret resources', () => { beforeEach(() => { // ensure a success is returned and calls can be counted existsSpy = jest - .spyOn(ResourceServiceClient.prototype, 'declare') + .spyOn(ResourcesClient.prototype, 'declare') .mockImplementation((request, callback: any) => { const response = new ResourceDeclareResponse(); callback(null, response); @@ -127,7 +129,7 @@ describe('Registering secret resources', () => { describe('When declaring usage', () => { it('Should return a secret reference', () => { - const ref = secretResource.for('access'); + const ref = secretResource.for('accessing'); expect(ref).toBeInstanceOf(Secret); }); }); diff --git a/src/resources/secret.ts b/src/resources/secret.ts index 7d9393d6..8f0592f4 100644 --- a/src/resources/secret.ts +++ b/src/resources/secret.ts @@ -13,37 +13,39 @@ // limitations under the License. import { Action, - Resource, + ResourceIdentifier, ResourceType, ResourceDeclareRequest, ResourceDeclareResponse, - ResourceDetailsResponse, -} from '@nitric/api/proto/resource/v1/resource_pb'; + ResourceTypeMap, + SecretResource as NitricSecretResource, +} from '@nitric/proto/resources/v1/resources_pb'; import resourceClient from './client'; import { secrets, Secret } from '../api/secrets'; import { ActionsList, make, SecureResource } from './common'; import { fromGrpcError } from '../api/errors'; -type SecretPermission = 'put' | 'access'; +type SecretPermission = 'putting' | 'accessing'; -const everything: SecretPermission[] = ['put', 'access']; +const everything: SecretPermission[] = ['putting', 'accessing']; /** * Cloud secret resource for secret storage */ export class SecretResource extends SecureResource { - protected async register(): Promise { + protected async register(): Promise { const req = new ResourceDeclareRequest(); - const resource = new Resource(); + const resource = new ResourceIdentifier(); resource.setName(this.name); resource.setType(ResourceType.SECRET); - req.setResource(resource); + req.setSecret(new NitricSecretResource()); + req.setId(resource); - return new Promise((resolve, reject) => { + return new Promise((resolve, reject) => { resourceClient.declare( req, - (error, response: ResourceDeclareResponse) => { + (error, _response: ResourceDeclareResponse) => { if (error) { reject(fromGrpcError(error)); } else { @@ -57,9 +59,9 @@ export class SecretResource extends SecureResource { protected permsToActions(...perms: SecretPermission[]): ActionsList { return perms.reduce((actions, perm) => { switch (perm) { - case 'put': + case 'putting': return [...actions, Action.SECRETPUT]; - case 'access': + case 'accessing': return [...actions, Action.SECRETACCESS]; default: throw new Error( @@ -71,14 +73,10 @@ export class SecretResource extends SecureResource { }, []); } - protected resourceType() { + protected resourceType(): ResourceTypeMap[keyof ResourceTypeMap] { return ResourceType.SECRET; } - protected unwrapDetails(resp: ResourceDetailsResponse): never { - throw new Error('details unimplemented for secret'); - } - public for(perm: SecretPermission, ...perms: SecretPermission[]): Secret { this.registerPolicy(perm, ...perms); @@ -86,4 +84,12 @@ export class SecretResource extends SecureResource { } } -export const secret = make(SecretResource); +/** + * Create a reference to a named secret in this project. + * + * If the secret hasn't been referenced before this is a request for a new resource. Otherwise, the existing secret with the same name will be used. + * + * @param name the name of the secret. + * @returns a reference to the secret. + */ +export const secret: (name: string) => SecretResource = make(SecretResource); diff --git a/src/resources/topic.test.ts b/src/resources/topic.test.ts index 7f5c61c8..21a95827 100644 --- a/src/resources/topic.test.ts +++ b/src/resources/topic.test.ts @@ -12,19 +12,22 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { ResourceServiceClient } from '@nitric/api/proto/resource/v1/resource_grpc_pb'; +import { ResourcesClient } from '@nitric/proto/resources/v1/resources_grpc_pb'; import { UnimplementedError } from '../api/errors'; -import { topic, SubscriptionWorkerOptions } from '.'; -import { ResourceDeclareResponse } from '@nitric/api/proto/resource/v1/resource_pb'; +import { + topic, + SubscriptionWorkerOptions, + TopicResource, + Subscription, +} from '.'; +import { ResourceDeclareResponse } from '@nitric/proto/resources/v1/resources_pb'; import { Topic } from '..'; -import * as faas from '../faas/index'; - -jest.mock('../faas/index'); +import { Metadata, status } from '@grpc/grpc-js'; describe('Registering topic resources', () => { describe('Given declare returns an error from the resource server', () => { const MOCK_ERROR = { - code: 2, + code: status.UNIMPLEMENTED, message: 'UNIMPLEMENTED', }; @@ -32,8 +35,9 @@ describe('Registering topic resources', () => { let declareSpy; beforeAll(() => { + jest.spyOn(console, 'error').mockImplementation(() => {}); declareSpy = jest - .spyOn(ResourceServiceClient.prototype, 'declare') + .spyOn(ResourcesClient.prototype, 'declare') .mockImplementationOnce((request, callback: any) => { callback(MOCK_ERROR, null); @@ -42,12 +46,12 @@ describe('Registering topic resources', () => { }); afterAll(() => { - declareSpy.mockClear(); + jest.restoreAllMocks(); }); it('Should throw the error', async () => { - await expect(topic(validName)['registerPromise']).rejects.toEqual( - new UnimplementedError('UNIMPLEMENTED') + await expect(topic(validName)['registerPromise']).rejects.toBeInstanceOf( + UnimplementedError ); }); @@ -63,7 +67,7 @@ describe('Registering topic resources', () => { beforeAll(() => { otherSpy = jest - .spyOn(ResourceServiceClient.prototype, 'declare') + .spyOn(ResourcesClient.prototype, 'declare') .mockImplementationOnce((request, callback: any) => { const response = new ResourceDeclareResponse(); callback(null, response); @@ -95,11 +99,11 @@ describe('Registering topic resources', () => { beforeEach(() => { // ensure a success is returned and calls can be counted. existsSpy = jest - .spyOn(ResourceServiceClient.prototype, 'declare') + .spyOn(ResourcesClient.prototype, 'declare') .mockImplementation((request, callback: any) => { const response = new ResourceDeclareResponse(); callback(null, response); - return null as any; + return null; }); // register the resource for the first time @@ -138,10 +142,15 @@ describe('Registering topic resources', () => { }); describe('subscription', () => { - const startSpy = jest - .spyOn(faas.Faas.prototype, 'start') - .mockReturnValue(Promise.resolve()); - const mockFn = jest.fn(); + let startSpy; + let mockFn; + + beforeAll(() => { + startSpy = jest + .spyOn(Subscription.prototype as any, 'start') + .mockReturnValue(Promise.resolve()); + mockFn = jest.fn(); + }); afterAll(() => { jest.clearAllMocks(); @@ -156,16 +165,7 @@ describe('subscription', () => { await topic('test-subscribe').subscribe(mockFn); }); - it('should create a new FaasClient', () => { - expect(faas.Faas).toBeCalledTimes(1); - }); - - it('should provide Faas with SubscriptionWorkerOptions', () => { - const expectedOpts = new SubscriptionWorkerOptions('test-subscribe'); - expect(faas.Faas).toBeCalledWith(expectedOpts); - }); - - it('should call FaasClient::start()', () => { + it('should call Subscription start()', () => { expect(startSpy).toBeCalledTimes(1); }); }); diff --git a/src/resources/topic.ts b/src/resources/topic.ts index 965c82aa..3f11dd2e 100644 --- a/src/resources/topic.ts +++ b/src/resources/topic.ts @@ -11,19 +11,36 @@ // 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 { Faas, EventMiddleware } from '../faas'; -import { events, Topic } from '../api/'; +import { Topic, topics } from '@nitric/sdk/api/topics'; import resourceClient from './client'; import { - Resource, + ResourceIdentifier, ResourceDeclareRequest, ResourceDeclareResponse, ResourceType, Action, -} from '@nitric/api/proto/resource/v1/resource_pb'; -import { ActionsList, make, SecureResource } from './common'; + ResourceTypeMap, + TopicResource as NitricTopicResource, +} from '@nitric/proto/resources/v1/resources_pb'; +import { + ActionsList, + make, + SecureResource, + startStreamHandler, +} from './common'; +import { SERVICE_BIND } from '../constants'; + +import { SubscriberClient } from '@nitric/proto/topics/v1/topics_grpc_pb'; +import * as grpc from '@grpc/grpc-js'; +import { + ClientMessage, + MessageResponse, + RegistrationRequest, + ServerMessage, +} from '@nitric/proto/topics/v1/topics_pb'; +import { MessageContext } from '../context/message'; +import { MessageMiddleware, createHandler } from '../handlers/handler'; import { fromGrpcError } from '../api/errors'; -import { NitricEvent } from '../types'; type TopicPermission = 'publishing'; @@ -38,16 +55,71 @@ export class SubscriptionWorkerOptions { /** * Creates a subscription worker */ -class Subscription = Record> { - private readonly faas: Faas; +export class Subscription = Record> { + private readonly options: SubscriptionWorkerOptions; + private readonly handler: MessageMiddleware; - constructor(name: string, ...middleware: EventMiddleware[]) { - this.faas = new Faas(new SubscriptionWorkerOptions(name)); - this.faas.event(...middleware); + constructor(name: string, ...middleware: MessageMiddleware[]) { + this.options = new SubscriptionWorkerOptions(name); + this.handler = createHandler(...middleware); } private async start(): Promise { - return this.faas.start(); + return startStreamHandler(async () => { + if (!this.handler) { + throw new Error( + `A handler function must be provided for topic ${this.options.topic}.` + ); + } + + const subscriberClient = new SubscriberClient( + SERVICE_BIND, + grpc.ChannelCredentials.createInsecure() + ); + + // Begin Bi-Di streaming + const stream = subscriberClient.subscribe(); + + stream.on('data', async (message: ServerMessage) => { + // We have an init response from the membrane + if (message.hasRegistrationResponse()) { + // We got an init response from the membrane + // The client can configure itself with any information provided by the membrane.. + } else if (message.hasMessageRequest()) { + // We want to handle a function here... + const messageRequest = message.getMessageRequest(); + const clientMessage = new ClientMessage(); + + clientMessage.setId(message.getId()); + + try { + const ctx = MessageContext.fromMessageRequest(messageRequest); + const result = (await this.handler(ctx, async (ctx) => ctx)) || ctx; + const messageResponse = MessageContext.toMessageResponse(result); + + clientMessage.setMessageResponse(messageResponse); + } catch (e) { + // generic error handling + console.error(e); + const messageResponse = new MessageResponse(); + messageResponse.setSuccess(false); + clientMessage.setMessageResponse(messageResponse); + } + // Send the response back to the membrane + stream.write(clientMessage); + } + }); + + // Let the membrane know we're ready to start + const initRequest = new RegistrationRequest(); + const initMessage = new ClientMessage(); + + initRequest.setTopicName(this.options.topic); + initMessage.setRegistrationRequest(initRequest); + stream.write(initMessage); + + return stream; + }); } } @@ -62,17 +134,18 @@ export class TopicResource< * * @returns a promise that resolves when the registration is complete */ - protected async register(): Promise { + protected async register(): Promise { const req = new ResourceDeclareRequest(); - const resource = new Resource(); + const resource = new ResourceIdentifier(); resource.setName(this.name); resource.setType(ResourceType.TOPIC); - req.setResource(resource); + req.setId(resource); + req.setTopic(new NitricTopicResource()); - return new Promise((resolve, reject) => { + return new Promise((resolve, reject) => { resourceClient.declare( req, - (error, response: ResourceDeclareResponse) => { + (error, _response: ResourceDeclareResponse) => { if (error) { reject(fromGrpcError(error)); } else { @@ -87,12 +160,7 @@ export class TopicResource< return perms.reduce((actions, p) => { switch (p) { case 'publishing': - return [ - ...actions, - Action.TOPICEVENTPUBLISH, - Action.TOPICLIST, - Action.TOPICDETAIL, - ]; + return [...actions, Action.TOPICPUBLISH]; default: throw new Error( `unknown permission ${p}, supported permissions is publishing.} @@ -103,47 +171,45 @@ export class TopicResource< } /** - * Register and start a subscription handler that will be called for all events from this topic. + * Register and start a subscription handler that will be called for all messages from this topic. * - * @param middleware handler middleware which will be run for every incoming event + * @param middleware handler middleware which will be run for every incoming message * @returns Promise which resolves when the handler server terminates */ - subscribe(...middleware: EventMiddleware[]): Promise { + subscribe(...middleware: MessageMiddleware[]): Promise { const sub = new Subscription(this.name, ...middleware); return sub['start'](); } - protected resourceType() { + protected resourceType(): ResourceTypeMap[keyof ResourceTypeMap] { return ResourceType.TOPIC; } - /** - * Unwraps the response details. - * - * Not used for topics. - * - * @param resp {never} - */ - protected unwrapDetails(resp: ResourceDeclareResponse): never { - throw new Error('details unimplemented for topic'); - } - /** * Return a topic reference and register the permissions required by the currently scoped function for this resource. * * e.g. const updates = resources.topic('updates').for('publishing') * - * @param perms the required permission set + * @param perm the required permission set + * @param perms additional required permissions set * @returns a usable topic reference */ public for(perm: TopicPermission, ...perms: TopicPermission[]): Topic { this.registerPolicy(perm, ...perms); - return events().topic(this.name); + return topics().topic(this.name); } } -export const topic = make(TopicResource) as < - T extends Record = Record ->( +/** + * Create a reference to a named topic in this project. + * + * If the topic hasn't been referenced before this is a request for a new resource. Otherwise, the existing topic with the same name will be used. + * + * @param name the name of the topic. + * @returns a reference to the topic. + */ +export function topic = Record>( name: string -) => TopicResource; +): TopicResource { + return make>(TopicResource)(name); +} diff --git a/src/resources/websocket.test.ts b/src/resources/websocket.test.ts index f309d175..3318e026 100644 --- a/src/resources/websocket.test.ts +++ b/src/resources/websocket.test.ts @@ -12,17 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { ResourceServiceClient } from '@nitric/api/proto/resource/v1/resource_grpc_pb'; +import { ResourcesClient } from '@nitric/proto/resources/v1/resources_grpc_pb'; import { UnimplementedError } from '../api/errors'; import { websocket } from '.'; -import { ResourceDeclareResponse } from '@nitric/api/proto/resource/v1/resource_pb'; - -jest.mock('../faas/index'); +import { ResourceDeclareResponse } from '@nitric/proto/resources/v1/resources_pb'; +import { Metadata, status } from '@grpc/grpc-js'; describe('Registering websocket resources', () => { describe('Given declare returns an error from the resource server', () => { const MOCK_ERROR = { - code: 2, + code: status.UNIMPLEMENTED, message: 'UNIMPLEMENTED', }; @@ -30,8 +29,9 @@ describe('Registering websocket resources', () => { let declareSpy; beforeAll(() => { + jest.spyOn(console, 'error').mockImplementation(() => {}); declareSpy = jest - .spyOn(ResourceServiceClient.prototype, 'declare') + .spyOn(ResourcesClient.prototype, 'declare') .mockImplementationOnce((request, callback: any) => { callback(MOCK_ERROR, null); @@ -40,13 +40,13 @@ describe('Registering websocket resources', () => { }); afterAll(() => { - declareSpy.mockClear(); + jest.restoreAllMocks(); }); it('Should throw the error', async () => { - await expect(websocket(validName)['registerPromise']).rejects.toEqual( - new UnimplementedError('UNIMPLEMENTED') - ); + await expect( + websocket(validName)['registerPromise'] + ).rejects.toBeInstanceOf(UnimplementedError); }); it('Should call the resource server', () => { @@ -61,7 +61,7 @@ describe('Registering websocket resources', () => { beforeAll(() => { otherSpy = jest - .spyOn(ResourceServiceClient.prototype, 'declare') + .spyOn(ResourcesClient.prototype, 'declare') .mockImplementation((request, callback: any) => { const response = new ResourceDeclareResponse(); callback(null, response); @@ -93,7 +93,7 @@ describe('Registering websocket resources', () => { beforeEach(() => { // ensure a success is returned and calls can be counted. existsSpy = jest - .spyOn(ResourceServiceClient.prototype, 'declare') + .spyOn(ResourcesClient.prototype, 'declare') .mockImplementation((request, callback: any) => { const response = new ResourceDeclareResponse(); callback(null, response); diff --git a/src/resources/websocket.ts b/src/resources/websocket.ts index 76113f56..be0045fd 100644 --- a/src/resources/websocket.ts +++ b/src/resources/websocket.ts @@ -11,63 +11,133 @@ // 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 { fromGrpcError } from '../api/errors'; -import { Faas, JSONTypes, WebsocketMiddleware } from '../faas'; import { Websocket as WsClient, websocket as wsClient, -} from '../api/websocket/v0'; -import { WebsocketEvent } from '../gen/proto/faas/v1/faas_pb'; +} from '../api/websocket/v1'; import { Action, PolicyResource, - Resource, + ResourceIdentifier, ResourceDeclareRequest, - ResourceDetailsResponse, ResourceType, -} from '../gen/proto/resource/v1/resource_pb'; + ResourceTypeMap, +} from '@nitric/proto/resources/v1/resources_pb'; +import { + ClientMessage, + RegistrationRequest, + ServerMessage, + WebsocketConnectionResponse, + WebsocketDetailsRequest, + WebsocketEventResponse, + WebsocketEventType, +} from '@nitric/proto/websockets/v1/websockets_pb'; import resourceClient from './client'; -import { make, Resource as Base } from './common'; +import { make, Resource as Base, startStreamHandler } from './common'; +import { WebsocketHandlerClient } from '../gen/nitric/proto/websockets/v1/websockets_grpc_pb'; +import { SERVICE_BIND } from '../constants'; +import * as grpc from '@grpc/grpc-js'; +import { WebsocketNotificationContext } from '../context/websocket'; +import { WebsocketMiddleware, createHandler } from '../handlers/handler'; +import { JSONTypes } from '../context/base'; +import { fromGrpcError } from '../api/errors'; const WebsocketEventTypeMap = { - connect: WebsocketEvent.CONNECT, - disconnect: WebsocketEvent.DISCONNECT, - message: WebsocketEvent.MESSAGE, + connect: WebsocketEventType.CONNECT, + disconnect: WebsocketEventType.DISCONNECT, + message: WebsocketEventType.MESSAGE, }; type WebsocketEventType = keyof typeof WebsocketEventTypeMap; -export class WebsocketWorkerOptions { - public readonly socket: string; - public readonly eventType: (typeof WebsocketEventTypeMap)[WebsocketEventType]; - - constructor(socket: string, eventType: WebsocketEventType) { - this.socket = socket; - this.eventType = WebsocketEventTypeMap[eventType]; - } -} - export class Websocket { - private readonly faas: Faas; + private readonly handler: WebsocketMiddleware; + public readonly socketName: string; + public readonly eventType: (typeof WebsocketEventTypeMap)[WebsocketEventType]; constructor( - socket: string, + socketName: string, eventType: WebsocketEventType, ...middleware: WebsocketMiddleware[] ) { - this.faas = new Faas(new WebsocketWorkerOptions(socket, eventType)); - this.faas.websocket(...middleware); + this.handler = createHandler(...middleware); + this.socketName = socketName; + this.eventType = WebsocketEventTypeMap[eventType]; } private async start(): Promise { - return this.faas.start(); + return startStreamHandler(async () => { + if (!this.handler) { + throw new Error( + `A handler function must be provided for websocket ${this.socketName}.` + ); + } + + const wsHandlerClient = new WebsocketHandlerClient( + SERVICE_BIND, + grpc.ChannelCredentials.createInsecure() + ); + + // Begin Bi-Di streaming + const stream = wsHandlerClient.handleEvents(); + + stream.on('data', async (message: ServerMessage) => { + // We have an init response from the membrane + if (message.hasRegistrationResponse()) { + // We got an init response from the membrane + // The client can configure itself with any information provided by the membrane.. + } else if (message.hasWebsocketEventRequest()) { + // We want to handle a function here... + const eventRequest = message.getWebsocketEventRequest(); + const responseMessage = new ClientMessage(); + + responseMessage.setId(message.getId()); + + try { + const ctx = WebsocketNotificationContext.fromRequest(eventRequest); + + const result = (await this.handler(ctx, async (ctx) => ctx)) || ctx; + responseMessage.setWebsocketEventResponse( + WebsocketNotificationContext.toResponse(result) + ); + } catch (e) { + // generic error handling + console.error(e); + const eventResponse = new WebsocketEventResponse(); + const connectionResponse = new WebsocketConnectionResponse(); + connectionResponse.setReject(true); + eventResponse.setConnectionResponse(connectionResponse); + responseMessage.setWebsocketEventResponse(eventResponse); + } + // Send the response back to the membrane + stream.write(responseMessage); + } + }); + + // Let the membrane know we're ready to start + const initRequest = new RegistrationRequest(); + const initMessage = new ClientMessage(); + + initRequest.setSocketName(this.socketName); + initRequest.setEventType(this.eventType); + + //Original faas workers should return a blank InitRequest for compatibility. + initMessage.setRegistrationRequest(initRequest); + stream.write(initMessage); + + return stream; + }); } } +interface WebsocketDetails { + url: string; +} + /** * Websocket resource for bi-di HTTP communication. */ -export class WebsocketResource extends Base { +export class WebsocketResource extends Base { private readonly wsClient: WsClient; constructor(name: string) { @@ -80,15 +150,15 @@ export class WebsocketResource extends Base { * * @returns a promise that resolves when the registration is complete */ - protected async register(): Promise { + protected async register(): Promise { const req = new ResourceDeclareRequest(); - const resource = new Resource(); + const resource = new ResourceIdentifier(); resource.setName(this.name); resource.setType(ResourceType.WEBSOCKET); - req.setResource(resource); + req.setId(resource); - const res = await new Promise((resolve, reject) => { + const res = await new Promise((resolve, reject) => { resourceClient.declare(req, (error, _: ResourceDeclareRequest) => { if (error) { reject(fromGrpcError(error)); @@ -98,10 +168,10 @@ export class WebsocketResource extends Base { }); }); - const defaultPrincipal = new Resource(); - defaultPrincipal.setType(ResourceType.FUNCTION); + const defaultPrincipal = new ResourceIdentifier(); + defaultPrincipal.setType(ResourceType.SERVICE); - const policyResource = new Resource(); + const policyResource = new ResourceIdentifier(); policyResource.setType(ResourceType.POLICY); const policyReq = new ResourceDeclareRequest(); const policy = new PolicyResource(); @@ -109,9 +179,9 @@ export class WebsocketResource extends Base { policy.setPrincipalsList([defaultPrincipal]); policy.setResourcesList([resource]); policyReq.setPolicy(policy); - policyReq.setResource(policyResource); + policyReq.setId(policyResource); - await new Promise((resolve, reject) => { + await new Promise((resolve, reject) => { resourceClient.declare(policyReq, (error, _: ResourceDeclareRequest) => { if (error) { reject(fromGrpcError(error)); @@ -126,7 +196,6 @@ export class WebsocketResource extends Base { async send( connectionId: string, - // TODO: add less raw data types data: string | Uint8Array | Record ): Promise { await this.wsClient.send(this.name, connectionId, data); @@ -142,11 +211,22 @@ export class WebsocketResource extends Base { * @returns Promise that returns the URL of this Websocket */ async url(): Promise { - const { - details: { url }, - } = await this.details(); + const request = new WebsocketDetailsRequest(); + request.setSocketName(this.name); - return url; + const details = await new Promise((resolve, reject) => { + this.wsClient.client.socketDetails(request, (error, data) => { + if (error) { + reject(fromGrpcError(error)); + } else { + resolve({ + url: data.getUrl(), + }); + } + }); + }); + + return details.url; } /** @@ -164,19 +244,19 @@ export class WebsocketResource extends Base { return notification['start'](); } - protected resourceType() { + protected resourceType(): ResourceTypeMap[keyof ResourceTypeMap] { return ResourceType.WEBSOCKET; } - - protected unwrapDetails(resp: ResourceDetailsResponse) { - if (resp.hasWebsocket()) { - return { - url: resp.getWebsocket().getUrl(), - }; - } - - throw new Error('Unexpected details in response. Expected API details'); - } } -export const websocket = make(WebsocketResource); +/** + * Register a Websocket Resource. If the Websocket has already been registered, the existing Websocket will be returned. + * + * The returned Websocket object can be used to register handlers for websocket events. + * e.g. socket.on('connect', async (ctx) => { ... }) + * + * @param name the name of the Websocket + * @returns a Websocket resource + */ +export const websocket: (name: string) => WebsocketResource = + make(WebsocketResource); diff --git a/src/faas/v0/traceProvider.ts b/src/traceProvider.ts similarity index 99% rename from src/faas/v0/traceProvider.ts rename to src/traceProvider.ts index b97eff35..e385137d 100644 --- a/src/faas/v0/traceProvider.ts +++ b/src/traceProvider.ts @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. import { - ConsoleSpanExporter, BatchSpanProcessor, NodeTracerProvider, NoopSpanProcessor, diff --git a/src/types.ts b/src/types.ts index 492e8a12..5f78453b 100644 --- a/src/types.ts +++ b/src/types.ts @@ -11,39 +11,6 @@ // 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. - -export class NitricEvent = Record> { - public readonly payload: T; - public readonly id?: string; - public readonly payloadType: string; - - constructor(payload: T, id?: string, payloadType?: string) { - this.payload = payload; - this.id = id; - this.payloadType = payloadType || 'none'; - } -} - -export class NitricTask = Record> { - public readonly id: string | undefined; - public readonly payloadType: string; - public readonly payload: T; - - constructor({ - id = undefined, - payload, - payloadType = 'none', - }: { - id?: string; - payloadType?: string; - payload: T; - }) { - this.id = id; - this.payload = payload; - this.payloadType = payloadType; - } -} - export type WhereQueryOperator = | '<' | '<=' diff --git a/tsconfig.json b/tsconfig.json index 15451326..916a2193 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,7 +13,7 @@ "paths": { "@nitric/sdk": ["src"], "@nitric/sdk/*": ["src/*"], - "@nitric/api/*": ["src/gen/*"] + "@nitric/proto/*": ["src/gen/nitric/proto/*"] } }, "include": ["src/**/*", "examples/**/*"] diff --git a/yarn.lock b/yarn.lock index a2f0bb0f..bbaa564c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3,11 +3,11 @@ "@ampproject/remapping@^2.2.0": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.0.tgz#56c133824780de3174aed5ab6834f3026790154d" - integrity sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w== + version "2.2.1" + resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.1.tgz#99e8e11851128b8702cd57c33684f1d0f260b630" + integrity sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg== dependencies: - "@jridgewell/gen-mapping" "^0.1.0" + "@jridgewell/gen-mapping" "^0.3.0" "@jridgewell/trace-mapping" "^0.3.9" "@babel/code-frame@7.12.11": @@ -17,145 +17,143 @@ dependencies: "@babel/highlight" "^7.10.4" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.18.6.tgz#3b25d38c89600baa2dcc219edfa88a74eb2c427a" - integrity sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q== +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.23.5": + version "7.23.5" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.23.5.tgz#9009b69a8c602293476ad598ff53e4562e15c244" + integrity sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA== dependencies: - "@babel/highlight" "^7.18.6" + "@babel/highlight" "^7.23.4" + chalk "^2.4.2" -"@babel/compat-data@^7.20.5": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.21.0.tgz#c241dc454e5b5917e40d37e525e2f4530c399298" - integrity sha512-gMuZsmsgxk/ENC3O/fRw5QY8A9/uxQbbCEypnLIiYYc/qVJtEV7ouxC3EllIIwNzMqAQee5tanFabWsUOutS7g== +"@babel/compat-data@^7.23.5": + version "7.23.5" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.23.5.tgz#ffb878728bb6bdcb6f4510aa51b1be9afb8cfd98" + integrity sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw== "@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.7.5": - version "7.21.3" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.21.3.tgz#cf1c877284a469da5d1ce1d1e53665253fae712e" - integrity sha512-qIJONzoa/qiHghnm0l1n4i/6IIziDpzqc36FBs4pzMhDUraHqponwJLiAKm1hGLP3OSB/TVNz6rMwVGpwxxySw== + version "7.23.9" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.23.9.tgz#b028820718000f267870822fec434820e9b1e4d1" + integrity sha512-5q0175NOjddqpvvzU+kDiSOAk4PfdO6FvwCWoQ6RO7rTzEe8vlo+4HVfcnAREhD4npMs0e9uZypjTwzZPCf/cw== dependencies: "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.21.3" - "@babel/helper-compilation-targets" "^7.20.7" - "@babel/helper-module-transforms" "^7.21.2" - "@babel/helpers" "^7.21.0" - "@babel/parser" "^7.21.3" - "@babel/template" "^7.20.7" - "@babel/traverse" "^7.21.3" - "@babel/types" "^7.21.3" - convert-source-map "^1.7.0" + "@babel/code-frame" "^7.23.5" + "@babel/generator" "^7.23.6" + "@babel/helper-compilation-targets" "^7.23.6" + "@babel/helper-module-transforms" "^7.23.3" + "@babel/helpers" "^7.23.9" + "@babel/parser" "^7.23.9" + "@babel/template" "^7.23.9" + "@babel/traverse" "^7.23.9" + "@babel/types" "^7.23.9" + convert-source-map "^2.0.0" debug "^4.1.0" gensync "^1.0.0-beta.2" - json5 "^2.2.2" - semver "^6.3.0" + json5 "^2.2.3" + semver "^6.3.1" -"@babel/generator@^7.21.3": - version "7.21.3" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.21.3.tgz#232359d0874b392df04045d72ce2fd9bb5045fce" - integrity sha512-QS3iR1GYC/YGUnW7IdggFeN5c1poPUurnGttOV/bZgPGV+izC/D8HnD6DLwod0fsatNyVn1G3EVWMYIF0nHbeA== +"@babel/generator@^7.23.6": + version "7.23.6" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.6.tgz#9e1fca4811c77a10580d17d26b57b036133f3c2e" + integrity sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw== dependencies: - "@babel/types" "^7.21.3" + "@babel/types" "^7.23.6" "@jridgewell/gen-mapping" "^0.3.2" "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" -"@babel/helper-compilation-targets@^7.20.7": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.7.tgz#a6cd33e93629f5eb473b021aac05df62c4cd09bb" - integrity sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ== +"@babel/helper-compilation-targets@^7.23.6": + version "7.23.6" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.23.6.tgz#4d79069b16cbcf1461289eccfbbd81501ae39991" + integrity sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ== dependencies: - "@babel/compat-data" "^7.20.5" - "@babel/helper-validator-option" "^7.18.6" - browserslist "^4.21.3" + "@babel/compat-data" "^7.23.5" + "@babel/helper-validator-option" "^7.23.5" + browserslist "^4.22.2" lru-cache "^5.1.1" - semver "^6.3.0" + semver "^6.3.1" -"@babel/helper-environment-visitor@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz#0c0cee9b35d2ca190478756865bb3528422f51be" - integrity sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg== +"@babel/helper-environment-visitor@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167" + integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA== -"@babel/helper-function-name@^7.21.0": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.21.0.tgz#d552829b10ea9f120969304023cd0645fa00b1b4" - integrity sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg== +"@babel/helper-function-name@^7.23.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz#1f9a3cdbd5b2698a670c30d2735f9af95ed52759" + integrity sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw== dependencies: - "@babel/template" "^7.20.7" - "@babel/types" "^7.21.0" + "@babel/template" "^7.22.15" + "@babel/types" "^7.23.0" -"@babel/helper-hoist-variables@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz#d4d2c8fb4baeaa5c68b99cc8245c56554f926678" - integrity sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q== +"@babel/helper-hoist-variables@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz#c01a007dac05c085914e8fb652b339db50d823bb" + integrity sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw== dependencies: - "@babel/types" "^7.18.6" + "@babel/types" "^7.22.5" -"@babel/helper-module-imports@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz#1e3ebdbbd08aad1437b428c50204db13c5a3ca6e" - integrity sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA== +"@babel/helper-module-imports@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz#16146307acdc40cc00c3b2c647713076464bdbf0" + integrity sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w== dependencies: - "@babel/types" "^7.18.6" + "@babel/types" "^7.22.15" -"@babel/helper-module-transforms@^7.21.2": - version "7.21.2" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.21.2.tgz#160caafa4978ac8c00ac66636cb0fa37b024e2d2" - integrity sha512-79yj2AR4U/Oqq/WOV7Lx6hUjau1Zfo4cI+JLAVYeMV5XIlbOhmjEk5ulbTc9fMpmlojzZHkUUxAiK+UKn+hNQQ== +"@babel/helper-module-transforms@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz#d7d12c3c5d30af5b3c0fcab2a6d5217773e2d0f1" + integrity sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ== dependencies: - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-module-imports" "^7.18.6" - "@babel/helper-simple-access" "^7.20.2" - "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/helper-validator-identifier" "^7.19.1" - "@babel/template" "^7.20.7" - "@babel/traverse" "^7.21.2" - "@babel/types" "^7.21.2" + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-module-imports" "^7.22.15" + "@babel/helper-simple-access" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + "@babel/helper-validator-identifier" "^7.22.20" "@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.8.0": - version "7.20.2" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz#d1b9000752b18d0877cff85a5c376ce5c3121629" - integrity sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ== + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz#dd7ee3735e8a313b9f7b05a773d892e88e6d7295" + integrity sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg== -"@babel/helper-simple-access@^7.20.2": - version "7.20.2" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.20.2.tgz#0ab452687fe0c2cfb1e2b9e0015de07fc2d62dd9" - integrity sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA== +"@babel/helper-simple-access@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz#4938357dc7d782b80ed6dbb03a0fba3d22b1d5de" + integrity sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w== dependencies: - "@babel/types" "^7.20.2" + "@babel/types" "^7.22.5" -"@babel/helper-split-export-declaration@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz#7367949bc75b20c6d5a5d4a97bba2824ae8ef075" - integrity sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA== +"@babel/helper-split-export-declaration@^7.22.6": + version "7.22.6" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz#322c61b7310c0997fe4c323955667f18fcefb91c" + integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g== dependencies: - "@babel/types" "^7.18.6" + "@babel/types" "^7.22.5" -"@babel/helper-string-parser@^7.19.4": - version "7.19.4" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz#38d3acb654b4701a9b77fb0615a96f775c3a9e63" - integrity sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw== +"@babel/helper-string-parser@^7.23.4": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz#9478c707febcbbe1ddb38a3d91a2e054ae622d83" + integrity sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ== -"@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.19.1": - version "7.19.1" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2" - integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== +"@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" + integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== -"@babel/helper-validator-option@^7.18.6": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.21.0.tgz#8224c7e13ace4bafdc4004da2cf064ef42673180" - integrity sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ== +"@babel/helper-validator-option@^7.23.5": + version "7.23.5" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz#907a3fbd4523426285365d1206c423c4c5520307" + integrity sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw== -"@babel/helpers@^7.21.0": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.21.0.tgz#9dd184fb5599862037917cdc9eecb84577dc4e7e" - integrity sha512-XXve0CBtOW0pd7MRzzmoyuSj0e3SEzj8pgyFxnTT1NJZL38BD1MK7yYrm8yefRPIDvNNe14xR4FdbHwpInD4rA== +"@babel/helpers@^7.23.9": + version "7.23.9" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.23.9.tgz#c3e20bbe7f7a7e10cb9b178384b4affdf5995c7d" + integrity sha512-87ICKgU5t5SzOT7sBMfCOZQ2rHjRU+Pcb9BoILMYz600W6DkVRLFBPwQ18gwUVvggqXivaUakpnxWQGbpywbBQ== dependencies: - "@babel/template" "^7.20.7" - "@babel/traverse" "^7.21.0" - "@babel/types" "^7.21.0" + "@babel/template" "^7.23.9" + "@babel/traverse" "^7.23.9" + "@babel/types" "^7.23.9" -"@babel/highlight@^7.10.4", "@babel/highlight@^7.18.6": +"@babel/highlight@^7.10.4": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.18.6.tgz#81158601e93e2563795adcbfbdf5d64be3f2ecdf" integrity sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g== @@ -164,10 +162,19 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.21.3": - version "7.21.3" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.21.3.tgz#1d285d67a19162ff9daa358d4cb41d50c06220b3" - integrity sha512-lobG0d7aOfQRXh8AyklEAgZGvA4FShxo6xQbUrrT/cNBPUdIDojlokwJsQyCC/eKia7ifqM0yP+2DRZ4WKw2RQ== +"@babel/highlight@^7.23.4": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.23.4.tgz#edaadf4d8232e1a961432db785091207ead0621b" + integrity sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A== + dependencies: + "@babel/helper-validator-identifier" "^7.22.20" + chalk "^2.4.2" + js-tokens "^4.0.0" + +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.23.9": + version "7.23.9" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.9.tgz#7b903b6149b0f8fa7ad564af646c4c38a77fc44b" + integrity sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA== "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -253,38 +260,38 @@ dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/template@^7.20.7", "@babel/template@^7.3.3": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.20.7.tgz#a15090c2839a83b02aa996c0b4994005841fd5a8" - integrity sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw== - dependencies: - "@babel/code-frame" "^7.18.6" - "@babel/parser" "^7.20.7" - "@babel/types" "^7.20.7" - -"@babel/traverse@^7.1.0", "@babel/traverse@^7.21.0", "@babel/traverse@^7.21.2", "@babel/traverse@^7.21.3": - version "7.21.3" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.21.3.tgz#4747c5e7903d224be71f90788b06798331896f67" - integrity sha512-XLyopNeaTancVitYZe2MlUEvgKb6YVVPXzofHgqHijCImG33b/uTurMS488ht/Hbsb2XK3U2BnSTxKVNGV3nGQ== - dependencies: - "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.21.3" - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-function-name" "^7.21.0" - "@babel/helper-hoist-variables" "^7.18.6" - "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/parser" "^7.21.3" - "@babel/types" "^7.21.3" - debug "^4.1.0" +"@babel/template@^7.22.15", "@babel/template@^7.23.9", "@babel/template@^7.3.3": + version "7.23.9" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.23.9.tgz#f881d0487cba2828d3259dcb9ef5005a9731011a" + integrity sha512-+xrD2BWLpvHKNmX2QbpdpsBaWnRxahMwJjO+KZk2JOElj5nSmKezyS1B4u+QbHMTX69t4ukm6hh9lsYQ7GHCKA== + dependencies: + "@babel/code-frame" "^7.23.5" + "@babel/parser" "^7.23.9" + "@babel/types" "^7.23.9" + +"@babel/traverse@^7.1.0", "@babel/traverse@^7.23.9": + version "7.23.9" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.9.tgz#2f9d6aead6b564669394c5ce0f9302bb65b9d950" + integrity sha512-I/4UJ9vs90OkBtY6iiiTORVMyIhJ4kAVmsKo9KFc8UOxMeUfi2hvtIBsET5u9GizXE6/GFSuKCTNfgCswuEjRg== + dependencies: + "@babel/code-frame" "^7.23.5" + "@babel/generator" "^7.23.6" + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-function-name" "^7.23.0" + "@babel/helper-hoist-variables" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + "@babel/parser" "^7.23.9" + "@babel/types" "^7.23.9" + debug "^4.3.1" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.18.6", "@babel/types@^7.20.2", "@babel/types@^7.20.7", "@babel/types@^7.21.0", "@babel/types@^7.21.2", "@babel/types@^7.21.3", "@babel/types@^7.3.0", "@babel/types@^7.3.3": - version "7.21.3" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.21.3.tgz#4865a5357ce40f64e3400b0f3b737dc6d4f64d05" - integrity sha512-sBGdETxC+/M4o/zKC0sl6sjWv62WFR/uzxrJ6uYyMLZOUlPnwzw0tKgVHOXxaAd5l2g8pEDM5RZ495GPQI77kg== +"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.22.15", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.23.6", "@babel/types@^7.23.9", "@babel/types@^7.3.3": + version "7.23.9" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.9.tgz#1dd7b59a9a2b5c87f8b41e52770b5ecbf492e002" + integrity sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q== dependencies: - "@babel/helper-string-parser" "^7.19.4" - "@babel/helper-validator-identifier" "^7.19.1" + "@babel/helper-string-parser" "^7.23.4" + "@babel/helper-validator-identifier" "^7.22.20" to-fast-properties "^2.0.0" "@bcoe/v8-coverage@^0.2.3": @@ -312,13 +319,13 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" -"@es-joy/jsdoccomment@~0.37.0": - version "0.37.0" - resolved "https://registry.yarnpkg.com/@es-joy/jsdoccomment/-/jsdoccomment-0.37.0.tgz#aaafb4bb6c88288aa7899aef0f3b1b851c36f908" - integrity sha512-hjK0wnsPCYLlF+HHB4R/RbUjOWeLW2SlarB67+Do5WsKILOkmIZvvPJFbtWSmbypxcjpoECLAMzoao0D4Bg5ZQ== +"@es-joy/jsdoccomment@~0.41.0": + version "0.41.0" + resolved "https://registry.yarnpkg.com/@es-joy/jsdoccomment/-/jsdoccomment-0.41.0.tgz#4a2f7db42209c0425c71a1476ef1bdb6dcd836f6" + integrity sha512-aKUhyn1QI5Ksbqcr3fFJj16p99QdjUxXAEuFst1Z47DRyoiMwivIH9MV/ARcJOCXVjPfjITciej8ZD2O/6qUmw== dependencies: - comment-parser "1.3.1" - esquery "^1.4.0" + comment-parser "1.4.1" + esquery "^1.5.0" jsdoc-type-pratt-parser "~4.0.0" "@esbuild/android-arm64@0.17.14": @@ -446,24 +453,23 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" -"@grpc/grpc-js@1.8.1": - version "1.8.1" - resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.8.1.tgz#71f809c148e52ac9c15da4b8d4a65ecd7063dff7" - integrity sha512-mdqYADWl/9Kb75XLstt6pvBnS1DpxSDFRKrbadkY1ymUd29hq49nP6tLcL7a7qLydgqFCpjNwa2RsyrqB3MsXA== +"@grpc/grpc-js@1.10.0": + version "1.10.0" + resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.10.0.tgz#23b5defd6a021a20924b4baca2dd1b3a3ecc3716" + integrity sha512-tx+eoEsqkMkLCHR4OOplwNIaJ7SVZWzeVKzEMBz8VR+TbssgBYOP4a0P+KQiQ6LaTG4SGaIEu7YTS8xOmkOWLA== dependencies: - "@grpc/proto-loader" "^0.7.0" + "@grpc/proto-loader" "^0.7.8" "@types/node" ">=12.12.47" -"@grpc/proto-loader@^0.7.0": - version "0.7.6" - resolved "https://registry.yarnpkg.com/@grpc/proto-loader/-/proto-loader-0.7.6.tgz#b71fdf92b184af184b668c4e9395a5ddc23d61de" - integrity sha512-QyAXR8Hyh7uMDmveWxDSUcJr9NAWaZ2I6IXgAYvQmfflwouTM+rArE2eEaCtLlRqO81j7pRLCt81IefUei6Zbw== +"@grpc/proto-loader@^0.7.8": + version "0.7.10" + resolved "https://registry.yarnpkg.com/@grpc/proto-loader/-/proto-loader-0.7.10.tgz#6bf26742b1b54d0a473067743da5d3189d06d720" + integrity sha512-CAqDfoaQ8ykFd9zqBDn4k6iWT9loLAlc2ETmDFS9JCD70gDcnA4L3AFEo2iV7KyAtAAHFW9ftq1Fz+Vsgq80RQ== dependencies: - "@types/long" "^4.0.1" lodash.camelcase "^4.3.0" - long "^4.0.0" - protobufjs "^7.0.0" - yargs "^16.2.0" + long "^5.0.0" + protobufjs "^7.2.4" + yargs "^17.7.2" "@humanwhocodes/config-array@^0.5.0": version "0.5.0" @@ -671,37 +677,34 @@ "@types/yargs" "^15.0.0" chalk "^4.0.0" -"@jridgewell/gen-mapping@^0.1.0": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz#e5d2e450306a9491e3bd77e323e38d7aff315996" - integrity sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w== - dependencies: - "@jridgewell/set-array" "^1.0.0" - "@jridgewell/sourcemap-codec" "^1.4.10" - -"@jridgewell/gen-mapping@^0.3.2": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz#c1aedc61e853f2bb9f5dfe6d4442d3b565b253b9" - integrity sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A== +"@jridgewell/gen-mapping@^0.3.0", "@jridgewell/gen-mapping@^0.3.2": + version "0.3.3" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz#7e02e6eb5df901aaedb08514203b096614024098" + integrity sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ== dependencies: "@jridgewell/set-array" "^1.0.1" "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.9" -"@jridgewell/resolve-uri@3.1.0", "@jridgewell/resolve-uri@^3.0.3": +"@jridgewell/resolve-uri@^3.0.3": version "3.1.0" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== -"@jridgewell/set-array@^1.0.0", "@jridgewell/set-array@^1.0.1": +"@jridgewell/resolve-uri@^3.1.0": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" + integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== + +"@jridgewell/set-array@^1.0.1": version "1.1.2" resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== -"@jridgewell/sourcemap-codec@1.4.14", "@jridgewell/sourcemap-codec@^1.4.10": - version "1.4.14" - resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" - integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== +"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14": + version "1.4.15" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" + integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== "@jridgewell/trace-mapping@0.3.9": version "0.3.9" @@ -712,12 +715,12 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.9": - version "0.3.17" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz#793041277af9073b0951a7fe0f0d8c4c98c36985" - integrity sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g== + version "0.3.22" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.22.tgz#72a621e5de59f5f1ef792d0793a82ee20f645e4c" + integrity sha512-Wf963MzWtA2sjrNt+g18IAln9lKnlRp+K2eH4jjIoF1wYeq3aMREpG09xhlhdzS0EjwU7qmUJYangWa+151vZw== dependencies: - "@jridgewell/resolve-uri" "3.1.0" - "@jridgewell/sourcemap-codec" "1.4.14" + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" "@mapbox/node-pre-gyp@^1.0.5": version "1.0.10" @@ -762,134 +765,153 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@opentelemetry/api@^1.4.1": - version "1.4.1" - resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.4.1.tgz#ff22eb2e5d476fbc2450a196e40dd243cc20c28f" - integrity sha512-O2yRJce1GOc6PAy3QxFM4NzFiWzvScDC1/5ihYBL6BUEVdq0XMWN01sppE+H6bBXbaFYipjwFLEWLg5PaSOThA== - -"@opentelemetry/context-async-hooks@1.10.1": - version "1.10.1" - resolved "https://registry.yarnpkg.com/@opentelemetry/context-async-hooks/-/context-async-hooks-1.10.1.tgz#aa4ba9b944f93ae0c29460229dc2d4588dbb484b" - integrity sha512-6CC9sWOZDkUkKrAR957fmxXXlaK3uiBu5xVnuNEQ7hI7VqkUC/r0mNYIql0ouRInLz5o0HwmDuga1eXgQU7KNQ== - -"@opentelemetry/core@1.10.1": - version "1.10.1" - resolved "https://registry.yarnpkg.com/@opentelemetry/core/-/core-1.10.1.tgz#057a621db13589bad5618b786bb4f0a643bd4323" - integrity sha512-uBZs9poKMWX7WWHsRfaGHqvrn77D9EU5LwU8Ge3YKD/Su5Gy+T1v476l49nl1UOzEMNo4cISao3nIqQVsABB8g== - dependencies: - "@opentelemetry/semantic-conventions" "1.10.1" - -"@opentelemetry/exporter-trace-otlp-http@^0.36.1": - version "0.36.1" - resolved "https://registry.yarnpkg.com/@opentelemetry/exporter-trace-otlp-http/-/exporter-trace-otlp-http-0.36.1.tgz#2b54a8b55f89cef212264a30824add575890e6c3" - integrity sha512-q/jKlfuKiHqltDzgzgEvXkoEJ/EyVSIAZhfiaoyBeQ49UhHCPvNTH36/hSwbGSEhKeX98WxXZK4NB/S3sUs8ig== - dependencies: - "@opentelemetry/core" "1.10.1" - "@opentelemetry/otlp-exporter-base" "0.36.1" - "@opentelemetry/otlp-transformer" "0.36.1" - "@opentelemetry/resources" "1.10.1" - "@opentelemetry/sdk-trace-base" "1.10.1" - -"@opentelemetry/instrumentation-grpc@^0.36.1": - version "0.36.1" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-grpc/-/instrumentation-grpc-0.36.1.tgz#d20c4bc1c001d05958e4e9a9a4808b5b562a39a9" - integrity sha512-advR1XRasogh7dsa//v9/yXgOu6YGVvcO3hHSipyAcK+GlTF/0ryt3MFl2noDGZMDObTN0KWWJlJlN1h4SHw9A== - dependencies: - "@opentelemetry/instrumentation" "0.36.1" - "@opentelemetry/semantic-conventions" "1.10.1" - -"@opentelemetry/instrumentation-http@^0.36.1": - version "0.36.1" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-http/-/instrumentation-http-0.36.1.tgz#909b7d96aef2bb76a2706c718e582e17bdab804a" - integrity sha512-ecvHhV/FQRvJFIHt41FsOrICjuBodm9I2RoTjjwNAF+QlokFrLDqmoklxzWE4eYjmLADLQ+RvV78MMfza+2Gzw== - dependencies: - "@opentelemetry/core" "1.10.1" - "@opentelemetry/instrumentation" "0.36.1" - "@opentelemetry/semantic-conventions" "1.10.1" - semver "^7.3.5" +"@opentelemetry/api-logs@0.48.0": + version "0.48.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/api-logs/-/api-logs-0.48.0.tgz#9521a0c1e920ed536f31cda117164c4afff44caf" + integrity sha512-1/aMiU4Eqo3Zzpfwu51uXssp5pzvHFObk8S9pKAiXb1ne8pvg1qxBQitYL1XUiAMEXFzgjaidYG2V6624DRhhw== + dependencies: + "@opentelemetry/api" "^1.0.0" + +"@opentelemetry/api@^1.0.0", "@opentelemetry/api@^1.4.1": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.7.0.tgz#b139c81999c23e3c8d3c0a7234480e945920fc40" + integrity sha512-AdY5wvN0P2vXBi3b29hxZgSFvdhdxPB9+f0B6s//P9Q8nibRWeA3cHm8UmLpio9ABigkVHJ5NMPk+Mz8VCCyrw== + +"@opentelemetry/context-async-hooks@1.21.0": + version "1.21.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/context-async-hooks/-/context-async-hooks-1.21.0.tgz#a56fa461e7786605bcbde2ff66f21b2392afacda" + integrity sha512-t0iulGPiMjG/NrSjinPQoIf8ST/o9V0dGOJthfrFporJlNdlKIQPfC7lkrV+5s2dyBThfmSbJlp/4hO1eOcDXA== + +"@opentelemetry/core@1.21.0": + version "1.21.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/core/-/core-1.21.0.tgz#8c16faf16edf861b073c03c9d45977b3f4003ee1" + integrity sha512-KP+OIweb3wYoP7qTYL/j5IpOlu52uxBv5M4+QhSmmUfLyTgu1OIS71msK3chFo1D6Y61BIH3wMiMYRCxJCQctA== + dependencies: + "@opentelemetry/semantic-conventions" "1.21.0" + +"@opentelemetry/exporter-trace-otlp-http@^0.48.0": + version "0.48.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/exporter-trace-otlp-http/-/exporter-trace-otlp-http-0.48.0.tgz#10e719ec7fec0797a3e325964da8f08ca8d903d9" + integrity sha512-QEZKbfWqXrbKVpr2PHd4KyKI0XVOhUYC+p2RPV8s+2K5QzZBE3+F9WlxxrXDfkrvGmpQAZytBoHQQYA3AGOtpw== + dependencies: + "@opentelemetry/core" "1.21.0" + "@opentelemetry/otlp-exporter-base" "0.48.0" + "@opentelemetry/otlp-transformer" "0.48.0" + "@opentelemetry/resources" "1.21.0" + "@opentelemetry/sdk-trace-base" "1.21.0" + +"@opentelemetry/instrumentation-grpc@^0.48.0": + version "0.48.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-grpc/-/instrumentation-grpc-0.48.0.tgz#4025e672037aa756aa36090ccc3fc08b909de598" + integrity sha512-MmJHkbqaulqfECjotRtco9AXOq+D1HLq53wI7UFeE8bl8kISP9iMkt+A7PrtPFpRGCglwFvSa0djId6EWsP0DQ== + dependencies: + "@opentelemetry/instrumentation" "0.48.0" + "@opentelemetry/semantic-conventions" "1.21.0" + +"@opentelemetry/instrumentation-http@^0.48.0": + version "0.48.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-http/-/instrumentation-http-0.48.0.tgz#88266dfcd2dddb45f755a0f1fc882472e6e30a87" + integrity sha512-uXqOsLhW9WC3ZlGm6+PSX0xjSDTCfy4CMjfYj6TPWusOO8dtdx040trOriF24y+sZmS3M+5UQc6/3/ZxBJh4Mw== + dependencies: + "@opentelemetry/core" "1.21.0" + "@opentelemetry/instrumentation" "0.48.0" + "@opentelemetry/semantic-conventions" "1.21.0" + semver "^7.5.2" + +"@opentelemetry/instrumentation@0.48.0", "@opentelemetry/instrumentation@^0.48.0": + version "0.48.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation/-/instrumentation-0.48.0.tgz#a6dee936e973f1270c464657a55bb570807194aa" + integrity sha512-sjtZQB5PStIdCw5ovVTDGwnmQC+GGYArJNgIcydrDSqUTdYBnMrN9P4pwQZgS3vTGIp+TU1L8vMXGe51NVmIKQ== + dependencies: + "@types/shimmer" "^1.0.2" + import-in-the-middle "1.7.1" + require-in-the-middle "^7.1.1" + semver "^7.5.2" + shimmer "^1.2.1" -"@opentelemetry/instrumentation@0.36.1", "@opentelemetry/instrumentation@^0.36.1": - version "0.36.1" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation/-/instrumentation-0.36.1.tgz#7492526eadacd032f066457d759fc4560b357f7e" - integrity sha512-gtYErugMEF5NXVacmuE+tHFBiyB82YIiO5l8iZX9/4R4TDV8uCWdrLW5QZMqgTzPhiyOG9AITFdqhwIZMw/5lA== +"@opentelemetry/otlp-exporter-base@0.48.0": + version "0.48.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.48.0.tgz#72b4efc548de9a0a7121c37669e052ded619bcc3" + integrity sha512-T4LJND+Ugl87GUONoyoQzuV9qCn4BFIPOnCH1biYqdGhc2JahjuLqVD9aefwLzGBW638iLAo88Lh68h2F1FLiA== dependencies: - require-in-the-middle "^6.0.0" - semver "^7.3.2" - shimmer "^1.2.1" + "@opentelemetry/core" "1.21.0" -"@opentelemetry/otlp-exporter-base@0.36.1": - version "0.36.1" - resolved "https://registry.yarnpkg.com/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.36.1.tgz#9825dce8f08e34636ee7a48e7fe43cfd2c137d2b" - integrity sha512-fpjPwLafJIjgxY5qx7Ly74AYmRCd9spC6/jCxvEgGheg1YT4+NkfVnrfllxLRgc9wQNhDj7Y0Knp8RcmXLLVfA== - dependencies: - "@opentelemetry/core" "1.10.1" - -"@opentelemetry/otlp-transformer@0.36.1": - version "0.36.1" - resolved "https://registry.yarnpkg.com/@opentelemetry/otlp-transformer/-/otlp-transformer-0.36.1.tgz#7bd5a597577153547fe07a84b9814e6c65e31140" - integrity sha512-d2MomkVHBHwfsmNz6E60s/sm7gtpSjFwDzkFLm9brVq//VXzEhaEyfYSeTabdUs4BmrzhqTIogHWlcd6cOiL+w== - dependencies: - "@opentelemetry/core" "1.10.1" - "@opentelemetry/resources" "1.10.1" - "@opentelemetry/sdk-metrics" "1.10.1" - "@opentelemetry/sdk-trace-base" "1.10.1" - -"@opentelemetry/propagator-b3@1.10.1": - version "1.10.1" - resolved "https://registry.yarnpkg.com/@opentelemetry/propagator-b3/-/propagator-b3-1.10.1.tgz#70ba9b96635ee295095837035be8c9c8a8c860c8" - integrity sha512-YrWqU93PH8RyCmqGhtDZgyk64D+cp8XIjQsLhEgOPcOsxvxSSGXnGt46rx9Z8+WdIbJgj13Q4nV/xuh36k+O+A== - dependencies: - "@opentelemetry/core" "1.10.1" - -"@opentelemetry/propagator-jaeger@1.10.1": - version "1.10.1" - resolved "https://registry.yarnpkg.com/@opentelemetry/propagator-jaeger/-/propagator-jaeger-1.10.1.tgz#15ac89b7ad9a80d15028d0f4fcc9631e7feedc0c" - integrity sha512-qvwFfDPoBw2YQW/OsGHdLdD/rqNRGBRLz5UZR/akO21C4qwIK+lQcXbSi5ve0p2eLHnFshhNFqDmgQclOYBcmg== - dependencies: - "@opentelemetry/core" "1.10.1" - -"@opentelemetry/resources@1.10.1", "@opentelemetry/resources@^1.10.1": - version "1.10.1" - resolved "https://registry.yarnpkg.com/@opentelemetry/resources/-/resources-1.10.1.tgz#a2537ea241e09a63d5d1afd566f89e2ef5889370" - integrity sha512-e+wwdyO44jZtsT1aqGiWMFOfN1XuP9Tv4+H0OYP3yQajBtGdsZjdSUn9UNjw46JsW0Mb+RaTxJwsb2uvfHar0g== - dependencies: - "@opentelemetry/core" "1.10.1" - "@opentelemetry/semantic-conventions" "1.10.1" - -"@opentelemetry/sdk-metrics@1.10.1": - version "1.10.1" - resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-metrics/-/sdk-metrics-1.10.1.tgz#1389a8524ba59dc2e1d9cf627d504119c111fca1" - integrity sha512-ARAD4e6lZhLwstwW+1HG2Q3XuYFA/t8vn10KK/mA4em1pZYKFn64c45RJZJcntxWp4wOZRbp9iL1RXsg7zIjow== - dependencies: - "@opentelemetry/core" "1.10.1" - "@opentelemetry/resources" "1.10.1" - lodash.merge "4.6.2" - -"@opentelemetry/sdk-trace-base@1.10.1": - version "1.10.1" - resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.10.1.tgz#fce06a810f9052d3c1b935d134979f4254bc8ae2" - integrity sha512-jutSP5t22wrPKReJKzI5uKht4mJ4cQdF/mGFJkN+emFFsDXru9CuFv/NfUrD0jEqoaaiqjcZtPSyTzMgu9LXvw== - dependencies: - "@opentelemetry/core" "1.10.1" - "@opentelemetry/resources" "1.10.1" - "@opentelemetry/semantic-conventions" "1.10.1" - -"@opentelemetry/sdk-trace-node@^1.10.1": - version "1.10.1" - resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-trace-node/-/sdk-trace-node-1.10.1.tgz#f627871fa048bf3c3c8d7ffaa57dfff069b683cb" - integrity sha512-/y+s1j8rPTaKnPnbrsbYv3ygTb4hjx/1H32zqobFr85cvWX+Tt1RWmcZ51TaPAfq5uJobGFhhLh6ADI2RDvk5Q== - dependencies: - "@opentelemetry/context-async-hooks" "1.10.1" - "@opentelemetry/core" "1.10.1" - "@opentelemetry/propagator-b3" "1.10.1" - "@opentelemetry/propagator-jaeger" "1.10.1" - "@opentelemetry/sdk-trace-base" "1.10.1" - semver "^7.3.5" +"@opentelemetry/otlp-transformer@0.48.0": + version "0.48.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/otlp-transformer/-/otlp-transformer-0.48.0.tgz#969d52a767c7538552b88f7baaa001d3f88feb17" + integrity sha512-yuoS4cUumaTK/hhxW3JUy3wl2U4keMo01cFDrUOmjloAdSSXvv1zyQ920IIH4lymp5Xd21Dj2/jq2LOro56TJg== + dependencies: + "@opentelemetry/api-logs" "0.48.0" + "@opentelemetry/core" "1.21.0" + "@opentelemetry/resources" "1.21.0" + "@opentelemetry/sdk-logs" "0.48.0" + "@opentelemetry/sdk-metrics" "1.21.0" + "@opentelemetry/sdk-trace-base" "1.21.0" + +"@opentelemetry/propagator-b3@1.21.0": + version "1.21.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/propagator-b3/-/propagator-b3-1.21.0.tgz#72fadc4a07afb2c83f0830b8a06071e0361eacb2" + integrity sha512-3ZTobj2VDIOzLsIvvYCdpw6tunxUVElPxDvog9lS49YX4hohHeD84A8u9Ns/6UYUcaN5GSoEf891lzhcBFiOLA== + dependencies: + "@opentelemetry/core" "1.21.0" + +"@opentelemetry/propagator-jaeger@1.21.0": + version "1.21.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/propagator-jaeger/-/propagator-jaeger-1.21.0.tgz#bfc1fa3a050496ec67a253040dfdec4d16339225" + integrity sha512-8TQSwXjBmaDx7JkxRD7hdmBmRK2RGRgzHX1ArJfJhIc5trzlVweyorzqQrXOvqVEdEg+zxUMHkL5qbGH/HDTPA== + dependencies: + "@opentelemetry/core" "1.21.0" + +"@opentelemetry/resources@1.21.0", "@opentelemetry/resources@^1.21.0": + version "1.21.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/resources/-/resources-1.21.0.tgz#e773e918cc8ca26493a987dfbfc6b8a315a2ab45" + integrity sha512-1Z86FUxPKL6zWVy2LdhueEGl9AHDJcx+bvHStxomruz6Whd02mE3lNUMjVJ+FGRoktx/xYQcxccYb03DiUP6Yw== + dependencies: + "@opentelemetry/core" "1.21.0" + "@opentelemetry/semantic-conventions" "1.21.0" + +"@opentelemetry/sdk-logs@0.48.0": + version "0.48.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-logs/-/sdk-logs-0.48.0.tgz#5248e4cbfc99bbee555ffd1a23b5db53d6553f2c" + integrity sha512-lRcA5/qkSJuSh4ItWCddhdn/nNbVvnzM+cm9Fg1xpZUeTeozjJDBcHnmeKoOaWRnrGYBdz6UTY6bynZR9aBeAA== + dependencies: + "@opentelemetry/core" "1.21.0" + "@opentelemetry/resources" "1.21.0" -"@opentelemetry/semantic-conventions@1.10.1", "@opentelemetry/semantic-conventions@^1.10.1": - version "1.10.1" - resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.10.1.tgz#b7a0f16d4131aee598e55814efea0ff11d99ef34" - integrity sha512-qiAueuCoN+1YEuHNXnsct9bkbroZBPd7QwQgd56YURG0LBRVHwE/lF6FOprfUvp1n1tu0O6+E3s6x+dmUndXFQ== +"@opentelemetry/sdk-metrics@1.21.0": + version "1.21.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-metrics/-/sdk-metrics-1.21.0.tgz#40d71aaec5b696e58743889ce6d5bf2593f9a23d" + integrity sha512-on1jTzIHc5DyWhRP+xpf+zrgrREXcHBH4EDAfaB5mIG7TWpKxNXooQ1JCylaPsswZUv4wGnVTinr4HrBdGARAQ== + dependencies: + "@opentelemetry/core" "1.21.0" + "@opentelemetry/resources" "1.21.0" + lodash.merge "^4.6.2" + +"@opentelemetry/sdk-trace-base@1.21.0": + version "1.21.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.21.0.tgz#ffad912e453a92044fb220bd5d2f6743bf37bb8a" + integrity sha512-yrElGX5Fv0umzp8Nxpta/XqU71+jCAyaLk34GmBzNcrW43nqbrqvdPs4gj4MVy/HcTjr6hifCDCYA3rMkajxxA== + dependencies: + "@opentelemetry/core" "1.21.0" + "@opentelemetry/resources" "1.21.0" + "@opentelemetry/semantic-conventions" "1.21.0" + +"@opentelemetry/sdk-trace-node@^1.21.0": + version "1.21.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-trace-node/-/sdk-trace-node-1.21.0.tgz#20599f42a6b59bf71c64ef8630d28464e6e18f2a" + integrity sha512-1pdm8jnqs+LuJ0Bvx6sNL28EhC8Rv7NYV8rnoXq3GIQo7uOHBDAFSj7makAfbakrla7ecO1FRfI8emnR4WvhYA== + dependencies: + "@opentelemetry/context-async-hooks" "1.21.0" + "@opentelemetry/core" "1.21.0" + "@opentelemetry/propagator-b3" "1.21.0" + "@opentelemetry/propagator-jaeger" "1.21.0" + "@opentelemetry/sdk-trace-base" "1.21.0" + semver "^7.5.2" + +"@opentelemetry/semantic-conventions@1.21.0", "@opentelemetry/semantic-conventions@^1.21.0": + version "1.21.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.21.0.tgz#83f7479c524ab523ac2df702ade30b9724476c72" + integrity sha512-lkC8kZYntxVKr7b8xmjCVUgE0a8xgDakPyDo9uSWavXPyYqLgYYGdEd2j8NxihRyb6UwpX3G/hFUF4/9q2V+/g== "@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": version "1.1.2" @@ -984,9 +1006,9 @@ integrity sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ== "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.7": - version "7.20.0" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.0.tgz#61bc5a4cae505ce98e1e36c5445e4bee060d8891" - integrity sha512-+n8dL/9GWblDO0iU6eZAwEIJVr5DWigtle+Q6HLOrh/pdbXOhOtqzq8VPPE2zvNJzSKY4vH/z3iT3tn0A3ypiQ== + version "7.20.5" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.5.tgz#3df15f27ba85319caa07ba08d0721889bb39c017" + integrity sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA== dependencies: "@babel/parser" "^7.20.7" "@babel/types" "^7.20.7" @@ -995,26 +1017,26 @@ "@types/babel__traverse" "*" "@types/babel__generator@*": - version "7.6.4" - resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.4.tgz#1f20ce4c5b1990b37900b63f050182d28c2439b7" - integrity sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg== + version "7.6.8" + resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.8.tgz#f836c61f48b1346e7d2b0d93c6dacc5b9535d3ab" + integrity sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw== dependencies: "@babel/types" "^7.0.0" "@types/babel__template@*": - version "7.4.1" - resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.4.1.tgz#3d1a48fd9d6c0edfd56f2ff578daed48f36c8969" - integrity sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g== + version "7.4.4" + resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.4.4.tgz#5672513701c1b2199bc6dad636a9d7491586766f" + integrity sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A== dependencies: "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" "@types/babel__traverse@*", "@types/babel__traverse@^7.0.4", "@types/babel__traverse@^7.0.6": - version "7.18.3" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.18.3.tgz#dfc508a85781e5698d5b33443416b6268c4b3e8d" - integrity sha512-1kbcJ40lLB7MHsj39U4Sh1uTd2E7rLEa79kmDpI6cy+XiXsteB3POdQomoq4FxszMrO3ZYchkhYJw7A2862b3w== + version "7.20.5" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.20.5.tgz#7b7502be0aa80cc4ef22978846b983edaafcd4dd" + integrity sha512-WXCyOcRtH37HAUkpXhUduaxdm82b4GSlyTqajXviN4EfiuPgNYR109xMCKvpl6zPIpua0DGlMEDCq+g8EdoheQ== dependencies: - "@babel/types" "^7.3.0" + "@babel/types" "^7.20.7" "@types/glob@^7.1.1": version "7.2.0" @@ -1030,28 +1052,28 @@ integrity sha512-pYVNNJ+winC4aek+lZp93sIKxnXt5qMkuKmaqS3WGuTq0Bw1ZDYNBgzG5kkdtwcv+GmYJGo3yEg6z2cKKAiEdw== "@types/graceful-fs@^4.1.2": - version "4.1.6" - resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.6.tgz#e14b2576a1c25026b7f02ede1de3b84c3a1efeae" - integrity sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw== + version "4.1.9" + resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.9.tgz#2a06bc0f68a20ab37b3e36aa238be6abdf49e8b4" + integrity sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ== dependencies: "@types/node" "*" "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz#8467d4b3c087805d63580480890791277ce35c44" - integrity sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g== + version "2.0.6" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz#7739c232a1fee9b4d3ce8985f314c0c6d33549d7" + integrity sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w== "@types/istanbul-lib-report@*": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#c14c24f18ea8190c118ee7562b7ff99a36552686" - integrity sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg== + version "3.0.3" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz#53047614ae72e19fc0401d872de3ae2b4ce350bf" + integrity sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA== dependencies: "@types/istanbul-lib-coverage" "*" "@types/istanbul-reports@^3.0.0": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz#9153fe98bba2bd565a63add9436d6f0d7f8468ff" - integrity sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw== + version "3.0.4" + resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz#0f03e3d2f670fbdac586e34b433783070cc16f54" + integrity sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ== dependencies: "@types/istanbul-lib-report" "*" @@ -1068,11 +1090,6 @@ resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== -"@types/long@^4.0.1": - version "4.0.2" - resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.2.tgz#b74129719fc8d11c01868010082d483b7545591a" - integrity sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA== - "@types/minimatch@*": version "5.1.2" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca" @@ -1083,15 +1100,22 @@ resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== -"@types/node@*", "@types/node@>=12.12.47", "@types/node@>=13.7.0": +"@types/node@*", "@types/node@^20.11.17": + version "20.11.17" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.17.tgz#cdd642d0e62ef3a861f88ddbc2b61e32578a9292" + integrity sha512-QmgQZGWu1Yw9TDyAP9ZzpFJKynYNeOvwMJmaxABfieQoVoiVOS6MN1WSpqpRcbeA5+RW82kraAVxCCJg+780Qw== + dependencies: + undici-types "~5.26.4" + +"@types/node@>=12.12.47", "@types/node@>=13.7.0": version "18.15.10" resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.10.tgz#4ee2171c3306a185d1208dad5f44dae3dee4cfe3" integrity sha512-9avDaQJczATcXgfmMAW3MIWArOO7A+m90vuCFLr8AotWf8igO/mRoYukrk2cqZVtv38tHs33retzHEilM7FpeQ== "@types/normalize-package-data@^2.4.0": - version "2.4.1" - resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301" - integrity sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw== + version "2.4.4" + resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz#56e2cc26c397c038fab0e3a917a12d5c5909e901" + integrity sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA== "@types/parse-json@^4.0.0": version "4.0.0" @@ -1099,24 +1123,29 @@ integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== "@types/prettier@^2.0.0": - version "2.7.2" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.2.tgz#6c2324641cc4ba050a8c710b2b251b377581fbf0" - integrity sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg== + version "2.7.3" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.3.tgz#3e51a17e291d01d17d3fc61422015a933af7a08f" + integrity sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA== + +"@types/shimmer@^1.0.2": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@types/shimmer/-/shimmer-1.0.5.tgz#491d8984d4510e550bfeb02d518791d7f59d2b88" + integrity sha512-9Hp0ObzwwO57DpLFF0InUjUm/II8GmKAvzbefxQTihCb7KI6yc9yzf0nLc4mVdby5N4DRCgQM2wCup9KTieeww== "@types/stack-utils@^2.0.0": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" - integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== + version "2.0.3" + resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.3.tgz#6209321eb2c1712a7e7466422b8cb1fc0d9dd5d8" + integrity sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw== "@types/yargs-parser@*": - version "21.0.0" - resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.0.tgz#0c60e537fa790f5f9472ed2776c2b71ec117351b" - integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA== + version "21.0.3" + resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.3.tgz#815e30b786d2e8f0dcd85fd5bcf5e1a04d008f15" + integrity sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ== "@types/yargs@^15.0.0": - version "15.0.15" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.15.tgz#e609a2b1ef9e05d90489c2f5f45bbfb2be092158" - integrity sha512-IziEYMU9XoVj8hWg7k+UJrXALkGFjWJhn5QFEv9q4p+v40oZhSuC135M38st8XPjICL7Ey4TV64ferBGUoJhBg== + version "15.0.19" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.19.tgz#328fb89e46109ecbdb70c295d96ff2f46dfd01b9" + integrity sha512-2XUaGVmyQjgyAZldf0D0c14vvo/yv0MhQBSTJcejMMaitsn3nxCB6TmH4G0ZQf+uxROOa9mpanoSm8h6SG/1ZA== dependencies: "@types/yargs-parser" "*" @@ -1216,6 +1245,11 @@ acorn-globals@^6.0.0: acorn "^7.1.1" acorn-walk "^7.1.1" +acorn-import-assertions@^1.9.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz#507276249d684797c84e0734ef84860334cfb1ac" + integrity sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA== + acorn-jsx@^5.3.1: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" @@ -1236,7 +1270,12 @@ acorn@^7.1.1, acorn@^7.4.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.2.4, acorn@^8.4.1: +acorn@^8.2.4, acorn@^8.8.2: + version "8.11.3" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" + integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== + +acorn@^8.4.1: version "8.8.2" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a" integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== @@ -1343,6 +1382,11 @@ anymatch@^3.0.3, anymatch@~3.1.2: resolved "https://registry.yarnpkg.com/aproba/-/aproba-2.0.0.tgz#52520b8ae5b569215b354efc0caa3fe1e45a8adc" integrity sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ== +are-docs-informative@^0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/are-docs-informative/-/are-docs-informative-0.0.2.tgz#387f0e93f5d45280373d387a59d34c96db321963" + integrity sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig== + are-we-there-yet@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz#372e0e7bd279d8e94c653aaa1f67200884bf3e1c" @@ -1589,15 +1633,15 @@ browser-process-hrtime@^1.0.0: resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== -browserslist@^4.21.3: - version "4.21.5" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.5.tgz#75c5dae60063ee641f977e00edd3cfb2fb7af6a7" - integrity sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w== +browserslist@^4.22.2: + version "4.22.3" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.22.3.tgz#299d11b7e947a6b843981392721169e27d60c5a6" + integrity sha512-UAp55yfwNv0klWNapjs/ktHoguxuQNGnOzxYmfnXIS+8AsRDZkSDxg7R1AX3GKzn078SBI5dzwzj/Yx0Or0e3A== dependencies: - caniuse-lite "^1.0.30001449" - electron-to-chromium "^1.4.284" - node-releases "^2.0.8" - update-browserslist-db "^1.0.10" + caniuse-lite "^1.0.30001580" + electron-to-chromium "^1.4.648" + node-releases "^2.0.14" + update-browserslist-db "^1.0.13" bs-logger@0.x: version "0.2.6" @@ -1618,6 +1662,11 @@ buffer-from@1.x, buffer-from@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== +builtin-modules@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.3.0.tgz#cae62812b89801e9656336e46223e030386be7b6" + integrity sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw== + bundle-require@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/bundle-require/-/bundle-require-4.0.1.tgz#2cc1ad76428043d15e0e7f30990ee3d5404aa2e3" @@ -1677,10 +1726,10 @@ camelcase@^6.0.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001449: - version "1.0.30001470" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001470.tgz#09c8e87c711f75ff5d39804db2613dd593feeb10" - integrity sha512-065uNwY6QtHCBOExzbV6m236DDhYCCtPmQUCoQtwkVqzud8v5QPidoMr6CoMkC2nfp6nksjttqWQRRh75LqUmA== +caniuse-lite@^1.0.30001580: + version "1.0.30001587" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001587.tgz#a0bce920155fa56a1885a69c74e1163fc34b4881" + integrity sha512-HMFNotUmLXn71BQxg8cijvqxnIAofforZOwGsxyXJ0qugTdspUF4sPSJ2vhgprHCB996tIDzEq1ubumPDV8ULA== capture-exit@^2.0.0: version "2.0.0" @@ -1741,6 +1790,11 @@ cjs-module-lexer@^0.6.0: resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-0.6.0.tgz#4186fcca0eae175970aee870b9fe2d6cf8d5655f" integrity sha512-uc2Vix1frTfnuzxxu1Hp4ktSvM3QaI4oXl4ZUqL1wjTu/BGki9TrCWoqLTg/drR1KwAEarXuRFCG2Svr1GxPFw== +cjs-module-lexer@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz#6c370ab19f8a3394e318fe682686ec0ac684d107" + integrity sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ== + class-utils@^0.3.5: version "0.3.6" resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" @@ -1798,6 +1852,15 @@ cliui@^7.0.2: strip-ansi "^6.0.0" wrap-ansi "^7.0.0" +cliui@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" + integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.1" + wrap-ansi "^7.0.0" + co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" @@ -1815,9 +1878,9 @@ codecov@^3.8.3: urlgrey "1.0.0" collect-v8-coverage@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz#cc2c8e94fc18bbdffe64d6534570c8a673b27f59" - integrity sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg== + version "1.0.2" + resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz#c0b29bcd33bcd0779a1344c2136051e6afd3d9e9" + integrity sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q== collection-visit@^1.0.0: version "1.0.0" @@ -1878,10 +1941,10 @@ commander@^6.2.0: resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c" integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA== -comment-parser@1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/comment-parser/-/comment-parser-1.3.1.tgz#3d7ea3adaf9345594aedee6563f422348f165c1b" - integrity sha512-B52sN2VNghyq5ofvUsqZjmk6YkihBX5vMSChmSK9v4ShjKf3Vk5Xcmgpw4o+iIgtrnM/u5FiMpz9VKb8lpBveA== +comment-parser@1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/comment-parser/-/comment-parser-1.4.1.tgz#bdafead37961ac079be11eb7ec65c4d021eaf9cc" + integrity sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg== compare-func@^2.0.0: version "2.0.0" @@ -1892,9 +1955,9 @@ compare-func@^2.0.0: dot-prop "^5.1.0" component-emitter@^1.2.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" - integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== + version "1.3.1" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.1.tgz#ef1d5796f7d93f135ee6fb684340b26403c97d17" + integrity sha512-T0+barUSQRTUQASh8bx02dl+DhF54GtIDY13Y3m9oWTklKbb3Wv974meRpeZ3lp1JpLVECWWNHC4vaG2XHXouQ== concat-map@0.0.1: version "0.0.1" @@ -2079,11 +2142,16 @@ conventional-recommended-bump@6.1.0: meow "^8.0.0" q "^1.5.1" -convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0: +convert-source-map@^1.4.0, convert-source-map@^1.6.0: version "1.9.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== +convert-source-map@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" + integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== + copy-descriptor@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" @@ -2227,7 +2295,7 @@ dedent@^0.7.0: resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" integrity sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA== -deep-is@^0.1.3, deep-is@~0.1.3: +deep-is@^0.1.3: version "0.1.4" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== @@ -2351,10 +2419,10 @@ dotgitignore@^2.1.0: find-up "^3.0.0" minimatch "^3.0.4" -electron-to-chromium@^1.4.284: - version "1.4.341" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.341.tgz#ab31e9e57ef7758a14c7a7977a1978d599514470" - integrity sha512-R4A8VfUBQY9WmAhuqY5tjHRf5fH2AAf6vqitBOE0y6u2PgHgqHSrhZmu78dIX3fVZtjqlwJNX1i2zwC3VpHtQQ== +electron-to-chromium@^1.4.648: + version "1.4.667" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.667.tgz#2767d998548e5eeeaf8bdaffd67b56796bfbed3d" + integrity sha512-66L3pLlWhTNVUhnmSA5+qDM3fwnXsM6KAqE36e2w4KN0g6pkEtlT5bs41FQtQwVwKnfhNBXiWRLPs30HSxd7Kw== emittery@^0.7.1: version "0.7.2" @@ -2484,9 +2552,9 @@ esbuild@^0.17.6: "@esbuild/win32-x64" "0.17.14" escalade@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" - integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + version "3.1.2" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.2.tgz#54076e9ab29ea5bf3d8f1ed62acffbb88272df27" + integrity sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA== escape-string-regexp@^1.0.5: version "1.0.5" @@ -2504,29 +2572,30 @@ escape-string-regexp@^4.0.0: integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== escodegen@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-2.0.0.tgz#5e32b12833e8aa8fa35e1bf0befa89380484c7dd" - integrity sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw== + version "2.1.0" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-2.1.0.tgz#ba93bbb7a43986d29d6041f99f5262da773e2e17" + integrity sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w== dependencies: esprima "^4.0.1" estraverse "^5.2.0" esutils "^2.0.2" - optionator "^0.8.1" optionalDependencies: source-map "~0.6.1" -eslint-plugin-jsdoc@^40.1.0: - version "40.1.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-40.1.0.tgz#fec2f649a60167fa5a94f05ce2c6c041caaab129" - integrity sha512-ANvrhiu62VlSorARM0hup60VQsS3hNyp0Ca7cnJDj8tpJzM7tNhBVqMVYXSuLzEmqrpwx6aAh+NAN2DdAGG5fQ== +eslint-plugin-jsdoc@^46.9.1: + version "46.9.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-46.9.1.tgz#d30adce51fecc768e87481bf4de46b8618c3d50e" + integrity sha512-11Ox5LCl2wY7gGkp9UOyew70o9qvii1daAH+h/MFobRVRNcy7sVlH+jm0HQdgcvcru6285GvpjpUyoa051j03Q== dependencies: - "@es-joy/jsdoccomment" "~0.37.0" - comment-parser "1.3.1" + "@es-joy/jsdoccomment" "~0.41.0" + are-docs-informative "^0.0.2" + comment-parser "1.4.1" debug "^4.3.4" escape-string-regexp "^4.0.0" esquery "^1.5.0" - semver "^7.3.8" - spdx-expression-parse "^3.0.1" + is-builtin-module "^3.2.1" + semver "^7.5.4" + spdx-expression-parse "^4.0.0" eslint-scope@^5.1.1: version "5.1.1" @@ -2777,7 +2846,7 @@ fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0: resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== -fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6: +fast-levenshtein@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== @@ -2933,15 +3002,20 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== -fsevents@^2.1.2, fsevents@~2.3.2: +fsevents@^2.1.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== + +fsevents@~2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== +function-bind@^1.1.1, function-bind@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" + integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== function.prototype.name@^1.1.5: version "1.1.5" @@ -3299,11 +3373,16 @@ has-values@^1.0.0: kind-of "^4.0.0" has@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + version "1.0.4" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.4.tgz#2eb2860e000011dae4f1406a86fe80e530fb2ec6" + integrity sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ== + +hasown@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.1.tgz#26f48f039de2c0f8d3356c223fb8d50253519faa" + integrity sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA== dependencies: - function-bind "^1.1.1" + function-bind "^1.1.2" hosted-git-info@^2.1.4: version "2.8.9" @@ -3393,6 +3472,16 @@ import-fresh@^3.0.0, import-fresh@^3.2.1: parent-module "^1.0.0" resolve-from "^4.0.0" +import-in-the-middle@1.7.1: + version "1.7.1" + resolved "https://registry.yarnpkg.com/import-in-the-middle/-/import-in-the-middle-1.7.1.tgz#3e111ff79c639d0bde459bd7ba29dd9fdf357364" + integrity sha512-1LrZPDtW+atAxH42S6288qyDFNQ2YCty+2mxEPRtfazH6Z5QwkaBSTS2ods7hnVJioF6rkRfNoA6A/MstpFXLg== + dependencies: + acorn "^8.8.2" + acorn-import-assertions "^1.9.0" + cjs-module-lexer "^1.2.2" + module-details-from-path "^1.0.3" + import-local@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.1.0.tgz#b4479df8a5fd44f6cdce24070675676063c95cb4" @@ -3438,19 +3527,12 @@ internal-slot@^1.0.5: has "^1.0.3" side-channel "^1.0.4" -is-accessor-descriptor@^0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" - integrity sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A== - dependencies: - kind-of "^3.0.2" - -is-accessor-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" - integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== +is-accessor-descriptor@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.1.tgz#3223b10628354644b86260db29b3e693f5ceedd4" + integrity sha512-YBUanLI8Yoihw923YeFUS5fs0fF2f5TSFTNiYAAzhhDscDa3lEqYuz1pDOEP5KvX94I9ey3vsqjJcLVFVU+3QA== dependencies: - kind-of "^6.0.0" + hasown "^2.0.0" is-array-buffer@^3.0.1, is-array-buffer@^3.0.2: version "3.0.2" @@ -3493,6 +3575,13 @@ is-buffer@^1.1.5: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== +is-builtin-module@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-3.2.1.tgz#f03271717d8654cfcaf07ab0463faa3571581169" + integrity sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A== + dependencies: + builtin-modules "^3.3.0" + is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.7: version "1.2.7" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" @@ -3505,26 +3594,26 @@ is-ci@^2.0.0: dependencies: ci-info "^2.0.0" -is-core-module@^2.5.0, is-core-module@^2.9.0: +is-core-module@^2.13.0, is-core-module@^2.9.0: + version "2.13.1" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.1.tgz#ad0d7532c6fea9da1ebdc82742d74525c6273384" + integrity sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw== + dependencies: + hasown "^2.0.0" + +is-core-module@^2.5.0: version "2.11.0" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.11.0.tgz#ad4cb3e3863e814523c96f3f58d26cc570ff0144" integrity sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw== dependencies: has "^1.0.3" -is-data-descriptor@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" - integrity sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg== - dependencies: - kind-of "^3.0.2" - -is-data-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" - integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== +is-data-descriptor@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.1.tgz#2109164426166d32ea38c405c1e0945d9e6a4eeb" + integrity sha512-bc4NlCDiCr28U4aEsQ3Qs2491gVq4V8G7MQyws968ImqjKuYtTJXrl7Vq7jsN7Ly/C3xj5KWFrY7sHNeDkAzXw== dependencies: - kind-of "^6.0.0" + hasown "^2.0.0" is-date-object@^1.0.1: version "1.0.5" @@ -3534,22 +3623,20 @@ is-date-object@^1.0.1: has-tostringtag "^1.0.0" is-descriptor@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" - integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== + version "0.1.7" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.7.tgz#2727eb61fd789dcd5bdf0ed4569f551d2fe3be33" + integrity sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg== dependencies: - is-accessor-descriptor "^0.1.6" - is-data-descriptor "^0.1.4" - kind-of "^5.0.0" + is-accessor-descriptor "^1.0.1" + is-data-descriptor "^1.0.1" is-descriptor@^1.0.0, is-descriptor@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" - integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.3.tgz#92d27cb3cd311c4977a4db47df457234a13cb306" + integrity sha512-JCNNGbwWZEVaSPtS45mdtrneRWJFp07LLmykxeFV5F6oBvNF8vHSfJuJgoT472pSfk+Mf8VnlrspaFBHWM8JAw== dependencies: - is-accessor-descriptor "^1.0.0" - is-data-descriptor "^1.0.0" - kind-of "^6.0.2" + is-accessor-descriptor "^1.0.1" + is-data-descriptor "^1.0.1" is-docker@^2.0.0: version "2.2.1" @@ -3760,9 +3847,9 @@ isobject@^3.0.0, isobject@^3.0.1: integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg== istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz#189e7909d0a39fa5a3dfad5b03f71947770191d3" - integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw== + version "3.2.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz#2d166c4b0644d43a39f04bf6c2edd1e585f31756" + integrity sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg== istanbul-lib-instrument@^4.0.3: version "4.0.3" @@ -3786,12 +3873,12 @@ istanbul-lib-instrument@^5.0.4: semver "^6.3.0" istanbul-lib-report@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#7518fe52ea44de372f460a76b5ecda9ffb73d8a6" - integrity sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw== + version "3.0.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz#908305bac9a5bd175ac6a74489eafd0fc2445a7d" + integrity sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw== dependencies: istanbul-lib-coverage "^3.0.0" - make-dir "^3.0.0" + make-dir "^4.0.0" supports-color "^7.1.0" istanbul-lib-source-maps@^4.0.0: @@ -3804,9 +3891,9 @@ istanbul-lib-source-maps@^4.0.0: source-map "^0.6.1" istanbul-reports@^3.0.2: - version "3.1.5" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.5.tgz#cc9a6ab25cb25659810e4785ed9d9fb742578bae" - integrity sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w== + version "3.1.6" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.6.tgz#2544bcab4768154281a2f0870471902704ccaa1a" + integrity sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg== dependencies: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" @@ -4280,7 +4367,7 @@ json-stringify-safe@^5.0.1: resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== -json5@2.x, json5@^2.2.2: +json5@2.x, json5@^2.2.2, json5@^2.2.3: version "2.2.3" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== @@ -4311,12 +4398,7 @@ kind-of@^4.0.0: dependencies: is-buffer "^1.1.5" -kind-of@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" - integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== - -kind-of@^6.0.0, kind-of@^6.0.2, kind-of@^6.0.3: +kind-of@^6.0.2, kind-of@^6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== @@ -4339,14 +4421,6 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" -levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - integrity sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA== - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - license-check-and-add@^4.0.2: version "4.0.5" resolved "https://registry.yarnpkg.com/license-check-and-add/-/license-check-and-add-4.0.5.tgz#ef820a78d59248327565ab5b7dec16776ac1ea4b" @@ -4479,7 +4553,7 @@ lodash.ismatch@^4.4.0: resolved "https://registry.yarnpkg.com/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz#756cb5150ca3ba6f11085a78849645f188f85f37" integrity sha512-fPMfXjGQEV9Xsq/8MTSgUf255gawYRbjwMyDbcvDhXgV7enSZA0hynz6vMPnpAb5iONEzBHBPsT+0zes5Z301g== -lodash.merge@4.6.2, lodash.merge@^4.6.2: +lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== @@ -4517,11 +4591,6 @@ log-update@^4.0.0: slice-ansi "^4.0.0" wrap-ansi "^6.2.0" -long@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" - integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== - long@^5.0.0: version "5.2.1" resolved "https://registry.yarnpkg.com/long/-/long-5.2.1.tgz#e27595d0083d103d2fa2c20c7699f8e0c92b897f" @@ -4541,13 +4610,20 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" -make-dir@^3.0.0, make-dir@^3.1.0: +make-dir@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== dependencies: semver "^6.0.0" +make-dir@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-4.0.0.tgz#c3c2307a771277cd9638305f915c29ae741b614e" + integrity sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw== + dependencies: + semver "^7.5.3" + make-error@1.x, make-error@^1.1.1: version "1.3.6" resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" @@ -4809,10 +4885,10 @@ node-notifier@^8.0.0: uuid "^8.3.0" which "^2.0.2" -node-releases@^2.0.8: - version "2.0.10" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.10.tgz#c311ebae3b6a148c89b1813fd7c4d3c024ef537f" - integrity sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w== +node-releases@^2.0.14: + version "2.0.14" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.14.tgz#2ffb053bceb8b2be8495ece1ab6ce600c4461b0b" + integrity sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw== nopt@^5.0.0: version "5.0.0" @@ -4893,9 +4969,9 @@ null-check@^1.0.0: integrity sha512-j8ZNHg19TyIQOWCGeeQJBuu6xZYIEurf8M1Qsfd8mFrGEfIZytbw18YjKWg+LcO25NowXGZXZpKAx+Ui3TFfDw== nwsapi@^2.2.0: - version "2.2.2" - resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.2.tgz#e5418863e7905df67d51ec95938d67bf801f0bb0" - integrity sha512-90yv+6538zuvUMnN+zCr8LuV6bPFdq50304114vJYJ8RDyK8D5O9Phpbd6SZWgI7PwzmmfN1upeOJlvybDSgCw== + version "2.2.7" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.7.tgz#738e0707d3128cb750dddcfe90e4610482df0f30" + integrity sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ== object-assign@^4.0.1, object-assign@^4.1.1: version "4.1.1" @@ -4969,18 +5045,6 @@ onetime@^5.1.0, onetime@^5.1.2: dependencies: mimic-fn "^2.1.0" -optionator@^0.8.1: - version "0.8.3" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" - integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== - dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.6" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - word-wrap "~1.2.3" - optionator@^0.9.1: version "0.9.1" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" @@ -5167,9 +5231,9 @@ pify@^3.0.0: integrity sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg== pirates@^4.0.1: - version "4.0.5" - resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.5.tgz#feec352ea5c3268fb23a37c702ab1699f35a5f3b" - integrity sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ== + version "4.0.6" + resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.6.tgz#3018ae32ecfcff6c29ba2267cbf21166ac1f36b9" + integrity sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg== pkg-dir@^4.2.0: version "4.2.0" @@ -5212,11 +5276,6 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - integrity sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w== - prettier@^2.2.1: version "2.8.7" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.7.tgz#bb79fc8729308549d28fe3a98fce73d2c0656450" @@ -5250,10 +5309,10 @@ prompts@^2.0.1: kleur "^3.0.3" sisteransi "^1.0.5" -protobufjs@^7.0.0: - version "7.2.3" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.2.3.tgz#01af019e40d9c6133c49acbb3ff9e30f4f0f70b2" - integrity sha512-TtpvOqwB5Gdz/PQmOjgsrGH1nHjAQVCN7JG4A6r1sXRWESL5rNMAiRcBQlCAdKxZcAbstExQePYG8xof/JVRgg== +protobufjs@^7.2.4: + version "7.2.6" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.2.6.tgz#4a0ccd79eb292717aacf07530a07e0ed20278215" + integrity sha512-dgJaEDDL6x8ASUZ1YqWciTRrdOuYNzoOf27oHNfdyvKqHr5i0FV7FSLU+aIeFjyFgVxrpTOtQUi0BLLBymZaBw== dependencies: "@protobufjs/aspromise" "^1.1.2" "@protobufjs/base64" "^1.1.2" @@ -5286,11 +5345,16 @@ punycode@^1.3.2: resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" integrity sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ== -punycode@^2.1.0, punycode@^2.1.1: +punycode@^2.1.0: version "2.3.0" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.0.tgz#f67fa67c94da8f4d0cfff981aee4118064199b8f" integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== +punycode@^2.1.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" + integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== + q@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" @@ -5465,10 +5529,10 @@ require-from-string@^2.0.2: resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== -require-in-the-middle@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/require-in-the-middle/-/require-in-the-middle-6.0.0.tgz#01cc6416286fb5e672d0fe031d996f8bc202509d" - integrity sha512-+dtWQ7l2lqQDxheaG3jjyN1QI37gEwvzACSgjYi4/C2y+ZTUMeRW8BIOm+9NBKvwaMBUSZfPXVOt1skB0vBkRw== +require-in-the-middle@^7.1.1: + version "7.2.0" + resolved "https://registry.yarnpkg.com/require-in-the-middle/-/require-in-the-middle-7.2.0.tgz#b539de8f00955444dc8aed95e17c69b0a4f10fcf" + integrity sha512-3TLx5TGyAY6AOqLBoXmHkNql0HIf2RGbuMgCDT2WO/uGVAPJs6h7Kl+bN6TIZGd9bWhWPwnDnTHGtW8Iu77sdw== dependencies: debug "^4.1.1" module-details-from-path "^1.0.3" @@ -5506,7 +5570,16 @@ resolve-url@^0.2.1: resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg== -resolve@^1.10.0, resolve@^1.18.1, resolve@^1.22.1: +resolve@^1.10.0, resolve@^1.18.1: + version "1.22.8" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" + integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== + dependencies: + is-core-module "^2.13.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + +resolve@^1.22.1: version "1.22.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== @@ -5630,21 +5703,35 @@ semver-compare@^1.0.0: integrity sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow== "semver@2 || 3 || 4 || 5", semver@^5.5.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + version "5.7.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" + integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== -semver@7.x, semver@^7.1.1, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.8: +semver@7.x, semver@^7.1.1, semver@^7.2.1, semver@^7.3.4, semver@^7.3.5: version "7.3.8" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A== dependencies: lru-cache "^6.0.0" -semver@^6.0.0, semver@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== +semver@^6.0.0, semver@^6.3.0, semver@^6.3.1: + version "6.3.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" + integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== + +semver@^7.3.2, semver@^7.5.2, semver@^7.5.3: + version "7.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.0.tgz#1a46a4db4bffcccd97b743b5005c8325f23d4e2d" + integrity sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg== + dependencies: + lru-cache "^6.0.0" + +semver@^7.5.4: + version "7.5.4" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" + integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== + dependencies: + lru-cache "^6.0.0" set-blocking@^2.0.0: version "2.0.0" @@ -5836,11 +5923,11 @@ spdx-correct@^3.0.0: spdx-license-ids "^3.0.0" spdx-exceptions@^2.1.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d" - integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== + version "2.4.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.4.0.tgz#c07a4ede25b16e4f78e6707bbd84b15a45c19c1b" + integrity sha512-hcjppoJ68fhxA/cjbN4T8N6uCUejN8yFw69ttpqtBeCbF3u13n7mb31NB9jKwGTTWWnt9IbRA/mf1FprYS8wfw== -spdx-expression-parse@^3.0.0, spdx-expression-parse@^3.0.1: +spdx-expression-parse@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== @@ -5848,6 +5935,14 @@ spdx-expression-parse@^3.0.0, spdx-expression-parse@^3.0.1: spdx-exceptions "^2.1.0" spdx-license-ids "^3.0.0" +spdx-expression-parse@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-4.0.0.tgz#a23af9f3132115465dac215c099303e4ceac5794" + integrity sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ== + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + spdx-expression-validate@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/spdx-expression-validate/-/spdx-expression-validate-2.0.0.tgz#25c9408e1c63fad94fff5517bb7101ffcd23350b" @@ -5856,9 +5951,9 @@ spdx-expression-validate@^2.0.0: spdx-expression-parse "^3.0.0" spdx-license-ids@^3.0.0: - version "3.0.13" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.13.tgz#7189a474c46f8d47c7b0da4b987bb45e908bd2d5" - integrity sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w== + version "3.0.17" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.17.tgz#887da8aa73218e51a1d917502d79863161a93f9c" + integrity sha512-sh8PWc/ftMqAAdFiBu6Fy6JUOYjqDJBJvIhpfDMyHrr0Rbp5liZqd4TjtQ/RgfLjKFZb+LMx5hpml5qOWy0qvg== spdx-osi@^3.0.0: version "3.0.0" @@ -6270,9 +6365,9 @@ to-regex@^3.0.1, to-regex@^3.0.2: safe-regex "^1.1.0" tough-cookie@^4.0.0: - version "4.1.2" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.2.tgz#e53e84b85f24e0b65dd526f46628db6c85f6b874" - integrity sha512-G9fqXWoYFZgTc2z8Q5zaHy/vJMjm+WV0AkAeHxVCQiEB1b+dGvWzFW6QV07cY5jQ5gRkeid2qIkzkxUnmoQZUQ== + version "4.1.3" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.3.tgz#97b9adb0728b42280aa3d814b6b999b2ff0318bf" + integrity sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw== dependencies: psl "^1.1.33" punycode "^2.1.1" @@ -6408,13 +6503,6 @@ type-check@^0.4.0, type-check@~0.4.0: dependencies: prelude-ls "^1.2.1" -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - integrity sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg== - dependencies: - prelude-ls "~1.1.2" - type-detect@4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" @@ -6486,6 +6574,11 @@ unbox-primitive@^1.0.2: has-symbols "^1.0.3" which-boxed-primitive "^1.0.2" +undici-types@~5.26.4: + version "5.26.5" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" + integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== + union-value@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" @@ -6514,10 +6607,10 @@ unset-value@^1.0.0: has-value "^0.3.1" isobject "^3.0.0" -update-browserslist-db@^1.0.10: - version "1.0.10" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz#0f54b876545726f17d00cd9a2561e6dade943ff3" - integrity sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ== +update-browserslist-db@^1.0.13: + version "1.0.13" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz#3c5e4f5c083661bd38ef64b6328c26ed6c8248c4" + integrity sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg== dependencies: escalade "^3.1.1" picocolors "^1.0.0" @@ -6689,9 +6782,9 @@ which-boxed-primitive@^1.0.2: is-symbol "^1.0.3" which-module@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" - integrity sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q== + version "2.0.1" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.1.tgz#776b1fe35d90aebe99e8ac15eb24093389a4a409" + integrity sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ== which-typed-array@^1.1.9: version "1.1.9" @@ -6726,7 +6819,7 @@ wide-align@^1.1.2: dependencies: string-width "^1.0.2 || 2 || 3 || 4" -word-wrap@^1.2.3, word-wrap@~1.2.3: +word-wrap@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== @@ -6844,6 +6937,11 @@ yargs-parser@^18.1.2: camelcase "^5.0.0" decamelize "^1.2.0" +yargs-parser@^21.1.1: + version "21.1.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" + integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== + yargs@^13.3.0: version "13.3.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd" @@ -6890,6 +6988,19 @@ yargs@^16.0.0, yargs@^16.2.0: y18n "^5.0.5" yargs-parser "^20.2.2" +yargs@^17.7.2: + version "17.7.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" + integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== + dependencies: + cliui "^8.0.1" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.3" + y18n "^5.0.5" + yargs-parser "^21.1.1" + yn@3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50"