diff --git a/README.md b/README.md index f19ee39e..3e1f3be2 100644 --- a/README.md +++ b/README.md @@ -5,21 +5,20 @@

- Build nitric applications with Node.js + Build Nitric applications with Node.js

- Tests - codecov + codecov - Version + Version - Downloads/week + Downloads/week - Discord + Discord

The NodeJS SDK supports the use of the Nitric framework with NodeJS 12+. For more information, check out the main [Nitric repo](https://github.com/nitrictech/nitric). diff --git a/assets/nitric-logo.svg b/assets/nitric-logo.svg index 2409c1b7..f25ad168 100644 --- a/assets/nitric-logo.svg +++ b/assets/nitric-logo.svg @@ -1,14 +1,11 @@ - - - + + + + + - - - - - - - - + + + diff --git a/package.json b/package.json index 1ae7eb12..43ea9a47 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@nitric/sdk", "description": "Nitric NodeJS client sdk", - "nitric": "v0.22.0", + "nitric": "v0.27.0", "author": "Nitric ", "repository": "https://github.com/nitrictech/node-sdk", "main": "lib/index.js", diff --git a/src/api/storage/v0/storage.test.ts b/src/api/storage/v0/storage.test.ts index 489c5c6a..688d7339 100644 --- a/src/api/storage/v0/storage.test.ts +++ b/src/api/storage/v0/storage.test.ts @@ -11,7 +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 { FileMode, Storage } from './storage'; +import { Bucket, FileMode, Storage } from './storage'; import { StorageServiceClient as GrpcStorageClient } from '@nitric/api/proto/storage/v1/storage_grpc_pb'; import { StorageWriteResponse, @@ -23,6 +23,15 @@ import { File, } from '@nitric/api/proto/storage/v1/storage_pb'; import { UnimplementedError } from '../../errors'; +import { + BucketNotificationType, + BucketNotificationWorkerOptions, + 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'; describe('Storage Client Tests', () => { describe('Given nitric.api.storage.StorageClient.Write throws an error', () => { @@ -422,3 +431,152 @@ describe('Storage Client Tests', () => { }); }); }); + +jest.mock('../../../faas/index'); + +describe('bucket notification', () => { + const startSpy = jest + .spyOn(faas.Faas.prototype, 'start') + .mockReturnValue(Promise.resolve()); + const mockFn = jest.fn(); + + afterAll(() => { + jest.clearAllMocks(); + }); + + describe('When registering a bucket notification for creating', () => { + afterAll(() => { + jest.resetAllMocks(); + }); + + beforeAll(async () => { + 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); + }); + }); + + describe('When registering a bucket notification for deleting', () => { + afterAll(() => { + jest.resetAllMocks(); + }); + + beforeAll(async () => { + 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); + }); + }); +}); + +describe('file notification', () => { + const startSpy = jest + .spyOn(faas.Faas.prototype, 'start') + .mockReturnValue(Promise.resolve()); + + const existsSpy = jest + .spyOn(ResourceServiceClient.prototype, 'declare') + .mockImplementation((_, callback: any) => { + const response = new ResourceDeclareResponse(); + callback(null, response); + return null as any; + }); + + const mockFn = jest.fn(); + + describe('When registering a file notification for creating', () => { + let bucketResource: Bucket; + beforeAll(async () => { + 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); + }); + }); + + describe('When registering a file notification for deleting', () => { + let bucketResource: Bucket; + beforeAll(async () => { + 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/v0/storage.ts index 9e9cf816..c3ce16f7 100644 --- a/src/api/storage/v0/storage.ts +++ b/src/api/storage/v0/storage.ts @@ -22,6 +22,15 @@ import { } from '@nitric/api/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'; /** * Nitric storage client, facilitates writing and reading from blob storage (buckets). @@ -56,7 +65,7 @@ export class Storage { * A reference to a storage bucket. */ export class Bucket { - storage: Storage; + private storage: Storage; name: string; constructor(storage: Storage, name: string) { @@ -97,6 +106,28 @@ export class Bucket { } return new File(this.storage, this, name); } + + /** + * Register and start a bucket notification handler that will be called for all matching notification events on this bucket + * + * @param notificationType the notification type that should trigger the middleware, either 'write' or 'delete' + * @param notificationPrefixFilter the file name prefix that files must match to trigger a notification + * @param middleware handler middleware which will be run for every incoming event + * @returns Promise which resolves when the handler server terminates + */ + on( + notificationType: BucketNotificationType, + notificationPrefixFilter: string, + ...middleware: FileNotificationMiddleware[] + ): Promise { + const notification = new FileNotification( + this, + notificationType, + notificationPrefixFilter, + ...middleware + ); + return notification['start'](); + } } export enum FileMode { diff --git a/src/faas/v0/context.test.ts b/src/faas/v0/context.test.ts index 3385b8ea..f9e2c31d 100644 --- a/src/faas/v0/context.test.ts +++ b/src/faas/v0/context.test.ts @@ -19,7 +19,7 @@ import { QueryValue, TriggerResponse, } from '@nitric/api/proto/faas/v1/faas_pb'; -import { TriggerContext, HttpContext, EventContext } from './context'; +import { TriggerContext, HttpContext, EventContext } from '.'; describe('NitricTrigger.fromGrpcTriggerRequest', () => { describe('From a HttpTriggerRequest', () => { @@ -39,6 +39,9 @@ describe('NitricTrigger.fromGrpcTriggerRequest', () => { 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); @@ -69,6 +72,7 @@ describe('NitricTrigger.fromGrpcTriggerRequest', () => { 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', () => { diff --git a/src/faas/v0/context.ts b/src/faas/v0/context.ts index aa716e28..f59835b3 100644 --- a/src/faas/v0/context.ts +++ b/src/faas/v0/context.ts @@ -14,13 +14,25 @@ import { TriggerRequest, TriggerResponse, - TopicResponseContext, - HttpResponseContext, - HeaderValue, TraceContext, + HeaderValue, + HttpResponseContext, + NotificationResponseContext, + TopicResponseContext, + BucketNotificationType as ProtoBucketNotificationType, } 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, @@ -47,6 +59,15 @@ export abstract class TriggerContext< return undefined; } + /** + * Noop base context bucketNotification method + * + * @returns undefined + */ + public get bucketNotification(): BucketNotificationContext | undefined { + return undefined; + } + /** * Return the request object from this context. * @@ -67,13 +88,25 @@ export abstract class TriggerContext< // Instantiate a concrete TriggerContext from the gRPC trigger model static fromGrpcTriggerRequest( - trigger: TriggerRequest + 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 + ); } throw new Error('Unsupported trigger request type'); } @@ -83,6 +116,8 @@ export abstract class TriggerContext< return HttpContext.toGrpcTriggerResponse(ctx); } else if (ctx.event) { return EventContext.toGrpcTriggerResponse(ctx); + } else if (ctx.bucketNotification) { + return BucketNotificationContext.toGrpcTriggerResponse(ctx); } throw new Error('Unsupported trigger context type'); @@ -102,6 +137,12 @@ export abstract class AbstractRequest< 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' @@ -111,13 +152,19 @@ export abstract class AbstractRequest< return stringPayload; } + /** + * Deserialize the request payload from JSON + * + * @returns JSON parsed request body + */ json(): JSONT { // attempt to deserialize as a JSON object - return this.text() ? JSON.parse(this.text()) : {}; + const textBody = this.text(); + return textBody ? JSON.parse(textBody) : undefined; } } -interface EventResponse { +export interface EventResponse { success: boolean; } @@ -202,23 +249,33 @@ export class EventRequest extends AbstractRequest { } // Propagate the context to the root context -const getTraceContext = (traceContext: TraceContext): api.Context => { - const traceContextObject: Record = traceContext - ? traceContext - .getValuesMap() - .toObject() - .reduce((prev, [k, v]) => (prev[k] = v), {}) +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): HttpContext { + static fromGrpcTriggerRequest( + trigger: TriggerRequest, + options?: ApiWorkerOptions + ): HttpContext { const http = trigger.getHttp(); const ctx = new HttpContext(); @@ -245,7 +302,10 @@ export class HttpContext extends TriggerContext { ).reduce( (acc, [key, [val]]) => ({ ...acc, - [key]: val.length === 1 ? val[0] : val, + [key]: + val.length === 1 + ? decodeURIComponent(val[0]) + : val.map((v) => decodeURIComponent(v)), }), {} ); @@ -269,7 +329,7 @@ export class HttpContext extends TriggerContext { .reduce( (acc, [key, val]) => ({ ...acc, - [key]: val, + [key]: decodeURIComponent(val), }), {} ); @@ -368,7 +428,8 @@ export class EventContext extends TriggerContext< } static fromGrpcTriggerRequest( - trigger: TriggerRequest + trigger: TriggerRequest, + options?: SubscriptionWorkerOptions ): EventContext { const topic = trigger.getTopic(); const ctx = new EventContext(); @@ -395,3 +456,142 @@ export class EventContext extends TriggerContext< 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; +} diff --git a/src/faas/v0/handler.ts b/src/faas/v0/handler.ts index efce4dbf..816dd3c1 100644 --- a/src/faas/v0/handler.ts +++ b/src/faas/v0/handler.ts @@ -12,7 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. import { NitricEvent } from '../../types'; -import { TriggerContext, HttpContext, EventContext } from '.'; +import { + TriggerContext, + HttpContext, + EventContext, + BucketNotificationContext, + FileNotificationContext, +} from '.'; export type GenericHandler = (ctx: Ctx) => Promise | Ctx; @@ -33,6 +39,10 @@ export type EventMiddleware< T extends Record = Record > = GenericMiddleware>>; export type ScheduleMiddleware = GenericMiddleware>; +export type BucketNotificationMiddleware = + GenericMiddleware; +export type FileNotificationMiddleware = + GenericMiddleware; /** * createHandler diff --git a/src/faas/v0/start.ts b/src/faas/v0/start.ts index 937aca9a..d9ed1957 100644 --- a/src/faas/v0/start.ts +++ b/src/faas/v0/start.ts @@ -29,6 +29,9 @@ import { ApiWorker, ApiWorkerOptions as ApiWorkerOptionsPb, ApiWorkerScopes, + NotificationResponseContext, + BucketNotificationWorker, + BucketNotificationConfig, } from '@nitric/api/proto/faas/v1/faas_pb'; import { @@ -37,8 +40,10 @@ import { GenericMiddleware, HttpMiddleware, ScheduleMiddleware, + BucketNotificationMiddleware, TriggerContext, TriggerMiddleware, + FileNotificationMiddleware, } from '.'; import newTracerProvider from './traceProvider'; @@ -48,17 +53,19 @@ import { CronWorkerOptions, RateWorkerOptions, SubscriptionWorkerOptions, + BucketNotificationWorkerOptions, } from '../../resources'; import * as grpc from '@grpc/grpc-js'; -class FaasWorkerOptions {} +export class FaasWorkerOptions {} type FaasClientOptions = | ApiWorkerOptions | RateWorkerOptions | CronWorkerOptions - | FaasWorkerOptions; + | FaasWorkerOptions + | BucketNotificationWorkerOptions; /** * @@ -66,6 +73,9 @@ type FaasClientOptions = export class Faas { private httpHandler?: HttpMiddleware; private eventHandler?: EventMiddleware | ScheduleMiddleware; + private bucketNotificationHandler?: + | BucketNotificationMiddleware + | FileNotificationMiddleware; private anyHandler?: TriggerMiddleware; private readonly options: FaasClientOptions; @@ -95,6 +105,19 @@ export class Faas { 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 * @@ -113,6 +136,19 @@ export class Faas { 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; + } + /** * Start the Faas server * @@ -123,7 +159,12 @@ export class Faas { const provider = newTracerProvider(); this.anyHandler = handlers.length && createHandler(...handlers); - if (!this.httpHandler && !this.eventHandler && !this.anyHandler) { + if ( + !this.httpHandler && + !this.eventHandler && + !this.bucketNotificationHandler && + !this.anyHandler + ) { throw new Error('A handler function must be provided.'); } @@ -150,7 +191,10 @@ export class Faas { responseMessage.setId(message.getId()); try { - const ctx = TriggerContext.fromGrpcTriggerRequest(triggerRequest); + const ctx = TriggerContext.fromGrpcTriggerRequest( + triggerRequest, + this.options + ); let handler: GenericMiddleware = undefined; let triggerType = 'Unknown'; @@ -162,6 +206,10 @@ export class Faas { triggerType = 'Event'; handler = this.getEventHandler() as GenericMiddleware; + } else if (ctx.bucketNotification) { + triggerType = 'Notification'; + handler = + this.getBucketNotificationHandler() as GenericMiddleware; } else { console.error( `received an unexpected trigger type, are you using an outdated version of the SDK?` @@ -202,6 +250,10 @@ export class Faas { const topicResponse = new TopicResponseContext(); topicResponse.setSuccess(false); triggerResponse.setTopic(topicResponse); + } else if (triggerRequest.hasNotification()) { + const notificationResponse = new NotificationResponseContext(); + notificationResponse.setSuccess(false); + triggerResponse.setNotification(notificationResponse); } } // Send the response back to the membrane @@ -254,6 +306,14 @@ export class Faas { 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); } // Original faas workers should return a blank InitRequest for compatibility. @@ -300,6 +360,16 @@ export const http = (...handlers: HttpMiddleware[]): Faas => 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 * diff --git a/src/gen/proto/deploy/v1/deploy_grpc_pb.d.ts b/src/gen/proto/deploy/v1/deploy_grpc_pb.d.ts new file mode 100644 index 00000000..89fc326c --- /dev/null +++ b/src/gen/proto/deploy/v1/deploy_grpc_pb.d.ts @@ -0,0 +1,27 @@ +// 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 new file mode 100644 index 00000000..aa3a30ab --- /dev/null +++ b/src/gen/proto/deploy/v1/deploy_grpc_pb.js @@ -0,0 +1,87 @@ +// 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.d.ts b/src/gen/proto/deploy/v1/deploy_pb.d.ts new file mode 100644 index 00000000..d489d207 --- /dev/null +++ b/src/gen/proto/deploy/v1/deploy_pb.d.ts @@ -0,0 +1,691 @@ +// package: nitric.deploy.v1 +// file: proto/deploy/v1/deploy.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"; + +export class DeployUpRequest extends jspb.Message { + hasSpec(): boolean; + clearSpec(): void; + getSpec(): Spec | undefined; + setSpec(value?: Spec): void; + + hasAttributes(): boolean; + clearAttributes(): void; + getAttributes(): google_protobuf_struct_pb.Struct | undefined; + setAttributes(value?: google_protobuf_struct_pb.Struct): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): DeployUpRequest.AsObject; + static toObject(includeInstance: boolean, msg: DeployUpRequest): DeployUpRequest.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; +} + +export namespace DeployUpRequest { + export type AsObject = { + spec?: Spec.AsObject, + attributes?: google_protobuf_struct_pb.Struct.AsObject, + } +} + +export class DeployUpEvent extends jspb.Message { + hasMessage(): boolean; + clearMessage(): void; + getMessage(): DeployEventMessage | undefined; + setMessage(value?: DeployEventMessage): void; + + hasResult(): boolean; + clearResult(): void; + getResult(): DeployUpEventResult | undefined; + setResult(value?: DeployUpEventResult): void; + + getContentCase(): DeployUpEvent.ContentCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): DeployUpEvent.AsObject; + static toObject(includeInstance: boolean, msg: DeployUpEvent): DeployUpEvent.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; +} + +export namespace DeployUpEvent { + export type AsObject = { + message?: DeployEventMessage.AsObject, + result?: DeployUpEventResult.AsObject, + } + + export enum ContentCase { + CONTENT_NOT_SET = 0, + MESSAGE = 1, + RESULT = 2, + } +} + +export class DeployEventMessage extends jspb.Message { + getMessage(): string; + setMessage(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): DeployEventMessage.AsObject; + static toObject(includeInstance: boolean, msg: DeployEventMessage): DeployEventMessage.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; +} + +export namespace DeployEventMessage { + export type AsObject = { + message: string, + } +} + +export class UpResult extends jspb.Message { + hasStringResult(): boolean; + clearStringResult(): void; + getStringResult(): string; + setStringResult(value: string): void; + + getContentCase(): UpResult.ContentCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): UpResult.AsObject; + static toObject(includeInstance: boolean, msg: UpResult): UpResult.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: UpResult, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): UpResult; + static deserializeBinaryFromReader(message: UpResult, reader: jspb.BinaryReader): UpResult; +} + +export namespace UpResult { + export type AsObject = { + stringResult: string, + } + + export enum ContentCase { + CONTENT_NOT_SET = 0, + STRING_RESULT = 1, + } +} + +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 { + hasAttributes(): boolean; + clearAttributes(): void; + getAttributes(): google_protobuf_struct_pb.Struct | undefined; + setAttributes(value?: google_protobuf_struct_pb.Struct): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): DeployDownRequest.AsObject; + static toObject(includeInstance: boolean, msg: DeployDownRequest): DeployDownRequest.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; +} + +export namespace DeployDownRequest { + export type AsObject = { + attributes?: google_protobuf_struct_pb.Struct.AsObject, + } +} + +export class DeployDownEvent extends jspb.Message { + hasMessage(): boolean; + clearMessage(): void; + getMessage(): DeployEventMessage | undefined; + setMessage(value?: DeployEventMessage): void; + + hasResult(): boolean; + clearResult(): void; + getResult(): DeployDownEventResult | undefined; + setResult(value?: DeployDownEventResult): void; + + getContentCase(): DeployDownEvent.ContentCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): DeployDownEvent.AsObject; + static toObject(includeInstance: boolean, msg: DeployDownEvent): DeployDownEvent.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; +} + +export namespace DeployDownEvent { + export type AsObject = { + message?: DeployEventMessage.AsObject, + result?: DeployDownEventResult.AsObject, + } + + export enum ContentCase { + CONTENT_NOT_SET = 0, + MESSAGE = 1, + RESULT = 2, + } +} + +export class DeployDownEventResult extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): DeployDownEventResult.AsObject; + static toObject(includeInstance: boolean, msg: DeployDownEventResult): DeployDownEventResult.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; +} + +export namespace DeployDownEventResult { + export type AsObject = { + } +} + +export class ImageSource extends jspb.Message { + getUri(): string; + setUri(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ImageSource.AsObject; + static toObject(includeInstance: boolean, msg: ImageSource): ImageSource.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ImageSource, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ImageSource; + static deserializeBinaryFromReader(message: ImageSource, reader: jspb.BinaryReader): ImageSource; +} + +export namespace ImageSource { + export type AsObject = { + uri: string, + } +} + +export class ExecutionUnit extends jspb.Message { + hasImage(): boolean; + clearImage(): void; + getImage(): ImageSource | undefined; + setImage(value?: ImageSource): void; + + getWorkers(): number; + setWorkers(value: number): void; + + getTimeout(): number; + setTimeout(value: number): void; + + getMemory(): number; + setMemory(value: number): void; + + getType(): string; + setType(value: string): void; + + getEnvMap(): jspb.Map; + clearEnvMap(): void; + getSourceCase(): ExecutionUnit.SourceCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ExecutionUnit.AsObject; + static toObject(includeInstance: boolean, msg: ExecutionUnit): ExecutionUnit.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; +} + +export namespace ExecutionUnit { + export type AsObject = { + image?: ImageSource.AsObject, + workers: number, + timeout: number, + memory: number, + type: string, + envMap: Array<[string, string]>, + } + + export enum SourceCase { + SOURCE_NOT_SET = 0, + IMAGE = 1, + } +} + +export class Bucket extends jspb.Message { + clearNotificationsList(): void; + getNotificationsList(): Array; + setNotificationsList(value: Array): void; + addNotifications(value?: BucketNotificationTarget, index?: number): BucketNotificationTarget; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Bucket.AsObject; + static toObject(includeInstance: boolean, msg: Bucket): Bucket.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Bucket, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Bucket; + static deserializeBinaryFromReader(message: Bucket, reader: jspb.BinaryReader): Bucket; +} + +export namespace Bucket { + export type AsObject = { + notificationsList: Array, + } +} + +export class BucketNotificationTarget extends jspb.Message { + hasConfig(): boolean; + clearConfig(): void; + getConfig(): proto_faas_v1_faas_pb.BucketNotificationConfig | undefined; + setConfig(value?: proto_faas_v1_faas_pb.BucketNotificationConfig): void; + + hasExecutionUnit(): boolean; + clearExecutionUnit(): void; + getExecutionUnit(): string; + setExecutionUnit(value: string): void; + + getTargetCase(): BucketNotificationTarget.TargetCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): BucketNotificationTarget.AsObject; + static toObject(includeInstance: boolean, msg: BucketNotificationTarget): BucketNotificationTarget.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; +} + +export namespace BucketNotificationTarget { + export type AsObject = { + config?: proto_faas_v1_faas_pb.BucketNotificationConfig.AsObject, + executionUnit: string, + } + + export enum TargetCase { + TARGET_NOT_SET = 0, + EXECUTION_UNIT = 2, + } +} + +export class Topic extends jspb.Message { + clearSubscriptionsList(): void; + getSubscriptionsList(): Array; + setSubscriptionsList(value: Array): void; + addSubscriptions(value?: SubscriptionTarget, index?: number): SubscriptionTarget; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Topic.AsObject; + static toObject(includeInstance: boolean, msg: Topic): Topic.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Topic, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Topic; + static deserializeBinaryFromReader(message: Topic, reader: jspb.BinaryReader): Topic; +} + +export namespace Topic { + export type AsObject = { + subscriptionsList: Array, + } +} + +export class Queue extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Queue.AsObject; + static toObject(includeInstance: boolean, msg: Queue): Queue.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Queue, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Queue; + static deserializeBinaryFromReader(message: Queue, reader: jspb.BinaryReader): Queue; +} + +export namespace Queue { + export type AsObject = { + } +} + +export class Collection extends jspb.Message { + 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 = { + } +} + +export class Secret extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Secret.AsObject; + static toObject(includeInstance: boolean, msg: Secret): Secret.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Secret, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Secret; + static deserializeBinaryFromReader(message: Secret, reader: jspb.BinaryReader): Secret; +} + +export namespace Secret { + export type AsObject = { + } +} + +export class SubscriptionTarget extends jspb.Message { + hasExecutionUnit(): boolean; + clearExecutionUnit(): void; + getExecutionUnit(): string; + setExecutionUnit(value: string): void; + + getTargetCase(): SubscriptionTarget.TargetCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SubscriptionTarget.AsObject; + static toObject(includeInstance: boolean, msg: SubscriptionTarget): SubscriptionTarget.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SubscriptionTarget, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SubscriptionTarget; + static deserializeBinaryFromReader(message: SubscriptionTarget, reader: jspb.BinaryReader): SubscriptionTarget; +} + +export namespace SubscriptionTarget { + export type AsObject = { + executionUnit: string, + } + + export enum TargetCase { + TARGET_NOT_SET = 0, + EXECUTION_UNIT = 1, + } +} + +export class TopicSubscription extends jspb.Message { + hasTarget(): boolean; + clearTarget(): void; + getTarget(): SubscriptionTarget | undefined; + setTarget(value?: SubscriptionTarget): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): TopicSubscription.AsObject; + static toObject(includeInstance: boolean, msg: TopicSubscription): TopicSubscription.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: TopicSubscription, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): TopicSubscription; + static deserializeBinaryFromReader(message: TopicSubscription, reader: jspb.BinaryReader): TopicSubscription; +} + +export namespace TopicSubscription { + export type AsObject = { + target?: SubscriptionTarget.AsObject, + } +} + +export class Api extends jspb.Message { + hasOpenapi(): boolean; + clearOpenapi(): void; + getOpenapi(): string; + setOpenapi(value: string): void; + + getDocumentCase(): Api.DocumentCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Api.AsObject; + static toObject(includeInstance: boolean, msg: Api): Api.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Api, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Api; + static deserializeBinaryFromReader(message: Api, reader: jspb.BinaryReader): Api; +} + +export namespace Api { + export type AsObject = { + openapi: string, + } + + export enum DocumentCase { + DOCUMENT_NOT_SET = 0, + OPENAPI = 1, + } +} + +export class ScheduleTarget extends jspb.Message { + hasExecutionUnit(): boolean; + clearExecutionUnit(): void; + getExecutionUnit(): string; + setExecutionUnit(value: string): void; + + getTargetCase(): ScheduleTarget.TargetCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ScheduleTarget.AsObject; + static toObject(includeInstance: boolean, msg: ScheduleTarget): ScheduleTarget.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ScheduleTarget, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ScheduleTarget; + static deserializeBinaryFromReader(message: ScheduleTarget, reader: jspb.BinaryReader): ScheduleTarget; +} + +export namespace ScheduleTarget { + export type AsObject = { + executionUnit: string, + } + + export enum TargetCase { + TARGET_NOT_SET = 0, + EXECUTION_UNIT = 1, + } +} + +export class Schedule extends jspb.Message { + getCron(): string; + setCron(value: string): void; + + hasTarget(): boolean; + clearTarget(): void; + getTarget(): ScheduleTarget | undefined; + setTarget(value?: ScheduleTarget): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Schedule.AsObject; + static toObject(includeInstance: boolean, msg: Schedule): Schedule.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Schedule, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Schedule; + static deserializeBinaryFromReader(message: Schedule, reader: jspb.BinaryReader): Schedule; +} + +export namespace Schedule { + export type AsObject = { + cron: string, + target?: ScheduleTarget.AsObject, + } +} + +export class Resource extends jspb.Message { + getName(): string; + setName(value: string): void; + + 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; + + hasExecutionUnit(): boolean; + clearExecutionUnit(): void; + getExecutionUnit(): ExecutionUnit | undefined; + setExecutionUnit(value?: ExecutionUnit): void; + + hasBucket(): boolean; + clearBucket(): void; + getBucket(): Bucket | undefined; + setBucket(value?: Bucket): void; + + hasTopic(): boolean; + clearTopic(): void; + 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; + setApi(value?: Api): void; + + hasPolicy(): boolean; + clearPolicy(): void; + getPolicy(): Policy | undefined; + setPolicy(value?: Policy): void; + + hasSchedule(): boolean; + clearSchedule(): void; + getSchedule(): Schedule | undefined; + setSchedule(value?: Schedule): void; + + hasCollection(): boolean; + clearCollection(): void; + getCollection(): Collection | undefined; + setCollection(value?: Collection): void; + + hasSecret(): boolean; + clearSecret(): void; + getSecret(): Secret | undefined; + setSecret(value?: Secret): void; + + getConfigCase(): Resource.ConfigCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Resource.AsObject; + static toObject(includeInstance: boolean, msg: Resource): Resource.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; +} + +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, + bucket?: Bucket.AsObject, + topic?: Topic.AsObject, + queue?: Queue.AsObject, + api?: Api.AsObject, + policy?: Policy.AsObject, + schedule?: Schedule.AsObject, + collection?: Collection.AsObject, + secret?: Secret.AsObject, + } + + export enum ConfigCase { + CONFIG_NOT_SET = 0, + EXECUTION_UNIT = 10, + BUCKET = 11, + TOPIC = 12, + QUEUE = 13, + API = 14, + POLICY = 15, + SCHEDULE = 16, + COLLECTION = 17, + SECRET = 18, + } +} + +export class Policy extends jspb.Message { + clearPrincipalsList(): void; + getPrincipalsList(): Array; + setPrincipalsList(value: Array): void; + 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]; + + clearResourcesList(): void; + getResourcesList(): Array; + setResourcesList(value: Array): void; + addResources(value?: Resource, index?: number): Resource; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Policy.AsObject; + static toObject(includeInstance: boolean, msg: Policy): Policy.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Policy, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Policy; + static deserializeBinaryFromReader(message: Policy, reader: jspb.BinaryReader): Policy; +} + +export namespace Policy { + export type AsObject = { + principalsList: Array, + actionsList: Array, + resourcesList: Array, + } +} + +export class Spec extends jspb.Message { + clearResourcesList(): void; + getResourcesList(): Array; + setResourcesList(value: Array): void; + addResources(value?: Resource, index?: number): Resource; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Spec.AsObject; + static toObject(includeInstance: boolean, msg: Spec): Spec.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Spec, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Spec; + static deserializeBinaryFromReader(message: Spec, reader: jspb.BinaryReader): Spec; +} + +export namespace Spec { + export type AsObject = { + resourcesList: Array, + } +} + diff --git a/src/gen/proto/deploy/v1/deploy_pb.js b/src/gen/proto/deploy/v1/deploy_pb.js new file mode 100644 index 00000000..6054f280 --- /dev/null +++ b/src/gen/proto/deploy/v1/deploy_pb.js @@ -0,0 +1,5194 @@ +// 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.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); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed 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.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.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.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; +}; + + + +/** + * 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]]; + +/** + * @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 +}; + +/** + * @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) + }; + + 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; + 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 + ); + } +}; + + +/** + * 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; +}; + + + +/** + * 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/faas/v1/faas_pb.d.ts b/src/gen/proto/faas/v1/faas_pb.d.ts index 84f1e1f9..509de0cf 100644 --- a/src/gen/proto/faas/v1/faas_pb.d.ts +++ b/src/gen/proto/faas/v1/faas_pb.d.ts @@ -261,6 +261,56 @@ export namespace ScheduleCron { } } +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 InitRequest extends jspb.Message { hasApi(): boolean; clearApi(): void; @@ -277,6 +327,11 @@ export class InitRequest extends jspb.Message { getSchedule(): ScheduleWorker | undefined; setSchedule(value?: ScheduleWorker): void; + hasBucketNotification(): boolean; + clearBucketNotification(): void; + getBucketNotification(): BucketNotificationWorker | undefined; + setBucketNotification(value?: BucketNotificationWorker): void; + getWorkerCase(): InitRequest.WorkerCase; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): InitRequest.AsObject; @@ -293,6 +348,7 @@ export namespace InitRequest { api?: ApiWorker.AsObject, subscription?: SubscriptionWorker.AsObject, schedule?: ScheduleWorker.AsObject, + bucketNotification?: BucketNotificationWorker.AsObject, } export enum WorkerCase { @@ -300,6 +356,7 @@ export namespace InitRequest { API = 10, SUBSCRIPTION = 11, SCHEDULE = 12, + BUCKET_NOTIFICATION = 13, } } @@ -362,6 +419,11 @@ export class TriggerRequest extends jspb.Message { getTopic(): TopicTriggerContext | undefined; setTopic(value?: TopicTriggerContext): void; + hasNotification(): boolean; + clearNotification(): void; + getNotification(): NotificationTriggerContext | undefined; + setNotification(value?: NotificationTriggerContext): void; + getContextCase(): TriggerRequest.ContextCase; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): TriggerRequest.AsObject; @@ -380,12 +442,14 @@ export namespace TriggerRequest { traceContext?: TraceContext.AsObject, http?: HttpTriggerContext.AsObject, topic?: TopicTriggerContext.AsObject, + notification?: NotificationTriggerContext.AsObject, } export enum ContextCase { CONTEXT_NOT_SET = 0, HTTP = 3, TOPIC = 4, + NOTIFICATION = 5, } } @@ -492,6 +556,62 @@ export namespace TopicTriggerContext { } } +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 TriggerResponse extends jspb.Message { getData(): Uint8Array | string; getData_asU8(): Uint8Array; @@ -508,6 +628,11 @@ export class TriggerResponse extends jspb.Message { getTopic(): TopicResponseContext | undefined; setTopic(value?: TopicResponseContext): void; + hasNotification(): boolean; + clearNotification(): void; + getNotification(): NotificationResponseContext | undefined; + setNotification(value?: NotificationResponseContext): void; + getContextCase(): TriggerResponse.ContextCase; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): TriggerResponse.AsObject; @@ -524,12 +649,14 @@ export namespace TriggerResponse { data: Uint8Array | string, http?: HttpResponseContext.AsObject, topic?: TopicResponseContext.AsObject, + notification?: NotificationResponseContext.AsObject, } export enum ContextCase { CONTEXT_NOT_SET = 0, HTTP = 10, TOPIC = 11, + NOTIFICATION = 12, } } @@ -579,3 +706,31 @@ export namespace TopicResponseContext { } } +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 interface BucketNotificationTypeMap { + ALL: 0; + CREATED: 1; + DELETED: 2; +} + +export const BucketNotificationType: BucketNotificationTypeMap; + diff --git a/src/gen/proto/faas/v1/faas_pb.js b/src/gen/proto/faas/v1/faas_pb.js index 363ecef1..38d391a0 100644 --- a/src/gen/proto/faas/v1/faas_pb.js +++ b/src/gen/proto/faas/v1/faas_pb.js @@ -24,6 +24,10 @@ var global = (function() { 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); @@ -32,6 +36,9 @@ goog.exportSymbol('proto.nitric.faas.v1.HttpTriggerContext', 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); @@ -236,6 +243,48 @@ if (goog.DEBUG && !COMPILED) { */ 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.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 @@ -404,6 +453,48 @@ if (goog.DEBUG && !COMPILED) { */ 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 @@ -467,6 +558,27 @@ if (goog.DEBUG && !COMPILED) { */ 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'; +} /** * Oneof group definitions for this message. Each group defines the field @@ -2218,33 +2330,6 @@ proto.nitric.faas.v1.ScheduleCron.prototype.setCron = function(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]]; - -/** - * @enum {number} - */ -proto.nitric.faas.v1.InitRequest.WorkerCase = { - WORKER_NOT_SET: 0, - API: 10, - SUBSCRIPTION: 11, - SCHEDULE: 12 -}; - -/** - * @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) { @@ -2260,8 +2345,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * 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); +proto.nitric.faas.v1.BucketNotificationWorker.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.faas.v1.BucketNotificationWorker.toObject(opt_includeInstance, this); }; @@ -2270,15 +2355,14 @@ proto.nitric.faas.v1.InitRequest.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.faas.v1.InitRequest} msg The msg instance to transform. + * @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.InitRequest.toObject = function(includeInstance, msg) { +proto.nitric.faas.v1.BucketNotificationWorker.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) + bucket: jspb.Message.getFieldWithDefault(msg, 1, ""), + config: (f = msg.getConfig()) && proto.nitric.faas.v1.BucketNotificationConfig.toObject(includeInstance, f) }; if (includeInstance) { @@ -2292,43 +2376,37 @@ proto.nitric.faas.v1.InitRequest.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.faas.v1.InitRequest} + * @return {!proto.nitric.faas.v1.BucketNotificationWorker} */ -proto.nitric.faas.v1.InitRequest.deserializeBinary = function(bytes) { +proto.nitric.faas.v1.BucketNotificationWorker.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); + 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.InitRequest} msg The message object to deserialize into. + * @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.InitRequest} + * @return {!proto.nitric.faas.v1.BucketNotificationWorker} */ -proto.nitric.faas.v1.InitRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.nitric.faas.v1.BucketNotificationWorker.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); + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setBucket(value); break; - case 12: - var value = new proto.nitric.faas.v1.ScheduleWorker; - reader.readMessage(value,proto.nitric.faas.v1.ScheduleWorker.deserializeBinaryFromReader); - msg.setSchedule(value); + 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(); @@ -2343,9 +2421,9 @@ proto.nitric.faas.v1.InitRequest.deserializeBinaryFromReader = function(msg, rea * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.nitric.faas.v1.InitRequest.prototype.serializeBinary = function() { +proto.nitric.faas.v1.BucketNotificationWorker.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.InitRequest.serializeBinaryToWriter(this, writer); + proto.nitric.faas.v1.BucketNotificationWorker.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -2353,138 +2431,73 @@ proto.nitric.faas.v1.InitRequest.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.InitRequest} message + * @param {!proto.nitric.faas.v1.BucketNotificationWorker} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.faas.v1.InitRequest.serializeBinaryToWriter = function(message, writer) { +proto.nitric.faas.v1.BucketNotificationWorker.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.getBucket(); + if (f.length > 0) { + writer.writeString( + 1, + f ); } - f = message.getSchedule(); + f = message.getConfig(); if (f != null) { writer.writeMessage( - 12, + 2, f, - proto.nitric.faas.v1.ScheduleWorker.serializeBinaryToWriter + proto.nitric.faas.v1.BucketNotificationConfig.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 + * optional string bucket = 1; + * @return {string} */ -proto.nitric.faas.v1.InitRequest.prototype.clearSubscription = function() { - return this.setSubscription(undefined); +proto.nitric.faas.v1.BucketNotificationWorker.prototype.getBucket = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * Returns whether this field is set. - * @return {boolean} + * @param {string} value + * @return {!proto.nitric.faas.v1.BucketNotificationWorker} returns this */ -proto.nitric.faas.v1.InitRequest.prototype.hasSubscription = function() { - return jspb.Message.getField(this, 11) != null; +proto.nitric.faas.v1.BucketNotificationWorker.prototype.setBucket = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); }; /** - * optional ScheduleWorker schedule = 12; - * @return {?proto.nitric.faas.v1.ScheduleWorker} + * optional BucketNotificationConfig config = 2; + * @return {?proto.nitric.faas.v1.BucketNotificationConfig} */ -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)); +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.ScheduleWorker|undefined} value - * @return {!proto.nitric.faas.v1.InitRequest} returns this + * @param {?proto.nitric.faas.v1.BucketNotificationConfig|undefined} value + * @return {!proto.nitric.faas.v1.BucketNotificationWorker} 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); +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.InitRequest} returns this + * @return {!proto.nitric.faas.v1.BucketNotificationWorker} returns this */ -proto.nitric.faas.v1.InitRequest.prototype.clearSchedule = function() { - return this.setSchedule(undefined); +proto.nitric.faas.v1.BucketNotificationWorker.prototype.clearConfig = function() { + return this.setConfig(undefined); }; @@ -2492,8 +2505,8 @@ proto.nitric.faas.v1.InitRequest.prototype.clearSchedule = function() { * Returns whether this field is set. * @return {boolean} */ -proto.nitric.faas.v1.InitRequest.prototype.hasSchedule = function() { - return jspb.Message.getField(this, 12) != null; +proto.nitric.faas.v1.BucketNotificationWorker.prototype.hasConfig = function() { + return jspb.Message.getField(this, 2) != null; }; @@ -2513,8 +2526,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * 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); +proto.nitric.faas.v1.BucketNotificationConfig.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.faas.v1.BucketNotificationConfig.toObject(opt_includeInstance, this); }; @@ -2523,13 +2536,14 @@ proto.nitric.faas.v1.InitResponse.prototype.toObject = function(opt_includeInsta * @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. + * @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.InitResponse.toObject = function(includeInstance, msg) { +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) { @@ -2543,29 +2557,37 @@ proto.nitric.faas.v1.InitResponse.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.faas.v1.InitResponse} + * @return {!proto.nitric.faas.v1.BucketNotificationConfig} */ -proto.nitric.faas.v1.InitResponse.deserializeBinary = function(bytes) { +proto.nitric.faas.v1.BucketNotificationConfig.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); + 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.InitResponse} msg The message object to deserialize into. + * @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.InitResponse} + * @return {!proto.nitric.faas.v1.BucketNotificationConfig} */ -proto.nitric.faas.v1.InitResponse.deserializeBinaryFromReader = function(msg, reader) { +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; @@ -2579,9 +2601,9 @@ proto.nitric.faas.v1.InitResponse.deserializeBinaryFromReader = function(msg, re * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.nitric.faas.v1.InitResponse.prototype.serializeBinary = function() { +proto.nitric.faas.v1.BucketNotificationConfig.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.InitResponse.serializeBinaryToWriter(this, writer); + proto.nitric.faas.v1.BucketNotificationConfig.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -2589,146 +2611,63 @@ proto.nitric.faas.v1.InitResponse.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.InitResponse} message + * @param {!proto.nitric.faas.v1.BucketNotificationConfig} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.faas.v1.InitResponse.serializeBinaryToWriter = function(message, writer) { +proto.nitric.faas.v1.BucketNotificationConfig.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; + f = message.getNotificationType(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); } - 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; - } + f = message.getNotificationPrefixFilter(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); } - return msg; }; /** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} + * optional BucketNotificationType notification_type = 1; + * @return {!proto.nitric.faas.v1.BucketNotificationType} */ -proto.nitric.faas.v1.TraceContext.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.TraceContext.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); +proto.nitric.faas.v1.BucketNotificationConfig.prototype.getNotificationType = function() { + return /** @type {!proto.nitric.faas.v1.BucketNotificationType} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; /** - * 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 + * @param {!proto.nitric.faas.v1.BucketNotificationType} value + * @return {!proto.nitric.faas.v1.BucketNotificationConfig} returns this */ -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); - } +proto.nitric.faas.v1.BucketNotificationConfig.prototype.setNotificationType = function(value) { + return jspb.Message.setProto3EnumField(this, 1, value); }; /** - * map values = 1; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} + * optional string notification_prefix_filter = 2; + * @return {string} */ -proto.nitric.faas.v1.TraceContext.prototype.getValuesMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 1, opt_noLazyCreate, - null)); +proto.nitric.faas.v1.BucketNotificationConfig.prototype.getNotificationPrefixFilter = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** - * Clears values from the map. The map will be non-null. - * @return {!proto.nitric.faas.v1.TraceContext} returns this + * @param {string} value + * @return {!proto.nitric.faas.v1.BucketNotificationConfig} returns this */ -proto.nitric.faas.v1.TraceContext.prototype.clearValuesMap = function() { - this.getValuesMap().clear(); - return this;}; +proto.nitric.faas.v1.BucketNotificationConfig.prototype.setNotificationPrefixFilter = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; @@ -2740,22 +2679,24 @@ proto.nitric.faas.v1.TraceContext.prototype.clearValuesMap = function() { * @private {!Array>} * @const */ -proto.nitric.faas.v1.TriggerRequest.oneofGroups_ = [[3,4]]; +proto.nitric.faas.v1.InitRequest.oneofGroups_ = [[10,11,12,13]]; /** * @enum {number} */ -proto.nitric.faas.v1.TriggerRequest.ContextCase = { - CONTEXT_NOT_SET: 0, - HTTP: 3, - TOPIC: 4 +proto.nitric.faas.v1.InitRequest.WorkerCase = { + WORKER_NOT_SET: 0, + API: 10, + SUBSCRIPTION: 11, + SCHEDULE: 12, + BUCKET_NOTIFICATION: 13 }; /** - * @return {proto.nitric.faas.v1.TriggerRequest.ContextCase} + * @return {proto.nitric.faas.v1.InitRequest.WorkerCase} */ -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])); +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])); }; @@ -2773,8 +2714,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * 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); +proto.nitric.faas.v1.InitRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.faas.v1.InitRequest.toObject(opt_includeInstance, this); }; @@ -2783,17 +2724,16 @@ proto.nitric.faas.v1.TriggerRequest.prototype.toObject = function(opt_includeIns * @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. + * @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.TriggerRequest.toObject = function(includeInstance, msg) { +proto.nitric.faas.v1.InitRequest.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) + 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) }; if (includeInstance) { @@ -2807,51 +2747,48 @@ proto.nitric.faas.v1.TriggerRequest.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.faas.v1.TriggerRequest} + * @return {!proto.nitric.faas.v1.InitRequest} */ -proto.nitric.faas.v1.TriggerRequest.deserializeBinary = function(bytes) { +proto.nitric.faas.v1.InitRequest.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); + 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.TriggerRequest} msg The message object to deserialize into. + * @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.TriggerRequest} + * @return {!proto.nitric.faas.v1.InitRequest} */ -proto.nitric.faas.v1.TriggerRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.nitric.faas.v1.InitRequest.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); + var value = new proto.nitric.faas.v1.ApiWorker; + reader.readMessage(value,proto.nitric.faas.v1.ApiWorker.deserializeBinaryFromReader); + msg.setApi(value); break; - case 3: - var value = new proto.nitric.faas.v1.HttpTriggerContext; - reader.readMessage(value,proto.nitric.faas.v1.HttpTriggerContext.deserializeBinaryFromReader); - msg.setHttp(value); + case 11: + var value = new proto.nitric.faas.v1.SubscriptionWorker; + reader.readMessage(value,proto.nitric.faas.v1.SubscriptionWorker.deserializeBinaryFromReader); + msg.setSubscription(value); break; - case 4: - var value = new proto.nitric.faas.v1.TopicTriggerContext; - reader.readMessage(value,proto.nitric.faas.v1.TopicTriggerContext.deserializeBinaryFromReader); - msg.setTopic(value); + 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; default: reader.skipField(); @@ -2866,9 +2803,9 @@ proto.nitric.faas.v1.TriggerRequest.deserializeBinaryFromReader = function(msg, * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.nitric.faas.v1.TriggerRequest.prototype.serializeBinary = function() { +proto.nitric.faas.v1.InitRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.TriggerRequest.serializeBinaryToWriter(this, writer); + proto.nitric.faas.v1.InitRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -2876,138 +2813,109 @@ proto.nitric.faas.v1.TriggerRequest.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.TriggerRequest} message + * @param {!proto.nitric.faas.v1.InitRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.faas.v1.TriggerRequest.serializeBinaryToWriter = function(message, writer) { +proto.nitric.faas.v1.InitRequest.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.getApi(); + if (f != null) { + writer.writeMessage( + 10, + f, + proto.nitric.faas.v1.ApiWorker.serializeBinaryToWriter ); } - f = message.getTraceContext(); + f = message.getSubscription(); if (f != null) { writer.writeMessage( - 10, + 11, f, - proto.nitric.faas.v1.TraceContext.serializeBinaryToWriter + proto.nitric.faas.v1.SubscriptionWorker.serializeBinaryToWriter ); } - f = message.getHttp(); + f = message.getSchedule(); if (f != null) { writer.writeMessage( - 3, + 12, f, - proto.nitric.faas.v1.HttpTriggerContext.serializeBinaryToWriter + proto.nitric.faas.v1.ScheduleWorker.serializeBinaryToWriter ); } - f = message.getTopic(); + f = message.getBucketNotification(); if (f != null) { writer.writeMessage( - 4, + 13, f, - proto.nitric.faas.v1.TopicTriggerContext.serializeBinaryToWriter + proto.nitric.faas.v1.BucketNotificationWorker.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} + * optional ApiWorker api = 10; + * @return {?proto.nitric.faas.v1.ApiWorker} */ -proto.nitric.faas.v1.TriggerRequest.prototype.getData_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getData())); +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 {!(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); + * @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); }; /** - * optional string mime_type = 2; - * @return {string} + * Clears the message field making it undefined. + * @return {!proto.nitric.faas.v1.InitRequest} returns this */ -proto.nitric.faas.v1.TriggerRequest.prototype.getMimeType = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +proto.nitric.faas.v1.InitRequest.prototype.clearApi = function() { + return this.setApi(undefined); }; /** - * @param {string} value - * @return {!proto.nitric.faas.v1.TriggerRequest} returns this + * Returns whether this field is set. + * @return {boolean} */ -proto.nitric.faas.v1.TriggerRequest.prototype.setMimeType = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); +proto.nitric.faas.v1.InitRequest.prototype.hasApi = function() { + return jspb.Message.getField(this, 10) != null; }; /** - * optional TraceContext trace_context = 10; - * @return {?proto.nitric.faas.v1.TraceContext} + * optional SubscriptionWorker subscription = 11; + * @return {?proto.nitric.faas.v1.SubscriptionWorker} */ -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)); +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.TraceContext|undefined} value - * @return {!proto.nitric.faas.v1.TriggerRequest} returns this + * @param {?proto.nitric.faas.v1.SubscriptionWorker|undefined} value + * @return {!proto.nitric.faas.v1.InitRequest} returns this */ -proto.nitric.faas.v1.TriggerRequest.prototype.setTraceContext = function(value) { - return jspb.Message.setWrapperField(this, 10, value); +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.TriggerRequest} returns this + * @return {!proto.nitric.faas.v1.InitRequest} returns this */ -proto.nitric.faas.v1.TriggerRequest.prototype.clearTraceContext = function() { - return this.setTraceContext(undefined); +proto.nitric.faas.v1.InitRequest.prototype.clearSubscription = function() { + return this.setSubscription(undefined); }; @@ -3015,36 +2923,36 @@ proto.nitric.faas.v1.TriggerRequest.prototype.clearTraceContext = function() { * Returns whether this field is set. * @return {boolean} */ -proto.nitric.faas.v1.TriggerRequest.prototype.hasTraceContext = function() { - return jspb.Message.getField(this, 10) != null; +proto.nitric.faas.v1.InitRequest.prototype.hasSubscription = function() { + return jspb.Message.getField(this, 11) != null; }; /** - * optional HttpTriggerContext http = 3; - * @return {?proto.nitric.faas.v1.HttpTriggerContext} + * optional ScheduleWorker schedule = 12; + * @return {?proto.nitric.faas.v1.ScheduleWorker} */ -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)); +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.HttpTriggerContext|undefined} value - * @return {!proto.nitric.faas.v1.TriggerRequest} returns this + * @param {?proto.nitric.faas.v1.ScheduleWorker|undefined} value + * @return {!proto.nitric.faas.v1.InitRequest} 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); +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.TriggerRequest} returns this + * @return {!proto.nitric.faas.v1.InitRequest} returns this */ -proto.nitric.faas.v1.TriggerRequest.prototype.clearHttp = function() { - return this.setHttp(undefined); +proto.nitric.faas.v1.InitRequest.prototype.clearSchedule = function() { + return this.setSchedule(undefined); }; @@ -3052,36 +2960,36 @@ proto.nitric.faas.v1.TriggerRequest.prototype.clearHttp = function() { * Returns whether this field is set. * @return {boolean} */ -proto.nitric.faas.v1.TriggerRequest.prototype.hasHttp = function() { - return jspb.Message.getField(this, 3) != null; +proto.nitric.faas.v1.InitRequest.prototype.hasSchedule = function() { + return jspb.Message.getField(this, 12) != null; }; /** - * optional TopicTriggerContext topic = 4; - * @return {?proto.nitric.faas.v1.TopicTriggerContext} + * optional BucketNotificationWorker bucket_notification = 13; + * @return {?proto.nitric.faas.v1.BucketNotificationWorker} */ -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)); +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.TopicTriggerContext|undefined} value - * @return {!proto.nitric.faas.v1.TriggerRequest} returns this + * @param {?proto.nitric.faas.v1.BucketNotificationWorker|undefined} value + * @return {!proto.nitric.faas.v1.InitRequest} 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); +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.TriggerRequest} returns this + * @return {!proto.nitric.faas.v1.InitRequest} returns this */ -proto.nitric.faas.v1.TriggerRequest.prototype.clearTopic = function() { - return this.setTopic(undefined); +proto.nitric.faas.v1.InitRequest.prototype.clearBucketNotification = function() { + return this.setBucketNotification(undefined); }; @@ -3089,19 +2997,12 @@ proto.nitric.faas.v1.TriggerRequest.prototype.clearTopic = function() { * Returns whether this field is set. * @return {boolean} */ -proto.nitric.faas.v1.TriggerRequest.prototype.hasTopic = function() { - return jspb.Message.getField(this, 4) != null; +proto.nitric.faas.v1.InitRequest.prototype.hasBucketNotification = function() { + return jspb.Message.getField(this, 13) != 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) { @@ -3117,8 +3018,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * 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); +proto.nitric.faas.v1.InitResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.faas.v1.InitResponse.toObject(opt_includeInstance, this); }; @@ -3127,13 +3028,13 @@ proto.nitric.faas.v1.HeaderValue.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.faas.v1.HeaderValue} msg The msg instance to transform. + * @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.HeaderValue.toObject = function(includeInstance, msg) { +proto.nitric.faas.v1.InitResponse.toObject = function(includeInstance, msg) { var f, obj = { - valueList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f + }; if (includeInstance) { @@ -3147,33 +3048,29 @@ proto.nitric.faas.v1.HeaderValue.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.faas.v1.HeaderValue} + * @return {!proto.nitric.faas.v1.InitResponse} */ -proto.nitric.faas.v1.HeaderValue.deserializeBinary = function(bytes) { +proto.nitric.faas.v1.InitResponse.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); + 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.HeaderValue} msg The message object to deserialize into. + * @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.HeaderValue} + * @return {!proto.nitric.faas.v1.InitResponse} */ -proto.nitric.faas.v1.HeaderValue.deserializeBinaryFromReader = function(msg, reader) { +proto.nitric.faas.v1.InitResponse.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; @@ -3187,9 +3084,9 @@ proto.nitric.faas.v1.HeaderValue.deserializeBinaryFromReader = function(msg, rea * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.nitric.faas.v1.HeaderValue.prototype.serializeBinary = function() { +proto.nitric.faas.v1.InitResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.HeaderValue.serializeBinaryToWriter(this, writer); + proto.nitric.faas.v1.InitResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -3197,66 +3094,1200 @@ proto.nitric.faas.v1.HeaderValue.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.HeaderValue} message + * @param {!proto.nitric.faas.v1.InitResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.faas.v1.HeaderValue.serializeBinaryToWriter = function(message, writer) { +proto.nitric.faas.v1.InitResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getValueList(); - if (f.length > 0) { - writer.writeRepeatedString( - 1, - f - ); - } }; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { /** - * repeated string value = 1; - * @return {!Array} + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @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.getValueList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +proto.nitric.faas.v1.TraceContext.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.faas.v1.TraceContext.toObject(opt_includeInstance, this); }; /** - * @param {!Array} value - * @return {!proto.nitric.faas.v1.HeaderValue} returns this + * Static version of the {@see toObject} 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.HeaderValue.prototype.setValueList = function(value) { - return jspb.Message.setField(this, 1, value || []); +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; }; +} /** - * @param {string} value - * @param {number=} opt_index - * @return {!proto.nitric.faas.v1.HeaderValue} returns this + * 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.HeaderValue.prototype.addValue = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +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); }; /** - * Clears the list making it empty but non-null. - * @return {!proto.nitric.faas.v1.HeaderValue} returns this + * 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.HeaderValue.prototype.clearValueList = function() { - return this.setValueList([]); +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]]; + +/** + * @enum {number} + */ +proto.nitric.faas.v1.TriggerRequest.ContextCase = { + CONTEXT_NOT_SET: 0, + HTTP: 3, + TOPIC: 4, + NOTIFICATION: 5 +}; + +/** + * @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) + }; + + 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; + 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 + ); + } +}; + + +/** + * 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; +}; + + + +/** + * 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)); }; - /** - * List of repeated fields within this message type. - * @private {!Array} - * @const + * Clears values from the map. The map will be non-null. + * @return {!proto.nitric.faas.v1.HttpTriggerContext} returns this */ -proto.nitric.faas.v1.QueryValue.repeatedFields_ = [1]; +proto.nitric.faas.v1.HttpTriggerContext.prototype.clearPathParamsMap = function() { + this.getPathParamsMap().clear(); + return this;}; + + @@ -3273,8 +4304,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * 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); +proto.nitric.faas.v1.TopicTriggerContext.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.faas.v1.TopicTriggerContext.toObject(opt_includeInstance, this); }; @@ -3283,13 +4314,13 @@ proto.nitric.faas.v1.QueryValue.prototype.toObject = function(opt_includeInstanc * @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. + * @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.QueryValue.toObject = function(includeInstance, msg) { +proto.nitric.faas.v1.TopicTriggerContext.toObject = function(includeInstance, msg) { var f, obj = { - valueList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f + topic: jspb.Message.getFieldWithDefault(msg, 1, "") }; if (includeInstance) { @@ -3303,23 +4334,23 @@ proto.nitric.faas.v1.QueryValue.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.faas.v1.QueryValue} + * @return {!proto.nitric.faas.v1.TopicTriggerContext} */ -proto.nitric.faas.v1.QueryValue.deserializeBinary = function(bytes) { +proto.nitric.faas.v1.TopicTriggerContext.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); + 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.QueryValue} msg The message object to deserialize into. + * @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.QueryValue} + * @return {!proto.nitric.faas.v1.TopicTriggerContext} */ -proto.nitric.faas.v1.QueryValue.deserializeBinaryFromReader = function(msg, reader) { +proto.nitric.faas.v1.TopicTriggerContext.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -3328,7 +4359,7 @@ proto.nitric.faas.v1.QueryValue.deserializeBinaryFromReader = function(msg, read switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); - msg.addValue(value); + msg.setTopic(value); break; default: reader.skipField(); @@ -3343,9 +4374,9 @@ proto.nitric.faas.v1.QueryValue.deserializeBinaryFromReader = function(msg, read * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.nitric.faas.v1.QueryValue.prototype.serializeBinary = function() { +proto.nitric.faas.v1.TopicTriggerContext.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.QueryValue.serializeBinaryToWriter(this, writer); + proto.nitric.faas.v1.TopicTriggerContext.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -3353,15 +4384,15 @@ proto.nitric.faas.v1.QueryValue.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.QueryValue} message + * @param {!proto.nitric.faas.v1.TopicTriggerContext} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.faas.v1.QueryValue.serializeBinaryToWriter = function(message, writer) { +proto.nitric.faas.v1.TopicTriggerContext.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getValueList(); + f = message.getTopic(); if (f.length > 0) { - writer.writeRepeatedString( + writer.writeString( 1, f ); @@ -3370,39 +4401,20 @@ proto.nitric.faas.v1.QueryValue.serializeBinaryToWriter = function(message, writ /** - * 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 + * optional string topic = 1; + * @return {string} */ -proto.nitric.faas.v1.QueryValue.prototype.setValueList = function(value) { - return jspb.Message.setField(this, 1, value || []); +proto.nitric.faas.v1.TopicTriggerContext.prototype.getTopic = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @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 + * @return {!proto.nitric.faas.v1.TopicTriggerContext} returns this */ -proto.nitric.faas.v1.QueryValue.prototype.clearValueList = function() { - return this.setValueList([]); +proto.nitric.faas.v1.TopicTriggerContext.prototype.setTopic = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); }; @@ -3422,8 +4434,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * 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); +proto.nitric.faas.v1.BucketNotification.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.faas.v1.BucketNotification.toObject(opt_includeInstance, this); }; @@ -3432,19 +4444,14 @@ proto.nitric.faas.v1.HttpTriggerContext.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.faas.v1.HttpTriggerContext} msg The msg instance to transform. + * @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.HttpTriggerContext.toObject = function(includeInstance, msg) { +proto.nitric.faas.v1.BucketNotification.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) : [] + key: jspb.Message.getFieldWithDefault(msg, 1, ""), + type: jspb.Message.getFieldWithDefault(msg, 2, 0) }; if (includeInstance) { @@ -3458,23 +4465,23 @@ proto.nitric.faas.v1.HttpTriggerContext.toObject = function(includeInstance, msg /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.faas.v1.HttpTriggerContext} + * @return {!proto.nitric.faas.v1.BucketNotification} */ -proto.nitric.faas.v1.HttpTriggerContext.deserializeBinary = function(bytes) { +proto.nitric.faas.v1.BucketNotification.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); + 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.HttpTriggerContext} msg The message object to deserialize into. + * @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.HttpTriggerContext} + * @return {!proto.nitric.faas.v1.BucketNotification} */ -proto.nitric.faas.v1.HttpTriggerContext.deserializeBinaryFromReader = function(msg, reader) { +proto.nitric.faas.v1.BucketNotification.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -3483,41 +4490,11 @@ proto.nitric.faas.v1.HttpTriggerContext.deserializeBinaryFromReader = function(m switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); - msg.setMethod(value); + msg.setKey(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, "", ""); - }); + var value = /** @type {!proto.nitric.faas.v1.BucketNotificationType} */ (reader.readEnum()); + msg.setType(value); break; default: reader.skipField(); @@ -3532,9 +4509,9 @@ proto.nitric.faas.v1.HttpTriggerContext.deserializeBinaryFromReader = function(m * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.nitric.faas.v1.HttpTriggerContext.prototype.serializeBinary = function() { +proto.nitric.faas.v1.BucketNotification.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.HttpTriggerContext.serializeBinaryToWriter(this, writer); + proto.nitric.faas.v1.BucketNotification.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -3542,195 +4519,90 @@ proto.nitric.faas.v1.HttpTriggerContext.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.HttpTriggerContext} message + * @param {!proto.nitric.faas.v1.BucketNotification} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.faas.v1.HttpTriggerContext.serializeBinaryToWriter = function(message, writer) { +proto.nitric.faas.v1.BucketNotification.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getMethod(); + f = message.getKey(); if (f.length > 0) { writer.writeString( 1, f ); } - f = message.getPath(); - if (f.length > 0) { - writer.writeString( + f = message.getType(); + if (f !== 0.0) { + writer.writeEnum( 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; + * optional string key = 1; * @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)); +proto.nitric.faas.v1.BucketNotification.prototype.getKey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * Clears values from the map. The map will be non-null. - * @return {!proto.nitric.faas.v1.HttpTriggerContext} returns this + * @param {string} value + * @return {!proto.nitric.faas.v1.BucketNotification} returns this */ -proto.nitric.faas.v1.HttpTriggerContext.prototype.clearHeadersMap = function() { - this.getHeadersMap().clear(); - return this;}; +proto.nitric.faas.v1.BucketNotification.prototype.setKey = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; /** - * map query_params = 6; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} + * optional BucketNotificationType type = 2; + * @return {!proto.nitric.faas.v1.BucketNotificationType} */ -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)); +proto.nitric.faas.v1.BucketNotification.prototype.getType = function() { + return /** @type {!proto.nitric.faas.v1.BucketNotificationType} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** - * Clears values from the map. The map will be non-null. - * @return {!proto.nitric.faas.v1.HttpTriggerContext} returns this + * @param {!proto.nitric.faas.v1.BucketNotificationType} value + * @return {!proto.nitric.faas.v1.BucketNotification} returns this */ -proto.nitric.faas.v1.HttpTriggerContext.prototype.clearQueryParamsMap = function() { - this.getQueryParamsMap().clear(); - return this;}; +proto.nitric.faas.v1.BucketNotification.prototype.setType = function(value) { + return jspb.Message.setProto3EnumField(this, 2, value); +}; + /** - * map path_params = 7; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} + * 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.HttpTriggerContext.prototype.getPathParamsMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 7, opt_noLazyCreate, - null)); -}; - +proto.nitric.faas.v1.NotificationTriggerContext.oneofGroups_ = [[10]]; /** - * Clears values from the map. The map will be non-null. - * @return {!proto.nitric.faas.v1.HttpTriggerContext} returns this + * @enum {number} */ -proto.nitric.faas.v1.HttpTriggerContext.prototype.clearPathParamsMap = function() { - this.getPathParamsMap().clear(); - return this;}; - +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])); +}; @@ -3747,8 +4619,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * 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); +proto.nitric.faas.v1.NotificationTriggerContext.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.faas.v1.NotificationTriggerContext.toObject(opt_includeInstance, this); }; @@ -3757,13 +4629,14 @@ proto.nitric.faas.v1.TopicTriggerContext.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.faas.v1.TopicTriggerContext} msg The msg instance to transform. + * @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.TopicTriggerContext.toObject = function(includeInstance, msg) { +proto.nitric.faas.v1.NotificationTriggerContext.toObject = function(includeInstance, msg) { var f, obj = { - topic: jspb.Message.getFieldWithDefault(msg, 1, "") + source: jspb.Message.getFieldWithDefault(msg, 1, ""), + bucket: (f = msg.getBucket()) && proto.nitric.faas.v1.BucketNotification.toObject(includeInstance, f) }; if (includeInstance) { @@ -3777,23 +4650,23 @@ proto.nitric.faas.v1.TopicTriggerContext.toObject = function(includeInstance, ms /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.faas.v1.TopicTriggerContext} + * @return {!proto.nitric.faas.v1.NotificationTriggerContext} */ -proto.nitric.faas.v1.TopicTriggerContext.deserializeBinary = function(bytes) { +proto.nitric.faas.v1.NotificationTriggerContext.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); + 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.TopicTriggerContext} msg The message object to deserialize into. + * @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.TopicTriggerContext} + * @return {!proto.nitric.faas.v1.NotificationTriggerContext} */ -proto.nitric.faas.v1.TopicTriggerContext.deserializeBinaryFromReader = function(msg, reader) { +proto.nitric.faas.v1.NotificationTriggerContext.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -3802,7 +4675,12 @@ proto.nitric.faas.v1.TopicTriggerContext.deserializeBinaryFromReader = function( switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); - msg.setTopic(value); + 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(); @@ -3817,9 +4695,9 @@ proto.nitric.faas.v1.TopicTriggerContext.deserializeBinaryFromReader = function( * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.nitric.faas.v1.TopicTriggerContext.prototype.serializeBinary = function() { +proto.nitric.faas.v1.NotificationTriggerContext.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.TopicTriggerContext.serializeBinaryToWriter(this, writer); + proto.nitric.faas.v1.NotificationTriggerContext.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -3827,40 +4705,85 @@ proto.nitric.faas.v1.TopicTriggerContext.prototype.serializeBinary = function() /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.TopicTriggerContext} message + * @param {!proto.nitric.faas.v1.NotificationTriggerContext} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.faas.v1.TopicTriggerContext.serializeBinaryToWriter = function(message, writer) { +proto.nitric.faas.v1.NotificationTriggerContext.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getTopic(); + 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 topic = 1; + * optional string source = 1; * @return {string} */ -proto.nitric.faas.v1.TopicTriggerContext.prototype.getTopic = function() { +proto.nitric.faas.v1.NotificationTriggerContext.prototype.getSource = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value - * @return {!proto.nitric.faas.v1.TopicTriggerContext} returns this + * @return {!proto.nitric.faas.v1.NotificationTriggerContext} returns this */ -proto.nitric.faas.v1.TopicTriggerContext.prototype.setTopic = function(value) { +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; +}; + + /** * Oneof group definitions for this message. Each group defines the field @@ -3870,7 +4793,7 @@ proto.nitric.faas.v1.TopicTriggerContext.prototype.setTopic = function(value) { * @private {!Array>} * @const */ -proto.nitric.faas.v1.TriggerResponse.oneofGroups_ = [[10,11]]; +proto.nitric.faas.v1.TriggerResponse.oneofGroups_ = [[10,11,12]]; /** * @enum {number} @@ -3878,7 +4801,8 @@ proto.nitric.faas.v1.TriggerResponse.oneofGroups_ = [[10,11]]; proto.nitric.faas.v1.TriggerResponse.ContextCase = { CONTEXT_NOT_SET: 0, HTTP: 10, - TOPIC: 11 + TOPIC: 11, + NOTIFICATION: 12 }; /** @@ -3921,7 +4845,8 @@ 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) + topic: (f = msg.getTopic()) && proto.nitric.faas.v1.TopicResponseContext.toObject(includeInstance, f), + notification: (f = msg.getNotification()) && proto.nitric.faas.v1.NotificationResponseContext.toObject(includeInstance, f) }; if (includeInstance) { @@ -3972,6 +4897,11 @@ proto.nitric.faas.v1.TriggerResponse.deserializeBinaryFromReader = function(msg, 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; default: reader.skipField(); break; @@ -4024,6 +4954,14 @@ proto.nitric.faas.v1.TriggerResponse.serializeBinaryToWriter = function(message, proto.nitric.faas.v1.TopicResponseContext.serializeBinaryToWriter ); } + f = message.getNotification(); + if (f != null) { + writer.writeMessage( + 12, + f, + proto.nitric.faas.v1.NotificationResponseContext.serializeBinaryToWriter + ); + } }; @@ -4143,6 +5081,43 @@ proto.nitric.faas.v1.TriggerResponse.prototype.hasTopic = function() { }; +/** + * 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; +}; + + @@ -4469,4 +5444,143 @@ proto.nitric.faas.v1.TopicResponseContext.prototype.setSuccess = function(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); +}; + + +/** + * @enum {number} + */ +proto.nitric.faas.v1.BucketNotificationType = { + ALL: 0, + CREATED: 1, + DELETED: 2 +}; + goog.object.extend(exports, proto.nitric.faas.v1); diff --git a/src/gen/proto/resource/v1/resource_pb.d.ts b/src/gen/proto/resource/v1/resource_pb.d.ts index 294e8f6c..a6e8510f 100644 --- a/src/gen/proto/resource/v1/resource_pb.d.ts +++ b/src/gen/proto/resource/v1/resource_pb.d.ts @@ -424,6 +424,7 @@ export interface ResourceTypeMap { COLLECTION: 7; POLICY: 8; SECRET: 9; + NOTIFICATION: 10; } export const ResourceType: ResourceTypeMap; diff --git a/src/gen/proto/resource/v1/resource_pb.js b/src/gen/proto/resource/v1/resource_pb.js index b6d90784..826f0c0b 100644 --- a/src/gen/proto/resource/v1/resource_pb.js +++ b/src/gen/proto/resource/v1/resource_pb.js @@ -3191,7 +3191,8 @@ proto.nitric.resource.v1.ResourceType = { SUBSCRIPTION: 6, COLLECTION: 7, POLICY: 8, - SECRET: 9 + SECRET: 9, + NOTIFICATION: 10 }; /** diff --git a/src/resources/api.ts b/src/resources/api.ts index 167f022a..77ddce85 100644 --- a/src/resources/api.ts +++ b/src/resources/api.ts @@ -20,7 +20,6 @@ import { Resource, ResourceDeclareRequest, ResourceDeclareResponse, - ResourceDetailsRequest, ResourceDetailsResponse, ResourceType, ResourceTypeMap, @@ -28,7 +27,7 @@ import { import { fromGrpcError } from '../api/errors'; import resourceClient from './client'; import { HttpMethod } from '../types'; -import { make, newer, Resource as Base } from './common'; +import { make, Resource as Base } from './common'; import path from 'path'; export class ApiWorkerOptions { @@ -50,7 +49,7 @@ export class ApiWorkerOptions { } } -interface MethodOptions { +export interface MethodOptions { /** * Optional security definitions for this method */ @@ -81,7 +80,7 @@ class Method { } } -interface RouteOpts { +export interface RouteOptions { /** * Optional middleware to apply to all methods for the route. Useful for universal middleware such as CORS or Auth. */ @@ -93,22 +92,26 @@ export class Route { public readonly path: string; public readonly middleware: HttpMiddleware[]; - constructor(api: Api, path: string, opts: RouteOpts = {}) { + constructor( + api: Api, + path: string, + options: RouteOptions = {} + ) { this.api = api; this.path = path; - const { middleware = [] } = opts; + const { middleware = [] } = options; this.middleware = composeMiddleware(middleware); } async method( methods: HttpMethod[], - opts: MethodOptions, + options: MethodOptions, ...middleware: HttpMiddleware[] ): Promise { const getHandler = new Method( this, methods, - opts, + options, ...this.middleware, ...middleware ); @@ -119,118 +122,118 @@ export class Route { * Register a handler function for GET requests to this route * * @param middleware that should be run on any GET request to this route - * @param opts the options for this method, such as security definitions + * @param options for this method, such as security definitions * @returns a Promise that resolves if the handler stops running */ async get( middleware: HttpMiddleware | HttpMiddleware[], - opts: MethodOptions = {} + options: MethodOptions = {} ): Promise { - return this.method(['GET'], opts, ...composeMiddleware(middleware)); + return this.method(['GET'], options, ...composeMiddleware(middleware)); } /** * Register a handler function for POST requests to this route * * @param middleware that should respond to any matching requests to this route and method - * @param opts the options for this method, such as security definitions + * @param options for this method, such as security definitions * @returns a Promise that resolves if the handler stops running */ async post( middleware: HttpMiddleware | HttpMiddleware[], - opts: MethodOptions = {} + options: MethodOptions = {} ): Promise { - return this.method(['POST'], opts, ...composeMiddleware(middleware)); + return this.method(['POST'], options, ...composeMiddleware(middleware)); } /** * Register a handler function for PUT requests to this route * * @param middleware that should respond to any matching requests to this route and method - * @param opts the options for this method, such as security definitions + * @param options for this method, such as security definitions * @returns a Promise that resolves if the handler stops running */ async put( middleware: HttpMiddleware | HttpMiddleware[], - opts: MethodOptions = {} + options: MethodOptions = {} ): Promise { - return this.method(['PUT'], opts, ...composeMiddleware(middleware)); + return this.method(['PUT'], options, ...composeMiddleware(middleware)); } /** * Register a handler function for PATCH requests to this route * * @param middleware that should respond to any matching requests to this route and method - * @param opts the options for this method, such as security definitions + * @param options for this method, such as security definitions * @returns a Promise that resolves if the handler stops running */ async patch( middleware: HttpMiddleware | HttpMiddleware[], - opts: MethodOptions = {} + options: MethodOptions = {} ): Promise { - return this.method(['PATCH'], opts, ...composeMiddleware(middleware)); + return this.method(['PATCH'], options, ...composeMiddleware(middleware)); } /** * Register a handler function for DELETE requests to this route * * @param middleware that should respond to any matching requests to this route and method - * @param opts the options for this method, such as security definitions + * @param options for this method, such as security definitions * @returns a Promise that resolves if the handler stops running */ async delete( middleware: HttpMiddleware | HttpMiddleware[], - opts: MethodOptions = {} + options: MethodOptions = {} ): Promise { - return this.method(['DELETE'], opts, ...composeMiddleware(middleware)); + return this.method(['DELETE'], options, ...composeMiddleware(middleware)); } /** * Register a handler function for OPTIONS requests to this route * * @param middleware that should respond to any matching requests to this route and method - * @param opts the options for this method, such as security definitions + * @param options for this method, such as security definitions * @returns a Promise that resolves if the handler stops running */ async options( middleware: HttpMiddleware | HttpMiddleware[], - opts: MethodOptions = {} + options: MethodOptions = {} ): Promise { - return this.method(['OPTIONS'], opts, ...composeMiddleware(middleware)); + return this.method(['OPTIONS'], options, ...composeMiddleware(middleware)); } /** * Register a handler function for GET, POST, PATCH, PUT and DELETE requests to this route * * @param middleware that should respond to matching requests to this route and all HTTP methods - * @param opts the options for this method, such as security definitions + * @param options for this method, such as security definitions * @returns a Promise that resolves if the handler stops running */ async all( middleware: HttpMiddleware | HttpMiddleware[], - opts: MethodOptions = {} + options: MethodOptions = {} ): Promise { return this.method( ['GET', 'POST', 'PATCH', 'PUT', 'DELETE', 'OPTIONS'], - opts, + options, ...composeMiddleware(middleware) ); } } -interface BaseSecurityDefinition { +export interface BaseSecurityDefinition { kind: T; } -interface JwtSecurityDefinition extends BaseSecurityDefinition<'jwt'> { +export interface JwtSecurityDefinition extends BaseSecurityDefinition<'jwt'> { issuer: string; audiences: string[]; } // TODO: Union type for multiple security definition mappings -type SecurityDefinition = JwtSecurityDefinition; +export type SecurityDefinition = JwtSecurityDefinition; -interface ApiOpts { +export interface ApiOptions { /** * The base path for all routes in the API. * @@ -249,7 +252,7 @@ interface ApiOpts { securityDefinitions?: Record; /** - * Optional root level secruity for the API + * Optional root level security for the API */ security?: Record; } @@ -274,7 +277,7 @@ export class Api extends Base { >; private readonly security?: Record; - constructor(name: string, options: ApiOpts = {}) { + constructor(name: string, options: ApiOptions = {}) { super(name); const { middleware, @@ -307,7 +310,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?: RouteOpts): 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('/'); @@ -337,15 +340,15 @@ export class Api extends Base { * * @param match the route path matcher e.g. '/home'. Supports path params via colon prefix e.g. '/customers/:customerId' * @param middleware the middleware/handler to register for calls to GET - * @param opts the options for this method, such as security definitions + * @param options for this method, such as security definitions * @returns A Promise that resolves when the handler terminates. */ async get( match: string, middleware: HttpMiddleware | HttpMiddleware[], - opts: MethodOptions = {} + options: MethodOptions = {} ): Promise { - return this.route(match).get(composeMiddleware(middleware), opts); + return this.route(match).get(composeMiddleware(middleware), options); } /** @@ -353,15 +356,15 @@ export class Api extends Base { * * @param match the route path matcher e.g. '/home'. Supports path params via colon prefix e.g. '/customers/:customerId' * @param middleware the middleware/handler to register for calls to POST - * @param opts the options for this method, such as security definitions + * @param options for this method, such as security definitions * @returns A Promise that resolves when the handler terminates. */ async post( match: string, middleware: HttpMiddleware | HttpMiddleware[], - opts: MethodOptions = {} + options: MethodOptions = {} ): Promise { - return this.route(match).post(composeMiddleware(middleware), opts); + return this.route(match).post(composeMiddleware(middleware), options); } /** @@ -369,15 +372,15 @@ export class Api extends Base { * * @param match the route path matcher e.g. '/home'. Supports path params via colon prefix e.g. '/customers/:customerId' * @param middleware the middleware/handler to register for calls to PUT - * @param opts the options for this method, such as security definitions + * @param options for this method, such as security definitions * @returns A Promise that resolves when the handler terminates. */ async put( match: string, middleware: HttpMiddleware | HttpMiddleware[], - opts: MethodOptions = {} + options: MethodOptions = {} ): Promise { - return this.route(match).put(composeMiddleware(middleware), opts); + return this.route(match).put(composeMiddleware(middleware), options); } /** @@ -385,15 +388,15 @@ export class Api extends Base { * * @param match the route path matcher e.g. '/home'. Supports path params via colon prefix e.g. '/customers/:customerId' * @param middleware the middleware/handler to register for calls to PATCH - * @param opts the options for this method, such as security definitions + * @param options for this method, such as security definitions * @returns A Promise that resolves when the handler terminates. */ async patch( match: string, middleware: HttpMiddleware | HttpMiddleware[], - opts: MethodOptions = {} + options: MethodOptions = {} ): Promise { - return this.route(match).patch(composeMiddleware(middleware), opts); + return this.route(match).patch(composeMiddleware(middleware), options); } /** @@ -401,15 +404,15 @@ export class Api extends Base { * * @param match the route path matcher e.g. '/home'. Supports path params via colon prefix e.g. '/customers/:customerId' * @param middleware the middleware/handler to register for calls to DELETE - * @param opts the options for this method, such as security definitions + * @param options for this method, such as security definitions * @returns A Promise that resolves when the handler terminates. */ async delete( match: string, middleware: HttpMiddleware | HttpMiddleware[], - opts: MethodOptions = {} + options: MethodOptions = {} ): Promise { - return this.route(match).delete(composeMiddleware(middleware), opts); + return this.route(match).delete(composeMiddleware(middleware), options); } /** @@ -417,15 +420,15 @@ export class Api extends Base { * * @param match the route path matcher e.g. '/home'. Supports path params via colon prefix e.g. '/customers/:customerId' * @param middleware the middleware/handler to register for calls to DELETE - * @param opts the options for this method, such as security definitions + * @param options for this method, such as security definitions * @returns A Promise that resolves when the handler terminates. */ async options( match: string, middleware: HttpMiddleware | HttpMiddleware[], - opts: MethodOptions = {} + options: MethodOptions = {} ): Promise { - return this.route(match).options(composeMiddleware(middleware), opts); + return this.route(match).options(composeMiddleware(middleware), options); } /** @@ -498,16 +501,13 @@ export class Api extends Base { req.setResource(resource); return new Promise((resolve, reject) => { - resourceClient.declare( - req, - (error, response: ResourceDeclareResponse) => { - if (error) { - reject(fromGrpcError(error)); - } else { - resolve(resource); - } + resourceClient.declare(req, (error, _: ResourceDeclareResponse) => { + if (error) { + reject(fromGrpcError(error)); + } else { + resolve(resource); } - ); + }); }); } } @@ -524,19 +524,19 @@ export class Api extends Base { */ export const api: ( name: string, - options?: ApiOpts + options?: ApiOptions ) => Api = make(Api); /** * Create a JWT security definition. * - * @param opts security definition options + * @param options security definition options * @returns the new security definition. */ export const jwt = ( - opts: Omit + options: Omit ): JwtSecurityDefinition => { - return { kind: 'jwt', issuer: opts.issuer, audiences: opts.audiences }; + return { kind: 'jwt', issuer: options.issuer, audiences: options.audiences }; }; const composeMiddleware = (middleware: HttpMiddleware | HttpMiddleware[]) => diff --git a/src/resources/bucket.ts b/src/resources/bucket.ts index a76e313b..8c85d284 100644 --- a/src/resources/bucket.ts +++ b/src/resources/bucket.ts @@ -23,11 +23,109 @@ import resourceClient from './client'; import { storage, Bucket } from '../api/storage'; import { ActionsList, make, SecureResource } from './common'; import { fromGrpcError } from '../api/errors'; +import { + Faas, + BucketNotificationMiddleware, + FileNotificationMiddleware, +} from '../faas'; +import { BucketNotificationType as ProtoBucketNotificationType } from '../gen/proto/faas/v1/faas_pb'; type BucketPermission = 'reading' | 'writing' | 'deleting'; const everything: BucketPermission[] = ['reading', 'writing', 'deleting']; +export type BucketNotificationType = 'write' | 'delete'; + +export class BucketNotificationWorkerOptions { + public readonly bucket: string; + public readonly notificationType: 0 | 1 | 2; + public readonly notificationPrefixFilter: string; + + constructor( + bucket: string, + notificationType: BucketNotificationType, + notificationPrefixFilter: string + ) { + this.bucket = bucket; + this.notificationType = + BucketNotificationWorkerOptions.toGrpcEvent(notificationType); + this.notificationPrefixFilter = notificationPrefixFilter; + } + + static toGrpcEvent(notificationType: BucketNotificationType): 0 | 1 | 2 { + switch (notificationType) { + case 'write': + return ProtoBucketNotificationType.CREATED; + case 'delete': + return ProtoBucketNotificationType.DELETED; + default: + throw new Error(`notification type ${notificationType} is unsupported`); + } + } +} + +export class FileNotificationWorkerOptions extends BucketNotificationWorkerOptions { + public readonly bucketRef: Bucket; + + constructor( + bucketRef: Bucket, + notificationType: BucketNotificationType, + notificationPrefixFilter: string + ) { + super(bucketRef.name, notificationType, notificationPrefixFilter); + + this.bucketRef = bucketRef; + } +} + +export class BucketNotification { + private readonly faas: Faas; + + constructor( + bucket: string, + notificationType: BucketNotificationType, + notificationPrefixFilter, + ...middleware: BucketNotificationMiddleware[] + ) { + this.faas = new Faas( + new BucketNotificationWorkerOptions( + bucket, + notificationType, + notificationPrefixFilter + ) + ); + this.faas.bucketNotification(...middleware); + } + + private async start(): Promise { + return this.faas.start(); + } +} + +export class FileNotification { + private readonly faas: Faas; + + constructor( + bucket: Bucket, + notificationType: BucketNotificationType, + notificationPrefixFilter, + ...middleware: FileNotificationMiddleware[] + ) { + this.faas = new Faas( + new FileNotificationWorkerOptions( + bucket, + notificationType, + notificationPrefixFilter + ) + ); + this.faas.bucketNotification(...middleware); + } + + private async start(): Promise { + return this.faas.start(); + } +} + /** * Cloud storage bucket resource for large file storage. */ @@ -46,19 +144,38 @@ export class BucketResource extends SecureResource { req.setResource(resource); return new Promise((resolve, reject) => { - resourceClient.declare( - req, - (error, response: ResourceDeclareResponse) => { - if (error) { - reject(fromGrpcError(error)); - } else { - resolve(resource); - } + resourceClient.declare(req, (error, _: ResourceDeclareResponse) => { + if (error) { + reject(fromGrpcError(error)); + } else { + resolve(resource); } - ); + }); }); } + /** + * Register and start a bucket notification handler that will be called for all matching notification events on this bucket + * + * @param notificationType the notification type that should trigger the middleware, either 'write' or 'delete' + * @param notificationPrefixFilter the file name prefix that files must match to trigger a notification + * @param middleware handler middleware which will be run for every incoming event + * @returns Promise which resolves when the handler server terminates + */ + on( + notificationType: BucketNotificationType, + notificationPrefixFilter: string, + ...middleware: BucketNotificationMiddleware[] + ): Promise { + const notification = new BucketNotification( + this.name, + notificationType, + notificationPrefixFilter, + ...middleware + ); + return notification['start'](); + } + protected permsToActions(...perms: BucketPermission[]): ActionsList { return perms.reduce((actions, perm) => { switch (perm) { diff --git a/src/resources/queue.ts b/src/resources/queue.ts index 03f7bb99..393a93c5 100644 --- a/src/resources/queue.ts +++ b/src/resources/queue.ts @@ -16,7 +16,6 @@ import { ResourceDeclareRequest, ResourceType, Action, - ActionMap, ResourceDeclareResponse, } from '@nitric/api/proto/resource/v1/resource_pb'; import resourceClient from './client'; diff --git a/src/resources/schedule.ts b/src/resources/schedule.ts index 95c104e4..ca595110 100644 --- a/src/resources/schedule.ts +++ b/src/resources/schedule.ts @@ -48,7 +48,11 @@ class Rate { public readonly schedule: Schedule; private readonly faas: Faas; - constructor(schedule: Schedule, rate: string, ...mw: ScheduleMiddleware[]) { + constructor( + schedule: Schedule, + rate: string, + ...middleware: ScheduleMiddleware[] + ) { const [, frequency] = rate.split(' '); const normalizedFrequency = frequency.toLocaleLowerCase() as Frequency; @@ -75,7 +79,7 @@ class Rate { normalizedFrequency ) ); - this.faas.event(...mw); + this.faas.event(...middleware); } private async start(): Promise { @@ -90,10 +94,14 @@ class Cron { public readonly schedule: Schedule; private readonly faas: Faas; - constructor(schedule: Schedule, cron: string, ...mw: ScheduleMiddleware[]) { + constructor( + schedule: Schedule, + cron: string, + ...middleware: ScheduleMiddleware[] + ) { this.schedule = schedule; this.faas = new Faas(new CronWorkerOptions(schedule['description'], cron)); - this.faas.event(...mw); + this.faas.event(...middleware); } private async start(): Promise { @@ -115,22 +123,28 @@ class Schedule { * Run this schedule on the provided frequency. * * @param rate to run the schedule, e.g. '7 days'. All rates accept a number and a frequency. Valid frequencies are 'days', 'hours' or 'minutes'. - * @param mw the handler/middleware to run on a schedule + * @param middleware the handler/middleware to run on a schedule * @returns A promise that resolves when the schedule worker stops running. */ - every = (rate: string, ...mw: ScheduleMiddleware[]): Promise => { + every = ( + rate: string, + ...middleware: ScheduleMiddleware[] + ): Promise => { // handle singular frequencies. e.g. schedule('something').every('day') if (FREQUENCIES.indexOf(`${rate}s` as Frequency) !== -1) { rate = `1 ${rate}s`; // 'day' becomes '1 days' } - const r = new Rate(this, rate, ...mw); + const r = new Rate(this, rate, ...middleware); // Start the new rate immediately return r['start'](); }; - cron = (expression: string, ...mw: ScheduleMiddleware[]): Promise => { - const r = new Cron(this, expression, ...mw); + cron = ( + expression: string, + ...middleware: ScheduleMiddleware[] + ): Promise => { + const r = new Cron(this, expression, ...middleware); // Start the new cron immediately return r['start'](); }; diff --git a/src/resources/topic.test.ts b/src/resources/topic.test.ts index f1c336a1..7f5c61c8 100644 --- a/src/resources/topic.test.ts +++ b/src/resources/topic.test.ts @@ -160,7 +160,7 @@ describe('subscription', () => { expect(faas.Faas).toBeCalledTimes(1); }); - it('should provide Faas with ApiWorkerOptions', () => { + it('should provide Faas with SubscriptionWorkerOptions', () => { const expectedOpts = new SubscriptionWorkerOptions('test-subscribe'); expect(faas.Faas).toBeCalledWith(expectedOpts); }); diff --git a/src/resources/topic.ts b/src/resources/topic.ts index c60d307c..2cf9d1af 100644 --- a/src/resources/topic.ts +++ b/src/resources/topic.ts @@ -41,9 +41,9 @@ export class SubscriptionWorkerOptions { class Subscription = Record> { private readonly faas: Faas; - constructor(name: string, ...mw: EventMiddleware[]) { + constructor(name: string, ...middleware: EventMiddleware[]) { this.faas = new Faas(new SubscriptionWorkerOptions(name)); - this.faas.event(...mw); + this.faas.event(...middleware); } private async start(): Promise { @@ -105,11 +105,11 @@ export class TopicResource< /** * Register and start a subscription handler that will be called for all events from this topic. * - * @param mw handler middleware which will be run for every incoming event + * @param middleware handler middleware which will be run for every incoming event * @returns Promise which resolves when the handler server terminates */ - subscribe(...mw: EventMiddleware[]): Promise { - const sub = new Subscription(this.name, ...mw); + subscribe(...middleware: EventMiddleware[]): Promise { + const sub = new Subscription(this.name, ...middleware); return sub['start'](); }