UNPKG

@ondewo/survey-client-angular

Version:

ONDEWO Survey client library for angular

1 lines 293 kB
{"version":3,"file":"ondewo-survey-client-angular.mjs","sources":["../../api/ondewo/survey/fhir.pb.ts","../../api/ondewo/survey/survey.pb.ts","../../api/ondewo/survey/fhir.pbconf.ts","../../api/ondewo/survey/fhir.pbsc.ts","../../api/ondewo/survey/survey.pbconf.ts","../../api/ondewo/survey/survey.pbsc.ts","../../api/google/api/http.pb.ts","../../ondewo-survey-client-angular.ts"],"sourcesContent":["/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\n//\n// THIS IS A GENERATED FILE\n// DO NOT MODIFY IT! YOUR CHANGES WILL BE LOST\nimport {\n GrpcMessage,\n RecursivePartial,\n ToProtobufJSONOptions\n} from '@ngx-grpc/common';\nimport { BinaryReader, BinaryWriter, ByteSource } from 'google-protobuf';\nimport * as googleApi000 from '../../google/api/http.pb';\nimport * as googleProtobuf001 from '@ngx-grpc/well-known-types';\nimport * as googleApi002 from '../../google/api/annotations.pb';\nimport * as googleProtobuf003 from '@ngx-grpc/well-known-types';\nimport * as googleProtobuf004 from '@ngx-grpc/well-known-types';\nimport * as ondewoSurvey005 from '../../ondewo/survey/survey.pb';\nimport * as googleProtobuf006 from '@ngx-grpc/well-known-types';\n/**\n * Message implementation for ondewo.survey.CreateFHIRSurveyRequest\n */\nexport class CreateFHIRSurveyRequest implements GrpcMessage {\n static id = 'ondewo.survey.CreateFHIRSurveyRequest';\n\n /**\n * Deserialize binary data to message\n * @param instance message instance\n */\n static deserializeBinary(bytes: ByteSource) {\n const instance = new CreateFHIRSurveyRequest();\n CreateFHIRSurveyRequest.deserializeBinaryFromReader(\n instance,\n new BinaryReader(bytes)\n );\n return instance;\n }\n\n /**\n * Check all the properties and set default protobuf values if necessary\n * @param _instance message instance\n */\n static refineValues(_instance: CreateFHIRSurveyRequest) {\n _instance.fhirQuestionnaire = _instance.fhirQuestionnaire || undefined;\n }\n\n /**\n * Deserializes / reads binary message into message instance using provided binary reader\n * @param _instance message instance\n * @param _reader binary reader instance\n */\n static deserializeBinaryFromReader(\n _instance: CreateFHIRSurveyRequest,\n _reader: BinaryReader\n ) {\n while (_reader.nextField()) {\n if (_reader.isEndGroup()) break;\n\n switch (_reader.getFieldNumber()) {\n case 1:\n _instance.fhirQuestionnaire = new googleProtobuf006.Struct();\n _reader.readMessage(\n _instance.fhirQuestionnaire,\n googleProtobuf006.Struct.deserializeBinaryFromReader\n );\n break;\n default:\n _reader.skipField();\n }\n }\n\n CreateFHIRSurveyRequest.refineValues(_instance);\n }\n\n /**\n * Serializes a message to binary format using provided binary reader\n * @param _instance message instance\n * @param _writer binary writer instance\n */\n static serializeBinaryToWriter(\n _instance: CreateFHIRSurveyRequest,\n _writer: BinaryWriter\n ) {\n if (_instance.fhirQuestionnaire) {\n _writer.writeMessage(\n 1,\n _instance.fhirQuestionnaire as any,\n googleProtobuf006.Struct.serializeBinaryToWriter\n );\n }\n }\n\n private _fhirQuestionnaire?: googleProtobuf006.Struct;\n\n /**\n * Message constructor. Initializes the properties and applies default Protobuf values if necessary\n * @param _value initial values object or instance of CreateFHIRSurveyRequest to deeply clone from\n */\n constructor(_value?: RecursivePartial<CreateFHIRSurveyRequest.AsObject>) {\n _value = _value || {};\n this.fhirQuestionnaire = _value.fhirQuestionnaire\n ? new googleProtobuf006.Struct(_value.fhirQuestionnaire)\n : undefined;\n CreateFHIRSurveyRequest.refineValues(this);\n }\n get fhirQuestionnaire(): googleProtobuf006.Struct | undefined {\n return this._fhirQuestionnaire;\n }\n set fhirQuestionnaire(value: googleProtobuf006.Struct | undefined) {\n this._fhirQuestionnaire = value;\n }\n\n /**\n * Serialize message to binary data\n * @param instance message instance\n */\n serializeBinary() {\n const writer = new BinaryWriter();\n CreateFHIRSurveyRequest.serializeBinaryToWriter(this, writer);\n return writer.getResultBuffer();\n }\n\n /**\n * Cast message to standard JavaScript object (all non-primitive values are deeply cloned)\n */\n toObject(): CreateFHIRSurveyRequest.AsObject {\n return {\n fhirQuestionnaire: this.fhirQuestionnaire\n ? this.fhirQuestionnaire.toObject()\n : undefined\n };\n }\n\n /**\n * Convenience method to support JSON.stringify(message), replicates the structure of toObject()\n */\n toJSON() {\n return this.toObject();\n }\n\n /**\n * Cast message to JSON using protobuf JSON notation: https://developers.google.com/protocol-buffers/docs/proto3#json\n * Attention: output differs from toObject() e.g. enums are represented as names and not as numbers, Timestamp is an ISO Date string format etc.\n * If the message itself or some of descendant messages is google.protobuf.Any, you MUST provide a message pool as options. If not, the messagePool is not required\n */\n toProtobufJSON(\n // @ts-ignore\n options?: ToProtobufJSONOptions\n ): CreateFHIRSurveyRequest.AsProtobufJSON {\n return {\n fhirQuestionnaire: this.fhirQuestionnaire\n ? this.fhirQuestionnaire.toProtobufJSON(options)\n : null\n };\n }\n}\nexport module CreateFHIRSurveyRequest {\n /**\n * Standard JavaScript object representation for CreateFHIRSurveyRequest\n */\n export interface AsObject {\n fhirQuestionnaire?: googleProtobuf006.Struct.AsObject;\n }\n\n /**\n * Protobuf JSON representation for CreateFHIRSurveyRequest\n */\n export interface AsProtobufJSON {\n fhirQuestionnaire: googleProtobuf006.Struct.AsProtobufJSON | null;\n }\n}\n\n/**\n * Message implementation for ondewo.survey.SurveyFHIRAnswersResponse\n */\nexport class SurveyFHIRAnswersResponse implements GrpcMessage {\n static id = 'ondewo.survey.SurveyFHIRAnswersResponse';\n\n /**\n * Deserialize binary data to message\n * @param instance message instance\n */\n static deserializeBinary(bytes: ByteSource) {\n const instance = new SurveyFHIRAnswersResponse();\n SurveyFHIRAnswersResponse.deserializeBinaryFromReader(\n instance,\n new BinaryReader(bytes)\n );\n return instance;\n }\n\n /**\n * Check all the properties and set default protobuf values if necessary\n * @param _instance message instance\n */\n static refineValues(_instance: SurveyFHIRAnswersResponse) {\n _instance.surveyId = _instance.surveyId || '';\n _instance.fhirQuestionnaireResponses =\n _instance.fhirQuestionnaireResponses || [];\n }\n\n /**\n * Deserializes / reads binary message into message instance using provided binary reader\n * @param _instance message instance\n * @param _reader binary reader instance\n */\n static deserializeBinaryFromReader(\n _instance: SurveyFHIRAnswersResponse,\n _reader: BinaryReader\n ) {\n while (_reader.nextField()) {\n if (_reader.isEndGroup()) break;\n\n switch (_reader.getFieldNumber()) {\n case 1:\n _instance.surveyId = _reader.readString();\n break;\n case 2:\n const messageInitializer2 = new googleProtobuf006.Struct();\n _reader.readMessage(\n messageInitializer2,\n googleProtobuf006.Struct.deserializeBinaryFromReader\n );\n (_instance.fhirQuestionnaireResponses =\n _instance.fhirQuestionnaireResponses || []).push(\n messageInitializer2\n );\n break;\n default:\n _reader.skipField();\n }\n }\n\n SurveyFHIRAnswersResponse.refineValues(_instance);\n }\n\n /**\n * Serializes a message to binary format using provided binary reader\n * @param _instance message instance\n * @param _writer binary writer instance\n */\n static serializeBinaryToWriter(\n _instance: SurveyFHIRAnswersResponse,\n _writer: BinaryWriter\n ) {\n if (_instance.surveyId) {\n _writer.writeString(1, _instance.surveyId);\n }\n if (\n _instance.fhirQuestionnaireResponses &&\n _instance.fhirQuestionnaireResponses.length\n ) {\n _writer.writeRepeatedMessage(\n 2,\n _instance.fhirQuestionnaireResponses as any,\n googleProtobuf006.Struct.serializeBinaryToWriter\n );\n }\n }\n\n private _surveyId: string;\n private _fhirQuestionnaireResponses?: googleProtobuf006.Struct[];\n\n /**\n * Message constructor. Initializes the properties and applies default Protobuf values if necessary\n * @param _value initial values object or instance of SurveyFHIRAnswersResponse to deeply clone from\n */\n constructor(_value?: RecursivePartial<SurveyFHIRAnswersResponse.AsObject>) {\n _value = _value || {};\n this.surveyId = _value.surveyId;\n this.fhirQuestionnaireResponses = (\n _value.fhirQuestionnaireResponses || []\n ).map(m => new googleProtobuf006.Struct(m));\n SurveyFHIRAnswersResponse.refineValues(this);\n }\n get surveyId(): string {\n return this._surveyId;\n }\n set surveyId(value: string) {\n this._surveyId = value;\n }\n get fhirQuestionnaireResponses(): googleProtobuf006.Struct[] | undefined {\n return this._fhirQuestionnaireResponses;\n }\n set fhirQuestionnaireResponses(\n value: googleProtobuf006.Struct[] | undefined\n ) {\n this._fhirQuestionnaireResponses = value;\n }\n\n /**\n * Serialize message to binary data\n * @param instance message instance\n */\n serializeBinary() {\n const writer = new BinaryWriter();\n SurveyFHIRAnswersResponse.serializeBinaryToWriter(this, writer);\n return writer.getResultBuffer();\n }\n\n /**\n * Cast message to standard JavaScript object (all non-primitive values are deeply cloned)\n */\n toObject(): SurveyFHIRAnswersResponse.AsObject {\n return {\n surveyId: this.surveyId,\n fhirQuestionnaireResponses: (\n this.fhirQuestionnaireResponses || []\n ).map(m => m.toObject())\n };\n }\n\n /**\n * Convenience method to support JSON.stringify(message), replicates the structure of toObject()\n */\n toJSON() {\n return this.toObject();\n }\n\n /**\n * Cast message to JSON using protobuf JSON notation: https://developers.google.com/protocol-buffers/docs/proto3#json\n * Attention: output differs from toObject() e.g. enums are represented as names and not as numbers, Timestamp is an ISO Date string format etc.\n * If the message itself or some of descendant messages is google.protobuf.Any, you MUST provide a message pool as options. If not, the messagePool is not required\n */\n toProtobufJSON(\n // @ts-ignore\n options?: ToProtobufJSONOptions\n ): SurveyFHIRAnswersResponse.AsProtobufJSON {\n return {\n surveyId: this.surveyId,\n fhirQuestionnaireResponses: (\n this.fhirQuestionnaireResponses || []\n ).map(m => m.toProtobufJSON(options))\n };\n }\n}\nexport module SurveyFHIRAnswersResponse {\n /**\n * Standard JavaScript object representation for SurveyFHIRAnswersResponse\n */\n export interface AsObject {\n surveyId: string;\n fhirQuestionnaireResponses?: googleProtobuf006.Struct.AsObject[];\n }\n\n /**\n * Protobuf JSON representation for SurveyFHIRAnswersResponse\n */\n export interface AsProtobufJSON {\n surveyId: string;\n fhirQuestionnaireResponses:\n | googleProtobuf006.Struct.AsProtobufJSON[]\n | null;\n }\n}\n","/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\n//\n// THIS IS A GENERATED FILE\n// DO NOT MODIFY IT! YOUR CHANGES WILL BE LOST\nimport {\n GrpcMessage,\n RecursivePartial,\n ToProtobufJSONOptions\n} from '@ngx-grpc/common';\nimport { BinaryReader, BinaryWriter, ByteSource } from 'google-protobuf';\nimport * as googleApi000 from '../../google/api/http.pb';\nimport * as googleProtobuf001 from '@ngx-grpc/well-known-types';\nimport * as googleApi002 from '../../google/api/annotations.pb';\nimport * as googleProtobuf003 from '@ngx-grpc/well-known-types';\nimport * as googleProtobuf004 from '@ngx-grpc/well-known-types';\nexport enum SubFlow {\n SUBFLOW_UNSPECIFIED = 0,\n BOT = 1,\n LEGAL_ENTITY = 2,\n POSTAL_ADDRESS = 3,\n EMAIL_ADDRESS = 4,\n PHONE_NUMBER = 5,\n PHONE_HOURS = 6,\n EXPECTED_DURATION = 7,\n PURPOSE = 8\n}\n/**\n * Message implementation for ondewo.survey.Survey\n */\nexport class Survey implements GrpcMessage {\n static id = 'ondewo.survey.Survey';\n\n /**\n * Deserialize binary data to message\n * @param instance message instance\n */\n static deserializeBinary(bytes: ByteSource) {\n const instance = new Survey();\n Survey.deserializeBinaryFromReader(instance, new BinaryReader(bytes));\n return instance;\n }\n\n /**\n * Check all the properties and set default protobuf values if necessary\n * @param _instance message instance\n */\n static refineValues(_instance: Survey) {\n _instance.surveyId = _instance.surveyId || '';\n _instance.displayName = _instance.displayName || '';\n _instance.languageCode = _instance.languageCode || '';\n _instance.questions = _instance.questions || [];\n _instance.surveyInfo = _instance.surveyInfo || undefined;\n _instance.excludeSubflows = _instance.excludeSubflows || [];\n _instance.status = _instance.status || 0;\n }\n\n /**\n * Deserializes / reads binary message into message instance using provided binary reader\n * @param _instance message instance\n * @param _reader binary reader instance\n */\n static deserializeBinaryFromReader(_instance: Survey, _reader: BinaryReader) {\n while (_reader.nextField()) {\n if (_reader.isEndGroup()) break;\n\n switch (_reader.getFieldNumber()) {\n case 1:\n _instance.surveyId = _reader.readString();\n break;\n case 2:\n _instance.displayName = _reader.readString();\n break;\n case 3:\n _instance.languageCode = _reader.readString();\n break;\n case 7:\n const messageInitializer7 = new Question();\n _reader.readMessage(\n messageInitializer7,\n Question.deserializeBinaryFromReader\n );\n (_instance.questions = _instance.questions || []).push(\n messageInitializer7\n );\n break;\n case 8:\n _instance.surveyInfo = new SurveyInfo();\n _reader.readMessage(\n _instance.surveyInfo,\n SurveyInfo.deserializeBinaryFromReader\n );\n break;\n case 9:\n (_instance.excludeSubflows = _instance.excludeSubflows || []).push(\n ...(_reader.readPackedEnum() || [])\n );\n break;\n case 10:\n _instance.status = _reader.readEnum();\n break;\n default:\n _reader.skipField();\n }\n }\n\n Survey.refineValues(_instance);\n }\n\n /**\n * Serializes a message to binary format using provided binary reader\n * @param _instance message instance\n * @param _writer binary writer instance\n */\n static serializeBinaryToWriter(_instance: Survey, _writer: BinaryWriter) {\n if (_instance.surveyId) {\n _writer.writeString(1, _instance.surveyId);\n }\n if (_instance.displayName) {\n _writer.writeString(2, _instance.displayName);\n }\n if (_instance.languageCode) {\n _writer.writeString(3, _instance.languageCode);\n }\n if (_instance.questions && _instance.questions.length) {\n _writer.writeRepeatedMessage(\n 7,\n _instance.questions as any,\n Question.serializeBinaryToWriter\n );\n }\n if (_instance.surveyInfo) {\n _writer.writeMessage(\n 8,\n _instance.surveyInfo as any,\n SurveyInfo.serializeBinaryToWriter\n );\n }\n if (_instance.excludeSubflows && _instance.excludeSubflows.length) {\n _writer.writePackedEnum(9, _instance.excludeSubflows);\n }\n if (_instance.status) {\n _writer.writeEnum(10, _instance.status);\n }\n }\n\n private _surveyId: string;\n private _displayName: string;\n private _languageCode: string;\n private _questions?: Question[];\n private _surveyInfo?: SurveyInfo;\n private _excludeSubflows: SubFlow[];\n private _status: Survey.AgentStatus;\n\n /**\n * Message constructor. Initializes the properties and applies default Protobuf values if necessary\n * @param _value initial values object or instance of Survey to deeply clone from\n */\n constructor(_value?: RecursivePartial<Survey.AsObject>) {\n _value = _value || {};\n this.surveyId = _value.surveyId;\n this.displayName = _value.displayName;\n this.languageCode = _value.languageCode;\n this.questions = (_value.questions || []).map(m => new Question(m));\n this.surveyInfo = _value.surveyInfo\n ? new SurveyInfo(_value.surveyInfo)\n : undefined;\n this.excludeSubflows = (_value.excludeSubflows || []).slice();\n this.status = _value.status;\n Survey.refineValues(this);\n }\n get surveyId(): string {\n return this._surveyId;\n }\n set surveyId(value: string) {\n this._surveyId = value;\n }\n get displayName(): string {\n return this._displayName;\n }\n set displayName(value: string) {\n this._displayName = value;\n }\n get languageCode(): string {\n return this._languageCode;\n }\n set languageCode(value: string) {\n this._languageCode = value;\n }\n get questions(): Question[] | undefined {\n return this._questions;\n }\n set questions(value: Question[] | undefined) {\n this._questions = value;\n }\n get surveyInfo(): SurveyInfo | undefined {\n return this._surveyInfo;\n }\n set surveyInfo(value: SurveyInfo | undefined) {\n this._surveyInfo = value;\n }\n get excludeSubflows(): SubFlow[] {\n return this._excludeSubflows;\n }\n set excludeSubflows(value: SubFlow[]) {\n this._excludeSubflows = value;\n }\n get status(): Survey.AgentStatus {\n return this._status;\n }\n set status(value: Survey.AgentStatus) {\n this._status = value;\n }\n\n /**\n * Serialize message to binary data\n * @param instance message instance\n */\n serializeBinary() {\n const writer = new BinaryWriter();\n Survey.serializeBinaryToWriter(this, writer);\n return writer.getResultBuffer();\n }\n\n /**\n * Cast message to standard JavaScript object (all non-primitive values are deeply cloned)\n */\n toObject(): Survey.AsObject {\n return {\n surveyId: this.surveyId,\n displayName: this.displayName,\n languageCode: this.languageCode,\n questions: (this.questions || []).map(m => m.toObject()),\n surveyInfo: this.surveyInfo ? this.surveyInfo.toObject() : undefined,\n excludeSubflows: (this.excludeSubflows || []).slice(),\n status: this.status\n };\n }\n\n /**\n * Convenience method to support JSON.stringify(message), replicates the structure of toObject()\n */\n toJSON() {\n return this.toObject();\n }\n\n /**\n * Cast message to JSON using protobuf JSON notation: https://developers.google.com/protocol-buffers/docs/proto3#json\n * Attention: output differs from toObject() e.g. enums are represented as names and not as numbers, Timestamp is an ISO Date string format etc.\n * If the message itself or some of descendant messages is google.protobuf.Any, you MUST provide a message pool as options. If not, the messagePool is not required\n */\n toProtobufJSON(\n // @ts-ignore\n options?: ToProtobufJSONOptions\n ): Survey.AsProtobufJSON {\n return {\n surveyId: this.surveyId,\n displayName: this.displayName,\n languageCode: this.languageCode,\n questions: (this.questions || []).map(m => m.toProtobufJSON(options)),\n surveyInfo: this.surveyInfo\n ? this.surveyInfo.toProtobufJSON(options)\n : null,\n excludeSubflows: (this.excludeSubflows || []).map(v => SubFlow[v]),\n status:\n Survey.AgentStatus[\n this.status === null || this.status === undefined ? 0 : this.status\n ]\n };\n }\n}\nexport module Survey {\n /**\n * Standard JavaScript object representation for Survey\n */\n export interface AsObject {\n surveyId: string;\n displayName: string;\n languageCode: string;\n questions?: Question.AsObject[];\n surveyInfo?: SurveyInfo.AsObject;\n excludeSubflows: SubFlow[];\n status: Survey.AgentStatus;\n }\n\n /**\n * Protobuf JSON representation for Survey\n */\n export interface AsProtobufJSON {\n surveyId: string;\n displayName: string;\n languageCode: string;\n questions: Question.AsProtobufJSON[] | null;\n surveyInfo: SurveyInfo.AsProtobufJSON | null;\n excludeSubflows: string[];\n status: string;\n }\n export enum AgentStatus {\n TO_BE_INITIALIZED = 0,\n UPDATED = 1,\n UPDATING = 2,\n OUTDATED = 3\n }\n}\n\n/**\n * Message implementation for ondewo.survey.SurveyInfo\n */\nexport class SurveyInfo implements GrpcMessage {\n static id = 'ondewo.survey.SurveyInfo';\n\n /**\n * Deserialize binary data to message\n * @param instance message instance\n */\n static deserializeBinary(bytes: ByteSource) {\n const instance = new SurveyInfo();\n SurveyInfo.deserializeBinaryFromReader(instance, new BinaryReader(bytes));\n return instance;\n }\n\n /**\n * Check all the properties and set default protobuf values if necessary\n * @param _instance message instance\n */\n static refineValues(_instance: SurveyInfo) {\n _instance.legalEntity = _instance.legalEntity || '';\n _instance.postalAddress = _instance.postalAddress || '';\n _instance.emailAddress = _instance.emailAddress || '';\n _instance.phoneNumber = _instance.phoneNumber || '';\n _instance.phoneHours = _instance.phoneHours || '';\n _instance.expectedDuration = _instance.expectedDuration || '';\n _instance.purpose = _instance.purpose || '';\n _instance.topic = _instance.topic || '';\n _instance.legalDisclaimer = _instance.legalDisclaimer || '';\n _instance.anonymous = _instance.anonymous || false;\n }\n\n /**\n * Deserializes / reads binary message into message instance using provided binary reader\n * @param _instance message instance\n * @param _reader binary reader instance\n */\n static deserializeBinaryFromReader(\n _instance: SurveyInfo,\n _reader: BinaryReader\n ) {\n while (_reader.nextField()) {\n if (_reader.isEndGroup()) break;\n\n switch (_reader.getFieldNumber()) {\n case 1:\n _instance.legalEntity = _reader.readString();\n break;\n case 2:\n _instance.postalAddress = _reader.readString();\n break;\n case 3:\n _instance.emailAddress = _reader.readString();\n break;\n case 4:\n _instance.phoneNumber = _reader.readString();\n break;\n case 5:\n _instance.phoneHours = _reader.readString();\n break;\n case 6:\n _instance.expectedDuration = _reader.readString();\n break;\n case 7:\n _instance.purpose = _reader.readString();\n break;\n case 8:\n _instance.topic = _reader.readString();\n break;\n case 9:\n _instance.legalDisclaimer = _reader.readString();\n break;\n case 10:\n _instance.anonymous = _reader.readBool();\n break;\n default:\n _reader.skipField();\n }\n }\n\n SurveyInfo.refineValues(_instance);\n }\n\n /**\n * Serializes a message to binary format using provided binary reader\n * @param _instance message instance\n * @param _writer binary writer instance\n */\n static serializeBinaryToWriter(_instance: SurveyInfo, _writer: BinaryWriter) {\n if (_instance.legalEntity) {\n _writer.writeString(1, _instance.legalEntity);\n }\n if (_instance.postalAddress) {\n _writer.writeString(2, _instance.postalAddress);\n }\n if (_instance.emailAddress) {\n _writer.writeString(3, _instance.emailAddress);\n }\n if (_instance.phoneNumber) {\n _writer.writeString(4, _instance.phoneNumber);\n }\n if (_instance.phoneHours) {\n _writer.writeString(5, _instance.phoneHours);\n }\n if (_instance.expectedDuration) {\n _writer.writeString(6, _instance.expectedDuration);\n }\n if (_instance.purpose) {\n _writer.writeString(7, _instance.purpose);\n }\n if (_instance.topic) {\n _writer.writeString(8, _instance.topic);\n }\n if (_instance.legalDisclaimer) {\n _writer.writeString(9, _instance.legalDisclaimer);\n }\n if (_instance.anonymous) {\n _writer.writeBool(10, _instance.anonymous);\n }\n }\n\n private _legalEntity: string;\n private _postalAddress: string;\n private _emailAddress: string;\n private _phoneNumber: string;\n private _phoneHours: string;\n private _expectedDuration: string;\n private _purpose: string;\n private _topic: string;\n private _legalDisclaimer: string;\n private _anonymous: boolean;\n\n /**\n * Message constructor. Initializes the properties and applies default Protobuf values if necessary\n * @param _value initial values object or instance of SurveyInfo to deeply clone from\n */\n constructor(_value?: RecursivePartial<SurveyInfo.AsObject>) {\n _value = _value || {};\n this.legalEntity = _value.legalEntity;\n this.postalAddress = _value.postalAddress;\n this.emailAddress = _value.emailAddress;\n this.phoneNumber = _value.phoneNumber;\n this.phoneHours = _value.phoneHours;\n this.expectedDuration = _value.expectedDuration;\n this.purpose = _value.purpose;\n this.topic = _value.topic;\n this.legalDisclaimer = _value.legalDisclaimer;\n this.anonymous = _value.anonymous;\n SurveyInfo.refineValues(this);\n }\n get legalEntity(): string {\n return this._legalEntity;\n }\n set legalEntity(value: string) {\n this._legalEntity = value;\n }\n get postalAddress(): string {\n return this._postalAddress;\n }\n set postalAddress(value: string) {\n this._postalAddress = value;\n }\n get emailAddress(): string {\n return this._emailAddress;\n }\n set emailAddress(value: string) {\n this._emailAddress = value;\n }\n get phoneNumber(): string {\n return this._phoneNumber;\n }\n set phoneNumber(value: string) {\n this._phoneNumber = value;\n }\n get phoneHours(): string {\n return this._phoneHours;\n }\n set phoneHours(value: string) {\n this._phoneHours = value;\n }\n get expectedDuration(): string {\n return this._expectedDuration;\n }\n set expectedDuration(value: string) {\n this._expectedDuration = value;\n }\n get purpose(): string {\n return this._purpose;\n }\n set purpose(value: string) {\n this._purpose = value;\n }\n get topic(): string {\n return this._topic;\n }\n set topic(value: string) {\n this._topic = value;\n }\n get legalDisclaimer(): string {\n return this._legalDisclaimer;\n }\n set legalDisclaimer(value: string) {\n this._legalDisclaimer = value;\n }\n get anonymous(): boolean {\n return this._anonymous;\n }\n set anonymous(value: boolean) {\n this._anonymous = value;\n }\n\n /**\n * Serialize message to binary data\n * @param instance message instance\n */\n serializeBinary() {\n const writer = new BinaryWriter();\n SurveyInfo.serializeBinaryToWriter(this, writer);\n return writer.getResultBuffer();\n }\n\n /**\n * Cast message to standard JavaScript object (all non-primitive values are deeply cloned)\n */\n toObject(): SurveyInfo.AsObject {\n return {\n legalEntity: this.legalEntity,\n postalAddress: this.postalAddress,\n emailAddress: this.emailAddress,\n phoneNumber: this.phoneNumber,\n phoneHours: this.phoneHours,\n expectedDuration: this.expectedDuration,\n purpose: this.purpose,\n topic: this.topic,\n legalDisclaimer: this.legalDisclaimer,\n anonymous: this.anonymous\n };\n }\n\n /**\n * Convenience method to support JSON.stringify(message), replicates the structure of toObject()\n */\n toJSON() {\n return this.toObject();\n }\n\n /**\n * Cast message to JSON using protobuf JSON notation: https://developers.google.com/protocol-buffers/docs/proto3#json\n * Attention: output differs from toObject() e.g. enums are represented as names and not as numbers, Timestamp is an ISO Date string format etc.\n * If the message itself or some of descendant messages is google.protobuf.Any, you MUST provide a message pool as options. If not, the messagePool is not required\n */\n toProtobufJSON(\n // @ts-ignore\n options?: ToProtobufJSONOptions\n ): SurveyInfo.AsProtobufJSON {\n return {\n legalEntity: this.legalEntity,\n postalAddress: this.postalAddress,\n emailAddress: this.emailAddress,\n phoneNumber: this.phoneNumber,\n phoneHours: this.phoneHours,\n expectedDuration: this.expectedDuration,\n purpose: this.purpose,\n topic: this.topic,\n legalDisclaimer: this.legalDisclaimer,\n anonymous: this.anonymous\n };\n }\n}\nexport module SurveyInfo {\n /**\n * Standard JavaScript object representation for SurveyInfo\n */\n export interface AsObject {\n legalEntity: string;\n postalAddress: string;\n emailAddress: string;\n phoneNumber: string;\n phoneHours: string;\n expectedDuration: string;\n purpose: string;\n topic: string;\n legalDisclaimer: string;\n anonymous: boolean;\n }\n\n /**\n * Protobuf JSON representation for SurveyInfo\n */\n export interface AsProtobufJSON {\n legalEntity: string;\n postalAddress: string;\n emailAddress: string;\n phoneNumber: string;\n phoneHours: string;\n expectedDuration: string;\n purpose: string;\n topic: string;\n legalDisclaimer: string;\n anonymous: boolean;\n }\n}\n\n/**\n * Message implementation for ondewo.survey.Question\n */\nexport class Question implements GrpcMessage {\n static id = 'ondewo.survey.Question';\n\n /**\n * Deserialize binary data to message\n * @param instance message instance\n */\n static deserializeBinary(bytes: ByteSource) {\n const instance = new Question();\n Question.deserializeBinaryFromReader(instance, new BinaryReader(bytes));\n return instance;\n }\n\n /**\n * Check all the properties and set default protobuf values if necessary\n * @param _instance message instance\n */\n static refineValues(_instance: Question) {}\n\n /**\n * Deserializes / reads binary message into message instance using provided binary reader\n * @param _instance message instance\n * @param _reader binary reader instance\n */\n static deserializeBinaryFromReader(\n _instance: Question,\n _reader: BinaryReader\n ) {\n while (_reader.nextField()) {\n if (_reader.isEndGroup()) break;\n\n switch (_reader.getFieldNumber()) {\n case 1:\n _instance.openQuestion = new OpenQuestion();\n _reader.readMessage(\n _instance.openQuestion,\n OpenQuestion.deserializeBinaryFromReader\n );\n break;\n case 2:\n _instance.singleChoiceQuestion = new SingleChoiceQuestion();\n _reader.readMessage(\n _instance.singleChoiceQuestion,\n SingleChoiceQuestion.deserializeBinaryFromReader\n );\n break;\n case 3:\n _instance.multipleChoiceQuestion = new MultipleChoiceQuestion();\n _reader.readMessage(\n _instance.multipleChoiceQuestion,\n MultipleChoiceQuestion.deserializeBinaryFromReader\n );\n break;\n case 4:\n _instance.scaleQuestion = new ScaleQuestion();\n _reader.readMessage(\n _instance.scaleQuestion,\n ScaleQuestion.deserializeBinaryFromReader\n );\n break;\n case 5:\n _instance.singleParameterQuestion = new SingleParameterQuestion();\n _reader.readMessage(\n _instance.singleParameterQuestion,\n SingleParameterQuestion.deserializeBinaryFromReader\n );\n break;\n case 6:\n _instance.multipleParameterQuestion = new MultipleParameterQuestion();\n _reader.readMessage(\n _instance.multipleParameterQuestion,\n MultipleParameterQuestion.deserializeBinaryFromReader\n );\n break;\n default:\n _reader.skipField();\n }\n }\n\n Question.refineValues(_instance);\n }\n\n /**\n * Serializes a message to binary format using provided binary reader\n * @param _instance message instance\n * @param _writer binary writer instance\n */\n static serializeBinaryToWriter(_instance: Question, _writer: BinaryWriter) {\n if (_instance.openQuestion) {\n _writer.writeMessage(\n 1,\n _instance.openQuestion as any,\n OpenQuestion.serializeBinaryToWriter\n );\n }\n if (_instance.singleChoiceQuestion) {\n _writer.writeMessage(\n 2,\n _instance.singleChoiceQuestion as any,\n SingleChoiceQuestion.serializeBinaryToWriter\n );\n }\n if (_instance.multipleChoiceQuestion) {\n _writer.writeMessage(\n 3,\n _instance.multipleChoiceQuestion as any,\n MultipleChoiceQuestion.serializeBinaryToWriter\n );\n }\n if (_instance.scaleQuestion) {\n _writer.writeMessage(\n 4,\n _instance.scaleQuestion as any,\n ScaleQuestion.serializeBinaryToWriter\n );\n }\n if (_instance.singleParameterQuestion) {\n _writer.writeMessage(\n 5,\n _instance.singleParameterQuestion as any,\n SingleParameterQuestion.serializeBinaryToWriter\n );\n }\n if (_instance.multipleParameterQuestion) {\n _writer.writeMessage(\n 6,\n _instance.multipleParameterQuestion as any,\n MultipleParameterQuestion.serializeBinaryToWriter\n );\n }\n }\n\n private _openQuestion?: OpenQuestion;\n private _singleChoiceQuestion?: SingleChoiceQuestion;\n private _multipleChoiceQuestion?: MultipleChoiceQuestion;\n private _scaleQuestion?: ScaleQuestion;\n private _singleParameterQuestion?: SingleParameterQuestion;\n private _multipleParameterQuestion?: MultipleParameterQuestion;\n\n private _question: Question.QuestionCase = Question.QuestionCase.none;\n\n /**\n * Message constructor. Initializes the properties and applies default Protobuf values if necessary\n * @param _value initial values object or instance of Question to deeply clone from\n */\n constructor(_value?: RecursivePartial<Question.AsObject>) {\n _value = _value || {};\n this.openQuestion = _value.openQuestion\n ? new OpenQuestion(_value.openQuestion)\n : undefined;\n this.singleChoiceQuestion = _value.singleChoiceQuestion\n ? new SingleChoiceQuestion(_value.singleChoiceQuestion)\n : undefined;\n this.multipleChoiceQuestion = _value.multipleChoiceQuestion\n ? new MultipleChoiceQuestion(_value.multipleChoiceQuestion)\n : undefined;\n this.scaleQuestion = _value.scaleQuestion\n ? new ScaleQuestion(_value.scaleQuestion)\n : undefined;\n this.singleParameterQuestion = _value.singleParameterQuestion\n ? new SingleParameterQuestion(_value.singleParameterQuestion)\n : undefined;\n this.multipleParameterQuestion = _value.multipleParameterQuestion\n ? new MultipleParameterQuestion(_value.multipleParameterQuestion)\n : undefined;\n Question.refineValues(this);\n }\n get openQuestion(): OpenQuestion | undefined {\n return this._openQuestion;\n }\n set openQuestion(value: OpenQuestion | undefined) {\n if (value !== undefined && value !== null) {\n this._singleChoiceQuestion = this._multipleChoiceQuestion = this._scaleQuestion = this._singleParameterQuestion = this._multipleParameterQuestion = undefined;\n this._question = Question.QuestionCase.openQuestion;\n }\n this._openQuestion = value;\n }\n get singleChoiceQuestion(): SingleChoiceQuestion | undefined {\n return this._singleChoiceQuestion;\n }\n set singleChoiceQuestion(value: SingleChoiceQuestion | undefined) {\n if (value !== undefined && value !== null) {\n this._openQuestion = this._multipleChoiceQuestion = this._scaleQuestion = this._singleParameterQuestion = this._multipleParameterQuestion = undefined;\n this._question = Question.QuestionCase.singleChoiceQuestion;\n }\n this._singleChoiceQuestion = value;\n }\n get multipleChoiceQuestion(): MultipleChoiceQuestion | undefined {\n return this._multipleChoiceQuestion;\n }\n set multipleChoiceQuestion(value: MultipleChoiceQuestion | undefined) {\n if (value !== undefined && value !== null) {\n this._openQuestion = this._singleChoiceQuestion = this._scaleQuestion = this._singleParameterQuestion = this._multipleParameterQuestion = undefined;\n this._question = Question.QuestionCase.multipleChoiceQuestion;\n }\n this._multipleChoiceQuestion = value;\n }\n get scaleQuestion(): ScaleQuestion | undefined {\n return this._scaleQuestion;\n }\n set scaleQuestion(value: ScaleQuestion | undefined) {\n if (value !== undefined && value !== null) {\n this._openQuestion = this._singleChoiceQuestion = this._multipleChoiceQuestion = this._singleParameterQuestion = this._multipleParameterQuestion = undefined;\n this._question = Question.QuestionCase.scaleQuestion;\n }\n this._scaleQuestion = value;\n }\n get singleParameterQuestion(): SingleParameterQuestion | undefined {\n return this._singleParameterQuestion;\n }\n set singleParameterQuestion(value: SingleParameterQuestion | undefined) {\n if (value !== undefined && value !== null) {\n this._openQuestion = this._singleChoiceQuestion = this._multipleChoiceQuestion = this._scaleQuestion = this._multipleParameterQuestion = undefined;\n this._question = Question.QuestionCase.singleParameterQuestion;\n }\n this._singleParameterQuestion = value;\n }\n get multipleParameterQuestion(): MultipleParameterQuestion | undefined {\n return this._multipleParameterQuestion;\n }\n set multipleParameterQuestion(value: MultipleParameterQuestion | undefined) {\n if (value !== undefined && value !== null) {\n this._openQuestion = this._singleChoiceQuestion = this._multipleChoiceQuestion = this._scaleQuestion = this._singleParameterQuestion = undefined;\n this._question = Question.QuestionCase.multipleParameterQuestion;\n }\n this._multipleParameterQuestion = value;\n }\n get question() {\n return this._question;\n }\n\n /**\n * Serialize message to binary data\n * @param instance message instance\n */\n serializeBinary() {\n const writer = new BinaryWriter();\n Question.serializeBinaryToWriter(this, writer);\n return writer.getResultBuffer();\n }\n\n /**\n * Cast message to standard JavaScript object (all non-primitive values are deeply cloned)\n */\n toObject(): Question.AsObject {\n return {\n openQuestion: this.openQuestion\n ? this.openQuestion.toObject()\n : undefined,\n singleChoiceQuestion: this.singleChoiceQuestion\n ? this.singleChoiceQuestion.toObject()\n : undefined,\n multipleChoiceQuestion: this.multipleChoiceQuestion\n ? this.multipleChoiceQuestion.toObject()\n : undefined,\n scaleQuestion: this.scaleQuestion\n ? this.scaleQuestion.toObject()\n : undefined,\n singleParameterQuestion: this.singleParameterQuestion\n ? this.singleParameterQuestion.toObject()\n : undefined,\n multipleParameterQuestion: this.multipleParameterQuestion\n ? this.multipleParameterQuestion.toObject()\n : undefined\n };\n }\n\n /**\n * Convenience method to support JSON.stringify(message), replicates the structure of toObject()\n */\n toJSON() {\n return this.toObject();\n }\n\n /**\n * Cast message to JSON using protobuf JSON notation: https://developers.google.com/protocol-buffers/docs/proto3#json\n * Attention: output differs from toObject() e.g. enums are represented as names and not as numbers, Timestamp is an ISO Date string format etc.\n * If the message itself or some of descendant messages is google.protobuf.Any, you MUST provide a message pool as options. If not, the messagePool is not required\n */\n toProtobufJSON(\n // @ts-ignore\n options?: ToProtobufJSONOptions\n ): Question.AsProtobufJSON {\n return {\n openQuestion: this.openQuestion\n ? this.openQuestion.toProtobufJSON(options)\n : null,\n singleChoiceQuestion: this.singleChoiceQuestion\n ? this.singleChoiceQuestion.toProtobufJSON(options)\n : null,\n multipleChoiceQuestion: this.multipleChoiceQuestion\n ? this.multipleChoiceQuestion.toProtobufJSON(options)\n : null,\n scaleQuestion: this.scaleQuestion\n ? this.scaleQuestion.toProtobufJSON(options)\n : null,\n singleParameterQuestion: this.singleParameterQuestion\n ? this.singleParameterQuestion.toProtobufJSON(options)\n : null,\n multipleParameterQuestion: this.multipleParameterQuestion\n ? this.multipleParameterQuestion.toProtobufJSON(options)\n : null\n };\n }\n}\nexport module Question {\n /**\n * Standard JavaScript object representation for Question\n */\n export interface AsObject {\n openQuestion?: OpenQuestion.AsObject;\n singleChoiceQuestion?: SingleChoiceQuestion.AsObject;\n multipleChoiceQuestion?: MultipleChoiceQuestion.AsObject;\n scaleQuestion?: ScaleQuestion.AsObject;\n singleParameterQuestion?: SingleParameterQuestion.AsObject;\n multipleParameterQuestion?: MultipleParameterQuestion.AsObject;\n }\n\n /**\n * Protobuf JSON representation for Question\n */\n export interface AsProtobufJSON {\n openQuestion: OpenQuestion.AsProtobufJSON | null;\n singleChoiceQuestion: SingleChoiceQuestion.AsProtobufJSON | null;\n multipleChoiceQuestion: MultipleChoiceQuestion.AsProtobufJSON | null;\n scaleQuestion: ScaleQuestion.AsProtobufJSON | null;\n singleParameterQuestion: SingleParameterQuestion.AsProtobufJSON | null;\n multipleParameterQuestion: MultipleParameterQuestion.AsProtobufJSON | null;\n }\n export enum QuestionCase {\n none = 0,\n openQuestion = 1,\n singleChoiceQuestion = 2,\n multipleChoiceQuestion = 3,\n scaleQuestion = 4,\n singleParameterQuestion = 5,\n multipleParameterQuestion = 6\n }\n}\n\n/**\n * Message implementation for ondewo.survey.OpenQuestion\n */\nexport class OpenQuestion implements GrpcMessage {\n static id = 'ondewo.survey.OpenQuestion';\n\n /**\n * Deserialize binary data to message\n * @param instance message instance\n */\n static deserializeBinary(bytes: ByteSource) {\n const instance = new OpenQuestion();\n OpenQuestion.deserializeBinaryFromReader(instance, new BinaryReader(bytes));\n return instance;\n }\n\n /**\n * Check all the properties and set default protobuf values if necessary\n * @param _instance message instance\n */\n static refineValues(_instance: OpenQuestion) {\n _instance.questionText = _instance.questionText || '';\n }\n\n /**\n * Deserializes / reads binary message into message instance using provided binary reader\n * @param _instance message instance\n * @param _reader binary reader instance\n */\n static deserializeBinaryFromReader(\n _instance: OpenQuestion,\n _reader: BinaryReader\n ) {\n while (_reader.nextField()) {\n if (_reader.isEndGroup()) break;\n\n switch (_reader.getFieldNumber()) {\n case 1:\n _instance.questionText = _reader.readString();\n break;\n default:\n _reader.skipField();\n }\n }\n\n OpenQuestion.refineValues(_instance);\n }\n\n /**\n * Serializes a message to binary format using provided binary reader\n * @param _instance message instance\n * @param _writer binary writer instance\n */\n static serializeBinaryToWriter(\n _instance: OpenQuestion,\n _writer: BinaryWriter\n ) {\n if (_instance.questionText) {\n _writer.writeString(1, _instance.questionText);\n }\n }\n\n private _questionText: string;\n\n /**\n * Message constructor. Initializes the properties and applies default Protobuf values if necessary\n * @param _value initial values object or instance of OpenQuestion to deeply clone from\n */\n constructor(_value?: RecursivePartial<OpenQuestion.AsObject>) {\n _value = _value || {};\n this.questionText = _value.questionText;\n OpenQuestion.refineValues(this);\n }\n get questionText(): string {\n return this._questionText;\n }\n set questionText(value: string) {\n this._questionText = value;\n }\n\n /**\n * Serialize message to binary data\n * @param instance message instance\n */\n serializeBinary() {\n const writer = new BinaryWriter();\n OpenQuestion.serializeBinaryToWriter(this, writer);\n return writer.getResultBuffer();\n }\n\n /**\n * Cast message to standard JavaScript object (all non-primitive values are deeply cloned)\n */\n toObject(): OpenQuestion.AsObject {\n return {\n questionText: this.questionText\n };\n }\n\n /**\n * Convenience method to support JSON.stringify(message), replicates the structure of toObject()\n */\n toJSON() {\n return this.toObject();\n }\n\n /**\n * Cast message to JSON using protobuf JSON notation: https://developers.google.com/protocol-buffers/docs/proto3#json\n * Attention: output differs from toObject() e.g. enums are represented as names and not as numbers, Timestamp is an ISO Date string format etc.\n * If the message itself or some of descendant messages is google.protobuf.Any, you MUST provide a message pool as options. If not, the messagePool is not required\n */\n toProtobufJSON(\n // @ts-ignore\n options?: ToProtobufJSONOptions\n ): OpenQuestion.AsProtobufJSON {\n return {\n questionText: this.questionText\n };\n }\n}\nexport module OpenQuestion {\n /**\n * Standard JavaScript object representation for OpenQuestion\n */\n export interface AsObject {\n questionText: string;\n }\n\n /**\n * Protobuf JSON representation for OpenQuestion\n */\n export interface AsProtobufJSON {\n questionText: string;\n }\n}\n\n/**\n * Message implementation for ondewo.survey.SingleChoiceQuestion\n */\nexport class SingleChoiceQuestion implements GrpcMessage {\n static id = 'ondewo.survey.SingleChoiceQuestion';\n\n /**\n * Deserialize binary data to message\n * @param instance message instance\n */\n static deserializeBinary(bytes: ByteSource) {\n const instance = new SingleChoiceQuestion();\n SingleChoiceQuestion.deserializeBinaryFromReader(\n instance,\n new BinaryReader(bytes)\n );\n return instance;\n }\n\n /**\n * Check all the properties and set default protobuf values if necessary\n * @param _instance message instance\n */\n static refineValues(_instance: SingleChoiceQuestion) {\n _instance.questionText = _instance.questionText || '';\n _instance.choices = _instance.choices || [];\n }\n\n /**\n * Deserializes / reads binary message into message instance using provided binary reader\n * @param _instance message instance\n * @param _reader binary reader instance\n */\n static deserializeBinaryFromReader(\n _instance: SingleChoiceQuestion,\n _reader: BinaryReader\n ) {\n while (_reader.nextField()) {\n if (_reader.isEndGroup()) break;\n\n switch (_reader.getFieldNumber()) {\n case 1:\n _instance.questionText = _reader.readString();\n break;\n case 2:\n const messageInitializer2 = new Choice();\n _reader.readMessage(\n messageInitializer2,\n Choice.deserializeBinaryFromReader\n );\n (_instance.choices = _instance.choices || []).push(\n messageInitializer2\n );\n break;\n default:\n _reader.skipField();\n }\n }\n\n SingleChoiceQuestion.refineValues(_instance);\n }\n\n /**\n * Serializes a message to binary format using provided binary reader\n * @param _instance message instance\n * @param _writer binary writer instance\n */\n static serializeBinaryToWriter(\n _instance: SingleChoiceQuestion,\n _writer: BinaryWriter\n ) {\n if (_instance.questionText) {\n _writer.writeString(1, _instance.questionText);\n }\n if (_instance.choices && _instance.choices.length) {\n _writer.writeRepeatedMessage(\n 2,\n _instance.choices as any,\n Choice.serializeBinaryToWriter\n );\n }\n }\n\n private _questionText: string;\n private _choices?: Choice[];\n\n /**\n * Message constructor. Initializes the properties and applies default Protobuf values if necessary\n * @param _value initial values object or instance of SingleChoiceQuestion to deeply clone from\n */\n constructor(_value?: RecursivePartial<SingleChoiceQuestion.AsObject>) {\n _value = _value || {};\n this.questionText = _value.questionText;\n this.choices = (_value.choices || []).map(m => new Choice(m));\n SingleChoiceQuestion.refineValues(this);\n }\n get questionText(): string {\n return this._questionText;\n }\n set questionText(value: string) {\n this._questionText = value;\n }\n get choices(): Choice