From 5e8ae3f8ed5780463db688c45667d49db113bff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Pra=C5=BCak?= Date: Tue, 19 Dec 2023 15:24:45 +0100 Subject: [PATCH] Add language.proto for Auto API --- core/project.scala | 2 +- .../pulumirpc/codegen/hcl/Diagnostic.scala | 261 +++++++ .../codegen/hcl/DiagnosticSeverity.scala | 65 ++ .../rpc/pulumirpc/codegen/hcl/HclProto.scala | 41 ++ .../besom/rpc/pulumirpc/codegen/hcl/Pos.scala | 196 +++++ .../rpc/pulumirpc/codegen/hcl/Range.scala | 185 +++++ .../pulumirpc/language/AboutResponse.scala | 338 +++++++++ .../pulumirpc/language/DependencyInfo.scala | 152 ++++ .../language/GeneratePackageRequest.scala | 368 ++++++++++ .../language/GeneratePackageResponse.scala | 123 ++++ .../language/GenerateProgramRequest.scala | 304 ++++++++ .../language/GenerateProgramResponse.scala | 302 ++++++++ .../language/GenerateProjectRequest.scala | 433 +++++++++++ .../language/GenerateProjectResponse.scala | 123 ++++ .../GetProgramDependenciesRequest.scala | 251 +++++++ .../GetProgramDependenciesResponse.scala | 123 ++++ .../language/GetRequiredPluginsRequest.scala | 219 ++++++ .../language/GetRequiredPluginsResponse.scala | 123 ++++ .../language/InstallDependenciesRequest.scala | 187 +++++ .../InstallDependenciesResponse.scala | 152 ++++ .../pulumirpc/language/LanguageProto.scala | 136 ++++ .../language/LanguageRuntimeGrpc.scala | 443 ++++++++++++ .../rpc/pulumirpc/language/PackRequest.scala | 184 +++++ .../rpc/pulumirpc/language/PackResponse.scala | 120 ++++ .../rpc/pulumirpc/language/ProgramInfo.scala | 226 ++++++ .../pulumirpc/language/RunPluginRequest.scala | 241 +++++++ .../language/RunPluginResponse.scala | 190 +++++ .../rpc/pulumirpc/language/RunRequest.scala | 676 ++++++++++++++++++ .../rpc/pulumirpc/language/RunResponse.scala | 156 ++++ proto/pulumi/codegen/hcl.proto | 89 +++ proto/pulumi/language.proto | 232 ++++++ scripts/Proto.scala | 32 +- 32 files changed, 6661 insertions(+), 12 deletions(-) create mode 100644 core/src/main/scala/besom/rpc/pulumirpc/codegen/hcl/Diagnostic.scala create mode 100644 core/src/main/scala/besom/rpc/pulumirpc/codegen/hcl/DiagnosticSeverity.scala create mode 100644 core/src/main/scala/besom/rpc/pulumirpc/codegen/hcl/HclProto.scala create mode 100644 core/src/main/scala/besom/rpc/pulumirpc/codegen/hcl/Pos.scala create mode 100644 core/src/main/scala/besom/rpc/pulumirpc/codegen/hcl/Range.scala create mode 100644 core/src/main/scala/besom/rpc/pulumirpc/language/AboutResponse.scala create mode 100644 core/src/main/scala/besom/rpc/pulumirpc/language/DependencyInfo.scala create mode 100644 core/src/main/scala/besom/rpc/pulumirpc/language/GeneratePackageRequest.scala create mode 100644 core/src/main/scala/besom/rpc/pulumirpc/language/GeneratePackageResponse.scala create mode 100644 core/src/main/scala/besom/rpc/pulumirpc/language/GenerateProgramRequest.scala create mode 100644 core/src/main/scala/besom/rpc/pulumirpc/language/GenerateProgramResponse.scala create mode 100644 core/src/main/scala/besom/rpc/pulumirpc/language/GenerateProjectRequest.scala create mode 100644 core/src/main/scala/besom/rpc/pulumirpc/language/GenerateProjectResponse.scala create mode 100644 core/src/main/scala/besom/rpc/pulumirpc/language/GetProgramDependenciesRequest.scala create mode 100644 core/src/main/scala/besom/rpc/pulumirpc/language/GetProgramDependenciesResponse.scala create mode 100644 core/src/main/scala/besom/rpc/pulumirpc/language/GetRequiredPluginsRequest.scala create mode 100644 core/src/main/scala/besom/rpc/pulumirpc/language/GetRequiredPluginsResponse.scala create mode 100644 core/src/main/scala/besom/rpc/pulumirpc/language/InstallDependenciesRequest.scala create mode 100644 core/src/main/scala/besom/rpc/pulumirpc/language/InstallDependenciesResponse.scala create mode 100644 core/src/main/scala/besom/rpc/pulumirpc/language/LanguageProto.scala create mode 100644 core/src/main/scala/besom/rpc/pulumirpc/language/LanguageRuntimeGrpc.scala create mode 100644 core/src/main/scala/besom/rpc/pulumirpc/language/PackRequest.scala create mode 100644 core/src/main/scala/besom/rpc/pulumirpc/language/PackResponse.scala create mode 100644 core/src/main/scala/besom/rpc/pulumirpc/language/ProgramInfo.scala create mode 100644 core/src/main/scala/besom/rpc/pulumirpc/language/RunPluginRequest.scala create mode 100644 core/src/main/scala/besom/rpc/pulumirpc/language/RunPluginResponse.scala create mode 100644 core/src/main/scala/besom/rpc/pulumirpc/language/RunRequest.scala create mode 100644 core/src/main/scala/besom/rpc/pulumirpc/language/RunResponse.scala create mode 100644 proto/pulumi/codegen/hcl.proto create mode 100644 proto/pulumi/language.proto diff --git a/core/project.scala b/core/project.scala index 62859dff0..e584f2965 100644 --- a/core/project.scala +++ b/core/project.scala @@ -1,6 +1,6 @@ //> using scala "3.3.1" //> using options "-java-output-version:11", "-Ysafe-init", "-Xmax-inlines:64" -//> using options "-Werror", "-Wunused:all", "-deprecation", "-feature" +//> using options "-Wunused:all", "-feature" //> using dep "org.virtuslab::besom-json:0.1.1-SNAPSHOT" diff --git a/core/src/main/scala/besom/rpc/pulumirpc/codegen/hcl/Diagnostic.scala b/core/src/main/scala/besom/rpc/pulumirpc/codegen/hcl/Diagnostic.scala new file mode 100644 index 000000000..0b275a1ae --- /dev/null +++ b/core/src/main/scala/besom/rpc/pulumirpc/codegen/hcl/Diagnostic.scala @@ -0,0 +1,261 @@ +// Generated by the Scala Plugin for the Protocol Buffer Compiler. +// Do not edit! +// +// Protofile syntax: PROTO3 + +package pulumirpc.codegen.hcl + +/** Diagnostic represents information to be presented to a user about an error or anomaly in parsing or evaluating configuration. + * + * @param summary + * Summary and Detail contain the English-language description of the + * problem. Summary is a terse description of the general problem and + * detail is a more elaborate, often-multi-sentence description of + * the problem and what might be done to solve it. + * @param subject + * Subject and Context are both source ranges relating to the diagnostic. + * + * Subject is a tight range referring to exactly the construct that + * is problematic, while Context is an optional broader range (which should + * fully contain Subject) that ought to be shown around Subject when + * generating isolated source-code snippets in diagnostic messages. + * If Context is nil, the Subject is also the Context. + * + * Some diagnostics have no source ranges at all. If Context is set then + * Subject should always also be set. + */ +@SerialVersionUID(0L) +final case class Diagnostic( + severity: pulumirpc.codegen.hcl.DiagnosticSeverity = pulumirpc.codegen.hcl.DiagnosticSeverity.DIAG_INVALID, + summary: _root_.scala.Predef.String = "", + detail: _root_.scala.Predef.String = "", + subject: _root_.scala.Option[pulumirpc.codegen.hcl.Range] = _root_.scala.None, + context: _root_.scala.Option[pulumirpc.codegen.hcl.Range] = _root_.scala.None, + unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[Diagnostic] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + + { + val __value = severity.value + if (__value != 0) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeEnumSize(1, __value) + } + }; + + { + val __value = summary + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(2, __value) + } + }; + + { + val __value = detail + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(3, __value) + } + }; + if (subject.isDefined) { + val __value = subject.get + __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize + }; + if (context.isDefined) { + val __value = context.get + __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize + }; + __size += unknownFields.serializedSize + __size + } + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size + } + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + { + val __v = severity.value + if (__v != 0) { + _output__.writeEnum(1, __v) + } + }; + { + val __v = summary + if (!__v.isEmpty) { + _output__.writeString(2, __v) + } + }; + { + val __v = detail + if (!__v.isEmpty) { + _output__.writeString(3, __v) + } + }; + subject.foreach { __v => + val __m = __v + _output__.writeTag(4, 2) + _output__.writeUInt32NoTag(__m.serializedSize) + __m.writeTo(_output__) + }; + context.foreach { __v => + val __m = __v + _output__.writeTag(5, 2) + _output__.writeUInt32NoTag(__m.serializedSize) + __m.writeTo(_output__) + }; + unknownFields.writeTo(_output__) + } + def withSeverity(__v: pulumirpc.codegen.hcl.DiagnosticSeverity): Diagnostic = copy(severity = __v) + def withSummary(__v: _root_.scala.Predef.String): Diagnostic = copy(summary = __v) + def withDetail(__v: _root_.scala.Predef.String): Diagnostic = copy(detail = __v) + def getSubject: pulumirpc.codegen.hcl.Range = subject.getOrElse(pulumirpc.codegen.hcl.Range.defaultInstance) + def clearSubject: Diagnostic = copy(subject = _root_.scala.None) + def withSubject(__v: pulumirpc.codegen.hcl.Range): Diagnostic = copy(subject = Option(__v)) + def getContext: pulumirpc.codegen.hcl.Range = context.getOrElse(pulumirpc.codegen.hcl.Range.defaultInstance) + def clearContext: Diagnostic = copy(context = _root_.scala.None) + def withContext(__v: pulumirpc.codegen.hcl.Range): Diagnostic = copy(context = Option(__v)) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => { + val __t = severity.javaValueDescriptor + if (__t.getNumber() != 0) __t else null + } + case 2 => { + val __t = summary + if (__t != "") __t else null + } + case 3 => { + val __t = detail + if (__t != "") __t else null + } + case 4 => subject.orNull + case 5 => context.orNull + } + } + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PEnum(severity.scalaValueDescriptor) + case 2 => _root_.scalapb.descriptors.PString(summary) + case 3 => _root_.scalapb.descriptors.PString(detail) + case 4 => subject.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty) + case 5 => context.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty) + } + } + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: pulumirpc.codegen.hcl.Diagnostic.type = pulumirpc.codegen.hcl.Diagnostic + // @@protoc_insertion_point(GeneratedMessage[pulumirpc.codegen.Diagnostic]) +} + +object Diagnostic extends scalapb.GeneratedMessageCompanion[pulumirpc.codegen.hcl.Diagnostic] { + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[pulumirpc.codegen.hcl.Diagnostic] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): pulumirpc.codegen.hcl.Diagnostic = { + var __severity: pulumirpc.codegen.hcl.DiagnosticSeverity = pulumirpc.codegen.hcl.DiagnosticSeverity.DIAG_INVALID + var __summary: _root_.scala.Predef.String = "" + var __detail: _root_.scala.Predef.String = "" + var __subject: _root_.scala.Option[pulumirpc.codegen.hcl.Range] = _root_.scala.None + var __context: _root_.scala.Option[pulumirpc.codegen.hcl.Range] = _root_.scala.None + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false + while (!_done__) { + val _tag__ = _input__.readTag() + _tag__ match { + case 0 => _done__ = true + case 8 => + __severity = pulumirpc.codegen.hcl.DiagnosticSeverity.fromValue(_input__.readEnum()) + case 18 => + __summary = _input__.readStringRequireUtf8() + case 26 => + __detail = _input__.readStringRequireUtf8() + case 34 => + __subject = Option(__subject.fold(_root_.scalapb.LiteParser.readMessage[pulumirpc.codegen.hcl.Range](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _))) + case 42 => + __context = Option(__context.fold(_root_.scalapb.LiteParser.readMessage[pulumirpc.codegen.hcl.Range](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _))) + case tag => + if (_unknownFields__ == null) { + _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder() + } + _unknownFields__.parseField(tag, _input__) + } + } + pulumirpc.codegen.hcl.Diagnostic( + severity = __severity, + summary = __summary, + detail = __detail, + subject = __subject, + context = __context, + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() + ) + } + implicit def messageReads: _root_.scalapb.descriptors.Reads[pulumirpc.codegen.hcl.Diagnostic] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + pulumirpc.codegen.hcl.Diagnostic( + severity = pulumirpc.codegen.hcl.DiagnosticSeverity.fromValue(__fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scalapb.descriptors.EnumValueDescriptor]).getOrElse(pulumirpc.codegen.hcl.DiagnosticSeverity.DIAG_INVALID.scalaValueDescriptor).number), + summary = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + detail = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + subject = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).flatMap(_.as[_root_.scala.Option[pulumirpc.codegen.hcl.Range]]), + context = __fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).flatMap(_.as[_root_.scala.Option[pulumirpc.codegen.hcl.Range]]) + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = HclProto.javaDescriptor.getMessageTypes().get(2) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = HclProto.scalaDescriptor.messages(2) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = { + var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null + (__number: @_root_.scala.unchecked) match { + case 4 => __out = pulumirpc.codegen.hcl.Range + case 5 => __out = pulumirpc.codegen.hcl.Range + } + __out + } + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => pulumirpc.codegen.hcl.DiagnosticSeverity + } + } + lazy val defaultInstance = pulumirpc.codegen.hcl.Diagnostic( + severity = pulumirpc.codegen.hcl.DiagnosticSeverity.DIAG_INVALID, + summary = "", + detail = "", + subject = _root_.scala.None, + context = _root_.scala.None + ) + implicit class DiagnosticLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.codegen.hcl.Diagnostic]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, pulumirpc.codegen.hcl.Diagnostic](_l) { + def severity: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.codegen.hcl.DiagnosticSeverity] = field(_.severity)((c_, f_) => c_.copy(severity = f_)) + def summary: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.summary)((c_, f_) => c_.copy(summary = f_)) + def detail: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.detail)((c_, f_) => c_.copy(detail = f_)) + def subject: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.codegen.hcl.Range] = field(_.getSubject)((c_, f_) => c_.copy(subject = Option(f_))) + def optionalSubject: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[pulumirpc.codegen.hcl.Range]] = field(_.subject)((c_, f_) => c_.copy(subject = f_)) + def context: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.codegen.hcl.Range] = field(_.getContext)((c_, f_) => c_.copy(context = Option(f_))) + def optionalContext: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[pulumirpc.codegen.hcl.Range]] = field(_.context)((c_, f_) => c_.copy(context = f_)) + } + final val SEVERITY_FIELD_NUMBER = 1 + final val SUMMARY_FIELD_NUMBER = 2 + final val DETAIL_FIELD_NUMBER = 3 + final val SUBJECT_FIELD_NUMBER = 4 + final val CONTEXT_FIELD_NUMBER = 5 + def of( + severity: pulumirpc.codegen.hcl.DiagnosticSeverity, + summary: _root_.scala.Predef.String, + detail: _root_.scala.Predef.String, + subject: _root_.scala.Option[pulumirpc.codegen.hcl.Range], + context: _root_.scala.Option[pulumirpc.codegen.hcl.Range] + ): _root_.pulumirpc.codegen.hcl.Diagnostic = _root_.pulumirpc.codegen.hcl.Diagnostic( + severity, + summary, + detail, + subject, + context + ) + // @@protoc_insertion_point(GeneratedMessageCompanion[pulumirpc.codegen.Diagnostic]) +} diff --git a/core/src/main/scala/besom/rpc/pulumirpc/codegen/hcl/DiagnosticSeverity.scala b/core/src/main/scala/besom/rpc/pulumirpc/codegen/hcl/DiagnosticSeverity.scala new file mode 100644 index 000000000..e993be77b --- /dev/null +++ b/core/src/main/scala/besom/rpc/pulumirpc/codegen/hcl/DiagnosticSeverity.scala @@ -0,0 +1,65 @@ +// Generated by the Scala Plugin for the Protocol Buffer Compiler. +// Do not edit! +// +// Protofile syntax: PROTO3 + +package pulumirpc.codegen.hcl + +/** DiagnosticSeverity is the severity level of a diagnostic message. + */ +sealed abstract class DiagnosticSeverity(val value: _root_.scala.Int) extends _root_.scalapb.GeneratedEnum { + type EnumType = pulumirpc.codegen.hcl.DiagnosticSeverity + type RecognizedType = pulumirpc.codegen.hcl.DiagnosticSeverity.Recognized + def isDiagInvalid: _root_.scala.Boolean = false + def isDiagError: _root_.scala.Boolean = false + def isDiagWarning: _root_.scala.Boolean = false + def companion: _root_.scalapb.GeneratedEnumCompanion[DiagnosticSeverity] = pulumirpc.codegen.hcl.DiagnosticSeverity + final def asRecognized: _root_.scala.Option[pulumirpc.codegen.hcl.DiagnosticSeverity.Recognized] = if (isUnrecognized) _root_.scala.None else _root_.scala.Some(this.asInstanceOf[pulumirpc.codegen.hcl.DiagnosticSeverity.Recognized]) +} + +object DiagnosticSeverity extends _root_.scalapb.GeneratedEnumCompanion[DiagnosticSeverity] { + sealed trait Recognized extends DiagnosticSeverity + implicit def enumCompanion: _root_.scalapb.GeneratedEnumCompanion[DiagnosticSeverity] = this + + /** DIAG_INVALID is the invalid zero value of DiagnosticSeverity + */ + @SerialVersionUID(0L) + case object DIAG_INVALID extends DiagnosticSeverity(0) with DiagnosticSeverity.Recognized { + val index = 0 + val name = "DIAG_INVALID" + override def isDiagInvalid: _root_.scala.Boolean = true + } + + /** DIAG_ERROR indicates that the problem reported by a diagnostic prevents + * further progress in parsing and/or evaluating the subject. + */ + @SerialVersionUID(0L) + case object DIAG_ERROR extends DiagnosticSeverity(1) with DiagnosticSeverity.Recognized { + val index = 1 + val name = "DIAG_ERROR" + override def isDiagError: _root_.scala.Boolean = true + } + + /** DIAG_WARNING indicates that the problem reported by a diagnostic warrants + * user attention but does not prevent further progress. It is most + * commonly used for showing deprecation notices. + */ + @SerialVersionUID(0L) + case object DIAG_WARNING extends DiagnosticSeverity(2) with DiagnosticSeverity.Recognized { + val index = 2 + val name = "DIAG_WARNING" + override def isDiagWarning: _root_.scala.Boolean = true + } + + @SerialVersionUID(0L) + final case class Unrecognized(unrecognizedValue: _root_.scala.Int) extends DiagnosticSeverity(unrecognizedValue) with _root_.scalapb.UnrecognizedEnum + lazy val values: scala.collection.immutable.Seq[ValueType] = scala.collection.immutable.Seq(DIAG_INVALID, DIAG_ERROR, DIAG_WARNING) + def fromValue(__value: _root_.scala.Int): DiagnosticSeverity = __value match { + case 0 => DIAG_INVALID + case 1 => DIAG_ERROR + case 2 => DIAG_WARNING + case __other => Unrecognized(__other) + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.EnumDescriptor = HclProto.javaDescriptor.getEnumTypes().get(0) + def scalaDescriptor: _root_.scalapb.descriptors.EnumDescriptor = HclProto.scalaDescriptor.enums(0) +} \ No newline at end of file diff --git a/core/src/main/scala/besom/rpc/pulumirpc/codegen/hcl/HclProto.scala b/core/src/main/scala/besom/rpc/pulumirpc/codegen/hcl/HclProto.scala new file mode 100644 index 000000000..3fee84917 --- /dev/null +++ b/core/src/main/scala/besom/rpc/pulumirpc/codegen/hcl/HclProto.scala @@ -0,0 +1,41 @@ +// Generated by the Scala Plugin for the Protocol Buffer Compiler. +// Do not edit! +// +// Protofile syntax: PROTO3 + +package pulumirpc.codegen.hcl + +object HclProto extends _root_.scalapb.GeneratedFileObject { + lazy val dependencies: Seq[_root_.scalapb.GeneratedFileObject] = Seq.empty + lazy val messagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = + Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]]( + pulumirpc.codegen.hcl.Pos, + pulumirpc.codegen.hcl.Range, + pulumirpc.codegen.hcl.Diagnostic + ) + private lazy val ProtoBytes: _root_.scala.Array[Byte] = + scalapb.Encoding.fromBase64(scala.collection.immutable.Seq( + """ChhwdWx1bWkvY29kZWdlbi9oY2wucHJvdG8SEXB1bHVtaXJwYy5jb2RlZ2VuImgKA1BvcxIdCgRsaW5lGAEgASgDQgniPwYSB + GxpbmVSBGxpbmUSIwoGY29sdW1uGAIgASgDQgviPwgSBmNvbHVtblIGY29sdW1uEh0KBGJ5dGUYAyABKANCCeI/BhIEYnl0ZVIEY + nl0ZSKgAQoFUmFuZ2USKQoIZmlsZW5hbWUYASABKAlCDeI/ChIIZmlsZW5hbWVSCGZpbGVuYW1lEjgKBXN0YXJ0GAIgASgLMhYuc + HVsdW1pcnBjLmNvZGVnZW4uUG9zQgriPwcSBXN0YXJ0UgVzdGFydBIyCgNlbmQYAyABKAsyFi5wdWx1bWlycGMuY29kZWdlbi5Qb + 3NCCOI/BRIDZW5kUgNlbmQirwIKCkRpYWdub3N0aWMSUAoIc2V2ZXJpdHkYASABKA4yJS5wdWx1bWlycGMuY29kZWdlbi5EaWFnb + m9zdGljU2V2ZXJpdHlCDeI/ChIIc2V2ZXJpdHlSCHNldmVyaXR5EiYKB3N1bW1hcnkYAiABKAlCDOI/CRIHc3VtbWFyeVIHc3Vtb + WFyeRIjCgZkZXRhaWwYAyABKAlCC+I/CBIGZGV0YWlsUgZkZXRhaWwSQAoHc3ViamVjdBgEIAEoCzIYLnB1bHVtaXJwYy5jb2RlZ + 2VuLlJhbmdlQgziPwkSB3N1YmplY3RSB3N1YmplY3QSQAoHY29udGV4dBgFIAEoCzIYLnB1bHVtaXJwYy5jb2RlZ2VuLlJhbmdlQ + gziPwkSB2NvbnRleHRSB2NvbnRleHQqfwoSRGlhZ25vc3RpY1NldmVyaXR5EiMKDERJQUdfSU5WQUxJRBAAGhHiPw4SDERJQUdfS + U5WQUxJRBIfCgpESUFHX0VSUk9SEAEaD+I/DBIKRElBR19FUlJPUhIjCgxESUFHX1dBUk5JTkcQAhoR4j8OEgxESUFHX1dBUk5JT + kdCMlowZ2l0aHViLmNvbS9wdWx1bWkvcHVsdW1pL3Nkay92My9wcm90by9nby9jb2RlZ2VuYgZwcm90bzM=""" + ).mkString) + lazy val scalaDescriptor: _root_.scalapb.descriptors.FileDescriptor = { + val scalaProto = com.google.protobuf.descriptor.FileDescriptorProto.parseFrom(ProtoBytes) + _root_.scalapb.descriptors.FileDescriptor.buildFrom(scalaProto, dependencies.map(_.scalaDescriptor)) + } + lazy val javaDescriptor: com.google.protobuf.Descriptors.FileDescriptor = { + val javaProto = com.google.protobuf.DescriptorProtos.FileDescriptorProto.parseFrom(ProtoBytes) + com.google.protobuf.Descriptors.FileDescriptor.buildFrom(javaProto, _root_.scala.Array( + )) + } + @deprecated("Use javaDescriptor instead. In a future version this will refer to scalaDescriptor.", "ScalaPB 0.5.47") + def descriptor: com.google.protobuf.Descriptors.FileDescriptor = javaDescriptor +} \ No newline at end of file diff --git a/core/src/main/scala/besom/rpc/pulumirpc/codegen/hcl/Pos.scala b/core/src/main/scala/besom/rpc/pulumirpc/codegen/hcl/Pos.scala new file mode 100644 index 000000000..2a6fcc0e0 --- /dev/null +++ b/core/src/main/scala/besom/rpc/pulumirpc/codegen/hcl/Pos.scala @@ -0,0 +1,196 @@ +// Generated by the Scala Plugin for the Protocol Buffer Compiler. +// Do not edit! +// +// Protofile syntax: PROTO3 + +package pulumirpc.codegen.hcl + +/** Pos represents a single position in a source file, by addressing the start byte of a unicode character + * encoded in UTF-8. + * + * @param line + * Line is the source code line where this position points. Lines are counted starting at 1 and + * incremented for each newline character encountered. + * @param column + * Column is the source code column where this position points, in unicode characters, with counting + * starting at 1. + * + * Column counts characters as they appear visually, so for example a latin letter with a combining + * diacritic mark counts as one character. This is intended for rendering visual markers against source + * code in contexts where these diacritics would be rendered in a single character cell. Technically + * speaking, Column is counting grapheme clusters as used in unicode normalization. + * @param byte + * Byte is the byte offset into the file where the indicated character begins. This is a zero-based offset + * to the first byte of the first UTF-8 codepoint sequence in the character, and thus gives a position + * that can be resolved _without_ awareness of Unicode characters. + */ +@SerialVersionUID(0L) +final case class Pos( + line: _root_.scala.Long = 0L, + column: _root_.scala.Long = 0L, + byte: _root_.scala.Long = 0L, + unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[Pos] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + + { + val __value = line + if (__value != 0L) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeInt64Size(1, __value) + } + }; + + { + val __value = column + if (__value != 0L) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeInt64Size(2, __value) + } + }; + + { + val __value = byte + if (__value != 0L) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeInt64Size(3, __value) + } + }; + __size += unknownFields.serializedSize + __size + } + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size + } + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + { + val __v = line + if (__v != 0L) { + _output__.writeInt64(1, __v) + } + }; + { + val __v = column + if (__v != 0L) { + _output__.writeInt64(2, __v) + } + }; + { + val __v = byte + if (__v != 0L) { + _output__.writeInt64(3, __v) + } + }; + unknownFields.writeTo(_output__) + } + def withLine(__v: _root_.scala.Long): Pos = copy(line = __v) + def withColumn(__v: _root_.scala.Long): Pos = copy(column = __v) + def withByte(__v: _root_.scala.Long): Pos = copy(byte = __v) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => { + val __t = line + if (__t != 0L) __t else null + } + case 2 => { + val __t = column + if (__t != 0L) __t else null + } + case 3 => { + val __t = byte + if (__t != 0L) __t else null + } + } + } + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PLong(line) + case 2 => _root_.scalapb.descriptors.PLong(column) + case 3 => _root_.scalapb.descriptors.PLong(byte) + } + } + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: pulumirpc.codegen.hcl.Pos.type = pulumirpc.codegen.hcl.Pos + // @@protoc_insertion_point(GeneratedMessage[pulumirpc.codegen.Pos]) +} + +object Pos extends scalapb.GeneratedMessageCompanion[pulumirpc.codegen.hcl.Pos] { + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[pulumirpc.codegen.hcl.Pos] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): pulumirpc.codegen.hcl.Pos = { + var __line: _root_.scala.Long = 0L + var __column: _root_.scala.Long = 0L + var __byte: _root_.scala.Long = 0L + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false + while (!_done__) { + val _tag__ = _input__.readTag() + _tag__ match { + case 0 => _done__ = true + case 8 => + __line = _input__.readInt64() + case 16 => + __column = _input__.readInt64() + case 24 => + __byte = _input__.readInt64() + case tag => + if (_unknownFields__ == null) { + _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder() + } + _unknownFields__.parseField(tag, _input__) + } + } + pulumirpc.codegen.hcl.Pos( + line = __line, + column = __column, + byte = __byte, + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() + ) + } + implicit def messageReads: _root_.scalapb.descriptors.Reads[pulumirpc.codegen.hcl.Pos] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + pulumirpc.codegen.hcl.Pos( + line = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Long]).getOrElse(0L), + column = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Long]).getOrElse(0L), + byte = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.scala.Long]).getOrElse(0L) + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = HclProto.javaDescriptor.getMessageTypes().get(0) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = HclProto.scalaDescriptor.messages(0) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number) + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + lazy val defaultInstance = pulumirpc.codegen.hcl.Pos( + line = 0L, + column = 0L, + byte = 0L + ) + implicit class PosLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.codegen.hcl.Pos]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, pulumirpc.codegen.hcl.Pos](_l) { + def line: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.line)((c_, f_) => c_.copy(line = f_)) + def column: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.column)((c_, f_) => c_.copy(column = f_)) + def byte: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.byte)((c_, f_) => c_.copy(byte = f_)) + } + final val LINE_FIELD_NUMBER = 1 + final val COLUMN_FIELD_NUMBER = 2 + final val BYTE_FIELD_NUMBER = 3 + def of( + line: _root_.scala.Long, + column: _root_.scala.Long, + byte: _root_.scala.Long + ): _root_.pulumirpc.codegen.hcl.Pos = _root_.pulumirpc.codegen.hcl.Pos( + line, + column, + byte + ) + // @@protoc_insertion_point(GeneratedMessageCompanion[pulumirpc.codegen.Pos]) +} diff --git a/core/src/main/scala/besom/rpc/pulumirpc/codegen/hcl/Range.scala b/core/src/main/scala/besom/rpc/pulumirpc/codegen/hcl/Range.scala new file mode 100644 index 000000000..02dc2c243 --- /dev/null +++ b/core/src/main/scala/besom/rpc/pulumirpc/codegen/hcl/Range.scala @@ -0,0 +1,185 @@ +// Generated by the Scala Plugin for the Protocol Buffer Compiler. +// Do not edit! +// +// Protofile syntax: PROTO3 + +package pulumirpc.codegen.hcl + +/** Range represents a span of characters between two positions in a source file. + * + * @param filename + * Filename is the name of the file into which this range's positions point. + * @param start + * Start and End represent the bounds of this range. Start is inclusive and End is exclusive. + */ +@SerialVersionUID(0L) +final case class Range( + filename: _root_.scala.Predef.String = "", + start: _root_.scala.Option[pulumirpc.codegen.hcl.Pos] = _root_.scala.None, + end: _root_.scala.Option[pulumirpc.codegen.hcl.Pos] = _root_.scala.None, + unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[Range] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + + { + val __value = filename + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value) + } + }; + if (start.isDefined) { + val __value = start.get + __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize + }; + if (end.isDefined) { + val __value = end.get + __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize + }; + __size += unknownFields.serializedSize + __size + } + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size + } + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + { + val __v = filename + if (!__v.isEmpty) { + _output__.writeString(1, __v) + } + }; + start.foreach { __v => + val __m = __v + _output__.writeTag(2, 2) + _output__.writeUInt32NoTag(__m.serializedSize) + __m.writeTo(_output__) + }; + end.foreach { __v => + val __m = __v + _output__.writeTag(3, 2) + _output__.writeUInt32NoTag(__m.serializedSize) + __m.writeTo(_output__) + }; + unknownFields.writeTo(_output__) + } + def withFilename(__v: _root_.scala.Predef.String): Range = copy(filename = __v) + def getStart: pulumirpc.codegen.hcl.Pos = start.getOrElse(pulumirpc.codegen.hcl.Pos.defaultInstance) + def clearStart: Range = copy(start = _root_.scala.None) + def withStart(__v: pulumirpc.codegen.hcl.Pos): Range = copy(start = Option(__v)) + def getEnd: pulumirpc.codegen.hcl.Pos = end.getOrElse(pulumirpc.codegen.hcl.Pos.defaultInstance) + def clearEnd: Range = copy(end = _root_.scala.None) + def withEnd(__v: pulumirpc.codegen.hcl.Pos): Range = copy(end = Option(__v)) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => { + val __t = filename + if (__t != "") __t else null + } + case 2 => start.orNull + case 3 => end.orNull + } + } + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PString(filename) + case 2 => start.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty) + case 3 => end.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty) + } + } + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: pulumirpc.codegen.hcl.Range.type = pulumirpc.codegen.hcl.Range + // @@protoc_insertion_point(GeneratedMessage[pulumirpc.codegen.Range]) +} + +object Range extends scalapb.GeneratedMessageCompanion[pulumirpc.codegen.hcl.Range] { + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[pulumirpc.codegen.hcl.Range] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): pulumirpc.codegen.hcl.Range = { + var __filename: _root_.scala.Predef.String = "" + var __start: _root_.scala.Option[pulumirpc.codegen.hcl.Pos] = _root_.scala.None + var __end: _root_.scala.Option[pulumirpc.codegen.hcl.Pos] = _root_.scala.None + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false + while (!_done__) { + val _tag__ = _input__.readTag() + _tag__ match { + case 0 => _done__ = true + case 10 => + __filename = _input__.readStringRequireUtf8() + case 18 => + __start = Option(__start.fold(_root_.scalapb.LiteParser.readMessage[pulumirpc.codegen.hcl.Pos](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _))) + case 26 => + __end = Option(__end.fold(_root_.scalapb.LiteParser.readMessage[pulumirpc.codegen.hcl.Pos](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _))) + case tag => + if (_unknownFields__ == null) { + _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder() + } + _unknownFields__.parseField(tag, _input__) + } + } + pulumirpc.codegen.hcl.Range( + filename = __filename, + start = __start, + end = __end, + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() + ) + } + implicit def messageReads: _root_.scalapb.descriptors.Reads[pulumirpc.codegen.hcl.Range] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + pulumirpc.codegen.hcl.Range( + filename = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + start = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).flatMap(_.as[_root_.scala.Option[pulumirpc.codegen.hcl.Pos]]), + end = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).flatMap(_.as[_root_.scala.Option[pulumirpc.codegen.hcl.Pos]]) + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = HclProto.javaDescriptor.getMessageTypes().get(1) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = HclProto.scalaDescriptor.messages(1) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = { + var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null + (__number: @_root_.scala.unchecked) match { + case 2 => __out = pulumirpc.codegen.hcl.Pos + case 3 => __out = pulumirpc.codegen.hcl.Pos + } + __out + } + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + lazy val defaultInstance = pulumirpc.codegen.hcl.Range( + filename = "", + start = _root_.scala.None, + end = _root_.scala.None + ) + implicit class RangeLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.codegen.hcl.Range]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, pulumirpc.codegen.hcl.Range](_l) { + def filename: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.filename)((c_, f_) => c_.copy(filename = f_)) + def start: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.codegen.hcl.Pos] = field(_.getStart)((c_, f_) => c_.copy(start = Option(f_))) + def optionalStart: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[pulumirpc.codegen.hcl.Pos]] = field(_.start)((c_, f_) => c_.copy(start = f_)) + def end: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.codegen.hcl.Pos] = field(_.getEnd)((c_, f_) => c_.copy(end = Option(f_))) + def optionalEnd: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[pulumirpc.codegen.hcl.Pos]] = field(_.end)((c_, f_) => c_.copy(end = f_)) + } + final val FILENAME_FIELD_NUMBER = 1 + final val START_FIELD_NUMBER = 2 + final val END_FIELD_NUMBER = 3 + def of( + filename: _root_.scala.Predef.String, + start: _root_.scala.Option[pulumirpc.codegen.hcl.Pos], + end: _root_.scala.Option[pulumirpc.codegen.hcl.Pos] + ): _root_.pulumirpc.codegen.hcl.Range = _root_.pulumirpc.codegen.hcl.Range( + filename, + start, + end + ) + // @@protoc_insertion_point(GeneratedMessageCompanion[pulumirpc.codegen.Range]) +} diff --git a/core/src/main/scala/besom/rpc/pulumirpc/language/AboutResponse.scala b/core/src/main/scala/besom/rpc/pulumirpc/language/AboutResponse.scala new file mode 100644 index 000000000..7f521561e --- /dev/null +++ b/core/src/main/scala/besom/rpc/pulumirpc/language/AboutResponse.scala @@ -0,0 +1,338 @@ +// Generated by the Scala Plugin for the Protocol Buffer Compiler. +// Do not edit! +// +// Protofile syntax: PROTO3 + +package pulumirpc.language + +/** AboutResponse returns runtime information about the language. + * + * @param executable + * the primary executable for the runtime of this language. + * @param version + * the version of the runtime for this language. + * @param metadata + * other information about this language. + */ +@SerialVersionUID(0L) +final case class AboutResponse( + executable: _root_.scala.Predef.String = "", + version: _root_.scala.Predef.String = "", + metadata: _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String] = _root_.scala.collection.immutable.Map.empty, + unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[AboutResponse] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + + { + val __value = executable + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value) + } + }; + + { + val __value = version + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(2, __value) + } + }; + metadata.foreach { __item => + val __value = pulumirpc.language.AboutResponse._typemapper_metadata.toBase(__item) + __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize + } + __size += unknownFields.serializedSize + __size + } + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size + } + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + { + val __v = executable + if (!__v.isEmpty) { + _output__.writeString(1, __v) + } + }; + { + val __v = version + if (!__v.isEmpty) { + _output__.writeString(2, __v) + } + }; + metadata.foreach { __v => + val __m = pulumirpc.language.AboutResponse._typemapper_metadata.toBase(__v) + _output__.writeTag(3, 2) + _output__.writeUInt32NoTag(__m.serializedSize) + __m.writeTo(_output__) + }; + unknownFields.writeTo(_output__) + } + def withExecutable(__v: _root_.scala.Predef.String): AboutResponse = copy(executable = __v) + def withVersion(__v: _root_.scala.Predef.String): AboutResponse = copy(version = __v) + def clearMetadata = copy(metadata = _root_.scala.collection.immutable.Map.empty) + def addMetadata(__vs: (_root_.scala.Predef.String, _root_.scala.Predef.String) *): AboutResponse = addAllMetadata(__vs) + def addAllMetadata(__vs: Iterable[(_root_.scala.Predef.String, _root_.scala.Predef.String)]): AboutResponse = copy(metadata = metadata ++ __vs) + def withMetadata(__v: _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String]): AboutResponse = copy(metadata = __v) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => { + val __t = executable + if (__t != "") __t else null + } + case 2 => { + val __t = version + if (__t != "") __t else null + } + case 3 => metadata.iterator.map(pulumirpc.language.AboutResponse._typemapper_metadata.toBase(_)).toSeq + } + } + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PString(executable) + case 2 => _root_.scalapb.descriptors.PString(version) + case 3 => _root_.scalapb.descriptors.PRepeated(metadata.iterator.map(pulumirpc.language.AboutResponse._typemapper_metadata.toBase(_).toPMessage).toVector) + } + } + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: pulumirpc.language.AboutResponse.type = pulumirpc.language.AboutResponse + // @@protoc_insertion_point(GeneratedMessage[pulumirpc.AboutResponse]) +} + +object AboutResponse extends scalapb.GeneratedMessageCompanion[pulumirpc.language.AboutResponse] { + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[pulumirpc.language.AboutResponse] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): pulumirpc.language.AboutResponse = { + var __executable: _root_.scala.Predef.String = "" + var __version: _root_.scala.Predef.String = "" + val __metadata: _root_.scala.collection.mutable.Builder[(_root_.scala.Predef.String, _root_.scala.Predef.String), _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String]] = _root_.scala.collection.immutable.Map.newBuilder[_root_.scala.Predef.String, _root_.scala.Predef.String] + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false + while (!_done__) { + val _tag__ = _input__.readTag() + _tag__ match { + case 0 => _done__ = true + case 10 => + __executable = _input__.readStringRequireUtf8() + case 18 => + __version = _input__.readStringRequireUtf8() + case 26 => + __metadata += pulumirpc.language.AboutResponse._typemapper_metadata.toCustom(_root_.scalapb.LiteParser.readMessage[pulumirpc.language.AboutResponse.MetadataEntry](_input__)) + case tag => + if (_unknownFields__ == null) { + _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder() + } + _unknownFields__.parseField(tag, _input__) + } + } + pulumirpc.language.AboutResponse( + executable = __executable, + version = __version, + metadata = __metadata.result(), + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() + ) + } + implicit def messageReads: _root_.scalapb.descriptors.Reads[pulumirpc.language.AboutResponse] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + pulumirpc.language.AboutResponse( + executable = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + version = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + metadata = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.scala.Seq[pulumirpc.language.AboutResponse.MetadataEntry]]).getOrElse(_root_.scala.Seq.empty).iterator.map(pulumirpc.language.AboutResponse._typemapper_metadata.toCustom(_)).toMap + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = LanguageProto.javaDescriptor.getMessageTypes().get(1) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = LanguageProto.scalaDescriptor.messages(1) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = { + var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null + (__number: @_root_.scala.unchecked) match { + case 3 => __out = pulumirpc.language.AboutResponse.MetadataEntry + } + __out + } + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = + Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]]( + _root_.pulumirpc.language.AboutResponse.MetadataEntry + ) + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + lazy val defaultInstance = pulumirpc.language.AboutResponse( + executable = "", + version = "", + metadata = _root_.scala.collection.immutable.Map.empty + ) + @SerialVersionUID(0L) + final case class MetadataEntry( + key: _root_.scala.Predef.String = "", + value: _root_.scala.Predef.String = "", + unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[MetadataEntry] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + + { + val __value = key + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value) + } + }; + + { + val __value = value + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(2, __value) + } + }; + __size += unknownFields.serializedSize + __size + } + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size + } + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + { + val __v = key + if (!__v.isEmpty) { + _output__.writeString(1, __v) + } + }; + { + val __v = value + if (!__v.isEmpty) { + _output__.writeString(2, __v) + } + }; + unknownFields.writeTo(_output__) + } + def withKey(__v: _root_.scala.Predef.String): MetadataEntry = copy(key = __v) + def withValue(__v: _root_.scala.Predef.String): MetadataEntry = copy(value = __v) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => { + val __t = key + if (__t != "") __t else null + } + case 2 => { + val __t = value + if (__t != "") __t else null + } + } + } + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PString(key) + case 2 => _root_.scalapb.descriptors.PString(value) + } + } + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: pulumirpc.language.AboutResponse.MetadataEntry.type = pulumirpc.language.AboutResponse.MetadataEntry + // @@protoc_insertion_point(GeneratedMessage[pulumirpc.AboutResponse.MetadataEntry]) + } + + object MetadataEntry extends scalapb.GeneratedMessageCompanion[pulumirpc.language.AboutResponse.MetadataEntry] { + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[pulumirpc.language.AboutResponse.MetadataEntry] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): pulumirpc.language.AboutResponse.MetadataEntry = { + var __key: _root_.scala.Predef.String = "" + var __value: _root_.scala.Predef.String = "" + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false + while (!_done__) { + val _tag__ = _input__.readTag() + _tag__ match { + case 0 => _done__ = true + case 10 => + __key = _input__.readStringRequireUtf8() + case 18 => + __value = _input__.readStringRequireUtf8() + case tag => + if (_unknownFields__ == null) { + _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder() + } + _unknownFields__.parseField(tag, _input__) + } + } + pulumirpc.language.AboutResponse.MetadataEntry( + key = __key, + value = __value, + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() + ) + } + implicit def messageReads: _root_.scalapb.descriptors.Reads[pulumirpc.language.AboutResponse.MetadataEntry] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + pulumirpc.language.AboutResponse.MetadataEntry( + key = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + value = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Predef.String]).getOrElse("") + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = pulumirpc.language.AboutResponse.javaDescriptor.getNestedTypes().get(0) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = pulumirpc.language.AboutResponse.scalaDescriptor.nestedMessages(0) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number) + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + lazy val defaultInstance = pulumirpc.language.AboutResponse.MetadataEntry( + key = "", + value = "" + ) + implicit class MetadataEntryLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.language.AboutResponse.MetadataEntry]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, pulumirpc.language.AboutResponse.MetadataEntry](_l) { + def key: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.key)((c_, f_) => c_.copy(key = f_)) + def value: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.value)((c_, f_) => c_.copy(value = f_)) + } + final val KEY_FIELD_NUMBER = 1 + final val VALUE_FIELD_NUMBER = 2 + @transient + implicit val keyValueMapper: _root_.scalapb.TypeMapper[pulumirpc.language.AboutResponse.MetadataEntry, (_root_.scala.Predef.String, _root_.scala.Predef.String)] = + _root_.scalapb.TypeMapper[pulumirpc.language.AboutResponse.MetadataEntry, (_root_.scala.Predef.String, _root_.scala.Predef.String)](__m => (__m.key, __m.value))(__p => pulumirpc.language.AboutResponse.MetadataEntry(__p._1, __p._2)) + def of( + key: _root_.scala.Predef.String, + value: _root_.scala.Predef.String + ): _root_.pulumirpc.language.AboutResponse.MetadataEntry = _root_.pulumirpc.language.AboutResponse.MetadataEntry( + key, + value + ) + // @@protoc_insertion_point(GeneratedMessageCompanion[pulumirpc.AboutResponse.MetadataEntry]) + } + + implicit class AboutResponseLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.language.AboutResponse]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, pulumirpc.language.AboutResponse](_l) { + def executable: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.executable)((c_, f_) => c_.copy(executable = f_)) + def version: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.version)((c_, f_) => c_.copy(version = f_)) + def metadata: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String]] = field(_.metadata)((c_, f_) => c_.copy(metadata = f_)) + } + final val EXECUTABLE_FIELD_NUMBER = 1 + final val VERSION_FIELD_NUMBER = 2 + final val METADATA_FIELD_NUMBER = 3 + @transient + private[language] val _typemapper_metadata: _root_.scalapb.TypeMapper[pulumirpc.language.AboutResponse.MetadataEntry, (_root_.scala.Predef.String, _root_.scala.Predef.String)] = implicitly[_root_.scalapb.TypeMapper[pulumirpc.language.AboutResponse.MetadataEntry, (_root_.scala.Predef.String, _root_.scala.Predef.String)]] + def of( + executable: _root_.scala.Predef.String, + version: _root_.scala.Predef.String, + metadata: _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String] + ): _root_.pulumirpc.language.AboutResponse = _root_.pulumirpc.language.AboutResponse( + executable, + version, + metadata + ) + // @@protoc_insertion_point(GeneratedMessageCompanion[pulumirpc.AboutResponse]) +} diff --git a/core/src/main/scala/besom/rpc/pulumirpc/language/DependencyInfo.scala b/core/src/main/scala/besom/rpc/pulumirpc/language/DependencyInfo.scala new file mode 100644 index 000000000..76f554d0d --- /dev/null +++ b/core/src/main/scala/besom/rpc/pulumirpc/language/DependencyInfo.scala @@ -0,0 +1,152 @@ +// Generated by the Scala Plugin for the Protocol Buffer Compiler. +// Do not edit! +// +// Protofile syntax: PROTO3 + +package pulumirpc.language + +/** @param name + * The name of the dependency. + * @param version + * The version of the dependency. + */ +@SerialVersionUID(0L) +final case class DependencyInfo( + name: _root_.scala.Predef.String = "", + version: _root_.scala.Predef.String = "", + unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[DependencyInfo] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + + { + val __value = name + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value) + } + }; + + { + val __value = version + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(2, __value) + } + }; + __size += unknownFields.serializedSize + __size + } + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size + } + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + { + val __v = name + if (!__v.isEmpty) { + _output__.writeString(1, __v) + } + }; + { + val __v = version + if (!__v.isEmpty) { + _output__.writeString(2, __v) + } + }; + unknownFields.writeTo(_output__) + } + def withName(__v: _root_.scala.Predef.String): DependencyInfo = copy(name = __v) + def withVersion(__v: _root_.scala.Predef.String): DependencyInfo = copy(version = __v) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => { + val __t = name + if (__t != "") __t else null + } + case 2 => { + val __t = version + if (__t != "") __t else null + } + } + } + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PString(name) + case 2 => _root_.scalapb.descriptors.PString(version) + } + } + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: pulumirpc.language.DependencyInfo.type = pulumirpc.language.DependencyInfo + // @@protoc_insertion_point(GeneratedMessage[pulumirpc.DependencyInfo]) +} + +object DependencyInfo extends scalapb.GeneratedMessageCompanion[pulumirpc.language.DependencyInfo] { + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[pulumirpc.language.DependencyInfo] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): pulumirpc.language.DependencyInfo = { + var __name: _root_.scala.Predef.String = "" + var __version: _root_.scala.Predef.String = "" + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false + while (!_done__) { + val _tag__ = _input__.readTag() + _tag__ match { + case 0 => _done__ = true + case 10 => + __name = _input__.readStringRequireUtf8() + case 18 => + __version = _input__.readStringRequireUtf8() + case tag => + if (_unknownFields__ == null) { + _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder() + } + _unknownFields__.parseField(tag, _input__) + } + } + pulumirpc.language.DependencyInfo( + name = __name, + version = __version, + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() + ) + } + implicit def messageReads: _root_.scalapb.descriptors.Reads[pulumirpc.language.DependencyInfo] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + pulumirpc.language.DependencyInfo( + name = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + version = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Predef.String]).getOrElse("") + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = LanguageProto.javaDescriptor.getMessageTypes().get(3) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = LanguageProto.scalaDescriptor.messages(3) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number) + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + lazy val defaultInstance = pulumirpc.language.DependencyInfo( + name = "", + version = "" + ) + implicit class DependencyInfoLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.language.DependencyInfo]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, pulumirpc.language.DependencyInfo](_l) { + def name: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.name)((c_, f_) => c_.copy(name = f_)) + def version: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.version)((c_, f_) => c_.copy(version = f_)) + } + final val NAME_FIELD_NUMBER = 1 + final val VERSION_FIELD_NUMBER = 2 + def of( + name: _root_.scala.Predef.String, + version: _root_.scala.Predef.String + ): _root_.pulumirpc.language.DependencyInfo = _root_.pulumirpc.language.DependencyInfo( + name, + version + ) + // @@protoc_insertion_point(GeneratedMessageCompanion[pulumirpc.DependencyInfo]) +} diff --git a/core/src/main/scala/besom/rpc/pulumirpc/language/GeneratePackageRequest.scala b/core/src/main/scala/besom/rpc/pulumirpc/language/GeneratePackageRequest.scala new file mode 100644 index 000000000..fc59e50b5 --- /dev/null +++ b/core/src/main/scala/besom/rpc/pulumirpc/language/GeneratePackageRequest.scala @@ -0,0 +1,368 @@ +// Generated by the Scala Plugin for the Protocol Buffer Compiler. +// Do not edit! +// +// Protofile syntax: PROTO3 + +package pulumirpc.language + +/** @param directory + * the directory to generate the package in. + * @param schema + * the JSON-encoded schema. + * @param extraFiles + * extra files to copy to the package output. + * @param loaderTarget + * The target of a codegen.LoaderServer to use for loading schemas. + */ +@SerialVersionUID(0L) +final case class GeneratePackageRequest( + directory: _root_.scala.Predef.String = "", + schema: _root_.scala.Predef.String = "", + extraFiles: _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.com.google.protobuf.ByteString] = _root_.scala.collection.immutable.Map.empty, + loaderTarget: _root_.scala.Predef.String = "", + unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[GeneratePackageRequest] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + + { + val __value = directory + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value) + } + }; + + { + val __value = schema + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(2, __value) + } + }; + extraFiles.foreach { __item => + val __value = pulumirpc.language.GeneratePackageRequest._typemapper_extraFiles.toBase(__item) + __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize + } + + { + val __value = loaderTarget + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(4, __value) + } + }; + __size += unknownFields.serializedSize + __size + } + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size + } + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + { + val __v = directory + if (!__v.isEmpty) { + _output__.writeString(1, __v) + } + }; + { + val __v = schema + if (!__v.isEmpty) { + _output__.writeString(2, __v) + } + }; + extraFiles.foreach { __v => + val __m = pulumirpc.language.GeneratePackageRequest._typemapper_extraFiles.toBase(__v) + _output__.writeTag(3, 2) + _output__.writeUInt32NoTag(__m.serializedSize) + __m.writeTo(_output__) + }; + { + val __v = loaderTarget + if (!__v.isEmpty) { + _output__.writeString(4, __v) + } + }; + unknownFields.writeTo(_output__) + } + def withDirectory(__v: _root_.scala.Predef.String): GeneratePackageRequest = copy(directory = __v) + def withSchema(__v: _root_.scala.Predef.String): GeneratePackageRequest = copy(schema = __v) + def clearExtraFiles = copy(extraFiles = _root_.scala.collection.immutable.Map.empty) + def addExtraFiles(__vs: (_root_.scala.Predef.String, _root_.com.google.protobuf.ByteString) *): GeneratePackageRequest = addAllExtraFiles(__vs) + def addAllExtraFiles(__vs: Iterable[(_root_.scala.Predef.String, _root_.com.google.protobuf.ByteString)]): GeneratePackageRequest = copy(extraFiles = extraFiles ++ __vs) + def withExtraFiles(__v: _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.com.google.protobuf.ByteString]): GeneratePackageRequest = copy(extraFiles = __v) + def withLoaderTarget(__v: _root_.scala.Predef.String): GeneratePackageRequest = copy(loaderTarget = __v) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => { + val __t = directory + if (__t != "") __t else null + } + case 2 => { + val __t = schema + if (__t != "") __t else null + } + case 3 => extraFiles.iterator.map(pulumirpc.language.GeneratePackageRequest._typemapper_extraFiles.toBase(_)).toSeq + case 4 => { + val __t = loaderTarget + if (__t != "") __t else null + } + } + } + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PString(directory) + case 2 => _root_.scalapb.descriptors.PString(schema) + case 3 => _root_.scalapb.descriptors.PRepeated(extraFiles.iterator.map(pulumirpc.language.GeneratePackageRequest._typemapper_extraFiles.toBase(_).toPMessage).toVector) + case 4 => _root_.scalapb.descriptors.PString(loaderTarget) + } + } + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: pulumirpc.language.GeneratePackageRequest.type = pulumirpc.language.GeneratePackageRequest + // @@protoc_insertion_point(GeneratedMessage[pulumirpc.GeneratePackageRequest]) +} + +object GeneratePackageRequest extends scalapb.GeneratedMessageCompanion[pulumirpc.language.GeneratePackageRequest] { + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[pulumirpc.language.GeneratePackageRequest] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): pulumirpc.language.GeneratePackageRequest = { + var __directory: _root_.scala.Predef.String = "" + var __schema: _root_.scala.Predef.String = "" + val __extraFiles: _root_.scala.collection.mutable.Builder[(_root_.scala.Predef.String, _root_.com.google.protobuf.ByteString), _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.com.google.protobuf.ByteString]] = _root_.scala.collection.immutable.Map.newBuilder[_root_.scala.Predef.String, _root_.com.google.protobuf.ByteString] + var __loaderTarget: _root_.scala.Predef.String = "" + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false + while (!_done__) { + val _tag__ = _input__.readTag() + _tag__ match { + case 0 => _done__ = true + case 10 => + __directory = _input__.readStringRequireUtf8() + case 18 => + __schema = _input__.readStringRequireUtf8() + case 26 => + __extraFiles += pulumirpc.language.GeneratePackageRequest._typemapper_extraFiles.toCustom(_root_.scalapb.LiteParser.readMessage[pulumirpc.language.GeneratePackageRequest.ExtraFilesEntry](_input__)) + case 34 => + __loaderTarget = _input__.readStringRequireUtf8() + case tag => + if (_unknownFields__ == null) { + _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder() + } + _unknownFields__.parseField(tag, _input__) + } + } + pulumirpc.language.GeneratePackageRequest( + directory = __directory, + schema = __schema, + extraFiles = __extraFiles.result(), + loaderTarget = __loaderTarget, + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() + ) + } + implicit def messageReads: _root_.scalapb.descriptors.Reads[pulumirpc.language.GeneratePackageRequest] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + pulumirpc.language.GeneratePackageRequest( + directory = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + schema = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + extraFiles = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.scala.Seq[pulumirpc.language.GeneratePackageRequest.ExtraFilesEntry]]).getOrElse(_root_.scala.Seq.empty).iterator.map(pulumirpc.language.GeneratePackageRequest._typemapper_extraFiles.toCustom(_)).toMap, + loaderTarget = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).map(_.as[_root_.scala.Predef.String]).getOrElse("") + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = LanguageProto.javaDescriptor.getMessageTypes().get(17) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = LanguageProto.scalaDescriptor.messages(17) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = { + var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null + (__number: @_root_.scala.unchecked) match { + case 3 => __out = pulumirpc.language.GeneratePackageRequest.ExtraFilesEntry + } + __out + } + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = + Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]]( + _root_.pulumirpc.language.GeneratePackageRequest.ExtraFilesEntry + ) + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + lazy val defaultInstance = pulumirpc.language.GeneratePackageRequest( + directory = "", + schema = "", + extraFiles = _root_.scala.collection.immutable.Map.empty, + loaderTarget = "" + ) + @SerialVersionUID(0L) + final case class ExtraFilesEntry( + key: _root_.scala.Predef.String = "", + value: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY, + unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[ExtraFilesEntry] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + + { + val __value = key + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value) + } + }; + + { + val __value = value + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeBytesSize(2, __value) + } + }; + __size += unknownFields.serializedSize + __size + } + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size + } + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + { + val __v = key + if (!__v.isEmpty) { + _output__.writeString(1, __v) + } + }; + { + val __v = value + if (!__v.isEmpty) { + _output__.writeBytes(2, __v) + } + }; + unknownFields.writeTo(_output__) + } + def withKey(__v: _root_.scala.Predef.String): ExtraFilesEntry = copy(key = __v) + def withValue(__v: _root_.com.google.protobuf.ByteString): ExtraFilesEntry = copy(value = __v) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => { + val __t = key + if (__t != "") __t else null + } + case 2 => { + val __t = value + if (__t != _root_.com.google.protobuf.ByteString.EMPTY) __t else null + } + } + } + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PString(key) + case 2 => _root_.scalapb.descriptors.PByteString(value) + } + } + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: pulumirpc.language.GeneratePackageRequest.ExtraFilesEntry.type = pulumirpc.language.GeneratePackageRequest.ExtraFilesEntry + // @@protoc_insertion_point(GeneratedMessage[pulumirpc.GeneratePackageRequest.ExtraFilesEntry]) + } + + object ExtraFilesEntry extends scalapb.GeneratedMessageCompanion[pulumirpc.language.GeneratePackageRequest.ExtraFilesEntry] { + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[pulumirpc.language.GeneratePackageRequest.ExtraFilesEntry] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): pulumirpc.language.GeneratePackageRequest.ExtraFilesEntry = { + var __key: _root_.scala.Predef.String = "" + var __value: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false + while (!_done__) { + val _tag__ = _input__.readTag() + _tag__ match { + case 0 => _done__ = true + case 10 => + __key = _input__.readStringRequireUtf8() + case 18 => + __value = _input__.readBytes() + case tag => + if (_unknownFields__ == null) { + _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder() + } + _unknownFields__.parseField(tag, _input__) + } + } + pulumirpc.language.GeneratePackageRequest.ExtraFilesEntry( + key = __key, + value = __value, + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() + ) + } + implicit def messageReads: _root_.scalapb.descriptors.Reads[pulumirpc.language.GeneratePackageRequest.ExtraFilesEntry] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + pulumirpc.language.GeneratePackageRequest.ExtraFilesEntry( + key = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + value = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.com.google.protobuf.ByteString]).getOrElse(_root_.com.google.protobuf.ByteString.EMPTY) + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = pulumirpc.language.GeneratePackageRequest.javaDescriptor.getNestedTypes().get(0) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = pulumirpc.language.GeneratePackageRequest.scalaDescriptor.nestedMessages(0) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number) + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + lazy val defaultInstance = pulumirpc.language.GeneratePackageRequest.ExtraFilesEntry( + key = "", + value = _root_.com.google.protobuf.ByteString.EMPTY + ) + implicit class ExtraFilesEntryLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.language.GeneratePackageRequest.ExtraFilesEntry]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, pulumirpc.language.GeneratePackageRequest.ExtraFilesEntry](_l) { + def key: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.key)((c_, f_) => c_.copy(key = f_)) + def value: _root_.scalapb.lenses.Lens[UpperPB, _root_.com.google.protobuf.ByteString] = field(_.value)((c_, f_) => c_.copy(value = f_)) + } + final val KEY_FIELD_NUMBER = 1 + final val VALUE_FIELD_NUMBER = 2 + @transient + implicit val keyValueMapper: _root_.scalapb.TypeMapper[pulumirpc.language.GeneratePackageRequest.ExtraFilesEntry, (_root_.scala.Predef.String, _root_.com.google.protobuf.ByteString)] = + _root_.scalapb.TypeMapper[pulumirpc.language.GeneratePackageRequest.ExtraFilesEntry, (_root_.scala.Predef.String, _root_.com.google.protobuf.ByteString)](__m => (__m.key, __m.value))(__p => pulumirpc.language.GeneratePackageRequest.ExtraFilesEntry(__p._1, __p._2)) + def of( + key: _root_.scala.Predef.String, + value: _root_.com.google.protobuf.ByteString + ): _root_.pulumirpc.language.GeneratePackageRequest.ExtraFilesEntry = _root_.pulumirpc.language.GeneratePackageRequest.ExtraFilesEntry( + key, + value + ) + // @@protoc_insertion_point(GeneratedMessageCompanion[pulumirpc.GeneratePackageRequest.ExtraFilesEntry]) + } + + implicit class GeneratePackageRequestLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.language.GeneratePackageRequest]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, pulumirpc.language.GeneratePackageRequest](_l) { + def directory: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.directory)((c_, f_) => c_.copy(directory = f_)) + def schema: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.schema)((c_, f_) => c_.copy(schema = f_)) + def extraFiles: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.com.google.protobuf.ByteString]] = field(_.extraFiles)((c_, f_) => c_.copy(extraFiles = f_)) + def loaderTarget: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.loaderTarget)((c_, f_) => c_.copy(loaderTarget = f_)) + } + final val DIRECTORY_FIELD_NUMBER = 1 + final val SCHEMA_FIELD_NUMBER = 2 + final val EXTRA_FILES_FIELD_NUMBER = 3 + final val LOADER_TARGET_FIELD_NUMBER = 4 + @transient + private[language] val _typemapper_extraFiles: _root_.scalapb.TypeMapper[pulumirpc.language.GeneratePackageRequest.ExtraFilesEntry, (_root_.scala.Predef.String, _root_.com.google.protobuf.ByteString)] = implicitly[_root_.scalapb.TypeMapper[pulumirpc.language.GeneratePackageRequest.ExtraFilesEntry, (_root_.scala.Predef.String, _root_.com.google.protobuf.ByteString)]] + def of( + directory: _root_.scala.Predef.String, + schema: _root_.scala.Predef.String, + extraFiles: _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.com.google.protobuf.ByteString], + loaderTarget: _root_.scala.Predef.String + ): _root_.pulumirpc.language.GeneratePackageRequest = _root_.pulumirpc.language.GeneratePackageRequest( + directory, + schema, + extraFiles, + loaderTarget + ) + // @@protoc_insertion_point(GeneratedMessageCompanion[pulumirpc.GeneratePackageRequest]) +} diff --git a/core/src/main/scala/besom/rpc/pulumirpc/language/GeneratePackageResponse.scala b/core/src/main/scala/besom/rpc/pulumirpc/language/GeneratePackageResponse.scala new file mode 100644 index 000000000..edf5ce9cd --- /dev/null +++ b/core/src/main/scala/besom/rpc/pulumirpc/language/GeneratePackageResponse.scala @@ -0,0 +1,123 @@ +// Generated by the Scala Plugin for the Protocol Buffer Compiler. +// Do not edit! +// +// Protofile syntax: PROTO3 + +package pulumirpc.language + +/** @param diagnostics + * any diagnostics from code generation. + */ +@SerialVersionUID(0L) +final case class GeneratePackageResponse( + diagnostics: _root_.scala.Seq[pulumirpc.codegen.hcl.Diagnostic] = _root_.scala.Seq.empty, + unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[GeneratePackageResponse] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + diagnostics.foreach { __item => + val __value = __item + __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize + } + __size += unknownFields.serializedSize + __size + } + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size + } + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + diagnostics.foreach { __v => + val __m = __v + _output__.writeTag(1, 2) + _output__.writeUInt32NoTag(__m.serializedSize) + __m.writeTo(_output__) + }; + unknownFields.writeTo(_output__) + } + def clearDiagnostics = copy(diagnostics = _root_.scala.Seq.empty) + def addDiagnostics(__vs: pulumirpc.codegen.hcl.Diagnostic *): GeneratePackageResponse = addAllDiagnostics(__vs) + def addAllDiagnostics(__vs: Iterable[pulumirpc.codegen.hcl.Diagnostic]): GeneratePackageResponse = copy(diagnostics = diagnostics ++ __vs) + def withDiagnostics(__v: _root_.scala.Seq[pulumirpc.codegen.hcl.Diagnostic]): GeneratePackageResponse = copy(diagnostics = __v) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => diagnostics + } + } + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PRepeated(diagnostics.iterator.map(_.toPMessage).toVector) + } + } + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: pulumirpc.language.GeneratePackageResponse.type = pulumirpc.language.GeneratePackageResponse + // @@protoc_insertion_point(GeneratedMessage[pulumirpc.GeneratePackageResponse]) +} + +object GeneratePackageResponse extends scalapb.GeneratedMessageCompanion[pulumirpc.language.GeneratePackageResponse] { + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[pulumirpc.language.GeneratePackageResponse] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): pulumirpc.language.GeneratePackageResponse = { + val __diagnostics: _root_.scala.collection.immutable.VectorBuilder[pulumirpc.codegen.hcl.Diagnostic] = new _root_.scala.collection.immutable.VectorBuilder[pulumirpc.codegen.hcl.Diagnostic] + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false + while (!_done__) { + val _tag__ = _input__.readTag() + _tag__ match { + case 0 => _done__ = true + case 10 => + __diagnostics += _root_.scalapb.LiteParser.readMessage[pulumirpc.codegen.hcl.Diagnostic](_input__) + case tag => + if (_unknownFields__ == null) { + _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder() + } + _unknownFields__.parseField(tag, _input__) + } + } + pulumirpc.language.GeneratePackageResponse( + diagnostics = __diagnostics.result(), + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() + ) + } + implicit def messageReads: _root_.scalapb.descriptors.Reads[pulumirpc.language.GeneratePackageResponse] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + pulumirpc.language.GeneratePackageResponse( + diagnostics = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Seq[pulumirpc.codegen.hcl.Diagnostic]]).getOrElse(_root_.scala.Seq.empty) + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = LanguageProto.javaDescriptor.getMessageTypes().get(18) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = LanguageProto.scalaDescriptor.messages(18) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = { + var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null + (__number: @_root_.scala.unchecked) match { + case 1 => __out = pulumirpc.codegen.hcl.Diagnostic + } + __out + } + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + lazy val defaultInstance = pulumirpc.language.GeneratePackageResponse( + diagnostics = _root_.scala.Seq.empty + ) + implicit class GeneratePackageResponseLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.language.GeneratePackageResponse]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, pulumirpc.language.GeneratePackageResponse](_l) { + def diagnostics: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[pulumirpc.codegen.hcl.Diagnostic]] = field(_.diagnostics)((c_, f_) => c_.copy(diagnostics = f_)) + } + final val DIAGNOSTICS_FIELD_NUMBER = 1 + def of( + diagnostics: _root_.scala.Seq[pulumirpc.codegen.hcl.Diagnostic] + ): _root_.pulumirpc.language.GeneratePackageResponse = _root_.pulumirpc.language.GeneratePackageResponse( + diagnostics + ) + // @@protoc_insertion_point(GeneratedMessageCompanion[pulumirpc.GeneratePackageResponse]) +} diff --git a/core/src/main/scala/besom/rpc/pulumirpc/language/GenerateProgramRequest.scala b/core/src/main/scala/besom/rpc/pulumirpc/language/GenerateProgramRequest.scala new file mode 100644 index 000000000..f7f5ee8cb --- /dev/null +++ b/core/src/main/scala/besom/rpc/pulumirpc/language/GenerateProgramRequest.scala @@ -0,0 +1,304 @@ +// Generated by the Scala Plugin for the Protocol Buffer Compiler. +// Do not edit! +// +// Protofile syntax: PROTO3 + +package pulumirpc.language + +/** @param source + * the PCL source of the project. + * @param loaderTarget + * The target of a codegen.LoaderServer to use for loading schemas. + */ +@SerialVersionUID(0L) +final case class GenerateProgramRequest( + source: _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String] = _root_.scala.collection.immutable.Map.empty, + loaderTarget: _root_.scala.Predef.String = "", + unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[GenerateProgramRequest] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + source.foreach { __item => + val __value = pulumirpc.language.GenerateProgramRequest._typemapper_source.toBase(__item) + __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize + } + + { + val __value = loaderTarget + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(2, __value) + } + }; + __size += unknownFields.serializedSize + __size + } + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size + } + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + source.foreach { __v => + val __m = pulumirpc.language.GenerateProgramRequest._typemapper_source.toBase(__v) + _output__.writeTag(1, 2) + _output__.writeUInt32NoTag(__m.serializedSize) + __m.writeTo(_output__) + }; + { + val __v = loaderTarget + if (!__v.isEmpty) { + _output__.writeString(2, __v) + } + }; + unknownFields.writeTo(_output__) + } + def clearSource = copy(source = _root_.scala.collection.immutable.Map.empty) + def addSource(__vs: (_root_.scala.Predef.String, _root_.scala.Predef.String) *): GenerateProgramRequest = addAllSource(__vs) + def addAllSource(__vs: Iterable[(_root_.scala.Predef.String, _root_.scala.Predef.String)]): GenerateProgramRequest = copy(source = source ++ __vs) + def withSource(__v: _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String]): GenerateProgramRequest = copy(source = __v) + def withLoaderTarget(__v: _root_.scala.Predef.String): GenerateProgramRequest = copy(loaderTarget = __v) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => source.iterator.map(pulumirpc.language.GenerateProgramRequest._typemapper_source.toBase(_)).toSeq + case 2 => { + val __t = loaderTarget + if (__t != "") __t else null + } + } + } + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PRepeated(source.iterator.map(pulumirpc.language.GenerateProgramRequest._typemapper_source.toBase(_).toPMessage).toVector) + case 2 => _root_.scalapb.descriptors.PString(loaderTarget) + } + } + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: pulumirpc.language.GenerateProgramRequest.type = pulumirpc.language.GenerateProgramRequest + // @@protoc_insertion_point(GeneratedMessage[pulumirpc.GenerateProgramRequest]) +} + +object GenerateProgramRequest extends scalapb.GeneratedMessageCompanion[pulumirpc.language.GenerateProgramRequest] { + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[pulumirpc.language.GenerateProgramRequest] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): pulumirpc.language.GenerateProgramRequest = { + val __source: _root_.scala.collection.mutable.Builder[(_root_.scala.Predef.String, _root_.scala.Predef.String), _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String]] = _root_.scala.collection.immutable.Map.newBuilder[_root_.scala.Predef.String, _root_.scala.Predef.String] + var __loaderTarget: _root_.scala.Predef.String = "" + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false + while (!_done__) { + val _tag__ = _input__.readTag() + _tag__ match { + case 0 => _done__ = true + case 10 => + __source += pulumirpc.language.GenerateProgramRequest._typemapper_source.toCustom(_root_.scalapb.LiteParser.readMessage[pulumirpc.language.GenerateProgramRequest.SourceEntry](_input__)) + case 18 => + __loaderTarget = _input__.readStringRequireUtf8() + case tag => + if (_unknownFields__ == null) { + _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder() + } + _unknownFields__.parseField(tag, _input__) + } + } + pulumirpc.language.GenerateProgramRequest( + source = __source.result(), + loaderTarget = __loaderTarget, + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() + ) + } + implicit def messageReads: _root_.scalapb.descriptors.Reads[pulumirpc.language.GenerateProgramRequest] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + pulumirpc.language.GenerateProgramRequest( + source = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Seq[pulumirpc.language.GenerateProgramRequest.SourceEntry]]).getOrElse(_root_.scala.Seq.empty).iterator.map(pulumirpc.language.GenerateProgramRequest._typemapper_source.toCustom(_)).toMap, + loaderTarget = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Predef.String]).getOrElse("") + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = LanguageProto.javaDescriptor.getMessageTypes().get(13) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = LanguageProto.scalaDescriptor.messages(13) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = { + var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null + (__number: @_root_.scala.unchecked) match { + case 1 => __out = pulumirpc.language.GenerateProgramRequest.SourceEntry + } + __out + } + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = + Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]]( + _root_.pulumirpc.language.GenerateProgramRequest.SourceEntry + ) + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + lazy val defaultInstance = pulumirpc.language.GenerateProgramRequest( + source = _root_.scala.collection.immutable.Map.empty, + loaderTarget = "" + ) + @SerialVersionUID(0L) + final case class SourceEntry( + key: _root_.scala.Predef.String = "", + value: _root_.scala.Predef.String = "", + unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[SourceEntry] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + + { + val __value = key + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value) + } + }; + + { + val __value = value + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(2, __value) + } + }; + __size += unknownFields.serializedSize + __size + } + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size + } + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + { + val __v = key + if (!__v.isEmpty) { + _output__.writeString(1, __v) + } + }; + { + val __v = value + if (!__v.isEmpty) { + _output__.writeString(2, __v) + } + }; + unknownFields.writeTo(_output__) + } + def withKey(__v: _root_.scala.Predef.String): SourceEntry = copy(key = __v) + def withValue(__v: _root_.scala.Predef.String): SourceEntry = copy(value = __v) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => { + val __t = key + if (__t != "") __t else null + } + case 2 => { + val __t = value + if (__t != "") __t else null + } + } + } + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PString(key) + case 2 => _root_.scalapb.descriptors.PString(value) + } + } + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: pulumirpc.language.GenerateProgramRequest.SourceEntry.type = pulumirpc.language.GenerateProgramRequest.SourceEntry + // @@protoc_insertion_point(GeneratedMessage[pulumirpc.GenerateProgramRequest.SourceEntry]) + } + + object SourceEntry extends scalapb.GeneratedMessageCompanion[pulumirpc.language.GenerateProgramRequest.SourceEntry] { + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[pulumirpc.language.GenerateProgramRequest.SourceEntry] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): pulumirpc.language.GenerateProgramRequest.SourceEntry = { + var __key: _root_.scala.Predef.String = "" + var __value: _root_.scala.Predef.String = "" + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false + while (!_done__) { + val _tag__ = _input__.readTag() + _tag__ match { + case 0 => _done__ = true + case 10 => + __key = _input__.readStringRequireUtf8() + case 18 => + __value = _input__.readStringRequireUtf8() + case tag => + if (_unknownFields__ == null) { + _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder() + } + _unknownFields__.parseField(tag, _input__) + } + } + pulumirpc.language.GenerateProgramRequest.SourceEntry( + key = __key, + value = __value, + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() + ) + } + implicit def messageReads: _root_.scalapb.descriptors.Reads[pulumirpc.language.GenerateProgramRequest.SourceEntry] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + pulumirpc.language.GenerateProgramRequest.SourceEntry( + key = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + value = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Predef.String]).getOrElse("") + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = pulumirpc.language.GenerateProgramRequest.javaDescriptor.getNestedTypes().get(0) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = pulumirpc.language.GenerateProgramRequest.scalaDescriptor.nestedMessages(0) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number) + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + lazy val defaultInstance = pulumirpc.language.GenerateProgramRequest.SourceEntry( + key = "", + value = "" + ) + implicit class SourceEntryLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.language.GenerateProgramRequest.SourceEntry]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, pulumirpc.language.GenerateProgramRequest.SourceEntry](_l) { + def key: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.key)((c_, f_) => c_.copy(key = f_)) + def value: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.value)((c_, f_) => c_.copy(value = f_)) + } + final val KEY_FIELD_NUMBER = 1 + final val VALUE_FIELD_NUMBER = 2 + @transient + implicit val keyValueMapper: _root_.scalapb.TypeMapper[pulumirpc.language.GenerateProgramRequest.SourceEntry, (_root_.scala.Predef.String, _root_.scala.Predef.String)] = + _root_.scalapb.TypeMapper[pulumirpc.language.GenerateProgramRequest.SourceEntry, (_root_.scala.Predef.String, _root_.scala.Predef.String)](__m => (__m.key, __m.value))(__p => pulumirpc.language.GenerateProgramRequest.SourceEntry(__p._1, __p._2)) + def of( + key: _root_.scala.Predef.String, + value: _root_.scala.Predef.String + ): _root_.pulumirpc.language.GenerateProgramRequest.SourceEntry = _root_.pulumirpc.language.GenerateProgramRequest.SourceEntry( + key, + value + ) + // @@protoc_insertion_point(GeneratedMessageCompanion[pulumirpc.GenerateProgramRequest.SourceEntry]) + } + + implicit class GenerateProgramRequestLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.language.GenerateProgramRequest]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, pulumirpc.language.GenerateProgramRequest](_l) { + def source: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String]] = field(_.source)((c_, f_) => c_.copy(source = f_)) + def loaderTarget: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.loaderTarget)((c_, f_) => c_.copy(loaderTarget = f_)) + } + final val SOURCE_FIELD_NUMBER = 1 + final val LOADER_TARGET_FIELD_NUMBER = 2 + @transient + private[language] val _typemapper_source: _root_.scalapb.TypeMapper[pulumirpc.language.GenerateProgramRequest.SourceEntry, (_root_.scala.Predef.String, _root_.scala.Predef.String)] = implicitly[_root_.scalapb.TypeMapper[pulumirpc.language.GenerateProgramRequest.SourceEntry, (_root_.scala.Predef.String, _root_.scala.Predef.String)]] + def of( + source: _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String], + loaderTarget: _root_.scala.Predef.String + ): _root_.pulumirpc.language.GenerateProgramRequest = _root_.pulumirpc.language.GenerateProgramRequest( + source, + loaderTarget + ) + // @@protoc_insertion_point(GeneratedMessageCompanion[pulumirpc.GenerateProgramRequest]) +} diff --git a/core/src/main/scala/besom/rpc/pulumirpc/language/GenerateProgramResponse.scala b/core/src/main/scala/besom/rpc/pulumirpc/language/GenerateProgramResponse.scala new file mode 100644 index 000000000..f32fa2331 --- /dev/null +++ b/core/src/main/scala/besom/rpc/pulumirpc/language/GenerateProgramResponse.scala @@ -0,0 +1,302 @@ +// Generated by the Scala Plugin for the Protocol Buffer Compiler. +// Do not edit! +// +// Protofile syntax: PROTO3 + +package pulumirpc.language + +/** @param diagnostics + * any diagnostics from code generation. + * @param source + * the generated program source code. + */ +@SerialVersionUID(0L) +final case class GenerateProgramResponse( + diagnostics: _root_.scala.Seq[pulumirpc.codegen.hcl.Diagnostic] = _root_.scala.Seq.empty, + source: _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.com.google.protobuf.ByteString] = _root_.scala.collection.immutable.Map.empty, + unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[GenerateProgramResponse] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + diagnostics.foreach { __item => + val __value = __item + __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize + } + source.foreach { __item => + val __value = pulumirpc.language.GenerateProgramResponse._typemapper_source.toBase(__item) + __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize + } + __size += unknownFields.serializedSize + __size + } + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size + } + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + diagnostics.foreach { __v => + val __m = __v + _output__.writeTag(1, 2) + _output__.writeUInt32NoTag(__m.serializedSize) + __m.writeTo(_output__) + }; + source.foreach { __v => + val __m = pulumirpc.language.GenerateProgramResponse._typemapper_source.toBase(__v) + _output__.writeTag(2, 2) + _output__.writeUInt32NoTag(__m.serializedSize) + __m.writeTo(_output__) + }; + unknownFields.writeTo(_output__) + } + def clearDiagnostics = copy(diagnostics = _root_.scala.Seq.empty) + def addDiagnostics(__vs: pulumirpc.codegen.hcl.Diagnostic *): GenerateProgramResponse = addAllDiagnostics(__vs) + def addAllDiagnostics(__vs: Iterable[pulumirpc.codegen.hcl.Diagnostic]): GenerateProgramResponse = copy(diagnostics = diagnostics ++ __vs) + def withDiagnostics(__v: _root_.scala.Seq[pulumirpc.codegen.hcl.Diagnostic]): GenerateProgramResponse = copy(diagnostics = __v) + def clearSource = copy(source = _root_.scala.collection.immutable.Map.empty) + def addSource(__vs: (_root_.scala.Predef.String, _root_.com.google.protobuf.ByteString) *): GenerateProgramResponse = addAllSource(__vs) + def addAllSource(__vs: Iterable[(_root_.scala.Predef.String, _root_.com.google.protobuf.ByteString)]): GenerateProgramResponse = copy(source = source ++ __vs) + def withSource(__v: _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.com.google.protobuf.ByteString]): GenerateProgramResponse = copy(source = __v) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => diagnostics + case 2 => source.iterator.map(pulumirpc.language.GenerateProgramResponse._typemapper_source.toBase(_)).toSeq + } + } + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PRepeated(diagnostics.iterator.map(_.toPMessage).toVector) + case 2 => _root_.scalapb.descriptors.PRepeated(source.iterator.map(pulumirpc.language.GenerateProgramResponse._typemapper_source.toBase(_).toPMessage).toVector) + } + } + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: pulumirpc.language.GenerateProgramResponse.type = pulumirpc.language.GenerateProgramResponse + // @@protoc_insertion_point(GeneratedMessage[pulumirpc.GenerateProgramResponse]) +} + +object GenerateProgramResponse extends scalapb.GeneratedMessageCompanion[pulumirpc.language.GenerateProgramResponse] { + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[pulumirpc.language.GenerateProgramResponse] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): pulumirpc.language.GenerateProgramResponse = { + val __diagnostics: _root_.scala.collection.immutable.VectorBuilder[pulumirpc.codegen.hcl.Diagnostic] = new _root_.scala.collection.immutable.VectorBuilder[pulumirpc.codegen.hcl.Diagnostic] + val __source: _root_.scala.collection.mutable.Builder[(_root_.scala.Predef.String, _root_.com.google.protobuf.ByteString), _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.com.google.protobuf.ByteString]] = _root_.scala.collection.immutable.Map.newBuilder[_root_.scala.Predef.String, _root_.com.google.protobuf.ByteString] + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false + while (!_done__) { + val _tag__ = _input__.readTag() + _tag__ match { + case 0 => _done__ = true + case 10 => + __diagnostics += _root_.scalapb.LiteParser.readMessage[pulumirpc.codegen.hcl.Diagnostic](_input__) + case 18 => + __source += pulumirpc.language.GenerateProgramResponse._typemapper_source.toCustom(_root_.scalapb.LiteParser.readMessage[pulumirpc.language.GenerateProgramResponse.SourceEntry](_input__)) + case tag => + if (_unknownFields__ == null) { + _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder() + } + _unknownFields__.parseField(tag, _input__) + } + } + pulumirpc.language.GenerateProgramResponse( + diagnostics = __diagnostics.result(), + source = __source.result(), + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() + ) + } + implicit def messageReads: _root_.scalapb.descriptors.Reads[pulumirpc.language.GenerateProgramResponse] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + pulumirpc.language.GenerateProgramResponse( + diagnostics = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Seq[pulumirpc.codegen.hcl.Diagnostic]]).getOrElse(_root_.scala.Seq.empty), + source = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Seq[pulumirpc.language.GenerateProgramResponse.SourceEntry]]).getOrElse(_root_.scala.Seq.empty).iterator.map(pulumirpc.language.GenerateProgramResponse._typemapper_source.toCustom(_)).toMap + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = LanguageProto.javaDescriptor.getMessageTypes().get(14) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = LanguageProto.scalaDescriptor.messages(14) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = { + var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null + (__number: @_root_.scala.unchecked) match { + case 1 => __out = pulumirpc.codegen.hcl.Diagnostic + case 2 => __out = pulumirpc.language.GenerateProgramResponse.SourceEntry + } + __out + } + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = + Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]]( + _root_.pulumirpc.language.GenerateProgramResponse.SourceEntry + ) + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + lazy val defaultInstance = pulumirpc.language.GenerateProgramResponse( + diagnostics = _root_.scala.Seq.empty, + source = _root_.scala.collection.immutable.Map.empty + ) + @SerialVersionUID(0L) + final case class SourceEntry( + key: _root_.scala.Predef.String = "", + value: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY, + unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[SourceEntry] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + + { + val __value = key + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value) + } + }; + + { + val __value = value + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeBytesSize(2, __value) + } + }; + __size += unknownFields.serializedSize + __size + } + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size + } + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + { + val __v = key + if (!__v.isEmpty) { + _output__.writeString(1, __v) + } + }; + { + val __v = value + if (!__v.isEmpty) { + _output__.writeBytes(2, __v) + } + }; + unknownFields.writeTo(_output__) + } + def withKey(__v: _root_.scala.Predef.String): SourceEntry = copy(key = __v) + def withValue(__v: _root_.com.google.protobuf.ByteString): SourceEntry = copy(value = __v) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => { + val __t = key + if (__t != "") __t else null + } + case 2 => { + val __t = value + if (__t != _root_.com.google.protobuf.ByteString.EMPTY) __t else null + } + } + } + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PString(key) + case 2 => _root_.scalapb.descriptors.PByteString(value) + } + } + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: pulumirpc.language.GenerateProgramResponse.SourceEntry.type = pulumirpc.language.GenerateProgramResponse.SourceEntry + // @@protoc_insertion_point(GeneratedMessage[pulumirpc.GenerateProgramResponse.SourceEntry]) + } + + object SourceEntry extends scalapb.GeneratedMessageCompanion[pulumirpc.language.GenerateProgramResponse.SourceEntry] { + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[pulumirpc.language.GenerateProgramResponse.SourceEntry] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): pulumirpc.language.GenerateProgramResponse.SourceEntry = { + var __key: _root_.scala.Predef.String = "" + var __value: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false + while (!_done__) { + val _tag__ = _input__.readTag() + _tag__ match { + case 0 => _done__ = true + case 10 => + __key = _input__.readStringRequireUtf8() + case 18 => + __value = _input__.readBytes() + case tag => + if (_unknownFields__ == null) { + _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder() + } + _unknownFields__.parseField(tag, _input__) + } + } + pulumirpc.language.GenerateProgramResponse.SourceEntry( + key = __key, + value = __value, + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() + ) + } + implicit def messageReads: _root_.scalapb.descriptors.Reads[pulumirpc.language.GenerateProgramResponse.SourceEntry] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + pulumirpc.language.GenerateProgramResponse.SourceEntry( + key = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + value = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.com.google.protobuf.ByteString]).getOrElse(_root_.com.google.protobuf.ByteString.EMPTY) + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = pulumirpc.language.GenerateProgramResponse.javaDescriptor.getNestedTypes().get(0) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = pulumirpc.language.GenerateProgramResponse.scalaDescriptor.nestedMessages(0) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number) + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + lazy val defaultInstance = pulumirpc.language.GenerateProgramResponse.SourceEntry( + key = "", + value = _root_.com.google.protobuf.ByteString.EMPTY + ) + implicit class SourceEntryLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.language.GenerateProgramResponse.SourceEntry]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, pulumirpc.language.GenerateProgramResponse.SourceEntry](_l) { + def key: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.key)((c_, f_) => c_.copy(key = f_)) + def value: _root_.scalapb.lenses.Lens[UpperPB, _root_.com.google.protobuf.ByteString] = field(_.value)((c_, f_) => c_.copy(value = f_)) + } + final val KEY_FIELD_NUMBER = 1 + final val VALUE_FIELD_NUMBER = 2 + @transient + implicit val keyValueMapper: _root_.scalapb.TypeMapper[pulumirpc.language.GenerateProgramResponse.SourceEntry, (_root_.scala.Predef.String, _root_.com.google.protobuf.ByteString)] = + _root_.scalapb.TypeMapper[pulumirpc.language.GenerateProgramResponse.SourceEntry, (_root_.scala.Predef.String, _root_.com.google.protobuf.ByteString)](__m => (__m.key, __m.value))(__p => pulumirpc.language.GenerateProgramResponse.SourceEntry(__p._1, __p._2)) + def of( + key: _root_.scala.Predef.String, + value: _root_.com.google.protobuf.ByteString + ): _root_.pulumirpc.language.GenerateProgramResponse.SourceEntry = _root_.pulumirpc.language.GenerateProgramResponse.SourceEntry( + key, + value + ) + // @@protoc_insertion_point(GeneratedMessageCompanion[pulumirpc.GenerateProgramResponse.SourceEntry]) + } + + implicit class GenerateProgramResponseLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.language.GenerateProgramResponse]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, pulumirpc.language.GenerateProgramResponse](_l) { + def diagnostics: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[pulumirpc.codegen.hcl.Diagnostic]] = field(_.diagnostics)((c_, f_) => c_.copy(diagnostics = f_)) + def source: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.com.google.protobuf.ByteString]] = field(_.source)((c_, f_) => c_.copy(source = f_)) + } + final val DIAGNOSTICS_FIELD_NUMBER = 1 + final val SOURCE_FIELD_NUMBER = 2 + @transient + private[language] val _typemapper_source: _root_.scalapb.TypeMapper[pulumirpc.language.GenerateProgramResponse.SourceEntry, (_root_.scala.Predef.String, _root_.com.google.protobuf.ByteString)] = implicitly[_root_.scalapb.TypeMapper[pulumirpc.language.GenerateProgramResponse.SourceEntry, (_root_.scala.Predef.String, _root_.com.google.protobuf.ByteString)]] + def of( + diagnostics: _root_.scala.Seq[pulumirpc.codegen.hcl.Diagnostic], + source: _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.com.google.protobuf.ByteString] + ): _root_.pulumirpc.language.GenerateProgramResponse = _root_.pulumirpc.language.GenerateProgramResponse( + diagnostics, + source + ) + // @@protoc_insertion_point(GeneratedMessageCompanion[pulumirpc.GenerateProgramResponse]) +} diff --git a/core/src/main/scala/besom/rpc/pulumirpc/language/GenerateProjectRequest.scala b/core/src/main/scala/besom/rpc/pulumirpc/language/GenerateProjectRequest.scala new file mode 100644 index 000000000..f75bbb2e6 --- /dev/null +++ b/core/src/main/scala/besom/rpc/pulumirpc/language/GenerateProjectRequest.scala @@ -0,0 +1,433 @@ +// Generated by the Scala Plugin for the Protocol Buffer Compiler. +// Do not edit! +// +// Protofile syntax: PROTO3 + +package pulumirpc.language + +/** @param sourceDirectory + * the directory to generate the project from. + * @param targetDirectory + * the directory to generate the project in. + * @param project + * the JSON-encoded pulumi project file. + * @param strict + * if PCL binding should be strict or not. + * @param loaderTarget + * The target of a codegen.LoaderServer to use for loading schemas. + * @param localDependencies + * local dependencies to use instead of using the package system. This is a map of package name to a local + * path of a language specific artifact to use for the SDK for that package. + */ +@SerialVersionUID(0L) +final case class GenerateProjectRequest( + sourceDirectory: _root_.scala.Predef.String = "", + targetDirectory: _root_.scala.Predef.String = "", + project: _root_.scala.Predef.String = "", + strict: _root_.scala.Boolean = false, + loaderTarget: _root_.scala.Predef.String = "", + localDependencies: _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String] = _root_.scala.collection.immutable.Map.empty, + unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[GenerateProjectRequest] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + + { + val __value = sourceDirectory + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value) + } + }; + + { + val __value = targetDirectory + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(2, __value) + } + }; + + { + val __value = project + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(3, __value) + } + }; + + { + val __value = strict + if (__value != false) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeBoolSize(4, __value) + } + }; + + { + val __value = loaderTarget + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(5, __value) + } + }; + localDependencies.foreach { __item => + val __value = pulumirpc.language.GenerateProjectRequest._typemapper_localDependencies.toBase(__item) + __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize + } + __size += unknownFields.serializedSize + __size + } + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size + } + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + { + val __v = sourceDirectory + if (!__v.isEmpty) { + _output__.writeString(1, __v) + } + }; + { + val __v = targetDirectory + if (!__v.isEmpty) { + _output__.writeString(2, __v) + } + }; + { + val __v = project + if (!__v.isEmpty) { + _output__.writeString(3, __v) + } + }; + { + val __v = strict + if (__v != false) { + _output__.writeBool(4, __v) + } + }; + { + val __v = loaderTarget + if (!__v.isEmpty) { + _output__.writeString(5, __v) + } + }; + localDependencies.foreach { __v => + val __m = pulumirpc.language.GenerateProjectRequest._typemapper_localDependencies.toBase(__v) + _output__.writeTag(6, 2) + _output__.writeUInt32NoTag(__m.serializedSize) + __m.writeTo(_output__) + }; + unknownFields.writeTo(_output__) + } + def withSourceDirectory(__v: _root_.scala.Predef.String): GenerateProjectRequest = copy(sourceDirectory = __v) + def withTargetDirectory(__v: _root_.scala.Predef.String): GenerateProjectRequest = copy(targetDirectory = __v) + def withProject(__v: _root_.scala.Predef.String): GenerateProjectRequest = copy(project = __v) + def withStrict(__v: _root_.scala.Boolean): GenerateProjectRequest = copy(strict = __v) + def withLoaderTarget(__v: _root_.scala.Predef.String): GenerateProjectRequest = copy(loaderTarget = __v) + def clearLocalDependencies = copy(localDependencies = _root_.scala.collection.immutable.Map.empty) + def addLocalDependencies(__vs: (_root_.scala.Predef.String, _root_.scala.Predef.String) *): GenerateProjectRequest = addAllLocalDependencies(__vs) + def addAllLocalDependencies(__vs: Iterable[(_root_.scala.Predef.String, _root_.scala.Predef.String)]): GenerateProjectRequest = copy(localDependencies = localDependencies ++ __vs) + def withLocalDependencies(__v: _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String]): GenerateProjectRequest = copy(localDependencies = __v) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => { + val __t = sourceDirectory + if (__t != "") __t else null + } + case 2 => { + val __t = targetDirectory + if (__t != "") __t else null + } + case 3 => { + val __t = project + if (__t != "") __t else null + } + case 4 => { + val __t = strict + if (__t != false) __t else null + } + case 5 => { + val __t = loaderTarget + if (__t != "") __t else null + } + case 6 => localDependencies.iterator.map(pulumirpc.language.GenerateProjectRequest._typemapper_localDependencies.toBase(_)).toSeq + } + } + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PString(sourceDirectory) + case 2 => _root_.scalapb.descriptors.PString(targetDirectory) + case 3 => _root_.scalapb.descriptors.PString(project) + case 4 => _root_.scalapb.descriptors.PBoolean(strict) + case 5 => _root_.scalapb.descriptors.PString(loaderTarget) + case 6 => _root_.scalapb.descriptors.PRepeated(localDependencies.iterator.map(pulumirpc.language.GenerateProjectRequest._typemapper_localDependencies.toBase(_).toPMessage).toVector) + } + } + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: pulumirpc.language.GenerateProjectRequest.type = pulumirpc.language.GenerateProjectRequest + // @@protoc_insertion_point(GeneratedMessage[pulumirpc.GenerateProjectRequest]) +} + +object GenerateProjectRequest extends scalapb.GeneratedMessageCompanion[pulumirpc.language.GenerateProjectRequest] { + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[pulumirpc.language.GenerateProjectRequest] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): pulumirpc.language.GenerateProjectRequest = { + var __sourceDirectory: _root_.scala.Predef.String = "" + var __targetDirectory: _root_.scala.Predef.String = "" + var __project: _root_.scala.Predef.String = "" + var __strict: _root_.scala.Boolean = false + var __loaderTarget: _root_.scala.Predef.String = "" + val __localDependencies: _root_.scala.collection.mutable.Builder[(_root_.scala.Predef.String, _root_.scala.Predef.String), _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String]] = _root_.scala.collection.immutable.Map.newBuilder[_root_.scala.Predef.String, _root_.scala.Predef.String] + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false + while (!_done__) { + val _tag__ = _input__.readTag() + _tag__ match { + case 0 => _done__ = true + case 10 => + __sourceDirectory = _input__.readStringRequireUtf8() + case 18 => + __targetDirectory = _input__.readStringRequireUtf8() + case 26 => + __project = _input__.readStringRequireUtf8() + case 32 => + __strict = _input__.readBool() + case 42 => + __loaderTarget = _input__.readStringRequireUtf8() + case 50 => + __localDependencies += pulumirpc.language.GenerateProjectRequest._typemapper_localDependencies.toCustom(_root_.scalapb.LiteParser.readMessage[pulumirpc.language.GenerateProjectRequest.LocalDependenciesEntry](_input__)) + case tag => + if (_unknownFields__ == null) { + _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder() + } + _unknownFields__.parseField(tag, _input__) + } + } + pulumirpc.language.GenerateProjectRequest( + sourceDirectory = __sourceDirectory, + targetDirectory = __targetDirectory, + project = __project, + strict = __strict, + loaderTarget = __loaderTarget, + localDependencies = __localDependencies.result(), + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() + ) + } + implicit def messageReads: _root_.scalapb.descriptors.Reads[pulumirpc.language.GenerateProjectRequest] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + pulumirpc.language.GenerateProjectRequest( + sourceDirectory = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + targetDirectory = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + project = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + strict = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).map(_.as[_root_.scala.Boolean]).getOrElse(false), + loaderTarget = __fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + localDependencies = __fieldsMap.get(scalaDescriptor.findFieldByNumber(6).get).map(_.as[_root_.scala.Seq[pulumirpc.language.GenerateProjectRequest.LocalDependenciesEntry]]).getOrElse(_root_.scala.Seq.empty).iterator.map(pulumirpc.language.GenerateProjectRequest._typemapper_localDependencies.toCustom(_)).toMap + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = LanguageProto.javaDescriptor.getMessageTypes().get(15) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = LanguageProto.scalaDescriptor.messages(15) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = { + var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null + (__number: @_root_.scala.unchecked) match { + case 6 => __out = pulumirpc.language.GenerateProjectRequest.LocalDependenciesEntry + } + __out + } + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = + Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]]( + _root_.pulumirpc.language.GenerateProjectRequest.LocalDependenciesEntry + ) + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + lazy val defaultInstance = pulumirpc.language.GenerateProjectRequest( + sourceDirectory = "", + targetDirectory = "", + project = "", + strict = false, + loaderTarget = "", + localDependencies = _root_.scala.collection.immutable.Map.empty + ) + @SerialVersionUID(0L) + final case class LocalDependenciesEntry( + key: _root_.scala.Predef.String = "", + value: _root_.scala.Predef.String = "", + unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[LocalDependenciesEntry] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + + { + val __value = key + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value) + } + }; + + { + val __value = value + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(2, __value) + } + }; + __size += unknownFields.serializedSize + __size + } + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size + } + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + { + val __v = key + if (!__v.isEmpty) { + _output__.writeString(1, __v) + } + }; + { + val __v = value + if (!__v.isEmpty) { + _output__.writeString(2, __v) + } + }; + unknownFields.writeTo(_output__) + } + def withKey(__v: _root_.scala.Predef.String): LocalDependenciesEntry = copy(key = __v) + def withValue(__v: _root_.scala.Predef.String): LocalDependenciesEntry = copy(value = __v) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => { + val __t = key + if (__t != "") __t else null + } + case 2 => { + val __t = value + if (__t != "") __t else null + } + } + } + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PString(key) + case 2 => _root_.scalapb.descriptors.PString(value) + } + } + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: pulumirpc.language.GenerateProjectRequest.LocalDependenciesEntry.type = pulumirpc.language.GenerateProjectRequest.LocalDependenciesEntry + // @@protoc_insertion_point(GeneratedMessage[pulumirpc.GenerateProjectRequest.LocalDependenciesEntry]) + } + + object LocalDependenciesEntry extends scalapb.GeneratedMessageCompanion[pulumirpc.language.GenerateProjectRequest.LocalDependenciesEntry] { + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[pulumirpc.language.GenerateProjectRequest.LocalDependenciesEntry] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): pulumirpc.language.GenerateProjectRequest.LocalDependenciesEntry = { + var __key: _root_.scala.Predef.String = "" + var __value: _root_.scala.Predef.String = "" + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false + while (!_done__) { + val _tag__ = _input__.readTag() + _tag__ match { + case 0 => _done__ = true + case 10 => + __key = _input__.readStringRequireUtf8() + case 18 => + __value = _input__.readStringRequireUtf8() + case tag => + if (_unknownFields__ == null) { + _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder() + } + _unknownFields__.parseField(tag, _input__) + } + } + pulumirpc.language.GenerateProjectRequest.LocalDependenciesEntry( + key = __key, + value = __value, + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() + ) + } + implicit def messageReads: _root_.scalapb.descriptors.Reads[pulumirpc.language.GenerateProjectRequest.LocalDependenciesEntry] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + pulumirpc.language.GenerateProjectRequest.LocalDependenciesEntry( + key = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + value = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Predef.String]).getOrElse("") + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = pulumirpc.language.GenerateProjectRequest.javaDescriptor.getNestedTypes().get(0) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = pulumirpc.language.GenerateProjectRequest.scalaDescriptor.nestedMessages(0) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number) + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + lazy val defaultInstance = pulumirpc.language.GenerateProjectRequest.LocalDependenciesEntry( + key = "", + value = "" + ) + implicit class LocalDependenciesEntryLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.language.GenerateProjectRequest.LocalDependenciesEntry]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, pulumirpc.language.GenerateProjectRequest.LocalDependenciesEntry](_l) { + def key: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.key)((c_, f_) => c_.copy(key = f_)) + def value: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.value)((c_, f_) => c_.copy(value = f_)) + } + final val KEY_FIELD_NUMBER = 1 + final val VALUE_FIELD_NUMBER = 2 + @transient + implicit val keyValueMapper: _root_.scalapb.TypeMapper[pulumirpc.language.GenerateProjectRequest.LocalDependenciesEntry, (_root_.scala.Predef.String, _root_.scala.Predef.String)] = + _root_.scalapb.TypeMapper[pulumirpc.language.GenerateProjectRequest.LocalDependenciesEntry, (_root_.scala.Predef.String, _root_.scala.Predef.String)](__m => (__m.key, __m.value))(__p => pulumirpc.language.GenerateProjectRequest.LocalDependenciesEntry(__p._1, __p._2)) + def of( + key: _root_.scala.Predef.String, + value: _root_.scala.Predef.String + ): _root_.pulumirpc.language.GenerateProjectRequest.LocalDependenciesEntry = _root_.pulumirpc.language.GenerateProjectRequest.LocalDependenciesEntry( + key, + value + ) + // @@protoc_insertion_point(GeneratedMessageCompanion[pulumirpc.GenerateProjectRequest.LocalDependenciesEntry]) + } + + implicit class GenerateProjectRequestLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.language.GenerateProjectRequest]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, pulumirpc.language.GenerateProjectRequest](_l) { + def sourceDirectory: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.sourceDirectory)((c_, f_) => c_.copy(sourceDirectory = f_)) + def targetDirectory: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.targetDirectory)((c_, f_) => c_.copy(targetDirectory = f_)) + def project: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.project)((c_, f_) => c_.copy(project = f_)) + def strict: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Boolean] = field(_.strict)((c_, f_) => c_.copy(strict = f_)) + def loaderTarget: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.loaderTarget)((c_, f_) => c_.copy(loaderTarget = f_)) + def localDependencies: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String]] = field(_.localDependencies)((c_, f_) => c_.copy(localDependencies = f_)) + } + final val SOURCE_DIRECTORY_FIELD_NUMBER = 1 + final val TARGET_DIRECTORY_FIELD_NUMBER = 2 + final val PROJECT_FIELD_NUMBER = 3 + final val STRICT_FIELD_NUMBER = 4 + final val LOADER_TARGET_FIELD_NUMBER = 5 + final val LOCAL_DEPENDENCIES_FIELD_NUMBER = 6 + @transient + private[language] val _typemapper_localDependencies: _root_.scalapb.TypeMapper[pulumirpc.language.GenerateProjectRequest.LocalDependenciesEntry, (_root_.scala.Predef.String, _root_.scala.Predef.String)] = implicitly[_root_.scalapb.TypeMapper[pulumirpc.language.GenerateProjectRequest.LocalDependenciesEntry, (_root_.scala.Predef.String, _root_.scala.Predef.String)]] + def of( + sourceDirectory: _root_.scala.Predef.String, + targetDirectory: _root_.scala.Predef.String, + project: _root_.scala.Predef.String, + strict: _root_.scala.Boolean, + loaderTarget: _root_.scala.Predef.String, + localDependencies: _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String] + ): _root_.pulumirpc.language.GenerateProjectRequest = _root_.pulumirpc.language.GenerateProjectRequest( + sourceDirectory, + targetDirectory, + project, + strict, + loaderTarget, + localDependencies + ) + // @@protoc_insertion_point(GeneratedMessageCompanion[pulumirpc.GenerateProjectRequest]) +} diff --git a/core/src/main/scala/besom/rpc/pulumirpc/language/GenerateProjectResponse.scala b/core/src/main/scala/besom/rpc/pulumirpc/language/GenerateProjectResponse.scala new file mode 100644 index 000000000..18f3379ad --- /dev/null +++ b/core/src/main/scala/besom/rpc/pulumirpc/language/GenerateProjectResponse.scala @@ -0,0 +1,123 @@ +// Generated by the Scala Plugin for the Protocol Buffer Compiler. +// Do not edit! +// +// Protofile syntax: PROTO3 + +package pulumirpc.language + +/** @param diagnostics + * any diagnostics from code generation. + */ +@SerialVersionUID(0L) +final case class GenerateProjectResponse( + diagnostics: _root_.scala.Seq[pulumirpc.codegen.hcl.Diagnostic] = _root_.scala.Seq.empty, + unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[GenerateProjectResponse] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + diagnostics.foreach { __item => + val __value = __item + __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize + } + __size += unknownFields.serializedSize + __size + } + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size + } + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + diagnostics.foreach { __v => + val __m = __v + _output__.writeTag(1, 2) + _output__.writeUInt32NoTag(__m.serializedSize) + __m.writeTo(_output__) + }; + unknownFields.writeTo(_output__) + } + def clearDiagnostics = copy(diagnostics = _root_.scala.Seq.empty) + def addDiagnostics(__vs: pulumirpc.codegen.hcl.Diagnostic *): GenerateProjectResponse = addAllDiagnostics(__vs) + def addAllDiagnostics(__vs: Iterable[pulumirpc.codegen.hcl.Diagnostic]): GenerateProjectResponse = copy(diagnostics = diagnostics ++ __vs) + def withDiagnostics(__v: _root_.scala.Seq[pulumirpc.codegen.hcl.Diagnostic]): GenerateProjectResponse = copy(diagnostics = __v) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => diagnostics + } + } + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PRepeated(diagnostics.iterator.map(_.toPMessage).toVector) + } + } + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: pulumirpc.language.GenerateProjectResponse.type = pulumirpc.language.GenerateProjectResponse + // @@protoc_insertion_point(GeneratedMessage[pulumirpc.GenerateProjectResponse]) +} + +object GenerateProjectResponse extends scalapb.GeneratedMessageCompanion[pulumirpc.language.GenerateProjectResponse] { + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[pulumirpc.language.GenerateProjectResponse] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): pulumirpc.language.GenerateProjectResponse = { + val __diagnostics: _root_.scala.collection.immutable.VectorBuilder[pulumirpc.codegen.hcl.Diagnostic] = new _root_.scala.collection.immutable.VectorBuilder[pulumirpc.codegen.hcl.Diagnostic] + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false + while (!_done__) { + val _tag__ = _input__.readTag() + _tag__ match { + case 0 => _done__ = true + case 10 => + __diagnostics += _root_.scalapb.LiteParser.readMessage[pulumirpc.codegen.hcl.Diagnostic](_input__) + case tag => + if (_unknownFields__ == null) { + _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder() + } + _unknownFields__.parseField(tag, _input__) + } + } + pulumirpc.language.GenerateProjectResponse( + diagnostics = __diagnostics.result(), + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() + ) + } + implicit def messageReads: _root_.scalapb.descriptors.Reads[pulumirpc.language.GenerateProjectResponse] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + pulumirpc.language.GenerateProjectResponse( + diagnostics = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Seq[pulumirpc.codegen.hcl.Diagnostic]]).getOrElse(_root_.scala.Seq.empty) + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = LanguageProto.javaDescriptor.getMessageTypes().get(16) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = LanguageProto.scalaDescriptor.messages(16) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = { + var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null + (__number: @_root_.scala.unchecked) match { + case 1 => __out = pulumirpc.codegen.hcl.Diagnostic + } + __out + } + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + lazy val defaultInstance = pulumirpc.language.GenerateProjectResponse( + diagnostics = _root_.scala.Seq.empty + ) + implicit class GenerateProjectResponseLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.language.GenerateProjectResponse]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, pulumirpc.language.GenerateProjectResponse](_l) { + def diagnostics: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[pulumirpc.codegen.hcl.Diagnostic]] = field(_.diagnostics)((c_, f_) => c_.copy(diagnostics = f_)) + } + final val DIAGNOSTICS_FIELD_NUMBER = 1 + def of( + diagnostics: _root_.scala.Seq[pulumirpc.codegen.hcl.Diagnostic] + ): _root_.pulumirpc.language.GenerateProjectResponse = _root_.pulumirpc.language.GenerateProjectResponse( + diagnostics + ) + // @@protoc_insertion_point(GeneratedMessageCompanion[pulumirpc.GenerateProjectResponse]) +} diff --git a/core/src/main/scala/besom/rpc/pulumirpc/language/GetProgramDependenciesRequest.scala b/core/src/main/scala/besom/rpc/pulumirpc/language/GetProgramDependenciesRequest.scala new file mode 100644 index 000000000..052422adb --- /dev/null +++ b/core/src/main/scala/besom/rpc/pulumirpc/language/GetProgramDependenciesRequest.scala @@ -0,0 +1,251 @@ +// Generated by the Scala Plugin for the Protocol Buffer Compiler. +// Do not edit! +// +// Protofile syntax: PROTO3 + +package pulumirpc.language + +/** @param project + * the project name. + * @param pwd + * the program's working directory. + * @param program + * the path to the program. + * @param transitiveDependencies + * if transitive dependencies should be included in the result. + * @param info + * the program info to use to calculate dependencies. + */ +@SerialVersionUID(0L) +final case class GetProgramDependenciesRequest( + @scala.deprecated(message="Marked as deprecated in proto file", "") project: _root_.scala.Predef.String = "", + @scala.deprecated(message="Marked as deprecated in proto file", "") pwd: _root_.scala.Predef.String = "", + @scala.deprecated(message="Marked as deprecated in proto file", "") program: _root_.scala.Predef.String = "", + transitiveDependencies: _root_.scala.Boolean = false, + info: _root_.scala.Option[pulumirpc.language.ProgramInfo] = _root_.scala.None, + unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[GetProgramDependenciesRequest] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + + { + val __value = project + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value) + } + }; + + { + val __value = pwd + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(2, __value) + } + }; + + { + val __value = program + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(3, __value) + } + }; + + { + val __value = transitiveDependencies + if (__value != false) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeBoolSize(4, __value) + } + }; + if (info.isDefined) { + val __value = info.get + __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize + }; + __size += unknownFields.serializedSize + __size + } + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size + } + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + { + val __v = project + if (!__v.isEmpty) { + _output__.writeString(1, __v) + } + }; + { + val __v = pwd + if (!__v.isEmpty) { + _output__.writeString(2, __v) + } + }; + { + val __v = program + if (!__v.isEmpty) { + _output__.writeString(3, __v) + } + }; + { + val __v = transitiveDependencies + if (__v != false) { + _output__.writeBool(4, __v) + } + }; + info.foreach { __v => + val __m = __v + _output__.writeTag(5, 2) + _output__.writeUInt32NoTag(__m.serializedSize) + __m.writeTo(_output__) + }; + unknownFields.writeTo(_output__) + } + def withProject(__v: _root_.scala.Predef.String): GetProgramDependenciesRequest = copy(project = __v) + def withPwd(__v: _root_.scala.Predef.String): GetProgramDependenciesRequest = copy(pwd = __v) + def withProgram(__v: _root_.scala.Predef.String): GetProgramDependenciesRequest = copy(program = __v) + def withTransitiveDependencies(__v: _root_.scala.Boolean): GetProgramDependenciesRequest = copy(transitiveDependencies = __v) + def getInfo: pulumirpc.language.ProgramInfo = info.getOrElse(pulumirpc.language.ProgramInfo.defaultInstance) + def clearInfo: GetProgramDependenciesRequest = copy(info = _root_.scala.None) + def withInfo(__v: pulumirpc.language.ProgramInfo): GetProgramDependenciesRequest = copy(info = Option(__v)) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => { + val __t = project + if (__t != "") __t else null + } + case 2 => { + val __t = pwd + if (__t != "") __t else null + } + case 3 => { + val __t = program + if (__t != "") __t else null + } + case 4 => { + val __t = transitiveDependencies + if (__t != false) __t else null + } + case 5 => info.orNull + } + } + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PString(project) + case 2 => _root_.scalapb.descriptors.PString(pwd) + case 3 => _root_.scalapb.descriptors.PString(program) + case 4 => _root_.scalapb.descriptors.PBoolean(transitiveDependencies) + case 5 => info.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty) + } + } + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: pulumirpc.language.GetProgramDependenciesRequest.type = pulumirpc.language.GetProgramDependenciesRequest + // @@protoc_insertion_point(GeneratedMessage[pulumirpc.GetProgramDependenciesRequest]) +} + +object GetProgramDependenciesRequest extends scalapb.GeneratedMessageCompanion[pulumirpc.language.GetProgramDependenciesRequest] { + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[pulumirpc.language.GetProgramDependenciesRequest] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): pulumirpc.language.GetProgramDependenciesRequest = { + var __project: _root_.scala.Predef.String = "" + var __pwd: _root_.scala.Predef.String = "" + var __program: _root_.scala.Predef.String = "" + var __transitiveDependencies: _root_.scala.Boolean = false + var __info: _root_.scala.Option[pulumirpc.language.ProgramInfo] = _root_.scala.None + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false + while (!_done__) { + val _tag__ = _input__.readTag() + _tag__ match { + case 0 => _done__ = true + case 10 => + __project = _input__.readStringRequireUtf8() + case 18 => + __pwd = _input__.readStringRequireUtf8() + case 26 => + __program = _input__.readStringRequireUtf8() + case 32 => + __transitiveDependencies = _input__.readBool() + case 42 => + __info = Option(__info.fold(_root_.scalapb.LiteParser.readMessage[pulumirpc.language.ProgramInfo](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _))) + case tag => + if (_unknownFields__ == null) { + _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder() + } + _unknownFields__.parseField(tag, _input__) + } + } + pulumirpc.language.GetProgramDependenciesRequest( + project = __project, + pwd = __pwd, + program = __program, + transitiveDependencies = __transitiveDependencies, + info = __info, + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() + ) + } + implicit def messageReads: _root_.scalapb.descriptors.Reads[pulumirpc.language.GetProgramDependenciesRequest] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + pulumirpc.language.GetProgramDependenciesRequest( + project = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + pwd = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + program = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + transitiveDependencies = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).map(_.as[_root_.scala.Boolean]).getOrElse(false), + info = __fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).flatMap(_.as[_root_.scala.Option[pulumirpc.language.ProgramInfo]]) + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = LanguageProto.javaDescriptor.getMessageTypes().get(2) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = LanguageProto.scalaDescriptor.messages(2) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = { + var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null + (__number: @_root_.scala.unchecked) match { + case 5 => __out = pulumirpc.language.ProgramInfo + } + __out + } + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + lazy val defaultInstance = pulumirpc.language.GetProgramDependenciesRequest( + project = "", + pwd = "", + program = "", + transitiveDependencies = false, + info = _root_.scala.None + ) + implicit class GetProgramDependenciesRequestLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.language.GetProgramDependenciesRequest]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, pulumirpc.language.GetProgramDependenciesRequest](_l) { + def project: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.project)((c_, f_) => c_.copy(project = f_)) + def pwd: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.pwd)((c_, f_) => c_.copy(pwd = f_)) + def program: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.program)((c_, f_) => c_.copy(program = f_)) + def transitiveDependencies: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Boolean] = field(_.transitiveDependencies)((c_, f_) => c_.copy(transitiveDependencies = f_)) + def info: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.language.ProgramInfo] = field(_.getInfo)((c_, f_) => c_.copy(info = Option(f_))) + def optionalInfo: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[pulumirpc.language.ProgramInfo]] = field(_.info)((c_, f_) => c_.copy(info = f_)) + } + final val PROJECT_FIELD_NUMBER = 1 + final val PWD_FIELD_NUMBER = 2 + final val PROGRAM_FIELD_NUMBER = 3 + final val TRANSITIVEDEPENDENCIES_FIELD_NUMBER = 4 + final val INFO_FIELD_NUMBER = 5 + def of( + project: _root_.scala.Predef.String, + pwd: _root_.scala.Predef.String, + program: _root_.scala.Predef.String, + transitiveDependencies: _root_.scala.Boolean, + info: _root_.scala.Option[pulumirpc.language.ProgramInfo] + ): _root_.pulumirpc.language.GetProgramDependenciesRequest = _root_.pulumirpc.language.GetProgramDependenciesRequest( + project, + pwd, + program, + transitiveDependencies, + info + ) + // @@protoc_insertion_point(GeneratedMessageCompanion[pulumirpc.GetProgramDependenciesRequest]) +} diff --git a/core/src/main/scala/besom/rpc/pulumirpc/language/GetProgramDependenciesResponse.scala b/core/src/main/scala/besom/rpc/pulumirpc/language/GetProgramDependenciesResponse.scala new file mode 100644 index 000000000..bd64391e5 --- /dev/null +++ b/core/src/main/scala/besom/rpc/pulumirpc/language/GetProgramDependenciesResponse.scala @@ -0,0 +1,123 @@ +// Generated by the Scala Plugin for the Protocol Buffer Compiler. +// Do not edit! +// +// Protofile syntax: PROTO3 + +package pulumirpc.language + +/** @param dependencies + * the dependencies of this program + */ +@SerialVersionUID(0L) +final case class GetProgramDependenciesResponse( + dependencies: _root_.scala.Seq[pulumirpc.language.DependencyInfo] = _root_.scala.Seq.empty, + unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[GetProgramDependenciesResponse] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + dependencies.foreach { __item => + val __value = __item + __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize + } + __size += unknownFields.serializedSize + __size + } + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size + } + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + dependencies.foreach { __v => + val __m = __v + _output__.writeTag(1, 2) + _output__.writeUInt32NoTag(__m.serializedSize) + __m.writeTo(_output__) + }; + unknownFields.writeTo(_output__) + } + def clearDependencies = copy(dependencies = _root_.scala.Seq.empty) + def addDependencies(__vs: pulumirpc.language.DependencyInfo *): GetProgramDependenciesResponse = addAllDependencies(__vs) + def addAllDependencies(__vs: Iterable[pulumirpc.language.DependencyInfo]): GetProgramDependenciesResponse = copy(dependencies = dependencies ++ __vs) + def withDependencies(__v: _root_.scala.Seq[pulumirpc.language.DependencyInfo]): GetProgramDependenciesResponse = copy(dependencies = __v) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => dependencies + } + } + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PRepeated(dependencies.iterator.map(_.toPMessage).toVector) + } + } + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: pulumirpc.language.GetProgramDependenciesResponse.type = pulumirpc.language.GetProgramDependenciesResponse + // @@protoc_insertion_point(GeneratedMessage[pulumirpc.GetProgramDependenciesResponse]) +} + +object GetProgramDependenciesResponse extends scalapb.GeneratedMessageCompanion[pulumirpc.language.GetProgramDependenciesResponse] { + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[pulumirpc.language.GetProgramDependenciesResponse] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): pulumirpc.language.GetProgramDependenciesResponse = { + val __dependencies: _root_.scala.collection.immutable.VectorBuilder[pulumirpc.language.DependencyInfo] = new _root_.scala.collection.immutable.VectorBuilder[pulumirpc.language.DependencyInfo] + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false + while (!_done__) { + val _tag__ = _input__.readTag() + _tag__ match { + case 0 => _done__ = true + case 10 => + __dependencies += _root_.scalapb.LiteParser.readMessage[pulumirpc.language.DependencyInfo](_input__) + case tag => + if (_unknownFields__ == null) { + _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder() + } + _unknownFields__.parseField(tag, _input__) + } + } + pulumirpc.language.GetProgramDependenciesResponse( + dependencies = __dependencies.result(), + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() + ) + } + implicit def messageReads: _root_.scalapb.descriptors.Reads[pulumirpc.language.GetProgramDependenciesResponse] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + pulumirpc.language.GetProgramDependenciesResponse( + dependencies = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Seq[pulumirpc.language.DependencyInfo]]).getOrElse(_root_.scala.Seq.empty) + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = LanguageProto.javaDescriptor.getMessageTypes().get(4) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = LanguageProto.scalaDescriptor.messages(4) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = { + var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null + (__number: @_root_.scala.unchecked) match { + case 1 => __out = pulumirpc.language.DependencyInfo + } + __out + } + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + lazy val defaultInstance = pulumirpc.language.GetProgramDependenciesResponse( + dependencies = _root_.scala.Seq.empty + ) + implicit class GetProgramDependenciesResponseLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.language.GetProgramDependenciesResponse]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, pulumirpc.language.GetProgramDependenciesResponse](_l) { + def dependencies: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[pulumirpc.language.DependencyInfo]] = field(_.dependencies)((c_, f_) => c_.copy(dependencies = f_)) + } + final val DEPENDENCIES_FIELD_NUMBER = 1 + def of( + dependencies: _root_.scala.Seq[pulumirpc.language.DependencyInfo] + ): _root_.pulumirpc.language.GetProgramDependenciesResponse = _root_.pulumirpc.language.GetProgramDependenciesResponse( + dependencies + ) + // @@protoc_insertion_point(GeneratedMessageCompanion[pulumirpc.GetProgramDependenciesResponse]) +} diff --git a/core/src/main/scala/besom/rpc/pulumirpc/language/GetRequiredPluginsRequest.scala b/core/src/main/scala/besom/rpc/pulumirpc/language/GetRequiredPluginsRequest.scala new file mode 100644 index 000000000..8f8c7b434 --- /dev/null +++ b/core/src/main/scala/besom/rpc/pulumirpc/language/GetRequiredPluginsRequest.scala @@ -0,0 +1,219 @@ +// Generated by the Scala Plugin for the Protocol Buffer Compiler. +// Do not edit! +// +// Protofile syntax: PROTO3 + +package pulumirpc.language + +/** @param project + * the project name. + * @param pwd + * the program's working directory. + * @param program + * the path to the program. + * @param info + * the program info to use to calculate plugins. + */ +@SerialVersionUID(0L) +final case class GetRequiredPluginsRequest( + @scala.deprecated(message="Marked as deprecated in proto file", "") project: _root_.scala.Predef.String = "", + @scala.deprecated(message="Marked as deprecated in proto file", "") pwd: _root_.scala.Predef.String = "", + @scala.deprecated(message="Marked as deprecated in proto file", "") program: _root_.scala.Predef.String = "", + info: _root_.scala.Option[pulumirpc.language.ProgramInfo] = _root_.scala.None, + unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[GetRequiredPluginsRequest] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + + { + val __value = project + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value) + } + }; + + { + val __value = pwd + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(2, __value) + } + }; + + { + val __value = program + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(3, __value) + } + }; + if (info.isDefined) { + val __value = info.get + __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize + }; + __size += unknownFields.serializedSize + __size + } + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size + } + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + { + val __v = project + if (!__v.isEmpty) { + _output__.writeString(1, __v) + } + }; + { + val __v = pwd + if (!__v.isEmpty) { + _output__.writeString(2, __v) + } + }; + { + val __v = program + if (!__v.isEmpty) { + _output__.writeString(3, __v) + } + }; + info.foreach { __v => + val __m = __v + _output__.writeTag(4, 2) + _output__.writeUInt32NoTag(__m.serializedSize) + __m.writeTo(_output__) + }; + unknownFields.writeTo(_output__) + } + def withProject(__v: _root_.scala.Predef.String): GetRequiredPluginsRequest = copy(project = __v) + def withPwd(__v: _root_.scala.Predef.String): GetRequiredPluginsRequest = copy(pwd = __v) + def withProgram(__v: _root_.scala.Predef.String): GetRequiredPluginsRequest = copy(program = __v) + def getInfo: pulumirpc.language.ProgramInfo = info.getOrElse(pulumirpc.language.ProgramInfo.defaultInstance) + def clearInfo: GetRequiredPluginsRequest = copy(info = _root_.scala.None) + def withInfo(__v: pulumirpc.language.ProgramInfo): GetRequiredPluginsRequest = copy(info = Option(__v)) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => { + val __t = project + if (__t != "") __t else null + } + case 2 => { + val __t = pwd + if (__t != "") __t else null + } + case 3 => { + val __t = program + if (__t != "") __t else null + } + case 4 => info.orNull + } + } + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PString(project) + case 2 => _root_.scalapb.descriptors.PString(pwd) + case 3 => _root_.scalapb.descriptors.PString(program) + case 4 => info.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty) + } + } + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: pulumirpc.language.GetRequiredPluginsRequest.type = pulumirpc.language.GetRequiredPluginsRequest + // @@protoc_insertion_point(GeneratedMessage[pulumirpc.GetRequiredPluginsRequest]) +} + +object GetRequiredPluginsRequest extends scalapb.GeneratedMessageCompanion[pulumirpc.language.GetRequiredPluginsRequest] { + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[pulumirpc.language.GetRequiredPluginsRequest] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): pulumirpc.language.GetRequiredPluginsRequest = { + var __project: _root_.scala.Predef.String = "" + var __pwd: _root_.scala.Predef.String = "" + var __program: _root_.scala.Predef.String = "" + var __info: _root_.scala.Option[pulumirpc.language.ProgramInfo] = _root_.scala.None + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false + while (!_done__) { + val _tag__ = _input__.readTag() + _tag__ match { + case 0 => _done__ = true + case 10 => + __project = _input__.readStringRequireUtf8() + case 18 => + __pwd = _input__.readStringRequireUtf8() + case 26 => + __program = _input__.readStringRequireUtf8() + case 34 => + __info = Option(__info.fold(_root_.scalapb.LiteParser.readMessage[pulumirpc.language.ProgramInfo](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _))) + case tag => + if (_unknownFields__ == null) { + _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder() + } + _unknownFields__.parseField(tag, _input__) + } + } + pulumirpc.language.GetRequiredPluginsRequest( + project = __project, + pwd = __pwd, + program = __program, + info = __info, + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() + ) + } + implicit def messageReads: _root_.scalapb.descriptors.Reads[pulumirpc.language.GetRequiredPluginsRequest] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + pulumirpc.language.GetRequiredPluginsRequest( + project = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + pwd = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + program = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + info = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).flatMap(_.as[_root_.scala.Option[pulumirpc.language.ProgramInfo]]) + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = LanguageProto.javaDescriptor.getMessageTypes().get(5) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = LanguageProto.scalaDescriptor.messages(5) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = { + var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null + (__number: @_root_.scala.unchecked) match { + case 4 => __out = pulumirpc.language.ProgramInfo + } + __out + } + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + lazy val defaultInstance = pulumirpc.language.GetRequiredPluginsRequest( + project = "", + pwd = "", + program = "", + info = _root_.scala.None + ) + implicit class GetRequiredPluginsRequestLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.language.GetRequiredPluginsRequest]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, pulumirpc.language.GetRequiredPluginsRequest](_l) { + def project: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.project)((c_, f_) => c_.copy(project = f_)) + def pwd: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.pwd)((c_, f_) => c_.copy(pwd = f_)) + def program: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.program)((c_, f_) => c_.copy(program = f_)) + def info: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.language.ProgramInfo] = field(_.getInfo)((c_, f_) => c_.copy(info = Option(f_))) + def optionalInfo: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[pulumirpc.language.ProgramInfo]] = field(_.info)((c_, f_) => c_.copy(info = f_)) + } + final val PROJECT_FIELD_NUMBER = 1 + final val PWD_FIELD_NUMBER = 2 + final val PROGRAM_FIELD_NUMBER = 3 + final val INFO_FIELD_NUMBER = 4 + def of( + project: _root_.scala.Predef.String, + pwd: _root_.scala.Predef.String, + program: _root_.scala.Predef.String, + info: _root_.scala.Option[pulumirpc.language.ProgramInfo] + ): _root_.pulumirpc.language.GetRequiredPluginsRequest = _root_.pulumirpc.language.GetRequiredPluginsRequest( + project, + pwd, + program, + info + ) + // @@protoc_insertion_point(GeneratedMessageCompanion[pulumirpc.GetRequiredPluginsRequest]) +} diff --git a/core/src/main/scala/besom/rpc/pulumirpc/language/GetRequiredPluginsResponse.scala b/core/src/main/scala/besom/rpc/pulumirpc/language/GetRequiredPluginsResponse.scala new file mode 100644 index 000000000..6b40506f9 --- /dev/null +++ b/core/src/main/scala/besom/rpc/pulumirpc/language/GetRequiredPluginsResponse.scala @@ -0,0 +1,123 @@ +// Generated by the Scala Plugin for the Protocol Buffer Compiler. +// Do not edit! +// +// Protofile syntax: PROTO3 + +package pulumirpc.language + +/** @param plugins + * a list of plugins required by this program. + */ +@SerialVersionUID(0L) +final case class GetRequiredPluginsResponse( + plugins: _root_.scala.Seq[pulumirpc.plugin.PluginDependency] = _root_.scala.Seq.empty, + unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[GetRequiredPluginsResponse] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + plugins.foreach { __item => + val __value = __item + __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize + } + __size += unknownFields.serializedSize + __size + } + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size + } + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + plugins.foreach { __v => + val __m = __v + _output__.writeTag(1, 2) + _output__.writeUInt32NoTag(__m.serializedSize) + __m.writeTo(_output__) + }; + unknownFields.writeTo(_output__) + } + def clearPlugins = copy(plugins = _root_.scala.Seq.empty) + def addPlugins(__vs: pulumirpc.plugin.PluginDependency *): GetRequiredPluginsResponse = addAllPlugins(__vs) + def addAllPlugins(__vs: Iterable[pulumirpc.plugin.PluginDependency]): GetRequiredPluginsResponse = copy(plugins = plugins ++ __vs) + def withPlugins(__v: _root_.scala.Seq[pulumirpc.plugin.PluginDependency]): GetRequiredPluginsResponse = copy(plugins = __v) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => plugins + } + } + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PRepeated(plugins.iterator.map(_.toPMessage).toVector) + } + } + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: pulumirpc.language.GetRequiredPluginsResponse.type = pulumirpc.language.GetRequiredPluginsResponse + // @@protoc_insertion_point(GeneratedMessage[pulumirpc.GetRequiredPluginsResponse]) +} + +object GetRequiredPluginsResponse extends scalapb.GeneratedMessageCompanion[pulumirpc.language.GetRequiredPluginsResponse] { + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[pulumirpc.language.GetRequiredPluginsResponse] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): pulumirpc.language.GetRequiredPluginsResponse = { + val __plugins: _root_.scala.collection.immutable.VectorBuilder[pulumirpc.plugin.PluginDependency] = new _root_.scala.collection.immutable.VectorBuilder[pulumirpc.plugin.PluginDependency] + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false + while (!_done__) { + val _tag__ = _input__.readTag() + _tag__ match { + case 0 => _done__ = true + case 10 => + __plugins += _root_.scalapb.LiteParser.readMessage[pulumirpc.plugin.PluginDependency](_input__) + case tag => + if (_unknownFields__ == null) { + _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder() + } + _unknownFields__.parseField(tag, _input__) + } + } + pulumirpc.language.GetRequiredPluginsResponse( + plugins = __plugins.result(), + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() + ) + } + implicit def messageReads: _root_.scalapb.descriptors.Reads[pulumirpc.language.GetRequiredPluginsResponse] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + pulumirpc.language.GetRequiredPluginsResponse( + plugins = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Seq[pulumirpc.plugin.PluginDependency]]).getOrElse(_root_.scala.Seq.empty) + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = LanguageProto.javaDescriptor.getMessageTypes().get(6) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = LanguageProto.scalaDescriptor.messages(6) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = { + var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null + (__number: @_root_.scala.unchecked) match { + case 1 => __out = pulumirpc.plugin.PluginDependency + } + __out + } + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + lazy val defaultInstance = pulumirpc.language.GetRequiredPluginsResponse( + plugins = _root_.scala.Seq.empty + ) + implicit class GetRequiredPluginsResponseLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.language.GetRequiredPluginsResponse]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, pulumirpc.language.GetRequiredPluginsResponse](_l) { + def plugins: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[pulumirpc.plugin.PluginDependency]] = field(_.plugins)((c_, f_) => c_.copy(plugins = f_)) + } + final val PLUGINS_FIELD_NUMBER = 1 + def of( + plugins: _root_.scala.Seq[pulumirpc.plugin.PluginDependency] + ): _root_.pulumirpc.language.GetRequiredPluginsResponse = _root_.pulumirpc.language.GetRequiredPluginsResponse( + plugins + ) + // @@protoc_insertion_point(GeneratedMessageCompanion[pulumirpc.GetRequiredPluginsResponse]) +} diff --git a/core/src/main/scala/besom/rpc/pulumirpc/language/InstallDependenciesRequest.scala b/core/src/main/scala/besom/rpc/pulumirpc/language/InstallDependenciesRequest.scala new file mode 100644 index 000000000..9b846de1d --- /dev/null +++ b/core/src/main/scala/besom/rpc/pulumirpc/language/InstallDependenciesRequest.scala @@ -0,0 +1,187 @@ +// Generated by the Scala Plugin for the Protocol Buffer Compiler. +// Do not edit! +// +// Protofile syntax: PROTO3 + +package pulumirpc.language + +/** @param directory + * the program's working directory. + * @param isTerminal + * if we are running in a terminal and should use ANSI codes + * @param info + * the program info to use to execute the plugin. + */ +@SerialVersionUID(0L) +final case class InstallDependenciesRequest( + @scala.deprecated(message="Marked as deprecated in proto file", "") directory: _root_.scala.Predef.String = "", + isTerminal: _root_.scala.Boolean = false, + info: _root_.scala.Option[pulumirpc.language.ProgramInfo] = _root_.scala.None, + unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[InstallDependenciesRequest] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + + { + val __value = directory + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value) + } + }; + + { + val __value = isTerminal + if (__value != false) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeBoolSize(2, __value) + } + }; + if (info.isDefined) { + val __value = info.get + __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize + }; + __size += unknownFields.serializedSize + __size + } + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size + } + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + { + val __v = directory + if (!__v.isEmpty) { + _output__.writeString(1, __v) + } + }; + { + val __v = isTerminal + if (__v != false) { + _output__.writeBool(2, __v) + } + }; + info.foreach { __v => + val __m = __v + _output__.writeTag(3, 2) + _output__.writeUInt32NoTag(__m.serializedSize) + __m.writeTo(_output__) + }; + unknownFields.writeTo(_output__) + } + def withDirectory(__v: _root_.scala.Predef.String): InstallDependenciesRequest = copy(directory = __v) + def withIsTerminal(__v: _root_.scala.Boolean): InstallDependenciesRequest = copy(isTerminal = __v) + def getInfo: pulumirpc.language.ProgramInfo = info.getOrElse(pulumirpc.language.ProgramInfo.defaultInstance) + def clearInfo: InstallDependenciesRequest = copy(info = _root_.scala.None) + def withInfo(__v: pulumirpc.language.ProgramInfo): InstallDependenciesRequest = copy(info = Option(__v)) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => { + val __t = directory + if (__t != "") __t else null + } + case 2 => { + val __t = isTerminal + if (__t != false) __t else null + } + case 3 => info.orNull + } + } + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PString(directory) + case 2 => _root_.scalapb.descriptors.PBoolean(isTerminal) + case 3 => info.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty) + } + } + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: pulumirpc.language.InstallDependenciesRequest.type = pulumirpc.language.InstallDependenciesRequest + // @@protoc_insertion_point(GeneratedMessage[pulumirpc.InstallDependenciesRequest]) +} + +object InstallDependenciesRequest extends scalapb.GeneratedMessageCompanion[pulumirpc.language.InstallDependenciesRequest] { + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[pulumirpc.language.InstallDependenciesRequest] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): pulumirpc.language.InstallDependenciesRequest = { + var __directory: _root_.scala.Predef.String = "" + var __isTerminal: _root_.scala.Boolean = false + var __info: _root_.scala.Option[pulumirpc.language.ProgramInfo] = _root_.scala.None + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false + while (!_done__) { + val _tag__ = _input__.readTag() + _tag__ match { + case 0 => _done__ = true + case 10 => + __directory = _input__.readStringRequireUtf8() + case 16 => + __isTerminal = _input__.readBool() + case 26 => + __info = Option(__info.fold(_root_.scalapb.LiteParser.readMessage[pulumirpc.language.ProgramInfo](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _))) + case tag => + if (_unknownFields__ == null) { + _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder() + } + _unknownFields__.parseField(tag, _input__) + } + } + pulumirpc.language.InstallDependenciesRequest( + directory = __directory, + isTerminal = __isTerminal, + info = __info, + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() + ) + } + implicit def messageReads: _root_.scalapb.descriptors.Reads[pulumirpc.language.InstallDependenciesRequest] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + pulumirpc.language.InstallDependenciesRequest( + directory = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + isTerminal = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Boolean]).getOrElse(false), + info = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).flatMap(_.as[_root_.scala.Option[pulumirpc.language.ProgramInfo]]) + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = LanguageProto.javaDescriptor.getMessageTypes().get(9) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = LanguageProto.scalaDescriptor.messages(9) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = { + var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null + (__number: @_root_.scala.unchecked) match { + case 3 => __out = pulumirpc.language.ProgramInfo + } + __out + } + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + lazy val defaultInstance = pulumirpc.language.InstallDependenciesRequest( + directory = "", + isTerminal = false, + info = _root_.scala.None + ) + implicit class InstallDependenciesRequestLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.language.InstallDependenciesRequest]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, pulumirpc.language.InstallDependenciesRequest](_l) { + def directory: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.directory)((c_, f_) => c_.copy(directory = f_)) + def isTerminal: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Boolean] = field(_.isTerminal)((c_, f_) => c_.copy(isTerminal = f_)) + def info: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.language.ProgramInfo] = field(_.getInfo)((c_, f_) => c_.copy(info = Option(f_))) + def optionalInfo: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[pulumirpc.language.ProgramInfo]] = field(_.info)((c_, f_) => c_.copy(info = f_)) + } + final val DIRECTORY_FIELD_NUMBER = 1 + final val IS_TERMINAL_FIELD_NUMBER = 2 + final val INFO_FIELD_NUMBER = 3 + def of( + directory: _root_.scala.Predef.String, + isTerminal: _root_.scala.Boolean, + info: _root_.scala.Option[pulumirpc.language.ProgramInfo] + ): _root_.pulumirpc.language.InstallDependenciesRequest = _root_.pulumirpc.language.InstallDependenciesRequest( + directory, + isTerminal, + info + ) + // @@protoc_insertion_point(GeneratedMessageCompanion[pulumirpc.InstallDependenciesRequest]) +} diff --git a/core/src/main/scala/besom/rpc/pulumirpc/language/InstallDependenciesResponse.scala b/core/src/main/scala/besom/rpc/pulumirpc/language/InstallDependenciesResponse.scala new file mode 100644 index 000000000..8e5fae91c --- /dev/null +++ b/core/src/main/scala/besom/rpc/pulumirpc/language/InstallDependenciesResponse.scala @@ -0,0 +1,152 @@ +// Generated by the Scala Plugin for the Protocol Buffer Compiler. +// Do not edit! +// +// Protofile syntax: PROTO3 + +package pulumirpc.language + +/** @param stdout + * a line of stdout text. + * @param stderr + * a line of stderr text. + */ +@SerialVersionUID(0L) +final case class InstallDependenciesResponse( + stdout: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY, + stderr: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY, + unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[InstallDependenciesResponse] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + + { + val __value = stdout + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeBytesSize(1, __value) + } + }; + + { + val __value = stderr + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeBytesSize(2, __value) + } + }; + __size += unknownFields.serializedSize + __size + } + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size + } + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + { + val __v = stdout + if (!__v.isEmpty) { + _output__.writeBytes(1, __v) + } + }; + { + val __v = stderr + if (!__v.isEmpty) { + _output__.writeBytes(2, __v) + } + }; + unknownFields.writeTo(_output__) + } + def withStdout(__v: _root_.com.google.protobuf.ByteString): InstallDependenciesResponse = copy(stdout = __v) + def withStderr(__v: _root_.com.google.protobuf.ByteString): InstallDependenciesResponse = copy(stderr = __v) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => { + val __t = stdout + if (__t != _root_.com.google.protobuf.ByteString.EMPTY) __t else null + } + case 2 => { + val __t = stderr + if (__t != _root_.com.google.protobuf.ByteString.EMPTY) __t else null + } + } + } + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PByteString(stdout) + case 2 => _root_.scalapb.descriptors.PByteString(stderr) + } + } + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: pulumirpc.language.InstallDependenciesResponse.type = pulumirpc.language.InstallDependenciesResponse + // @@protoc_insertion_point(GeneratedMessage[pulumirpc.InstallDependenciesResponse]) +} + +object InstallDependenciesResponse extends scalapb.GeneratedMessageCompanion[pulumirpc.language.InstallDependenciesResponse] { + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[pulumirpc.language.InstallDependenciesResponse] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): pulumirpc.language.InstallDependenciesResponse = { + var __stdout: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY + var __stderr: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false + while (!_done__) { + val _tag__ = _input__.readTag() + _tag__ match { + case 0 => _done__ = true + case 10 => + __stdout = _input__.readBytes() + case 18 => + __stderr = _input__.readBytes() + case tag => + if (_unknownFields__ == null) { + _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder() + } + _unknownFields__.parseField(tag, _input__) + } + } + pulumirpc.language.InstallDependenciesResponse( + stdout = __stdout, + stderr = __stderr, + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() + ) + } + implicit def messageReads: _root_.scalapb.descriptors.Reads[pulumirpc.language.InstallDependenciesResponse] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + pulumirpc.language.InstallDependenciesResponse( + stdout = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.com.google.protobuf.ByteString]).getOrElse(_root_.com.google.protobuf.ByteString.EMPTY), + stderr = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.com.google.protobuf.ByteString]).getOrElse(_root_.com.google.protobuf.ByteString.EMPTY) + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = LanguageProto.javaDescriptor.getMessageTypes().get(10) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = LanguageProto.scalaDescriptor.messages(10) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number) + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + lazy val defaultInstance = pulumirpc.language.InstallDependenciesResponse( + stdout = _root_.com.google.protobuf.ByteString.EMPTY, + stderr = _root_.com.google.protobuf.ByteString.EMPTY + ) + implicit class InstallDependenciesResponseLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.language.InstallDependenciesResponse]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, pulumirpc.language.InstallDependenciesResponse](_l) { + def stdout: _root_.scalapb.lenses.Lens[UpperPB, _root_.com.google.protobuf.ByteString] = field(_.stdout)((c_, f_) => c_.copy(stdout = f_)) + def stderr: _root_.scalapb.lenses.Lens[UpperPB, _root_.com.google.protobuf.ByteString] = field(_.stderr)((c_, f_) => c_.copy(stderr = f_)) + } + final val STDOUT_FIELD_NUMBER = 1 + final val STDERR_FIELD_NUMBER = 2 + def of( + stdout: _root_.com.google.protobuf.ByteString, + stderr: _root_.com.google.protobuf.ByteString + ): _root_.pulumirpc.language.InstallDependenciesResponse = _root_.pulumirpc.language.InstallDependenciesResponse( + stdout, + stderr + ) + // @@protoc_insertion_point(GeneratedMessageCompanion[pulumirpc.InstallDependenciesResponse]) +} diff --git a/core/src/main/scala/besom/rpc/pulumirpc/language/LanguageProto.scala b/core/src/main/scala/besom/rpc/pulumirpc/language/LanguageProto.scala new file mode 100644 index 000000000..4e3cb81f3 --- /dev/null +++ b/core/src/main/scala/besom/rpc/pulumirpc/language/LanguageProto.scala @@ -0,0 +1,136 @@ +// Generated by the Scala Plugin for the Protocol Buffer Compiler. +// Do not edit! +// +// Protofile syntax: PROTO3 + +package pulumirpc.language + +object LanguageProto extends _root_.scalapb.GeneratedFileObject { + lazy val dependencies: Seq[_root_.scalapb.GeneratedFileObject] = Seq( + pulumirpc.codegen.hcl.HclProto, + pulumirpc.plugin.PluginProto, + com.google.protobuf.empty.EmptyProto, + com.google.protobuf.struct.StructProto + ) + lazy val messagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = + Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]]( + pulumirpc.language.ProgramInfo, + pulumirpc.language.AboutResponse, + pulumirpc.language.GetProgramDependenciesRequest, + pulumirpc.language.DependencyInfo, + pulumirpc.language.GetProgramDependenciesResponse, + pulumirpc.language.GetRequiredPluginsRequest, + pulumirpc.language.GetRequiredPluginsResponse, + pulumirpc.language.RunRequest, + pulumirpc.language.RunResponse, + pulumirpc.language.InstallDependenciesRequest, + pulumirpc.language.InstallDependenciesResponse, + pulumirpc.language.RunPluginRequest, + pulumirpc.language.RunPluginResponse, + pulumirpc.language.GenerateProgramRequest, + pulumirpc.language.GenerateProgramResponse, + pulumirpc.language.GenerateProjectRequest, + pulumirpc.language.GenerateProjectResponse, + pulumirpc.language.GeneratePackageRequest, + pulumirpc.language.GeneratePackageResponse, + pulumirpc.language.PackRequest, + pulumirpc.language.PackResponse + ) + private lazy val ProtoBytes: _root_.scala.Array[Byte] = + scalapb.Encoding.fromBase64(scala.collection.immutable.Seq( + """ChVwdWx1bWkvbGFuZ3VhZ2UucHJvdG8SCXB1bHVtaXJwYxoYcHVsdW1pL2NvZGVnZW4vaGNsLnByb3RvGhNwdWx1bWkvcGx1Z + 2luLnByb3RvGhtnb29nbGUvcHJvdG9idWYvZW1wdHkucHJvdG8aHGdvb2dsZS9wcm90b2J1Zi9zdHJ1Y3QucHJvdG8i/wEKC1Byb + 2dyYW1JbmZvEjkKDnJvb3RfZGlyZWN0b3J5GAEgASgJQhLiPw8SDXJvb3REaXJlY3RvcnlSDXJvb3REaXJlY3RvcnkSQgoRcHJvZ + 3JhbV9kaXJlY3RvcnkYAiABKAlCFeI/EhIQcHJvZ3JhbURpcmVjdG9yeVIQcHJvZ3JhbURpcmVjdG9yeRIwCgtlbnRyeV9wb2lud + BgDIAEoCUIP4j8MEgplbnRyeVBvaW50UgplbnRyeVBvaW50Ej8KB29wdGlvbnMYBCABKAsyFy5nb29nbGUucHJvdG9idWYuU3Ryd + WN0QgziPwkSB29wdGlvbnNSB29wdGlvbnMijgIKDUFib3V0UmVzcG9uc2USLwoKZXhlY3V0YWJsZRgBIAEoCUIP4j8MEgpleGVjd + XRhYmxlUgpleGVjdXRhYmxlEiYKB3ZlcnNpb24YAiABKAlCDOI/CRIHdmVyc2lvblIHdmVyc2lvbhJRCghtZXRhZGF0YRgDIAMoC + zImLnB1bHVtaXJwYy5BYm91dFJlc3BvbnNlLk1ldGFkYXRhRW50cnlCDeI/ChIIbWV0YWRhdGFSCG1ldGFkYXRhGlEKDU1ldGFkY + XRhRW50cnkSGgoDa2V5GAEgASgJQgjiPwUSA2tleVIDa2V5EiAKBXZhbHVlGAIgASgJQgriPwcSBXZhbHVlUgV2YWx1ZToCOAEin + QIKHUdldFByb2dyYW1EZXBlbmRlbmNpZXNSZXF1ZXN0EigKB3Byb2plY3QYASABKAlCDhgB4j8JEgdwcm9qZWN0Ugdwcm9qZWN0E + hwKA3B3ZBgCIAEoCUIKGAHiPwUSA3B3ZFIDcHdkEigKB3Byb2dyYW0YAyABKAlCDhgB4j8JEgdwcm9ncmFtUgdwcm9ncmFtElMKF + nRyYW5zaXRpdmVEZXBlbmRlbmNpZXMYBCABKAhCG+I/GBIWdHJhbnNpdGl2ZURlcGVuZGVuY2llc1IWdHJhbnNpdGl2ZURlcGVuZ + GVuY2llcxI1CgRpbmZvGAUgASgLMhYucHVsdW1pcnBjLlByb2dyYW1JbmZvQgniPwYSBGluZm9SBGluZm8iVwoORGVwZW5kZW5je + UluZm8SHQoEbmFtZRgBIAEoCUIJ4j8GEgRuYW1lUgRuYW1lEiYKB3ZlcnNpb24YAiABKAlCDOI/CRIHdmVyc2lvblIHdmVyc2lvb + iJyCh5HZXRQcm9ncmFtRGVwZW5kZW5jaWVzUmVzcG9uc2USUAoMZGVwZW5kZW5jaWVzGAEgAygLMhkucHVsdW1pcnBjLkRlcGVuZ + GVuY3lJbmZvQhHiPw4SDGRlcGVuZGVuY2llc1IMZGVwZW5kZW5jaWVzIsQBChlHZXRSZXF1aXJlZFBsdWdpbnNSZXF1ZXN0EigKB + 3Byb2plY3QYASABKAlCDhgB4j8JEgdwcm9qZWN0Ugdwcm9qZWN0EhwKA3B3ZBgCIAEoCUIKGAHiPwUSA3B3ZFIDcHdkEigKB3Byb + 2dyYW0YAyABKAlCDhgB4j8JEgdwcm9ncmFtUgdwcm9ncmFtEjUKBGluZm8YBCABKAsyFi5wdWx1bWlycGMuUHJvZ3JhbUluZm9CC + eI/BhIEaW5mb1IEaW5mbyJhChpHZXRSZXF1aXJlZFBsdWdpbnNSZXNwb25zZRJDCgdwbHVnaW5zGAEgAygLMhsucHVsdW1pcnBjL + lBsdWdpbkRlcGVuZGVuY3lCDOI/CRIHcGx1Z2luc1IHcGx1Z2lucyKgBgoKUnVuUmVxdWVzdBImCgdwcm9qZWN0GAEgASgJQgziP + wkSB3Byb2plY3RSB3Byb2plY3QSIAoFc3RhY2sYAiABKAlCCuI/BxIFc3RhY2tSBXN0YWNrEhoKA3B3ZBgDIAEoCUII4j8FEgNwd + 2RSA3B3ZBIoCgdwcm9ncmFtGAQgASgJQg4YAeI/CRIHcHJvZ3JhbVIHcHJvZ3JhbRIdCgRhcmdzGAUgAygJQgniPwYSBGFyZ3NSB + GFyZ3MSRgoGY29uZmlnGAYgAygLMiEucHVsdW1pcnBjLlJ1blJlcXVlc3QuQ29uZmlnRW50cnlCC+I/CBIGY29uZmlnUgZjb25ma + WcSIwoGZHJ5UnVuGAcgASgIQgviPwgSBmRyeVJ1blIGZHJ5UnVuEikKCHBhcmFsbGVsGAggASgFQg3iPwoSCHBhcmFsbGVsUghwY + XJhbGxlbBI8Cg9tb25pdG9yX2FkZHJlc3MYCSABKAlCE+I/EBIObW9uaXRvckFkZHJlc3NSDm1vbml0b3JBZGRyZXNzEiwKCXF1Z + XJ5TW9kZRgKIAEoCEIO4j8LEglxdWVyeU1vZGVSCXF1ZXJ5TW9kZRJBChBjb25maWdTZWNyZXRLZXlzGAsgAygJQhXiPxISEGNvb + mZpZ1NlY3JldEtleXNSEGNvbmZpZ1NlY3JldEtleXMSNQoMb3JnYW5pemF0aW9uGAwgASgJQhHiPw4SDG9yZ2FuaXphdGlvblIMb + 3JnYW5pemF0aW9uEl0KEWNvbmZpZ1Byb3BlcnR5TWFwGA0gASgLMhcuZ29vZ2xlLnByb3RvYnVmLlN0cnVjdEIW4j8TEhFjb25ma + WdQcm9wZXJ0eU1hcFIRY29uZmlnUHJvcGVydHlNYXASNQoEaW5mbxgOIAEoCzIWLnB1bHVtaXJwYy5Qcm9ncmFtSW5mb0IJ4j8GE + gRpbmZvUgRpbmZvGk8KC0NvbmZpZ0VudHJ5EhoKA2tleRgBIAEoCUII4j8FEgNrZXlSA2tleRIgCgV2YWx1ZRgCIAEoCUIK4j8HE + gV2YWx1ZVIFdmFsdWU6AjgBIk4KC1J1blJlc3BvbnNlEiAKBWVycm9yGAEgASgJQgriPwcSBWVycm9yUgVlcnJvchIdCgRiYWlsG + AIgASgIQgniPwYSBGJhaWxSBGJhaWwitQEKGkluc3RhbGxEZXBlbmRlbmNpZXNSZXF1ZXN0Ei4KCWRpcmVjdG9yeRgBIAEoCUIQG + AHiPwsSCWRpcmVjdG9yeVIJZGlyZWN0b3J5EjAKC2lzX3Rlcm1pbmFsGAIgASgIQg/iPwwSCmlzVGVybWluYWxSCmlzVGVybWluY + WwSNQoEaW5mbxgDIAEoCzIWLnB1bHVtaXJwYy5Qcm9ncmFtSW5mb0IJ4j8GEgRpbmZvUgRpbmZvImcKG0luc3RhbGxEZXBlbmRlb + mNpZXNSZXNwb25zZRIjCgZzdGRvdXQYASABKAxCC+I/CBIGc3Rkb3V0UgZzdGRvdXQSIwoGc3RkZXJyGAIgASgMQgviPwgSBnN0Z + GVyclIGc3RkZXJyIsoBChBSdW5QbHVnaW5SZXF1ZXN0EhoKA3B3ZBgBIAEoCUII4j8FEgNwd2RSA3B3ZBIoCgdwcm9ncmFtGAIgA + SgJQg4YAeI/CRIHcHJvZ3JhbVIHcHJvZ3JhbRIdCgRhcmdzGAMgAygJQgniPwYSBGFyZ3NSBGFyZ3MSGgoDZW52GAQgAygJQgjiP + wUSA2VudlIDZW52EjUKBGluZm8YBSABKAsyFi5wdWx1bWlycGMuUHJvZ3JhbUluZm9CCeI/BhIEaW5mb1IEaW5mbyKYAQoRUnVuU + Gx1Z2luUmVzcG9uc2USJQoGc3Rkb3V0GAEgASgMQgviPwgSBnN0ZG91dEgAUgZzdGRvdXQSJQoGc3RkZXJyGAIgASgMQgviPwgSB + nN0ZGVyckgAUgZzdGRlcnISKwoIZXhpdGNvZGUYAyABKAVCDeI/ChIIZXhpdGNvZGVIAFIIZXhpdGNvZGVCCAoGb3V0cHV0IvUBC + hZHZW5lcmF0ZVByb2dyYW1SZXF1ZXN0ElIKBnNvdXJjZRgBIAMoCzItLnB1bHVtaXJwYy5HZW5lcmF0ZVByb2dyYW1SZXF1ZXN0L + lNvdXJjZUVudHJ5QgviPwgSBnNvdXJjZVIGc291cmNlEjYKDWxvYWRlcl90YXJnZXQYAiABKAlCEeI/DhIMbG9hZGVyVGFyZ2V0U + gxsb2FkZXJUYXJnZXQaTwoLU291cmNlRW50cnkSGgoDa2V5GAEgASgJQgjiPwUSA2tleVIDa2V5EiAKBXZhbHVlGAIgASgJQgriP + wcSBXZhbHVlUgV2YWx1ZToCOAEikgIKF0dlbmVyYXRlUHJvZ3JhbVJlc3BvbnNlElEKC2RpYWdub3N0aWNzGAEgAygLMh0ucHVsd + W1pcnBjLmNvZGVnZW4uRGlhZ25vc3RpY0IQ4j8NEgtkaWFnbm9zdGljc1ILZGlhZ25vc3RpY3MSUwoGc291cmNlGAIgAygLMi4uc + HVsdW1pcnBjLkdlbmVyYXRlUHJvZ3JhbVJlc3BvbnNlLlNvdXJjZUVudHJ5QgviPwgSBnNvdXJjZVIGc291cmNlGk8KC1NvdXJjZ + UVudHJ5EhoKA2tleRgBIAEoCUII4j8FEgNrZXlSA2tleRIgCgV2YWx1ZRgCIAEoDEIK4j8HEgV2YWx1ZVIFdmFsdWU6AjgBIvwDC + hZHZW5lcmF0ZVByb2plY3RSZXF1ZXN0Ej8KEHNvdXJjZV9kaXJlY3RvcnkYASABKAlCFOI/ERIPc291cmNlRGlyZWN0b3J5Ug9zb + 3VyY2VEaXJlY3RvcnkSPwoQdGFyZ2V0X2RpcmVjdG9yeRgCIAEoCUIU4j8REg90YXJnZXREaXJlY3RvcnlSD3RhcmdldERpcmVjd + G9yeRImCgdwcm9qZWN0GAMgASgJQgziPwkSB3Byb2plY3RSB3Byb2plY3QSIwoGc3RyaWN0GAQgASgIQgviPwgSBnN0cmljdFIGc + 3RyaWN0EjYKDWxvYWRlcl90YXJnZXQYBSABKAlCEeI/DhIMbG9hZGVyVGFyZ2V0Ugxsb2FkZXJUYXJnZXQSfwoSbG9jYWxfZGVwZ + W5kZW5jaWVzGAYgAygLMjgucHVsdW1pcnBjLkdlbmVyYXRlUHJvamVjdFJlcXVlc3QuTG9jYWxEZXBlbmRlbmNpZXNFbnRyeUIW4 + j8TEhFsb2NhbERlcGVuZGVuY2llc1IRbG9jYWxEZXBlbmRlbmNpZXMaWgoWTG9jYWxEZXBlbmRlbmNpZXNFbnRyeRIaCgNrZXkYA + SABKAlCCOI/BRIDa2V5UgNrZXkSIAoFdmFsdWUYAiABKAlCCuI/BxIFdmFsdWVSBXZhbHVlOgI4ASJsChdHZW5lcmF0ZVByb2plY + 3RSZXNwb25zZRJRCgtkaWFnbm9zdGljcxgBIAMoCzIdLnB1bHVtaXJwYy5jb2RlZ2VuLkRpYWdub3N0aWNCEOI/DRILZGlhZ25vc + 3RpY3NSC2RpYWdub3N0aWNzIt0CChZHZW5lcmF0ZVBhY2thZ2VSZXF1ZXN0EiwKCWRpcmVjdG9yeRgBIAEoCUIO4j8LEglkaXJlY + 3RvcnlSCWRpcmVjdG9yeRIjCgZzY2hlbWEYAiABKAlCC+I/CBIGc2NoZW1hUgZzY2hlbWESYwoLZXh0cmFfZmlsZXMYAyADKAsyM + S5wdWx1bWlycGMuR2VuZXJhdGVQYWNrYWdlUmVxdWVzdC5FeHRyYUZpbGVzRW50cnlCD+I/DBIKZXh0cmFGaWxlc1IKZXh0cmFGa + WxlcxI2Cg1sb2FkZXJfdGFyZ2V0GAQgASgJQhHiPw4SDGxvYWRlclRhcmdldFIMbG9hZGVyVGFyZ2V0GlMKD0V4dHJhRmlsZXNFb + nRyeRIaCgNrZXkYASABKAlCCOI/BRIDa2V5UgNrZXkSIAoFdmFsdWUYAiABKAxCCuI/BxIFdmFsdWVSBXZhbHVlOgI4ASJsChdHZ + W5lcmF0ZVBhY2thZ2VSZXNwb25zZRJRCgtkaWFnbm9zdGljcxgBIAMoCzIdLnB1bHVtaXJwYy5jb2RlZ2VuLkRpYWdub3N0aWNCE + OI/DRILZGlhZ25vc3RpY3NSC2RpYWdub3N0aWNzIskBCgtQYWNrUmVxdWVzdBJCChFwYWNrYWdlX2RpcmVjdG9yeRgBIAEoCUIV4 + j8SEhBwYWNrYWdlRGlyZWN0b3J5UhBwYWNrYWdlRGlyZWN0b3J5EiYKB3ZlcnNpb24YAiABKAlCDOI/CRIHdmVyc2lvblIHdmVyc + 2lvbhJOChVkZXN0aW5hdGlvbl9kaXJlY3RvcnkYAyABKAlCGeI/FhIUZGVzdGluYXRpb25EaXJlY3RvcnlSFGRlc3RpbmF0aW9uR + GlyZWN0b3J5IkYKDFBhY2tSZXNwb25zZRI2Cg1hcnRpZmFjdF9wYXRoGAEgASgJQhHiPw4SDGFydGlmYWN0UGF0aFIMYXJ0aWZhY + 3RQYXRoMqMHCg9MYW5ndWFnZVJ1bnRpbWUSYwoSR2V0UmVxdWlyZWRQbHVnaW5zEiQucHVsdW1pcnBjLkdldFJlcXVpcmVkUGx1Z + 2luc1JlcXVlc3QaJS5wdWx1bWlycGMuR2V0UmVxdWlyZWRQbHVnaW5zUmVzcG9uc2UiABI2CgNSdW4SFS5wdWx1bWlycGMuUnVuU + mVxdWVzdBoWLnB1bHVtaXJwYy5SdW5SZXNwb25zZSIAEkAKDUdldFBsdWdpbkluZm8SFi5nb29nbGUucHJvdG9idWYuRW1wdHkaF + S5wdWx1bWlycGMuUGx1Z2luSW5mbyIAEmgKE0luc3RhbGxEZXBlbmRlbmNpZXMSJS5wdWx1bWlycGMuSW5zdGFsbERlcGVuZGVuY + 2llc1JlcXVlc3QaJi5wdWx1bWlycGMuSW5zdGFsbERlcGVuZGVuY2llc1Jlc3BvbnNlIgAwARI7CgVBYm91dBIWLmdvb2dsZS5wc + m90b2J1Zi5FbXB0eRoYLnB1bHVtaXJwYy5BYm91dFJlc3BvbnNlIgASbwoWR2V0UHJvZ3JhbURlcGVuZGVuY2llcxIoLnB1bHVta + XJwYy5HZXRQcm9ncmFtRGVwZW5kZW5jaWVzUmVxdWVzdBopLnB1bHVtaXJwYy5HZXRQcm9ncmFtRGVwZW5kZW5jaWVzUmVzcG9uc + 2UiABJKCglSdW5QbHVnaW4SGy5wdWx1bWlycGMuUnVuUGx1Z2luUmVxdWVzdBocLnB1bHVtaXJwYy5SdW5QbHVnaW5SZXNwb25zZ + SIAMAESWgoPR2VuZXJhdGVQcm9ncmFtEiEucHVsdW1pcnBjLkdlbmVyYXRlUHJvZ3JhbVJlcXVlc3QaIi5wdWx1bWlycGMuR2VuZ + XJhdGVQcm9ncmFtUmVzcG9uc2UiABJaCg9HZW5lcmF0ZVByb2plY3QSIS5wdWx1bWlycGMuR2VuZXJhdGVQcm9qZWN0UmVxdWVzd + BoiLnB1bHVtaXJwYy5HZW5lcmF0ZVByb2plY3RSZXNwb25zZSIAEloKD0dlbmVyYXRlUGFja2FnZRIhLnB1bHVtaXJwYy5HZW5lc + mF0ZVBhY2thZ2VSZXF1ZXN0GiIucHVsdW1pcnBjLkdlbmVyYXRlUGFja2FnZVJlc3BvbnNlIgASOQoEUGFjaxIWLnB1bHVtaXJwY + y5QYWNrUmVxdWVzdBoXLnB1bHVtaXJwYy5QYWNrUmVzcG9uc2UiAEI0WjJnaXRodWIuY29tL3B1bHVtaS9wdWx1bWkvc2RrL3YzL + 3Byb3RvL2dvO3B1bHVtaXJwY2IGcHJvdG8z""" + ).mkString) + lazy val scalaDescriptor: _root_.scalapb.descriptors.FileDescriptor = { + val scalaProto = com.google.protobuf.descriptor.FileDescriptorProto.parseFrom(ProtoBytes) + _root_.scalapb.descriptors.FileDescriptor.buildFrom(scalaProto, dependencies.map(_.scalaDescriptor)) + } + lazy val javaDescriptor: com.google.protobuf.Descriptors.FileDescriptor = { + val javaProto = com.google.protobuf.DescriptorProtos.FileDescriptorProto.parseFrom(ProtoBytes) + com.google.protobuf.Descriptors.FileDescriptor.buildFrom(javaProto, _root_.scala.Array( + pulumirpc.codegen.hcl.HclProto.javaDescriptor, + pulumirpc.plugin.PluginProto.javaDescriptor, + com.google.protobuf.empty.EmptyProto.javaDescriptor, + com.google.protobuf.struct.StructProto.javaDescriptor + )) + } + @deprecated("Use javaDescriptor instead. In a future version this will refer to scalaDescriptor.", "ScalaPB 0.5.47") + def descriptor: com.google.protobuf.Descriptors.FileDescriptor = javaDescriptor +} \ No newline at end of file diff --git a/core/src/main/scala/besom/rpc/pulumirpc/language/LanguageRuntimeGrpc.scala b/core/src/main/scala/besom/rpc/pulumirpc/language/LanguageRuntimeGrpc.scala new file mode 100644 index 000000000..680a14a0e --- /dev/null +++ b/core/src/main/scala/besom/rpc/pulumirpc/language/LanguageRuntimeGrpc.scala @@ -0,0 +1,443 @@ +// Generated by the Scala Plugin for the Protocol Buffer Compiler. +// Do not edit! +// +// Protofile syntax: PROTO3 + +package pulumirpc.language + + +object LanguageRuntimeGrpc { + val METHOD_GET_REQUIRED_PLUGINS: _root_.io.grpc.MethodDescriptor[pulumirpc.language.GetRequiredPluginsRequest, pulumirpc.language.GetRequiredPluginsResponse] = + _root_.io.grpc.MethodDescriptor.newBuilder() + .setType(_root_.io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(_root_.io.grpc.MethodDescriptor.generateFullMethodName("pulumirpc.LanguageRuntime", "GetRequiredPlugins")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(_root_.scalapb.grpc.Marshaller.forMessage[pulumirpc.language.GetRequiredPluginsRequest]) + .setResponseMarshaller(_root_.scalapb.grpc.Marshaller.forMessage[pulumirpc.language.GetRequiredPluginsResponse]) + .setSchemaDescriptor(_root_.scalapb.grpc.ConcreteProtoMethodDescriptorSupplier.fromMethodDescriptor(pulumirpc.language.LanguageProto.javaDescriptor.getServices().get(0).getMethods().get(0))) + .build() + + val METHOD_RUN: _root_.io.grpc.MethodDescriptor[pulumirpc.language.RunRequest, pulumirpc.language.RunResponse] = + _root_.io.grpc.MethodDescriptor.newBuilder() + .setType(_root_.io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(_root_.io.grpc.MethodDescriptor.generateFullMethodName("pulumirpc.LanguageRuntime", "Run")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(_root_.scalapb.grpc.Marshaller.forMessage[pulumirpc.language.RunRequest]) + .setResponseMarshaller(_root_.scalapb.grpc.Marshaller.forMessage[pulumirpc.language.RunResponse]) + .setSchemaDescriptor(_root_.scalapb.grpc.ConcreteProtoMethodDescriptorSupplier.fromMethodDescriptor(pulumirpc.language.LanguageProto.javaDescriptor.getServices().get(0).getMethods().get(1))) + .build() + + val METHOD_GET_PLUGIN_INFO: _root_.io.grpc.MethodDescriptor[com.google.protobuf.empty.Empty, pulumirpc.plugin.PluginInfo] = + _root_.io.grpc.MethodDescriptor.newBuilder() + .setType(_root_.io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(_root_.io.grpc.MethodDescriptor.generateFullMethodName("pulumirpc.LanguageRuntime", "GetPluginInfo")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(_root_.scalapb.grpc.Marshaller.forMessage[com.google.protobuf.empty.Empty]) + .setResponseMarshaller(_root_.scalapb.grpc.Marshaller.forMessage[pulumirpc.plugin.PluginInfo]) + .setSchemaDescriptor(_root_.scalapb.grpc.ConcreteProtoMethodDescriptorSupplier.fromMethodDescriptor(pulumirpc.language.LanguageProto.javaDescriptor.getServices().get(0).getMethods().get(2))) + .build() + + val METHOD_INSTALL_DEPENDENCIES: _root_.io.grpc.MethodDescriptor[pulumirpc.language.InstallDependenciesRequest, pulumirpc.language.InstallDependenciesResponse] = + _root_.io.grpc.MethodDescriptor.newBuilder() + .setType(_root_.io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(_root_.io.grpc.MethodDescriptor.generateFullMethodName("pulumirpc.LanguageRuntime", "InstallDependencies")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(_root_.scalapb.grpc.Marshaller.forMessage[pulumirpc.language.InstallDependenciesRequest]) + .setResponseMarshaller(_root_.scalapb.grpc.Marshaller.forMessage[pulumirpc.language.InstallDependenciesResponse]) + .setSchemaDescriptor(_root_.scalapb.grpc.ConcreteProtoMethodDescriptorSupplier.fromMethodDescriptor(pulumirpc.language.LanguageProto.javaDescriptor.getServices().get(0).getMethods().get(3))) + .build() + + val METHOD_ABOUT: _root_.io.grpc.MethodDescriptor[com.google.protobuf.empty.Empty, pulumirpc.language.AboutResponse] = + _root_.io.grpc.MethodDescriptor.newBuilder() + .setType(_root_.io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(_root_.io.grpc.MethodDescriptor.generateFullMethodName("pulumirpc.LanguageRuntime", "About")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(_root_.scalapb.grpc.Marshaller.forMessage[com.google.protobuf.empty.Empty]) + .setResponseMarshaller(_root_.scalapb.grpc.Marshaller.forMessage[pulumirpc.language.AboutResponse]) + .setSchemaDescriptor(_root_.scalapb.grpc.ConcreteProtoMethodDescriptorSupplier.fromMethodDescriptor(pulumirpc.language.LanguageProto.javaDescriptor.getServices().get(0).getMethods().get(4))) + .build() + + val METHOD_GET_PROGRAM_DEPENDENCIES: _root_.io.grpc.MethodDescriptor[pulumirpc.language.GetProgramDependenciesRequest, pulumirpc.language.GetProgramDependenciesResponse] = + _root_.io.grpc.MethodDescriptor.newBuilder() + .setType(_root_.io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(_root_.io.grpc.MethodDescriptor.generateFullMethodName("pulumirpc.LanguageRuntime", "GetProgramDependencies")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(_root_.scalapb.grpc.Marshaller.forMessage[pulumirpc.language.GetProgramDependenciesRequest]) + .setResponseMarshaller(_root_.scalapb.grpc.Marshaller.forMessage[pulumirpc.language.GetProgramDependenciesResponse]) + .setSchemaDescriptor(_root_.scalapb.grpc.ConcreteProtoMethodDescriptorSupplier.fromMethodDescriptor(pulumirpc.language.LanguageProto.javaDescriptor.getServices().get(0).getMethods().get(5))) + .build() + + val METHOD_RUN_PLUGIN: _root_.io.grpc.MethodDescriptor[pulumirpc.language.RunPluginRequest, pulumirpc.language.RunPluginResponse] = + _root_.io.grpc.MethodDescriptor.newBuilder() + .setType(_root_.io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(_root_.io.grpc.MethodDescriptor.generateFullMethodName("pulumirpc.LanguageRuntime", "RunPlugin")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(_root_.scalapb.grpc.Marshaller.forMessage[pulumirpc.language.RunPluginRequest]) + .setResponseMarshaller(_root_.scalapb.grpc.Marshaller.forMessage[pulumirpc.language.RunPluginResponse]) + .setSchemaDescriptor(_root_.scalapb.grpc.ConcreteProtoMethodDescriptorSupplier.fromMethodDescriptor(pulumirpc.language.LanguageProto.javaDescriptor.getServices().get(0).getMethods().get(6))) + .build() + + val METHOD_GENERATE_PROGRAM: _root_.io.grpc.MethodDescriptor[pulumirpc.language.GenerateProgramRequest, pulumirpc.language.GenerateProgramResponse] = + _root_.io.grpc.MethodDescriptor.newBuilder() + .setType(_root_.io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(_root_.io.grpc.MethodDescriptor.generateFullMethodName("pulumirpc.LanguageRuntime", "GenerateProgram")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(_root_.scalapb.grpc.Marshaller.forMessage[pulumirpc.language.GenerateProgramRequest]) + .setResponseMarshaller(_root_.scalapb.grpc.Marshaller.forMessage[pulumirpc.language.GenerateProgramResponse]) + .setSchemaDescriptor(_root_.scalapb.grpc.ConcreteProtoMethodDescriptorSupplier.fromMethodDescriptor(pulumirpc.language.LanguageProto.javaDescriptor.getServices().get(0).getMethods().get(7))) + .build() + + val METHOD_GENERATE_PROJECT: _root_.io.grpc.MethodDescriptor[pulumirpc.language.GenerateProjectRequest, pulumirpc.language.GenerateProjectResponse] = + _root_.io.grpc.MethodDescriptor.newBuilder() + .setType(_root_.io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(_root_.io.grpc.MethodDescriptor.generateFullMethodName("pulumirpc.LanguageRuntime", "GenerateProject")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(_root_.scalapb.grpc.Marshaller.forMessage[pulumirpc.language.GenerateProjectRequest]) + .setResponseMarshaller(_root_.scalapb.grpc.Marshaller.forMessage[pulumirpc.language.GenerateProjectResponse]) + .setSchemaDescriptor(_root_.scalapb.grpc.ConcreteProtoMethodDescriptorSupplier.fromMethodDescriptor(pulumirpc.language.LanguageProto.javaDescriptor.getServices().get(0).getMethods().get(8))) + .build() + + val METHOD_GENERATE_PACKAGE: _root_.io.grpc.MethodDescriptor[pulumirpc.language.GeneratePackageRequest, pulumirpc.language.GeneratePackageResponse] = + _root_.io.grpc.MethodDescriptor.newBuilder() + .setType(_root_.io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(_root_.io.grpc.MethodDescriptor.generateFullMethodName("pulumirpc.LanguageRuntime", "GeneratePackage")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(_root_.scalapb.grpc.Marshaller.forMessage[pulumirpc.language.GeneratePackageRequest]) + .setResponseMarshaller(_root_.scalapb.grpc.Marshaller.forMessage[pulumirpc.language.GeneratePackageResponse]) + .setSchemaDescriptor(_root_.scalapb.grpc.ConcreteProtoMethodDescriptorSupplier.fromMethodDescriptor(pulumirpc.language.LanguageProto.javaDescriptor.getServices().get(0).getMethods().get(9))) + .build() + + val METHOD_PACK: _root_.io.grpc.MethodDescriptor[pulumirpc.language.PackRequest, pulumirpc.language.PackResponse] = + _root_.io.grpc.MethodDescriptor.newBuilder() + .setType(_root_.io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(_root_.io.grpc.MethodDescriptor.generateFullMethodName("pulumirpc.LanguageRuntime", "Pack")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(_root_.scalapb.grpc.Marshaller.forMessage[pulumirpc.language.PackRequest]) + .setResponseMarshaller(_root_.scalapb.grpc.Marshaller.forMessage[pulumirpc.language.PackResponse]) + .setSchemaDescriptor(_root_.scalapb.grpc.ConcreteProtoMethodDescriptorSupplier.fromMethodDescriptor(pulumirpc.language.LanguageProto.javaDescriptor.getServices().get(0).getMethods().get(10))) + .build() + + val SERVICE: _root_.io.grpc.ServiceDescriptor = + _root_.io.grpc.ServiceDescriptor.newBuilder("pulumirpc.LanguageRuntime") + .setSchemaDescriptor(new _root_.scalapb.grpc.ConcreteProtoFileDescriptorSupplier(pulumirpc.language.LanguageProto.javaDescriptor)) + .addMethod(METHOD_GET_REQUIRED_PLUGINS) + .addMethod(METHOD_RUN) + .addMethod(METHOD_GET_PLUGIN_INFO) + .addMethod(METHOD_INSTALL_DEPENDENCIES) + .addMethod(METHOD_ABOUT) + .addMethod(METHOD_GET_PROGRAM_DEPENDENCIES) + .addMethod(METHOD_RUN_PLUGIN) + .addMethod(METHOD_GENERATE_PROGRAM) + .addMethod(METHOD_GENERATE_PROJECT) + .addMethod(METHOD_GENERATE_PACKAGE) + .addMethod(METHOD_PACK) + .build() + + /** LanguageRuntime is the interface that the planning monitor uses to drive execution of an interpreter responsible + * for confguring and creating resource objects. + */ + trait LanguageRuntime extends _root_.scalapb.grpc.AbstractService { + override def serviceCompanion: _root_.scalapb.grpc.ServiceCompanion[LanguageRuntime] = LanguageRuntime + /** GetRequiredPlugins computes the complete set of anticipated plugins required by a program. + */ + def getRequiredPlugins(request: pulumirpc.language.GetRequiredPluginsRequest): scala.concurrent.Future[pulumirpc.language.GetRequiredPluginsResponse] + /** Run executes a program and returns its result. + */ + def run(request: pulumirpc.language.RunRequest): scala.concurrent.Future[pulumirpc.language.RunResponse] + /** GetPluginInfo returns generic information about this plugin, like its version. + */ + def getPluginInfo(request: com.google.protobuf.empty.Empty): scala.concurrent.Future[pulumirpc.plugin.PluginInfo] + /** InstallDependencies will install dependencies for the project, e.g. by running `npm install` for nodejs projects. + */ + def installDependencies(request: pulumirpc.language.InstallDependenciesRequest, responseObserver: _root_.io.grpc.stub.StreamObserver[pulumirpc.language.InstallDependenciesResponse]): _root_.scala.Unit + /** About returns information about the runtime for this language. + */ + def about(request: com.google.protobuf.empty.Empty): scala.concurrent.Future[pulumirpc.language.AboutResponse] + /** GetProgramDependencies returns the set of dependencies required by the program. + */ + def getProgramDependencies(request: pulumirpc.language.GetProgramDependenciesRequest): scala.concurrent.Future[pulumirpc.language.GetProgramDependenciesResponse] + /** RunPlugin executes a plugin program and returns its result asynchronously. + */ + def runPlugin(request: pulumirpc.language.RunPluginRequest, responseObserver: _root_.io.grpc.stub.StreamObserver[pulumirpc.language.RunPluginResponse]): _root_.scala.Unit + /** GenerateProgram generates a given PCL program into a program for this language. + */ + def generateProgram(request: pulumirpc.language.GenerateProgramRequest): scala.concurrent.Future[pulumirpc.language.GenerateProgramResponse] + /** GenerateProject generates a given PCL program into a project for this language. + */ + def generateProject(request: pulumirpc.language.GenerateProjectRequest): scala.concurrent.Future[pulumirpc.language.GenerateProjectResponse] + /** GeneratePackage generates a given pulumi package into a package for this language. + */ + def generatePackage(request: pulumirpc.language.GeneratePackageRequest): scala.concurrent.Future[pulumirpc.language.GeneratePackageResponse] + /** Pack packs a package into a language specific artifact. + */ + def pack(request: pulumirpc.language.PackRequest): scala.concurrent.Future[pulumirpc.language.PackResponse] + } + + object LanguageRuntime extends _root_.scalapb.grpc.ServiceCompanion[LanguageRuntime] { + implicit def serviceCompanion: _root_.scalapb.grpc.ServiceCompanion[LanguageRuntime] = this + def javaDescriptor: _root_.com.google.protobuf.Descriptors.ServiceDescriptor = pulumirpc.language.LanguageProto.javaDescriptor.getServices().get(0) + def scalaDescriptor: _root_.scalapb.descriptors.ServiceDescriptor = pulumirpc.language.LanguageProto.scalaDescriptor.services(0) + def bindService(serviceImpl: LanguageRuntime, executionContext: scala.concurrent.ExecutionContext): _root_.io.grpc.ServerServiceDefinition = + _root_.io.grpc.ServerServiceDefinition.builder(SERVICE) + .addMethod( + METHOD_GET_REQUIRED_PLUGINS, + _root_.io.grpc.stub.ServerCalls.asyncUnaryCall((request: pulumirpc.language.GetRequiredPluginsRequest, observer: _root_.io.grpc.stub.StreamObserver[pulumirpc.language.GetRequiredPluginsResponse]) => { + serviceImpl.getRequiredPlugins(request).onComplete(scalapb.grpc.Grpc.completeObserver(observer))( + executionContext) + })) + .addMethod( + METHOD_RUN, + _root_.io.grpc.stub.ServerCalls.asyncUnaryCall((request: pulumirpc.language.RunRequest, observer: _root_.io.grpc.stub.StreamObserver[pulumirpc.language.RunResponse]) => { + serviceImpl.run(request).onComplete(scalapb.grpc.Grpc.completeObserver(observer))( + executionContext) + })) + .addMethod( + METHOD_GET_PLUGIN_INFO, + _root_.io.grpc.stub.ServerCalls.asyncUnaryCall((request: com.google.protobuf.empty.Empty, observer: _root_.io.grpc.stub.StreamObserver[pulumirpc.plugin.PluginInfo]) => { + serviceImpl.getPluginInfo(request).onComplete(scalapb.grpc.Grpc.completeObserver(observer))( + executionContext) + })) + .addMethod( + METHOD_INSTALL_DEPENDENCIES, + _root_.io.grpc.stub.ServerCalls.asyncServerStreamingCall((request: pulumirpc.language.InstallDependenciesRequest, observer: _root_.io.grpc.stub.StreamObserver[pulumirpc.language.InstallDependenciesResponse]) => { + serviceImpl.installDependencies(request, observer) + })) + .addMethod( + METHOD_ABOUT, + _root_.io.grpc.stub.ServerCalls.asyncUnaryCall((request: com.google.protobuf.empty.Empty, observer: _root_.io.grpc.stub.StreamObserver[pulumirpc.language.AboutResponse]) => { + serviceImpl.about(request).onComplete(scalapb.grpc.Grpc.completeObserver(observer))( + executionContext) + })) + .addMethod( + METHOD_GET_PROGRAM_DEPENDENCIES, + _root_.io.grpc.stub.ServerCalls.asyncUnaryCall((request: pulumirpc.language.GetProgramDependenciesRequest, observer: _root_.io.grpc.stub.StreamObserver[pulumirpc.language.GetProgramDependenciesResponse]) => { + serviceImpl.getProgramDependencies(request).onComplete(scalapb.grpc.Grpc.completeObserver(observer))( + executionContext) + })) + .addMethod( + METHOD_RUN_PLUGIN, + _root_.io.grpc.stub.ServerCalls.asyncServerStreamingCall((request: pulumirpc.language.RunPluginRequest, observer: _root_.io.grpc.stub.StreamObserver[pulumirpc.language.RunPluginResponse]) => { + serviceImpl.runPlugin(request, observer) + })) + .addMethod( + METHOD_GENERATE_PROGRAM, + _root_.io.grpc.stub.ServerCalls.asyncUnaryCall((request: pulumirpc.language.GenerateProgramRequest, observer: _root_.io.grpc.stub.StreamObserver[pulumirpc.language.GenerateProgramResponse]) => { + serviceImpl.generateProgram(request).onComplete(scalapb.grpc.Grpc.completeObserver(observer))( + executionContext) + })) + .addMethod( + METHOD_GENERATE_PROJECT, + _root_.io.grpc.stub.ServerCalls.asyncUnaryCall((request: pulumirpc.language.GenerateProjectRequest, observer: _root_.io.grpc.stub.StreamObserver[pulumirpc.language.GenerateProjectResponse]) => { + serviceImpl.generateProject(request).onComplete(scalapb.grpc.Grpc.completeObserver(observer))( + executionContext) + })) + .addMethod( + METHOD_GENERATE_PACKAGE, + _root_.io.grpc.stub.ServerCalls.asyncUnaryCall((request: pulumirpc.language.GeneratePackageRequest, observer: _root_.io.grpc.stub.StreamObserver[pulumirpc.language.GeneratePackageResponse]) => { + serviceImpl.generatePackage(request).onComplete(scalapb.grpc.Grpc.completeObserver(observer))( + executionContext) + })) + .addMethod( + METHOD_PACK, + _root_.io.grpc.stub.ServerCalls.asyncUnaryCall((request: pulumirpc.language.PackRequest, observer: _root_.io.grpc.stub.StreamObserver[pulumirpc.language.PackResponse]) => { + serviceImpl.pack(request).onComplete(scalapb.grpc.Grpc.completeObserver(observer))( + executionContext) + })) + .build() + } + + /** LanguageRuntime is the interface that the planning monitor uses to drive execution of an interpreter responsible + * for confguring and creating resource objects. + */ + trait LanguageRuntimeBlockingClient { + def serviceCompanion: _root_.scalapb.grpc.ServiceCompanion[LanguageRuntime] = LanguageRuntime + /** GetRequiredPlugins computes the complete set of anticipated plugins required by a program. + */ + def getRequiredPlugins(request: pulumirpc.language.GetRequiredPluginsRequest): pulumirpc.language.GetRequiredPluginsResponse + /** Run executes a program and returns its result. + */ + def run(request: pulumirpc.language.RunRequest): pulumirpc.language.RunResponse + /** GetPluginInfo returns generic information about this plugin, like its version. + */ + def getPluginInfo(request: com.google.protobuf.empty.Empty): pulumirpc.plugin.PluginInfo + /** InstallDependencies will install dependencies for the project, e.g. by running `npm install` for nodejs projects. + */ + def installDependencies(request: pulumirpc.language.InstallDependenciesRequest): scala.collection.Iterator[pulumirpc.language.InstallDependenciesResponse] + /** About returns information about the runtime for this language. + */ + def about(request: com.google.protobuf.empty.Empty): pulumirpc.language.AboutResponse + /** GetProgramDependencies returns the set of dependencies required by the program. + */ + def getProgramDependencies(request: pulumirpc.language.GetProgramDependenciesRequest): pulumirpc.language.GetProgramDependenciesResponse + /** RunPlugin executes a plugin program and returns its result asynchronously. + */ + def runPlugin(request: pulumirpc.language.RunPluginRequest): scala.collection.Iterator[pulumirpc.language.RunPluginResponse] + /** GenerateProgram generates a given PCL program into a program for this language. + */ + def generateProgram(request: pulumirpc.language.GenerateProgramRequest): pulumirpc.language.GenerateProgramResponse + /** GenerateProject generates a given PCL program into a project for this language. + */ + def generateProject(request: pulumirpc.language.GenerateProjectRequest): pulumirpc.language.GenerateProjectResponse + /** GeneratePackage generates a given pulumi package into a package for this language. + */ + def generatePackage(request: pulumirpc.language.GeneratePackageRequest): pulumirpc.language.GeneratePackageResponse + /** Pack packs a package into a language specific artifact. + */ + def pack(request: pulumirpc.language.PackRequest): pulumirpc.language.PackResponse + } + + class LanguageRuntimeBlockingStub(channel: _root_.io.grpc.Channel, options: _root_.io.grpc.CallOptions = _root_.io.grpc.CallOptions.DEFAULT) extends _root_.io.grpc.stub.AbstractStub[LanguageRuntimeBlockingStub](channel, options) with LanguageRuntimeBlockingClient { + /** GetRequiredPlugins computes the complete set of anticipated plugins required by a program. + */ + override def getRequiredPlugins(request: pulumirpc.language.GetRequiredPluginsRequest): pulumirpc.language.GetRequiredPluginsResponse = { + _root_.scalapb.grpc.ClientCalls.blockingUnaryCall(channel, METHOD_GET_REQUIRED_PLUGINS, options, request) + } + + /** Run executes a program and returns its result. + */ + override def run(request: pulumirpc.language.RunRequest): pulumirpc.language.RunResponse = { + _root_.scalapb.grpc.ClientCalls.blockingUnaryCall(channel, METHOD_RUN, options, request) + } + + /** GetPluginInfo returns generic information about this plugin, like its version. + */ + override def getPluginInfo(request: com.google.protobuf.empty.Empty): pulumirpc.plugin.PluginInfo = { + _root_.scalapb.grpc.ClientCalls.blockingUnaryCall(channel, METHOD_GET_PLUGIN_INFO, options, request) + } + + /** InstallDependencies will install dependencies for the project, e.g. by running `npm install` for nodejs projects. + */ + override def installDependencies(request: pulumirpc.language.InstallDependenciesRequest): scala.collection.Iterator[pulumirpc.language.InstallDependenciesResponse] = { + _root_.scalapb.grpc.ClientCalls.blockingServerStreamingCall(channel, METHOD_INSTALL_DEPENDENCIES, options, request) + } + + /** About returns information about the runtime for this language. + */ + override def about(request: com.google.protobuf.empty.Empty): pulumirpc.language.AboutResponse = { + _root_.scalapb.grpc.ClientCalls.blockingUnaryCall(channel, METHOD_ABOUT, options, request) + } + + /** GetProgramDependencies returns the set of dependencies required by the program. + */ + override def getProgramDependencies(request: pulumirpc.language.GetProgramDependenciesRequest): pulumirpc.language.GetProgramDependenciesResponse = { + _root_.scalapb.grpc.ClientCalls.blockingUnaryCall(channel, METHOD_GET_PROGRAM_DEPENDENCIES, options, request) + } + + /** RunPlugin executes a plugin program and returns its result asynchronously. + */ + override def runPlugin(request: pulumirpc.language.RunPluginRequest): scala.collection.Iterator[pulumirpc.language.RunPluginResponse] = { + _root_.scalapb.grpc.ClientCalls.blockingServerStreamingCall(channel, METHOD_RUN_PLUGIN, options, request) + } + + /** GenerateProgram generates a given PCL program into a program for this language. + */ + override def generateProgram(request: pulumirpc.language.GenerateProgramRequest): pulumirpc.language.GenerateProgramResponse = { + _root_.scalapb.grpc.ClientCalls.blockingUnaryCall(channel, METHOD_GENERATE_PROGRAM, options, request) + } + + /** GenerateProject generates a given PCL program into a project for this language. + */ + override def generateProject(request: pulumirpc.language.GenerateProjectRequest): pulumirpc.language.GenerateProjectResponse = { + _root_.scalapb.grpc.ClientCalls.blockingUnaryCall(channel, METHOD_GENERATE_PROJECT, options, request) + } + + /** GeneratePackage generates a given pulumi package into a package for this language. + */ + override def generatePackage(request: pulumirpc.language.GeneratePackageRequest): pulumirpc.language.GeneratePackageResponse = { + _root_.scalapb.grpc.ClientCalls.blockingUnaryCall(channel, METHOD_GENERATE_PACKAGE, options, request) + } + + /** Pack packs a package into a language specific artifact. + */ + override def pack(request: pulumirpc.language.PackRequest): pulumirpc.language.PackResponse = { + _root_.scalapb.grpc.ClientCalls.blockingUnaryCall(channel, METHOD_PACK, options, request) + } + + override def build(channel: _root_.io.grpc.Channel, options: _root_.io.grpc.CallOptions): LanguageRuntimeBlockingStub = new LanguageRuntimeBlockingStub(channel, options) + } + + class LanguageRuntimeStub(channel: _root_.io.grpc.Channel, options: _root_.io.grpc.CallOptions = _root_.io.grpc.CallOptions.DEFAULT) extends _root_.io.grpc.stub.AbstractStub[LanguageRuntimeStub](channel, options) with LanguageRuntime { + /** GetRequiredPlugins computes the complete set of anticipated plugins required by a program. + */ + override def getRequiredPlugins(request: pulumirpc.language.GetRequiredPluginsRequest): scala.concurrent.Future[pulumirpc.language.GetRequiredPluginsResponse] = { + _root_.scalapb.grpc.ClientCalls.asyncUnaryCall(channel, METHOD_GET_REQUIRED_PLUGINS, options, request) + } + + /** Run executes a program and returns its result. + */ + override def run(request: pulumirpc.language.RunRequest): scala.concurrent.Future[pulumirpc.language.RunResponse] = { + _root_.scalapb.grpc.ClientCalls.asyncUnaryCall(channel, METHOD_RUN, options, request) + } + + /** GetPluginInfo returns generic information about this plugin, like its version. + */ + override def getPluginInfo(request: com.google.protobuf.empty.Empty): scala.concurrent.Future[pulumirpc.plugin.PluginInfo] = { + _root_.scalapb.grpc.ClientCalls.asyncUnaryCall(channel, METHOD_GET_PLUGIN_INFO, options, request) + } + + /** InstallDependencies will install dependencies for the project, e.g. by running `npm install` for nodejs projects. + */ + override def installDependencies(request: pulumirpc.language.InstallDependenciesRequest, responseObserver: _root_.io.grpc.stub.StreamObserver[pulumirpc.language.InstallDependenciesResponse]): _root_.scala.Unit = { + _root_.scalapb.grpc.ClientCalls.asyncServerStreamingCall(channel, METHOD_INSTALL_DEPENDENCIES, options, request, responseObserver) + } + + /** About returns information about the runtime for this language. + */ + override def about(request: com.google.protobuf.empty.Empty): scala.concurrent.Future[pulumirpc.language.AboutResponse] = { + _root_.scalapb.grpc.ClientCalls.asyncUnaryCall(channel, METHOD_ABOUT, options, request) + } + + /** GetProgramDependencies returns the set of dependencies required by the program. + */ + override def getProgramDependencies(request: pulumirpc.language.GetProgramDependenciesRequest): scala.concurrent.Future[pulumirpc.language.GetProgramDependenciesResponse] = { + _root_.scalapb.grpc.ClientCalls.asyncUnaryCall(channel, METHOD_GET_PROGRAM_DEPENDENCIES, options, request) + } + + /** RunPlugin executes a plugin program and returns its result asynchronously. + */ + override def runPlugin(request: pulumirpc.language.RunPluginRequest, responseObserver: _root_.io.grpc.stub.StreamObserver[pulumirpc.language.RunPluginResponse]): _root_.scala.Unit = { + _root_.scalapb.grpc.ClientCalls.asyncServerStreamingCall(channel, METHOD_RUN_PLUGIN, options, request, responseObserver) + } + + /** GenerateProgram generates a given PCL program into a program for this language. + */ + override def generateProgram(request: pulumirpc.language.GenerateProgramRequest): scala.concurrent.Future[pulumirpc.language.GenerateProgramResponse] = { + _root_.scalapb.grpc.ClientCalls.asyncUnaryCall(channel, METHOD_GENERATE_PROGRAM, options, request) + } + + /** GenerateProject generates a given PCL program into a project for this language. + */ + override def generateProject(request: pulumirpc.language.GenerateProjectRequest): scala.concurrent.Future[pulumirpc.language.GenerateProjectResponse] = { + _root_.scalapb.grpc.ClientCalls.asyncUnaryCall(channel, METHOD_GENERATE_PROJECT, options, request) + } + + /** GeneratePackage generates a given pulumi package into a package for this language. + */ + override def generatePackage(request: pulumirpc.language.GeneratePackageRequest): scala.concurrent.Future[pulumirpc.language.GeneratePackageResponse] = { + _root_.scalapb.grpc.ClientCalls.asyncUnaryCall(channel, METHOD_GENERATE_PACKAGE, options, request) + } + + /** Pack packs a package into a language specific artifact. + */ + override def pack(request: pulumirpc.language.PackRequest): scala.concurrent.Future[pulumirpc.language.PackResponse] = { + _root_.scalapb.grpc.ClientCalls.asyncUnaryCall(channel, METHOD_PACK, options, request) + } + + override def build(channel: _root_.io.grpc.Channel, options: _root_.io.grpc.CallOptions): LanguageRuntimeStub = new LanguageRuntimeStub(channel, options) + } + + object LanguageRuntimeStub extends _root_.io.grpc.stub.AbstractStub.StubFactory[LanguageRuntimeStub] { + override def newStub(channel: _root_.io.grpc.Channel, options: _root_.io.grpc.CallOptions): LanguageRuntimeStub = new LanguageRuntimeStub(channel, options) + + implicit val stubFactory: _root_.io.grpc.stub.AbstractStub.StubFactory[LanguageRuntimeStub] = this + } + + def bindService(serviceImpl: LanguageRuntime, executionContext: scala.concurrent.ExecutionContext): _root_.io.grpc.ServerServiceDefinition = LanguageRuntime.bindService(serviceImpl, executionContext) + + def blockingStub(channel: _root_.io.grpc.Channel): LanguageRuntimeBlockingStub = new LanguageRuntimeBlockingStub(channel) + + def stub(channel: _root_.io.grpc.Channel): LanguageRuntimeStub = new LanguageRuntimeStub(channel) + + def javaDescriptor: _root_.com.google.protobuf.Descriptors.ServiceDescriptor = pulumirpc.language.LanguageProto.javaDescriptor.getServices().get(0) + +} \ No newline at end of file diff --git a/core/src/main/scala/besom/rpc/pulumirpc/language/PackRequest.scala b/core/src/main/scala/besom/rpc/pulumirpc/language/PackRequest.scala new file mode 100644 index 000000000..1037b29e5 --- /dev/null +++ b/core/src/main/scala/besom/rpc/pulumirpc/language/PackRequest.scala @@ -0,0 +1,184 @@ +// Generated by the Scala Plugin for the Protocol Buffer Compiler. +// Do not edit! +// +// Protofile syntax: PROTO3 + +package pulumirpc.language + +/** @param packageDirectory + * the directory of a package to pack. + * @param version + * the version to tag the artifact with. + * @param destinationDirectory + * the directory to write the packed artifact to. + */ +@SerialVersionUID(0L) +final case class PackRequest( + packageDirectory: _root_.scala.Predef.String = "", + version: _root_.scala.Predef.String = "", + destinationDirectory: _root_.scala.Predef.String = "", + unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[PackRequest] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + + { + val __value = packageDirectory + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value) + } + }; + + { + val __value = version + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(2, __value) + } + }; + + { + val __value = destinationDirectory + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(3, __value) + } + }; + __size += unknownFields.serializedSize + __size + } + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size + } + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + { + val __v = packageDirectory + if (!__v.isEmpty) { + _output__.writeString(1, __v) + } + }; + { + val __v = version + if (!__v.isEmpty) { + _output__.writeString(2, __v) + } + }; + { + val __v = destinationDirectory + if (!__v.isEmpty) { + _output__.writeString(3, __v) + } + }; + unknownFields.writeTo(_output__) + } + def withPackageDirectory(__v: _root_.scala.Predef.String): PackRequest = copy(packageDirectory = __v) + def withVersion(__v: _root_.scala.Predef.String): PackRequest = copy(version = __v) + def withDestinationDirectory(__v: _root_.scala.Predef.String): PackRequest = copy(destinationDirectory = __v) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => { + val __t = packageDirectory + if (__t != "") __t else null + } + case 2 => { + val __t = version + if (__t != "") __t else null + } + case 3 => { + val __t = destinationDirectory + if (__t != "") __t else null + } + } + } + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PString(packageDirectory) + case 2 => _root_.scalapb.descriptors.PString(version) + case 3 => _root_.scalapb.descriptors.PString(destinationDirectory) + } + } + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: pulumirpc.language.PackRequest.type = pulumirpc.language.PackRequest + // @@protoc_insertion_point(GeneratedMessage[pulumirpc.PackRequest]) +} + +object PackRequest extends scalapb.GeneratedMessageCompanion[pulumirpc.language.PackRequest] { + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[pulumirpc.language.PackRequest] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): pulumirpc.language.PackRequest = { + var __packageDirectory: _root_.scala.Predef.String = "" + var __version: _root_.scala.Predef.String = "" + var __destinationDirectory: _root_.scala.Predef.String = "" + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false + while (!_done__) { + val _tag__ = _input__.readTag() + _tag__ match { + case 0 => _done__ = true + case 10 => + __packageDirectory = _input__.readStringRequireUtf8() + case 18 => + __version = _input__.readStringRequireUtf8() + case 26 => + __destinationDirectory = _input__.readStringRequireUtf8() + case tag => + if (_unknownFields__ == null) { + _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder() + } + _unknownFields__.parseField(tag, _input__) + } + } + pulumirpc.language.PackRequest( + packageDirectory = __packageDirectory, + version = __version, + destinationDirectory = __destinationDirectory, + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() + ) + } + implicit def messageReads: _root_.scalapb.descriptors.Reads[pulumirpc.language.PackRequest] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + pulumirpc.language.PackRequest( + packageDirectory = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + version = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + destinationDirectory = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.scala.Predef.String]).getOrElse("") + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = LanguageProto.javaDescriptor.getMessageTypes().get(19) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = LanguageProto.scalaDescriptor.messages(19) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number) + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + lazy val defaultInstance = pulumirpc.language.PackRequest( + packageDirectory = "", + version = "", + destinationDirectory = "" + ) + implicit class PackRequestLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.language.PackRequest]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, pulumirpc.language.PackRequest](_l) { + def packageDirectory: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.packageDirectory)((c_, f_) => c_.copy(packageDirectory = f_)) + def version: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.version)((c_, f_) => c_.copy(version = f_)) + def destinationDirectory: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.destinationDirectory)((c_, f_) => c_.copy(destinationDirectory = f_)) + } + final val PACKAGE_DIRECTORY_FIELD_NUMBER = 1 + final val VERSION_FIELD_NUMBER = 2 + final val DESTINATION_DIRECTORY_FIELD_NUMBER = 3 + def of( + packageDirectory: _root_.scala.Predef.String, + version: _root_.scala.Predef.String, + destinationDirectory: _root_.scala.Predef.String + ): _root_.pulumirpc.language.PackRequest = _root_.pulumirpc.language.PackRequest( + packageDirectory, + version, + destinationDirectory + ) + // @@protoc_insertion_point(GeneratedMessageCompanion[pulumirpc.PackRequest]) +} diff --git a/core/src/main/scala/besom/rpc/pulumirpc/language/PackResponse.scala b/core/src/main/scala/besom/rpc/pulumirpc/language/PackResponse.scala new file mode 100644 index 000000000..48d47ec1c --- /dev/null +++ b/core/src/main/scala/besom/rpc/pulumirpc/language/PackResponse.scala @@ -0,0 +1,120 @@ +// Generated by the Scala Plugin for the Protocol Buffer Compiler. +// Do not edit! +// +// Protofile syntax: PROTO3 + +package pulumirpc.language + +/** @param artifactPath + * the full path of the packed artifact. + */ +@SerialVersionUID(0L) +final case class PackResponse( + artifactPath: _root_.scala.Predef.String = "", + unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[PackResponse] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + + { + val __value = artifactPath + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value) + } + }; + __size += unknownFields.serializedSize + __size + } + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size + } + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + { + val __v = artifactPath + if (!__v.isEmpty) { + _output__.writeString(1, __v) + } + }; + unknownFields.writeTo(_output__) + } + def withArtifactPath(__v: _root_.scala.Predef.String): PackResponse = copy(artifactPath = __v) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => { + val __t = artifactPath + if (__t != "") __t else null + } + } + } + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PString(artifactPath) + } + } + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: pulumirpc.language.PackResponse.type = pulumirpc.language.PackResponse + // @@protoc_insertion_point(GeneratedMessage[pulumirpc.PackResponse]) +} + +object PackResponse extends scalapb.GeneratedMessageCompanion[pulumirpc.language.PackResponse] { + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[pulumirpc.language.PackResponse] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): pulumirpc.language.PackResponse = { + var __artifactPath: _root_.scala.Predef.String = "" + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false + while (!_done__) { + val _tag__ = _input__.readTag() + _tag__ match { + case 0 => _done__ = true + case 10 => + __artifactPath = _input__.readStringRequireUtf8() + case tag => + if (_unknownFields__ == null) { + _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder() + } + _unknownFields__.parseField(tag, _input__) + } + } + pulumirpc.language.PackResponse( + artifactPath = __artifactPath, + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() + ) + } + implicit def messageReads: _root_.scalapb.descriptors.Reads[pulumirpc.language.PackResponse] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + pulumirpc.language.PackResponse( + artifactPath = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse("") + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = LanguageProto.javaDescriptor.getMessageTypes().get(20) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = LanguageProto.scalaDescriptor.messages(20) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number) + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + lazy val defaultInstance = pulumirpc.language.PackResponse( + artifactPath = "" + ) + implicit class PackResponseLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.language.PackResponse]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, pulumirpc.language.PackResponse](_l) { + def artifactPath: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.artifactPath)((c_, f_) => c_.copy(artifactPath = f_)) + } + final val ARTIFACT_PATH_FIELD_NUMBER = 1 + def of( + artifactPath: _root_.scala.Predef.String + ): _root_.pulumirpc.language.PackResponse = _root_.pulumirpc.language.PackResponse( + artifactPath + ) + // @@protoc_insertion_point(GeneratedMessageCompanion[pulumirpc.PackResponse]) +} diff --git a/core/src/main/scala/besom/rpc/pulumirpc/language/ProgramInfo.scala b/core/src/main/scala/besom/rpc/pulumirpc/language/ProgramInfo.scala new file mode 100644 index 000000000..6bcd112e3 --- /dev/null +++ b/core/src/main/scala/besom/rpc/pulumirpc/language/ProgramInfo.scala @@ -0,0 +1,226 @@ +// Generated by the Scala Plugin for the Protocol Buffer Compiler. +// Do not edit! +// +// Protofile syntax: PROTO3 + +package pulumirpc.language + +/** ProgramInfo are the common set of options that a language runtime needs to execute or query a program. This + * is filled in by the engine based on where the `Pulumi.yaml` file was, the `runtime.options` property, and + * the `main` property. + * + * @param rootDirectory + * the root of the project, where the `Pulumi.yaml` file is located. + * @param programDirectory + * the absolute path to the directory of the program to execute. Generally, but not required to be, + * underneath the root directory. + * @param entryPoint + * the entry point of the program, normally '.' meaning to just use the program directory, but can also be + * a filename inside the program directory. How that filename is interpreted, if at all, is language + * specific. + * @param options + * JSON style options from the `Pulumi.yaml` runtime options section. + */ +@SerialVersionUID(0L) +final case class ProgramInfo( + rootDirectory: _root_.scala.Predef.String = "", + programDirectory: _root_.scala.Predef.String = "", + entryPoint: _root_.scala.Predef.String = "", + options: _root_.scala.Option[com.google.protobuf.struct.Struct] = _root_.scala.None, + unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[ProgramInfo] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + + { + val __value = rootDirectory + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value) + } + }; + + { + val __value = programDirectory + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(2, __value) + } + }; + + { + val __value = entryPoint + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(3, __value) + } + }; + if (options.isDefined) { + val __value = options.get + __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize + }; + __size += unknownFields.serializedSize + __size + } + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size + } + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + { + val __v = rootDirectory + if (!__v.isEmpty) { + _output__.writeString(1, __v) + } + }; + { + val __v = programDirectory + if (!__v.isEmpty) { + _output__.writeString(2, __v) + } + }; + { + val __v = entryPoint + if (!__v.isEmpty) { + _output__.writeString(3, __v) + } + }; + options.foreach { __v => + val __m = __v + _output__.writeTag(4, 2) + _output__.writeUInt32NoTag(__m.serializedSize) + __m.writeTo(_output__) + }; + unknownFields.writeTo(_output__) + } + def withRootDirectory(__v: _root_.scala.Predef.String): ProgramInfo = copy(rootDirectory = __v) + def withProgramDirectory(__v: _root_.scala.Predef.String): ProgramInfo = copy(programDirectory = __v) + def withEntryPoint(__v: _root_.scala.Predef.String): ProgramInfo = copy(entryPoint = __v) + def getOptions: com.google.protobuf.struct.Struct = options.getOrElse(com.google.protobuf.struct.Struct.defaultInstance) + def clearOptions: ProgramInfo = copy(options = _root_.scala.None) + def withOptions(__v: com.google.protobuf.struct.Struct): ProgramInfo = copy(options = Option(__v)) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => { + val __t = rootDirectory + if (__t != "") __t else null + } + case 2 => { + val __t = programDirectory + if (__t != "") __t else null + } + case 3 => { + val __t = entryPoint + if (__t != "") __t else null + } + case 4 => options.orNull + } + } + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PString(rootDirectory) + case 2 => _root_.scalapb.descriptors.PString(programDirectory) + case 3 => _root_.scalapb.descriptors.PString(entryPoint) + case 4 => options.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty) + } + } + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: pulumirpc.language.ProgramInfo.type = pulumirpc.language.ProgramInfo + // @@protoc_insertion_point(GeneratedMessage[pulumirpc.ProgramInfo]) +} + +object ProgramInfo extends scalapb.GeneratedMessageCompanion[pulumirpc.language.ProgramInfo] { + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[pulumirpc.language.ProgramInfo] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): pulumirpc.language.ProgramInfo = { + var __rootDirectory: _root_.scala.Predef.String = "" + var __programDirectory: _root_.scala.Predef.String = "" + var __entryPoint: _root_.scala.Predef.String = "" + var __options: _root_.scala.Option[com.google.protobuf.struct.Struct] = _root_.scala.None + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false + while (!_done__) { + val _tag__ = _input__.readTag() + _tag__ match { + case 0 => _done__ = true + case 10 => + __rootDirectory = _input__.readStringRequireUtf8() + case 18 => + __programDirectory = _input__.readStringRequireUtf8() + case 26 => + __entryPoint = _input__.readStringRequireUtf8() + case 34 => + __options = Option(__options.fold(_root_.scalapb.LiteParser.readMessage[com.google.protobuf.struct.Struct](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _))) + case tag => + if (_unknownFields__ == null) { + _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder() + } + _unknownFields__.parseField(tag, _input__) + } + } + pulumirpc.language.ProgramInfo( + rootDirectory = __rootDirectory, + programDirectory = __programDirectory, + entryPoint = __entryPoint, + options = __options, + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() + ) + } + implicit def messageReads: _root_.scalapb.descriptors.Reads[pulumirpc.language.ProgramInfo] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + pulumirpc.language.ProgramInfo( + rootDirectory = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + programDirectory = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + entryPoint = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + options = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).flatMap(_.as[_root_.scala.Option[com.google.protobuf.struct.Struct]]) + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = LanguageProto.javaDescriptor.getMessageTypes().get(0) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = LanguageProto.scalaDescriptor.messages(0) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = { + var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null + (__number: @_root_.scala.unchecked) match { + case 4 => __out = com.google.protobuf.struct.Struct + } + __out + } + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + lazy val defaultInstance = pulumirpc.language.ProgramInfo( + rootDirectory = "", + programDirectory = "", + entryPoint = "", + options = _root_.scala.None + ) + implicit class ProgramInfoLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.language.ProgramInfo]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, pulumirpc.language.ProgramInfo](_l) { + def rootDirectory: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.rootDirectory)((c_, f_) => c_.copy(rootDirectory = f_)) + def programDirectory: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.programDirectory)((c_, f_) => c_.copy(programDirectory = f_)) + def entryPoint: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.entryPoint)((c_, f_) => c_.copy(entryPoint = f_)) + def options: _root_.scalapb.lenses.Lens[UpperPB, com.google.protobuf.struct.Struct] = field(_.getOptions)((c_, f_) => c_.copy(options = Option(f_))) + def optionalOptions: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[com.google.protobuf.struct.Struct]] = field(_.options)((c_, f_) => c_.copy(options = f_)) + } + final val ROOT_DIRECTORY_FIELD_NUMBER = 1 + final val PROGRAM_DIRECTORY_FIELD_NUMBER = 2 + final val ENTRY_POINT_FIELD_NUMBER = 3 + final val OPTIONS_FIELD_NUMBER = 4 + def of( + rootDirectory: _root_.scala.Predef.String, + programDirectory: _root_.scala.Predef.String, + entryPoint: _root_.scala.Predef.String, + options: _root_.scala.Option[com.google.protobuf.struct.Struct] + ): _root_.pulumirpc.language.ProgramInfo = _root_.pulumirpc.language.ProgramInfo( + rootDirectory, + programDirectory, + entryPoint, + options + ) + // @@protoc_insertion_point(GeneratedMessageCompanion[pulumirpc.ProgramInfo]) +} diff --git a/core/src/main/scala/besom/rpc/pulumirpc/language/RunPluginRequest.scala b/core/src/main/scala/besom/rpc/pulumirpc/language/RunPluginRequest.scala new file mode 100644 index 000000000..1f49c383a --- /dev/null +++ b/core/src/main/scala/besom/rpc/pulumirpc/language/RunPluginRequest.scala @@ -0,0 +1,241 @@ +// Generated by the Scala Plugin for the Protocol Buffer Compiler. +// Do not edit! +// +// Protofile syntax: PROTO3 + +package pulumirpc.language + +/** @param pwd + * the program's working directory. + * @param program + * the path to the program to execute. + * @param args + * any arguments to pass to the program. + * @param env + * any environment variables to set as part of the program. + * @param info + * the program info to use to execute the plugin. + */ +@SerialVersionUID(0L) +final case class RunPluginRequest( + pwd: _root_.scala.Predef.String = "", + @scala.deprecated(message="Marked as deprecated in proto file", "") program: _root_.scala.Predef.String = "", + args: _root_.scala.Seq[_root_.scala.Predef.String] = _root_.scala.Seq.empty, + env: _root_.scala.Seq[_root_.scala.Predef.String] = _root_.scala.Seq.empty, + info: _root_.scala.Option[pulumirpc.language.ProgramInfo] = _root_.scala.None, + unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[RunPluginRequest] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + + { + val __value = pwd + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value) + } + }; + + { + val __value = program + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(2, __value) + } + }; + args.foreach { __item => + val __value = __item + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(3, __value) + } + env.foreach { __item => + val __value = __item + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(4, __value) + } + if (info.isDefined) { + val __value = info.get + __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize + }; + __size += unknownFields.serializedSize + __size + } + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size + } + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + { + val __v = pwd + if (!__v.isEmpty) { + _output__.writeString(1, __v) + } + }; + { + val __v = program + if (!__v.isEmpty) { + _output__.writeString(2, __v) + } + }; + args.foreach { __v => + val __m = __v + _output__.writeString(3, __m) + }; + env.foreach { __v => + val __m = __v + _output__.writeString(4, __m) + }; + info.foreach { __v => + val __m = __v + _output__.writeTag(5, 2) + _output__.writeUInt32NoTag(__m.serializedSize) + __m.writeTo(_output__) + }; + unknownFields.writeTo(_output__) + } + def withPwd(__v: _root_.scala.Predef.String): RunPluginRequest = copy(pwd = __v) + def withProgram(__v: _root_.scala.Predef.String): RunPluginRequest = copy(program = __v) + def clearArgs = copy(args = _root_.scala.Seq.empty) + def addArgs(__vs: _root_.scala.Predef.String *): RunPluginRequest = addAllArgs(__vs) + def addAllArgs(__vs: Iterable[_root_.scala.Predef.String]): RunPluginRequest = copy(args = args ++ __vs) + def withArgs(__v: _root_.scala.Seq[_root_.scala.Predef.String]): RunPluginRequest = copy(args = __v) + def clearEnv = copy(env = _root_.scala.Seq.empty) + def addEnv(__vs: _root_.scala.Predef.String *): RunPluginRequest = addAllEnv(__vs) + def addAllEnv(__vs: Iterable[_root_.scala.Predef.String]): RunPluginRequest = copy(env = env ++ __vs) + def withEnv(__v: _root_.scala.Seq[_root_.scala.Predef.String]): RunPluginRequest = copy(env = __v) + def getInfo: pulumirpc.language.ProgramInfo = info.getOrElse(pulumirpc.language.ProgramInfo.defaultInstance) + def clearInfo: RunPluginRequest = copy(info = _root_.scala.None) + def withInfo(__v: pulumirpc.language.ProgramInfo): RunPluginRequest = copy(info = Option(__v)) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => { + val __t = pwd + if (__t != "") __t else null + } + case 2 => { + val __t = program + if (__t != "") __t else null + } + case 3 => args + case 4 => env + case 5 => info.orNull + } + } + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PString(pwd) + case 2 => _root_.scalapb.descriptors.PString(program) + case 3 => _root_.scalapb.descriptors.PRepeated(args.iterator.map(_root_.scalapb.descriptors.PString(_)).toVector) + case 4 => _root_.scalapb.descriptors.PRepeated(env.iterator.map(_root_.scalapb.descriptors.PString(_)).toVector) + case 5 => info.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty) + } + } + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: pulumirpc.language.RunPluginRequest.type = pulumirpc.language.RunPluginRequest + // @@protoc_insertion_point(GeneratedMessage[pulumirpc.RunPluginRequest]) +} + +object RunPluginRequest extends scalapb.GeneratedMessageCompanion[pulumirpc.language.RunPluginRequest] { + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[pulumirpc.language.RunPluginRequest] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): pulumirpc.language.RunPluginRequest = { + var __pwd: _root_.scala.Predef.String = "" + var __program: _root_.scala.Predef.String = "" + val __args: _root_.scala.collection.immutable.VectorBuilder[_root_.scala.Predef.String] = new _root_.scala.collection.immutable.VectorBuilder[_root_.scala.Predef.String] + val __env: _root_.scala.collection.immutable.VectorBuilder[_root_.scala.Predef.String] = new _root_.scala.collection.immutable.VectorBuilder[_root_.scala.Predef.String] + var __info: _root_.scala.Option[pulumirpc.language.ProgramInfo] = _root_.scala.None + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false + while (!_done__) { + val _tag__ = _input__.readTag() + _tag__ match { + case 0 => _done__ = true + case 10 => + __pwd = _input__.readStringRequireUtf8() + case 18 => + __program = _input__.readStringRequireUtf8() + case 26 => + __args += _input__.readStringRequireUtf8() + case 34 => + __env += _input__.readStringRequireUtf8() + case 42 => + __info = Option(__info.fold(_root_.scalapb.LiteParser.readMessage[pulumirpc.language.ProgramInfo](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _))) + case tag => + if (_unknownFields__ == null) { + _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder() + } + _unknownFields__.parseField(tag, _input__) + } + } + pulumirpc.language.RunPluginRequest( + pwd = __pwd, + program = __program, + args = __args.result(), + env = __env.result(), + info = __info, + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() + ) + } + implicit def messageReads: _root_.scalapb.descriptors.Reads[pulumirpc.language.RunPluginRequest] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + pulumirpc.language.RunPluginRequest( + pwd = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + program = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + args = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.scala.Seq[_root_.scala.Predef.String]]).getOrElse(_root_.scala.Seq.empty), + env = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).map(_.as[_root_.scala.Seq[_root_.scala.Predef.String]]).getOrElse(_root_.scala.Seq.empty), + info = __fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).flatMap(_.as[_root_.scala.Option[pulumirpc.language.ProgramInfo]]) + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = LanguageProto.javaDescriptor.getMessageTypes().get(11) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = LanguageProto.scalaDescriptor.messages(11) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = { + var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null + (__number: @_root_.scala.unchecked) match { + case 5 => __out = pulumirpc.language.ProgramInfo + } + __out + } + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + lazy val defaultInstance = pulumirpc.language.RunPluginRequest( + pwd = "", + program = "", + args = _root_.scala.Seq.empty, + env = _root_.scala.Seq.empty, + info = _root_.scala.None + ) + implicit class RunPluginRequestLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.language.RunPluginRequest]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, pulumirpc.language.RunPluginRequest](_l) { + def pwd: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.pwd)((c_, f_) => c_.copy(pwd = f_)) + def program: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.program)((c_, f_) => c_.copy(program = f_)) + def args: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[_root_.scala.Predef.String]] = field(_.args)((c_, f_) => c_.copy(args = f_)) + def env: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[_root_.scala.Predef.String]] = field(_.env)((c_, f_) => c_.copy(env = f_)) + def info: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.language.ProgramInfo] = field(_.getInfo)((c_, f_) => c_.copy(info = Option(f_))) + def optionalInfo: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[pulumirpc.language.ProgramInfo]] = field(_.info)((c_, f_) => c_.copy(info = f_)) + } + final val PWD_FIELD_NUMBER = 1 + final val PROGRAM_FIELD_NUMBER = 2 + final val ARGS_FIELD_NUMBER = 3 + final val ENV_FIELD_NUMBER = 4 + final val INFO_FIELD_NUMBER = 5 + def of( + pwd: _root_.scala.Predef.String, + program: _root_.scala.Predef.String, + args: _root_.scala.Seq[_root_.scala.Predef.String], + env: _root_.scala.Seq[_root_.scala.Predef.String], + info: _root_.scala.Option[pulumirpc.language.ProgramInfo] + ): _root_.pulumirpc.language.RunPluginRequest = _root_.pulumirpc.language.RunPluginRequest( + pwd, + program, + args, + env, + info + ) + // @@protoc_insertion_point(GeneratedMessageCompanion[pulumirpc.RunPluginRequest]) +} diff --git a/core/src/main/scala/besom/rpc/pulumirpc/language/RunPluginResponse.scala b/core/src/main/scala/besom/rpc/pulumirpc/language/RunPluginResponse.scala new file mode 100644 index 000000000..e2b08705e --- /dev/null +++ b/core/src/main/scala/besom/rpc/pulumirpc/language/RunPluginResponse.scala @@ -0,0 +1,190 @@ +// Generated by the Scala Plugin for the Protocol Buffer Compiler. +// Do not edit! +// +// Protofile syntax: PROTO3 + +package pulumirpc.language + +@SerialVersionUID(0L) +final case class RunPluginResponse( + output: pulumirpc.language.RunPluginResponse.Output = pulumirpc.language.RunPluginResponse.Output.Empty, + unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[RunPluginResponse] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + if (output.stdout.isDefined) { + val __value = output.stdout.get + __size += _root_.com.google.protobuf.CodedOutputStream.computeBytesSize(1, __value) + }; + if (output.stderr.isDefined) { + val __value = output.stderr.get + __size += _root_.com.google.protobuf.CodedOutputStream.computeBytesSize(2, __value) + }; + if (output.exitcode.isDefined) { + val __value = output.exitcode.get + __size += _root_.com.google.protobuf.CodedOutputStream.computeInt32Size(3, __value) + }; + __size += unknownFields.serializedSize + __size + } + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size + } + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + output.stdout.foreach { __v => + val __m = __v + _output__.writeBytes(1, __m) + }; + output.stderr.foreach { __v => + val __m = __v + _output__.writeBytes(2, __m) + }; + output.exitcode.foreach { __v => + val __m = __v + _output__.writeInt32(3, __m) + }; + unknownFields.writeTo(_output__) + } + def getStdout: _root_.com.google.protobuf.ByteString = output.stdout.getOrElse(_root_.com.google.protobuf.ByteString.EMPTY) + def withStdout(__v: _root_.com.google.protobuf.ByteString): RunPluginResponse = copy(output = pulumirpc.language.RunPluginResponse.Output.Stdout(__v)) + def getStderr: _root_.com.google.protobuf.ByteString = output.stderr.getOrElse(_root_.com.google.protobuf.ByteString.EMPTY) + def withStderr(__v: _root_.com.google.protobuf.ByteString): RunPluginResponse = copy(output = pulumirpc.language.RunPluginResponse.Output.Stderr(__v)) + def getExitcode: _root_.scala.Int = output.exitcode.getOrElse(0) + def withExitcode(__v: _root_.scala.Int): RunPluginResponse = copy(output = pulumirpc.language.RunPluginResponse.Output.Exitcode(__v)) + def clearOutput: RunPluginResponse = copy(output = pulumirpc.language.RunPluginResponse.Output.Empty) + def withOutput(__v: pulumirpc.language.RunPluginResponse.Output): RunPluginResponse = copy(output = __v) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => output.stdout.orNull + case 2 => output.stderr.orNull + case 3 => output.exitcode.orNull + } + } + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => output.stdout.map(_root_.scalapb.descriptors.PByteString(_)).getOrElse(_root_.scalapb.descriptors.PEmpty) + case 2 => output.stderr.map(_root_.scalapb.descriptors.PByteString(_)).getOrElse(_root_.scalapb.descriptors.PEmpty) + case 3 => output.exitcode.map(_root_.scalapb.descriptors.PInt(_)).getOrElse(_root_.scalapb.descriptors.PEmpty) + } + } + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: pulumirpc.language.RunPluginResponse.type = pulumirpc.language.RunPluginResponse + // @@protoc_insertion_point(GeneratedMessage[pulumirpc.RunPluginResponse]) +} + +object RunPluginResponse extends scalapb.GeneratedMessageCompanion[pulumirpc.language.RunPluginResponse] { + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[pulumirpc.language.RunPluginResponse] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): pulumirpc.language.RunPluginResponse = { + var __output: pulumirpc.language.RunPluginResponse.Output = pulumirpc.language.RunPluginResponse.Output.Empty + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false + while (!_done__) { + val _tag__ = _input__.readTag() + _tag__ match { + case 0 => _done__ = true + case 10 => + __output = pulumirpc.language.RunPluginResponse.Output.Stdout(_input__.readBytes()) + case 18 => + __output = pulumirpc.language.RunPluginResponse.Output.Stderr(_input__.readBytes()) + case 24 => + __output = pulumirpc.language.RunPluginResponse.Output.Exitcode(_input__.readInt32()) + case tag => + if (_unknownFields__ == null) { + _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder() + } + _unknownFields__.parseField(tag, _input__) + } + } + pulumirpc.language.RunPluginResponse( + output = __output, + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() + ) + } + implicit def messageReads: _root_.scalapb.descriptors.Reads[pulumirpc.language.RunPluginResponse] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + pulumirpc.language.RunPluginResponse( + output = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).flatMap(_.as[_root_.scala.Option[_root_.com.google.protobuf.ByteString]]).map(pulumirpc.language.RunPluginResponse.Output.Stdout(_)) + .orElse[pulumirpc.language.RunPluginResponse.Output](__fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).flatMap(_.as[_root_.scala.Option[_root_.com.google.protobuf.ByteString]]).map(pulumirpc.language.RunPluginResponse.Output.Stderr(_))) + .orElse[pulumirpc.language.RunPluginResponse.Output](__fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).flatMap(_.as[_root_.scala.Option[_root_.scala.Int]]).map(pulumirpc.language.RunPluginResponse.Output.Exitcode(_))) + .getOrElse(pulumirpc.language.RunPluginResponse.Output.Empty) + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = LanguageProto.javaDescriptor.getMessageTypes().get(12) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = LanguageProto.scalaDescriptor.messages(12) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number) + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + lazy val defaultInstance = pulumirpc.language.RunPluginResponse( + output = pulumirpc.language.RunPluginResponse.Output.Empty + ) + sealed trait Output extends _root_.scalapb.GeneratedOneof { + def isEmpty: _root_.scala.Boolean = false + def isDefined: _root_.scala.Boolean = true + def isStdout: _root_.scala.Boolean = false + def isStderr: _root_.scala.Boolean = false + def isExitcode: _root_.scala.Boolean = false + def stdout: _root_.scala.Option[_root_.com.google.protobuf.ByteString] = _root_.scala.None + def stderr: _root_.scala.Option[_root_.com.google.protobuf.ByteString] = _root_.scala.None + def exitcode: _root_.scala.Option[_root_.scala.Int] = _root_.scala.None + } + object Output { + @SerialVersionUID(0L) + case object Empty extends pulumirpc.language.RunPluginResponse.Output { + type ValueType = _root_.scala.Nothing + override def isEmpty: _root_.scala.Boolean = true + override def isDefined: _root_.scala.Boolean = false + override def number: _root_.scala.Int = 0 + override def value: _root_.scala.Nothing = throw new java.util.NoSuchElementException("Empty.value") + } + + @SerialVersionUID(0L) + final case class Stdout(value: _root_.com.google.protobuf.ByteString) extends pulumirpc.language.RunPluginResponse.Output { + type ValueType = _root_.com.google.protobuf.ByteString + override def isStdout: _root_.scala.Boolean = true + override def stdout: _root_.scala.Option[_root_.com.google.protobuf.ByteString] = Some(value) + override def number: _root_.scala.Int = 1 + } + @SerialVersionUID(0L) + final case class Stderr(value: _root_.com.google.protobuf.ByteString) extends pulumirpc.language.RunPluginResponse.Output { + type ValueType = _root_.com.google.protobuf.ByteString + override def isStderr: _root_.scala.Boolean = true + override def stderr: _root_.scala.Option[_root_.com.google.protobuf.ByteString] = Some(value) + override def number: _root_.scala.Int = 2 + } + @SerialVersionUID(0L) + final case class Exitcode(value: _root_.scala.Int) extends pulumirpc.language.RunPluginResponse.Output { + type ValueType = _root_.scala.Int + override def isExitcode: _root_.scala.Boolean = true + override def exitcode: _root_.scala.Option[_root_.scala.Int] = Some(value) + override def number: _root_.scala.Int = 3 + } + } + implicit class RunPluginResponseLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.language.RunPluginResponse]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, pulumirpc.language.RunPluginResponse](_l) { + def stdout: _root_.scalapb.lenses.Lens[UpperPB, _root_.com.google.protobuf.ByteString] = field(_.getStdout)((c_, f_) => c_.copy(output = pulumirpc.language.RunPluginResponse.Output.Stdout(f_))) + def stderr: _root_.scalapb.lenses.Lens[UpperPB, _root_.com.google.protobuf.ByteString] = field(_.getStderr)((c_, f_) => c_.copy(output = pulumirpc.language.RunPluginResponse.Output.Stderr(f_))) + def exitcode: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = field(_.getExitcode)((c_, f_) => c_.copy(output = pulumirpc.language.RunPluginResponse.Output.Exitcode(f_))) + def output: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.language.RunPluginResponse.Output] = field(_.output)((c_, f_) => c_.copy(output = f_)) + } + final val STDOUT_FIELD_NUMBER = 1 + final val STDERR_FIELD_NUMBER = 2 + final val EXITCODE_FIELD_NUMBER = 3 + def of( + output: pulumirpc.language.RunPluginResponse.Output + ): _root_.pulumirpc.language.RunPluginResponse = _root_.pulumirpc.language.RunPluginResponse( + output + ) + // @@protoc_insertion_point(GeneratedMessageCompanion[pulumirpc.RunPluginResponse]) +} diff --git a/core/src/main/scala/besom/rpc/pulumirpc/language/RunRequest.scala b/core/src/main/scala/besom/rpc/pulumirpc/language/RunRequest.scala new file mode 100644 index 000000000..7b649c498 --- /dev/null +++ b/core/src/main/scala/besom/rpc/pulumirpc/language/RunRequest.scala @@ -0,0 +1,676 @@ +// Generated by the Scala Plugin for the Protocol Buffer Compiler. +// Do not edit! +// +// Protofile syntax: PROTO3 + +package pulumirpc.language + +/** RunRequest asks the interpreter to execute a program. + * + * @param project + * the project name. + * @param stack + * the name of the stack being deployed into. + * @param pwd + * the program's working directory. + * @param program + * the path to the program to execute. + * @param args + * any arguments to pass to the program. + * @param config + * the configuration variables to apply before running. + * @param dryRun + * true if we're only doing a dryrun (preview). + * @param parallel + * the degree of parallelism for resource operations (<=1 for serial). + * @param monitorAddress + * the address for communicating back to the resource monitor. + * @param queryMode + * true if we're only doing a query. + * @param configSecretKeys + * the configuration keys that have secret values. + * @param organization + * the organization of the stack being deployed into. + * @param configPropertyMap + * the configuration variables to apply before running. + * @param info + * the program info to use to execute the program. + */ +@SerialVersionUID(0L) +final case class RunRequest( + project: _root_.scala.Predef.String = "", + stack: _root_.scala.Predef.String = "", + pwd: _root_.scala.Predef.String = "", + @scala.deprecated(message="Marked as deprecated in proto file", "") program: _root_.scala.Predef.String = "", + args: _root_.scala.Seq[_root_.scala.Predef.String] = _root_.scala.Seq.empty, + config: _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String] = _root_.scala.collection.immutable.Map.empty, + dryRun: _root_.scala.Boolean = false, + parallel: _root_.scala.Int = 0, + monitorAddress: _root_.scala.Predef.String = "", + queryMode: _root_.scala.Boolean = false, + configSecretKeys: _root_.scala.Seq[_root_.scala.Predef.String] = _root_.scala.Seq.empty, + organization: _root_.scala.Predef.String = "", + configPropertyMap: _root_.scala.Option[com.google.protobuf.struct.Struct] = _root_.scala.None, + info: _root_.scala.Option[pulumirpc.language.ProgramInfo] = _root_.scala.None, + unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[RunRequest] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + + { + val __value = project + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value) + } + }; + + { + val __value = stack + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(2, __value) + } + }; + + { + val __value = pwd + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(3, __value) + } + }; + + { + val __value = program + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(4, __value) + } + }; + args.foreach { __item => + val __value = __item + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(5, __value) + } + config.foreach { __item => + val __value = pulumirpc.language.RunRequest._typemapper_config.toBase(__item) + __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize + } + + { + val __value = dryRun + if (__value != false) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeBoolSize(7, __value) + } + }; + + { + val __value = parallel + if (__value != 0) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeInt32Size(8, __value) + } + }; + + { + val __value = monitorAddress + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(9, __value) + } + }; + + { + val __value = queryMode + if (__value != false) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeBoolSize(10, __value) + } + }; + configSecretKeys.foreach { __item => + val __value = __item + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(11, __value) + } + + { + val __value = organization + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(12, __value) + } + }; + if (configPropertyMap.isDefined) { + val __value = configPropertyMap.get + __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize + }; + if (info.isDefined) { + val __value = info.get + __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize + }; + __size += unknownFields.serializedSize + __size + } + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size + } + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + { + val __v = project + if (!__v.isEmpty) { + _output__.writeString(1, __v) + } + }; + { + val __v = stack + if (!__v.isEmpty) { + _output__.writeString(2, __v) + } + }; + { + val __v = pwd + if (!__v.isEmpty) { + _output__.writeString(3, __v) + } + }; + { + val __v = program + if (!__v.isEmpty) { + _output__.writeString(4, __v) + } + }; + args.foreach { __v => + val __m = __v + _output__.writeString(5, __m) + }; + config.foreach { __v => + val __m = pulumirpc.language.RunRequest._typemapper_config.toBase(__v) + _output__.writeTag(6, 2) + _output__.writeUInt32NoTag(__m.serializedSize) + __m.writeTo(_output__) + }; + { + val __v = dryRun + if (__v != false) { + _output__.writeBool(7, __v) + } + }; + { + val __v = parallel + if (__v != 0) { + _output__.writeInt32(8, __v) + } + }; + { + val __v = monitorAddress + if (!__v.isEmpty) { + _output__.writeString(9, __v) + } + }; + { + val __v = queryMode + if (__v != false) { + _output__.writeBool(10, __v) + } + }; + configSecretKeys.foreach { __v => + val __m = __v + _output__.writeString(11, __m) + }; + { + val __v = organization + if (!__v.isEmpty) { + _output__.writeString(12, __v) + } + }; + configPropertyMap.foreach { __v => + val __m = __v + _output__.writeTag(13, 2) + _output__.writeUInt32NoTag(__m.serializedSize) + __m.writeTo(_output__) + }; + info.foreach { __v => + val __m = __v + _output__.writeTag(14, 2) + _output__.writeUInt32NoTag(__m.serializedSize) + __m.writeTo(_output__) + }; + unknownFields.writeTo(_output__) + } + def withProject(__v: _root_.scala.Predef.String): RunRequest = copy(project = __v) + def withStack(__v: _root_.scala.Predef.String): RunRequest = copy(stack = __v) + def withPwd(__v: _root_.scala.Predef.String): RunRequest = copy(pwd = __v) + def withProgram(__v: _root_.scala.Predef.String): RunRequest = copy(program = __v) + def clearArgs = copy(args = _root_.scala.Seq.empty) + def addArgs(__vs: _root_.scala.Predef.String *): RunRequest = addAllArgs(__vs) + def addAllArgs(__vs: Iterable[_root_.scala.Predef.String]): RunRequest = copy(args = args ++ __vs) + def withArgs(__v: _root_.scala.Seq[_root_.scala.Predef.String]): RunRequest = copy(args = __v) + def clearConfig = copy(config = _root_.scala.collection.immutable.Map.empty) + def addConfig(__vs: (_root_.scala.Predef.String, _root_.scala.Predef.String) *): RunRequest = addAllConfig(__vs) + def addAllConfig(__vs: Iterable[(_root_.scala.Predef.String, _root_.scala.Predef.String)]): RunRequest = copy(config = config ++ __vs) + def withConfig(__v: _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String]): RunRequest = copy(config = __v) + def withDryRun(__v: _root_.scala.Boolean): RunRequest = copy(dryRun = __v) + def withParallel(__v: _root_.scala.Int): RunRequest = copy(parallel = __v) + def withMonitorAddress(__v: _root_.scala.Predef.String): RunRequest = copy(monitorAddress = __v) + def withQueryMode(__v: _root_.scala.Boolean): RunRequest = copy(queryMode = __v) + def clearConfigSecretKeys = copy(configSecretKeys = _root_.scala.Seq.empty) + def addConfigSecretKeys(__vs: _root_.scala.Predef.String *): RunRequest = addAllConfigSecretKeys(__vs) + def addAllConfigSecretKeys(__vs: Iterable[_root_.scala.Predef.String]): RunRequest = copy(configSecretKeys = configSecretKeys ++ __vs) + def withConfigSecretKeys(__v: _root_.scala.Seq[_root_.scala.Predef.String]): RunRequest = copy(configSecretKeys = __v) + def withOrganization(__v: _root_.scala.Predef.String): RunRequest = copy(organization = __v) + def getConfigPropertyMap: com.google.protobuf.struct.Struct = configPropertyMap.getOrElse(com.google.protobuf.struct.Struct.defaultInstance) + def clearConfigPropertyMap: RunRequest = copy(configPropertyMap = _root_.scala.None) + def withConfigPropertyMap(__v: com.google.protobuf.struct.Struct): RunRequest = copy(configPropertyMap = Option(__v)) + def getInfo: pulumirpc.language.ProgramInfo = info.getOrElse(pulumirpc.language.ProgramInfo.defaultInstance) + def clearInfo: RunRequest = copy(info = _root_.scala.None) + def withInfo(__v: pulumirpc.language.ProgramInfo): RunRequest = copy(info = Option(__v)) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => { + val __t = project + if (__t != "") __t else null + } + case 2 => { + val __t = stack + if (__t != "") __t else null + } + case 3 => { + val __t = pwd + if (__t != "") __t else null + } + case 4 => { + val __t = program + if (__t != "") __t else null + } + case 5 => args + case 6 => config.iterator.map(pulumirpc.language.RunRequest._typemapper_config.toBase(_)).toSeq + case 7 => { + val __t = dryRun + if (__t != false) __t else null + } + case 8 => { + val __t = parallel + if (__t != 0) __t else null + } + case 9 => { + val __t = monitorAddress + if (__t != "") __t else null + } + case 10 => { + val __t = queryMode + if (__t != false) __t else null + } + case 11 => configSecretKeys + case 12 => { + val __t = organization + if (__t != "") __t else null + } + case 13 => configPropertyMap.orNull + case 14 => info.orNull + } + } + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PString(project) + case 2 => _root_.scalapb.descriptors.PString(stack) + case 3 => _root_.scalapb.descriptors.PString(pwd) + case 4 => _root_.scalapb.descriptors.PString(program) + case 5 => _root_.scalapb.descriptors.PRepeated(args.iterator.map(_root_.scalapb.descriptors.PString(_)).toVector) + case 6 => _root_.scalapb.descriptors.PRepeated(config.iterator.map(pulumirpc.language.RunRequest._typemapper_config.toBase(_).toPMessage).toVector) + case 7 => _root_.scalapb.descriptors.PBoolean(dryRun) + case 8 => _root_.scalapb.descriptors.PInt(parallel) + case 9 => _root_.scalapb.descriptors.PString(monitorAddress) + case 10 => _root_.scalapb.descriptors.PBoolean(queryMode) + case 11 => _root_.scalapb.descriptors.PRepeated(configSecretKeys.iterator.map(_root_.scalapb.descriptors.PString(_)).toVector) + case 12 => _root_.scalapb.descriptors.PString(organization) + case 13 => configPropertyMap.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty) + case 14 => info.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty) + } + } + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: pulumirpc.language.RunRequest.type = pulumirpc.language.RunRequest + // @@protoc_insertion_point(GeneratedMessage[pulumirpc.RunRequest]) +} + +object RunRequest extends scalapb.GeneratedMessageCompanion[pulumirpc.language.RunRequest] { + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[pulumirpc.language.RunRequest] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): pulumirpc.language.RunRequest = { + var __project: _root_.scala.Predef.String = "" + var __stack: _root_.scala.Predef.String = "" + var __pwd: _root_.scala.Predef.String = "" + var __program: _root_.scala.Predef.String = "" + val __args: _root_.scala.collection.immutable.VectorBuilder[_root_.scala.Predef.String] = new _root_.scala.collection.immutable.VectorBuilder[_root_.scala.Predef.String] + val __config: _root_.scala.collection.mutable.Builder[(_root_.scala.Predef.String, _root_.scala.Predef.String), _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String]] = _root_.scala.collection.immutable.Map.newBuilder[_root_.scala.Predef.String, _root_.scala.Predef.String] + var __dryRun: _root_.scala.Boolean = false + var __parallel: _root_.scala.Int = 0 + var __monitorAddress: _root_.scala.Predef.String = "" + var __queryMode: _root_.scala.Boolean = false + val __configSecretKeys: _root_.scala.collection.immutable.VectorBuilder[_root_.scala.Predef.String] = new _root_.scala.collection.immutable.VectorBuilder[_root_.scala.Predef.String] + var __organization: _root_.scala.Predef.String = "" + var __configPropertyMap: _root_.scala.Option[com.google.protobuf.struct.Struct] = _root_.scala.None + var __info: _root_.scala.Option[pulumirpc.language.ProgramInfo] = _root_.scala.None + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false + while (!_done__) { + val _tag__ = _input__.readTag() + _tag__ match { + case 0 => _done__ = true + case 10 => + __project = _input__.readStringRequireUtf8() + case 18 => + __stack = _input__.readStringRequireUtf8() + case 26 => + __pwd = _input__.readStringRequireUtf8() + case 34 => + __program = _input__.readStringRequireUtf8() + case 42 => + __args += _input__.readStringRequireUtf8() + case 50 => + __config += pulumirpc.language.RunRequest._typemapper_config.toCustom(_root_.scalapb.LiteParser.readMessage[pulumirpc.language.RunRequest.ConfigEntry](_input__)) + case 56 => + __dryRun = _input__.readBool() + case 64 => + __parallel = _input__.readInt32() + case 74 => + __monitorAddress = _input__.readStringRequireUtf8() + case 80 => + __queryMode = _input__.readBool() + case 90 => + __configSecretKeys += _input__.readStringRequireUtf8() + case 98 => + __organization = _input__.readStringRequireUtf8() + case 106 => + __configPropertyMap = Option(__configPropertyMap.fold(_root_.scalapb.LiteParser.readMessage[com.google.protobuf.struct.Struct](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _))) + case 114 => + __info = Option(__info.fold(_root_.scalapb.LiteParser.readMessage[pulumirpc.language.ProgramInfo](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _))) + case tag => + if (_unknownFields__ == null) { + _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder() + } + _unknownFields__.parseField(tag, _input__) + } + } + pulumirpc.language.RunRequest( + project = __project, + stack = __stack, + pwd = __pwd, + program = __program, + args = __args.result(), + config = __config.result(), + dryRun = __dryRun, + parallel = __parallel, + monitorAddress = __monitorAddress, + queryMode = __queryMode, + configSecretKeys = __configSecretKeys.result(), + organization = __organization, + configPropertyMap = __configPropertyMap, + info = __info, + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() + ) + } + implicit def messageReads: _root_.scalapb.descriptors.Reads[pulumirpc.language.RunRequest] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + pulumirpc.language.RunRequest( + project = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + stack = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + pwd = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + program = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + args = __fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).map(_.as[_root_.scala.Seq[_root_.scala.Predef.String]]).getOrElse(_root_.scala.Seq.empty), + config = __fieldsMap.get(scalaDescriptor.findFieldByNumber(6).get).map(_.as[_root_.scala.Seq[pulumirpc.language.RunRequest.ConfigEntry]]).getOrElse(_root_.scala.Seq.empty).iterator.map(pulumirpc.language.RunRequest._typemapper_config.toCustom(_)).toMap, + dryRun = __fieldsMap.get(scalaDescriptor.findFieldByNumber(7).get).map(_.as[_root_.scala.Boolean]).getOrElse(false), + parallel = __fieldsMap.get(scalaDescriptor.findFieldByNumber(8).get).map(_.as[_root_.scala.Int]).getOrElse(0), + monitorAddress = __fieldsMap.get(scalaDescriptor.findFieldByNumber(9).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + queryMode = __fieldsMap.get(scalaDescriptor.findFieldByNumber(10).get).map(_.as[_root_.scala.Boolean]).getOrElse(false), + configSecretKeys = __fieldsMap.get(scalaDescriptor.findFieldByNumber(11).get).map(_.as[_root_.scala.Seq[_root_.scala.Predef.String]]).getOrElse(_root_.scala.Seq.empty), + organization = __fieldsMap.get(scalaDescriptor.findFieldByNumber(12).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + configPropertyMap = __fieldsMap.get(scalaDescriptor.findFieldByNumber(13).get).flatMap(_.as[_root_.scala.Option[com.google.protobuf.struct.Struct]]), + info = __fieldsMap.get(scalaDescriptor.findFieldByNumber(14).get).flatMap(_.as[_root_.scala.Option[pulumirpc.language.ProgramInfo]]) + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = LanguageProto.javaDescriptor.getMessageTypes().get(7) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = LanguageProto.scalaDescriptor.messages(7) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = { + var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null + (__number: @_root_.scala.unchecked) match { + case 6 => __out = pulumirpc.language.RunRequest.ConfigEntry + case 13 => __out = com.google.protobuf.struct.Struct + case 14 => __out = pulumirpc.language.ProgramInfo + } + __out + } + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = + Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]]( + _root_.pulumirpc.language.RunRequest.ConfigEntry + ) + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + lazy val defaultInstance = pulumirpc.language.RunRequest( + project = "", + stack = "", + pwd = "", + program = "", + args = _root_.scala.Seq.empty, + config = _root_.scala.collection.immutable.Map.empty, + dryRun = false, + parallel = 0, + monitorAddress = "", + queryMode = false, + configSecretKeys = _root_.scala.Seq.empty, + organization = "", + configPropertyMap = _root_.scala.None, + info = _root_.scala.None + ) + @SerialVersionUID(0L) + final case class ConfigEntry( + key: _root_.scala.Predef.String = "", + value: _root_.scala.Predef.String = "", + unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[ConfigEntry] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + + { + val __value = key + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value) + } + }; + + { + val __value = value + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(2, __value) + } + }; + __size += unknownFields.serializedSize + __size + } + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size + } + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + { + val __v = key + if (!__v.isEmpty) { + _output__.writeString(1, __v) + } + }; + { + val __v = value + if (!__v.isEmpty) { + _output__.writeString(2, __v) + } + }; + unknownFields.writeTo(_output__) + } + def withKey(__v: _root_.scala.Predef.String): ConfigEntry = copy(key = __v) + def withValue(__v: _root_.scala.Predef.String): ConfigEntry = copy(value = __v) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => { + val __t = key + if (__t != "") __t else null + } + case 2 => { + val __t = value + if (__t != "") __t else null + } + } + } + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PString(key) + case 2 => _root_.scalapb.descriptors.PString(value) + } + } + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: pulumirpc.language.RunRequest.ConfigEntry.type = pulumirpc.language.RunRequest.ConfigEntry + // @@protoc_insertion_point(GeneratedMessage[pulumirpc.RunRequest.ConfigEntry]) + } + + object ConfigEntry extends scalapb.GeneratedMessageCompanion[pulumirpc.language.RunRequest.ConfigEntry] { + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[pulumirpc.language.RunRequest.ConfigEntry] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): pulumirpc.language.RunRequest.ConfigEntry = { + var __key: _root_.scala.Predef.String = "" + var __value: _root_.scala.Predef.String = "" + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false + while (!_done__) { + val _tag__ = _input__.readTag() + _tag__ match { + case 0 => _done__ = true + case 10 => + __key = _input__.readStringRequireUtf8() + case 18 => + __value = _input__.readStringRequireUtf8() + case tag => + if (_unknownFields__ == null) { + _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder() + } + _unknownFields__.parseField(tag, _input__) + } + } + pulumirpc.language.RunRequest.ConfigEntry( + key = __key, + value = __value, + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() + ) + } + implicit def messageReads: _root_.scalapb.descriptors.Reads[pulumirpc.language.RunRequest.ConfigEntry] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + pulumirpc.language.RunRequest.ConfigEntry( + key = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + value = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Predef.String]).getOrElse("") + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = pulumirpc.language.RunRequest.javaDescriptor.getNestedTypes().get(0) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = pulumirpc.language.RunRequest.scalaDescriptor.nestedMessages(0) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number) + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + lazy val defaultInstance = pulumirpc.language.RunRequest.ConfigEntry( + key = "", + value = "" + ) + implicit class ConfigEntryLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.language.RunRequest.ConfigEntry]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, pulumirpc.language.RunRequest.ConfigEntry](_l) { + def key: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.key)((c_, f_) => c_.copy(key = f_)) + def value: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.value)((c_, f_) => c_.copy(value = f_)) + } + final val KEY_FIELD_NUMBER = 1 + final val VALUE_FIELD_NUMBER = 2 + @transient + implicit val keyValueMapper: _root_.scalapb.TypeMapper[pulumirpc.language.RunRequest.ConfigEntry, (_root_.scala.Predef.String, _root_.scala.Predef.String)] = + _root_.scalapb.TypeMapper[pulumirpc.language.RunRequest.ConfigEntry, (_root_.scala.Predef.String, _root_.scala.Predef.String)](__m => (__m.key, __m.value))(__p => pulumirpc.language.RunRequest.ConfigEntry(__p._1, __p._2)) + def of( + key: _root_.scala.Predef.String, + value: _root_.scala.Predef.String + ): _root_.pulumirpc.language.RunRequest.ConfigEntry = _root_.pulumirpc.language.RunRequest.ConfigEntry( + key, + value + ) + // @@protoc_insertion_point(GeneratedMessageCompanion[pulumirpc.RunRequest.ConfigEntry]) + } + + implicit class RunRequestLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.language.RunRequest]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, pulumirpc.language.RunRequest](_l) { + def project: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.project)((c_, f_) => c_.copy(project = f_)) + def stack: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.stack)((c_, f_) => c_.copy(stack = f_)) + def pwd: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.pwd)((c_, f_) => c_.copy(pwd = f_)) + def program: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.program)((c_, f_) => c_.copy(program = f_)) + def args: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[_root_.scala.Predef.String]] = field(_.args)((c_, f_) => c_.copy(args = f_)) + def config: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String]] = field(_.config)((c_, f_) => c_.copy(config = f_)) + def dryRun: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Boolean] = field(_.dryRun)((c_, f_) => c_.copy(dryRun = f_)) + def parallel: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = field(_.parallel)((c_, f_) => c_.copy(parallel = f_)) + def monitorAddress: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.monitorAddress)((c_, f_) => c_.copy(monitorAddress = f_)) + def queryMode: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Boolean] = field(_.queryMode)((c_, f_) => c_.copy(queryMode = f_)) + def configSecretKeys: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[_root_.scala.Predef.String]] = field(_.configSecretKeys)((c_, f_) => c_.copy(configSecretKeys = f_)) + def organization: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.organization)((c_, f_) => c_.copy(organization = f_)) + def configPropertyMap: _root_.scalapb.lenses.Lens[UpperPB, com.google.protobuf.struct.Struct] = field(_.getConfigPropertyMap)((c_, f_) => c_.copy(configPropertyMap = Option(f_))) + def optionalConfigPropertyMap: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[com.google.protobuf.struct.Struct]] = field(_.configPropertyMap)((c_, f_) => c_.copy(configPropertyMap = f_)) + def info: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.language.ProgramInfo] = field(_.getInfo)((c_, f_) => c_.copy(info = Option(f_))) + def optionalInfo: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[pulumirpc.language.ProgramInfo]] = field(_.info)((c_, f_) => c_.copy(info = f_)) + } + final val PROJECT_FIELD_NUMBER = 1 + final val STACK_FIELD_NUMBER = 2 + final val PWD_FIELD_NUMBER = 3 + final val PROGRAM_FIELD_NUMBER = 4 + final val ARGS_FIELD_NUMBER = 5 + final val CONFIG_FIELD_NUMBER = 6 + final val DRYRUN_FIELD_NUMBER = 7 + final val PARALLEL_FIELD_NUMBER = 8 + final val MONITOR_ADDRESS_FIELD_NUMBER = 9 + final val QUERYMODE_FIELD_NUMBER = 10 + final val CONFIGSECRETKEYS_FIELD_NUMBER = 11 + final val ORGANIZATION_FIELD_NUMBER = 12 + final val CONFIGPROPERTYMAP_FIELD_NUMBER = 13 + final val INFO_FIELD_NUMBER = 14 + @transient + private[language] val _typemapper_config: _root_.scalapb.TypeMapper[pulumirpc.language.RunRequest.ConfigEntry, (_root_.scala.Predef.String, _root_.scala.Predef.String)] = implicitly[_root_.scalapb.TypeMapper[pulumirpc.language.RunRequest.ConfigEntry, (_root_.scala.Predef.String, _root_.scala.Predef.String)]] + def of( + project: _root_.scala.Predef.String, + stack: _root_.scala.Predef.String, + pwd: _root_.scala.Predef.String, + program: _root_.scala.Predef.String, + args: _root_.scala.Seq[_root_.scala.Predef.String], + config: _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String], + dryRun: _root_.scala.Boolean, + parallel: _root_.scala.Int, + monitorAddress: _root_.scala.Predef.String, + queryMode: _root_.scala.Boolean, + configSecretKeys: _root_.scala.Seq[_root_.scala.Predef.String], + organization: _root_.scala.Predef.String, + configPropertyMap: _root_.scala.Option[com.google.protobuf.struct.Struct], + info: _root_.scala.Option[pulumirpc.language.ProgramInfo] + ): _root_.pulumirpc.language.RunRequest = _root_.pulumirpc.language.RunRequest( + project, + stack, + pwd, + program, + args, + config, + dryRun, + parallel, + monitorAddress, + queryMode, + configSecretKeys, + organization, + configPropertyMap, + info + ) + // @@protoc_insertion_point(GeneratedMessageCompanion[pulumirpc.RunRequest]) +} diff --git a/core/src/main/scala/besom/rpc/pulumirpc/language/RunResponse.scala b/core/src/main/scala/besom/rpc/pulumirpc/language/RunResponse.scala new file mode 100644 index 000000000..aef6fbed9 --- /dev/null +++ b/core/src/main/scala/besom/rpc/pulumirpc/language/RunResponse.scala @@ -0,0 +1,156 @@ +// Generated by the Scala Plugin for the Protocol Buffer Compiler. +// Do not edit! +// +// Protofile syntax: PROTO3 + +package pulumirpc.language + +/** RunResponse is the response back from the interpreter/source back to the monitor. + * + * @param error + * An unhandled error if any occurred. + * @param bail + * An error happened. And it was reported to the user. Work should stop immediately + * with nothing further to print to the user. This corresponds to a "result.Bail()" + * value in the 'go' layer. + */ +@SerialVersionUID(0L) +final case class RunResponse( + error: _root_.scala.Predef.String = "", + bail: _root_.scala.Boolean = false, + unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty + ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[RunResponse] { + @transient + private[this] var __serializedSizeMemoized: _root_.scala.Int = 0 + private[this] def __computeSerializedSize(): _root_.scala.Int = { + var __size = 0 + + { + val __value = error + if (!__value.isEmpty) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value) + } + }; + + { + val __value = bail + if (__value != false) { + __size += _root_.com.google.protobuf.CodedOutputStream.computeBoolSize(2, __value) + } + }; + __size += unknownFields.serializedSize + __size + } + override def serializedSize: _root_.scala.Int = { + var __size = __serializedSizeMemoized + if (__size == 0) { + __size = __computeSerializedSize() + 1 + __serializedSizeMemoized = __size + } + __size - 1 + + } + def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = { + { + val __v = error + if (!__v.isEmpty) { + _output__.writeString(1, __v) + } + }; + { + val __v = bail + if (__v != false) { + _output__.writeBool(2, __v) + } + }; + unknownFields.writeTo(_output__) + } + def withError(__v: _root_.scala.Predef.String): RunResponse = copy(error = __v) + def withBail(__v: _root_.scala.Boolean): RunResponse = copy(bail = __v) + def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v) + def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty) + def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = { + (__fieldNumber: @_root_.scala.unchecked) match { + case 1 => { + val __t = error + if (__t != "") __t else null + } + case 2 => { + val __t = bail + if (__t != false) __t else null + } + } + } + def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = { + _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor) + (__field.number: @_root_.scala.unchecked) match { + case 1 => _root_.scalapb.descriptors.PString(error) + case 2 => _root_.scalapb.descriptors.PBoolean(bail) + } + } + def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this) + def companion: pulumirpc.language.RunResponse.type = pulumirpc.language.RunResponse + // @@protoc_insertion_point(GeneratedMessage[pulumirpc.RunResponse]) +} + +object RunResponse extends scalapb.GeneratedMessageCompanion[pulumirpc.language.RunResponse] { + implicit def messageCompanion: scalapb.GeneratedMessageCompanion[pulumirpc.language.RunResponse] = this + def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): pulumirpc.language.RunResponse = { + var __error: _root_.scala.Predef.String = "" + var __bail: _root_.scala.Boolean = false + var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null + var _done__ = false + while (!_done__) { + val _tag__ = _input__.readTag() + _tag__ match { + case 0 => _done__ = true + case 10 => + __error = _input__.readStringRequireUtf8() + case 16 => + __bail = _input__.readBool() + case tag => + if (_unknownFields__ == null) { + _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder() + } + _unknownFields__.parseField(tag, _input__) + } + } + pulumirpc.language.RunResponse( + error = __error, + bail = __bail, + unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result() + ) + } + implicit def messageReads: _root_.scalapb.descriptors.Reads[pulumirpc.language.RunResponse] = _root_.scalapb.descriptors.Reads{ + case _root_.scalapb.descriptors.PMessage(__fieldsMap) => + _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.") + pulumirpc.language.RunResponse( + error = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""), + bail = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Boolean]).getOrElse(false) + ) + case _ => throw new RuntimeException("Expected PMessage") + } + def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = LanguageProto.javaDescriptor.getMessageTypes().get(8) + def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = LanguageProto.scalaDescriptor.messages(8) + def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number) + lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty + def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber) + lazy val defaultInstance = pulumirpc.language.RunResponse( + error = "", + bail = false + ) + implicit class RunResponseLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, pulumirpc.language.RunResponse]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, pulumirpc.language.RunResponse](_l) { + def error: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.error)((c_, f_) => c_.copy(error = f_)) + def bail: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Boolean] = field(_.bail)((c_, f_) => c_.copy(bail = f_)) + } + final val ERROR_FIELD_NUMBER = 1 + final val BAIL_FIELD_NUMBER = 2 + def of( + error: _root_.scala.Predef.String, + bail: _root_.scala.Boolean + ): _root_.pulumirpc.language.RunResponse = _root_.pulumirpc.language.RunResponse( + error, + bail + ) + // @@protoc_insertion_point(GeneratedMessageCompanion[pulumirpc.RunResponse]) +} diff --git a/proto/pulumi/codegen/hcl.proto b/proto/pulumi/codegen/hcl.proto new file mode 100644 index 000000000..fdeafc4dc --- /dev/null +++ b/proto/pulumi/codegen/hcl.proto @@ -0,0 +1,89 @@ +// Copyright 2016-2023, Pulumi Corporation. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package pulumirpc.codegen; + +option go_package = "github.com/pulumi/pulumi/sdk/v3/proto/go/codegen"; + +// Pos represents a single position in a source file, by addressing the start byte of a unicode character +// encoded in UTF-8. +message Pos { + // Line is the source code line where this position points. Lines are counted starting at 1 and + // incremented for each newline character encountered. + int64 line = 1; + + // Column is the source code column where this position points, in unicode characters, with counting + // starting at 1. + // + // Column counts characters as they appear visually, so for example a latin letter with a combining + // diacritic mark counts as one character. This is intended for rendering visual markers against source + // code in contexts where these diacritics would be rendered in a single character cell. Technically + // speaking, Column is counting grapheme clusters as used in unicode normalization. + int64 column = 2; + + // Byte is the byte offset into the file where the indicated character begins. This is a zero-based offset + // to the first byte of the first UTF-8 codepoint sequence in the character, and thus gives a position + // that can be resolved _without_ awareness of Unicode characters. + int64 byte = 3; +} + +// Range represents a span of characters between two positions in a source file. +message Range { + // Filename is the name of the file into which this range's positions point. + string filename = 1; + + // Start and End represent the bounds of this range. Start is inclusive and End is exclusive. + Pos start = 2; + Pos end = 3; +} + +// DiagnosticSeverity is the severity level of a diagnostic message. +enum DiagnosticSeverity { + // DIAG_INVALID is the invalid zero value of DiagnosticSeverity + DIAG_INVALID = 0; + // DIAG_ERROR indicates that the problem reported by a diagnostic prevents + // further progress in parsing and/or evaluating the subject. + DIAG_ERROR = 1; + // DIAG_WARNING indicates that the problem reported by a diagnostic warrants + // user attention but does not prevent further progress. It is most + // commonly used for showing deprecation notices. + DIAG_WARNING = 2; +} + +// Diagnostic represents information to be presented to a user about an error or anomaly in parsing or evaluating configuration. +message Diagnostic { + DiagnosticSeverity severity = 1; + + // Summary and Detail contain the English-language description of the + // problem. Summary is a terse description of the general problem and + // detail is a more elaborate, often-multi-sentence description of + // the problem and what might be done to solve it. + string summary = 2; + string detail = 3; + + // Subject and Context are both source ranges relating to the diagnostic. + // + // Subject is a tight range referring to exactly the construct that + // is problematic, while Context is an optional broader range (which should + // fully contain Subject) that ought to be shown around Subject when + // generating isolated source-code snippets in diagnostic messages. + // If Context is nil, the Subject is also the Context. + // + // Some diagnostics have no source ranges at all. If Context is set then + // Subject should always also be set. + Range subject = 4; + Range context = 5; +} \ No newline at end of file diff --git a/proto/pulumi/language.proto b/proto/pulumi/language.proto new file mode 100644 index 000000000..ba0a39ffb --- /dev/null +++ b/proto/pulumi/language.proto @@ -0,0 +1,232 @@ +// Copyright 2016-2023, Pulumi Corporation. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +import "pulumi/codegen/hcl.proto"; +import "pulumi/plugin.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/struct.proto"; + +package pulumirpc; + +option go_package = "github.com/pulumi/pulumi/sdk/v3/proto/go;pulumirpc"; + +// LanguageRuntime is the interface that the planning monitor uses to drive execution of an interpreter responsible +// for confguring and creating resource objects. +service LanguageRuntime { + // GetRequiredPlugins computes the complete set of anticipated plugins required by a program. + rpc GetRequiredPlugins(GetRequiredPluginsRequest) returns (GetRequiredPluginsResponse) {} + // Run executes a program and returns its result. + rpc Run(RunRequest) returns (RunResponse) {} + // GetPluginInfo returns generic information about this plugin, like its version. + rpc GetPluginInfo(google.protobuf.Empty) returns (PluginInfo) {} + + // InstallDependencies will install dependencies for the project, e.g. by running `npm install` for nodejs projects. + rpc InstallDependencies(InstallDependenciesRequest) returns (stream InstallDependenciesResponse) {} + + // About returns information about the runtime for this language. + rpc About(google.protobuf.Empty) returns (AboutResponse) {} + + // GetProgramDependencies returns the set of dependencies required by the program. + rpc GetProgramDependencies(GetProgramDependenciesRequest) returns (GetProgramDependenciesResponse) {} + + // RunPlugin executes a plugin program and returns its result asynchronously. + rpc RunPlugin(RunPluginRequest) returns (stream RunPluginResponse) {} + + // GenerateProgram generates a given PCL program into a program for this language. + rpc GenerateProgram(GenerateProgramRequest) returns (GenerateProgramResponse) {} + + // GenerateProject generates a given PCL program into a project for this language. + rpc GenerateProject(GenerateProjectRequest) returns (GenerateProjectResponse) {} + + // GeneratePackage generates a given pulumi package into a package for this language. + rpc GeneratePackage(GeneratePackageRequest) returns (GeneratePackageResponse) {} + + // Pack packs a package into a language specific artifact. + rpc Pack(PackRequest) returns (PackResponse) {} +} + +// ProgramInfo are the common set of options that a language runtime needs to execute or query a program. This +// is filled in by the engine based on where the `Pulumi.yaml` file was, the `runtime.options` property, and +// the `main` property. +message ProgramInfo { + // the root of the project, where the `Pulumi.yaml` file is located. + string root_directory = 1; + // the absolute path to the directory of the program to execute. Generally, but not required to be, + // underneath the root directory. + string program_directory = 2; + // the entry point of the program, normally '.' meaning to just use the program directory, but can also be + // a filename inside the program directory. How that filename is interpreted, if at all, is language + // specific. + string entry_point = 3; + // JSON style options from the `Pulumi.yaml` runtime options section. + google.protobuf.Struct options = 4; +} + +// AboutResponse returns runtime information about the language. +message AboutResponse { + string executable = 1; // the primary executable for the runtime of this language. + string version = 2; // the version of the runtime for this language. + map metadata = 3; // other information about this language. +} + +message GetProgramDependenciesRequest { + string project = 1 [deprecated = true]; // the project name. + string pwd = 2 [deprecated = true]; // the program's working directory. + string program = 3 [deprecated = true]; // the path to the program. + bool transitiveDependencies = 4; // if transitive dependencies should be included in the result. + ProgramInfo info = 5; // the program info to use to calculate dependencies. +} + +message DependencyInfo { + string name = 1; // The name of the dependency. + string version = 2; // The version of the dependency. +} + +message GetProgramDependenciesResponse { + repeated DependencyInfo dependencies = 1; // the dependencies of this program +} + +message GetRequiredPluginsRequest { + string project = 1 [deprecated = true]; // the project name. + string pwd = 2 [deprecated = true]; // the program's working directory. + string program = 3 [deprecated = true]; // the path to the program. + ProgramInfo info = 4; // the program info to use to calculate plugins. +} + +message GetRequiredPluginsResponse { + repeated PluginDependency plugins = 1; // a list of plugins required by this program. +} + +// RunRequest asks the interpreter to execute a program. +message RunRequest { + string project = 1; // the project name. + string stack = 2; // the name of the stack being deployed into. + string pwd = 3; // the program's working directory. + string program = 4 [deprecated = true]; // the path to the program to execute. + repeated string args = 5; // any arguments to pass to the program. + map config = 6; // the configuration variables to apply before running. + bool dryRun = 7; // true if we're only doing a dryrun (preview). + int32 parallel = 8; // the degree of parallelism for resource operations (<=1 for serial). + string monitor_address = 9; // the address for communicating back to the resource monitor. + bool queryMode = 10; // true if we're only doing a query. + repeated string configSecretKeys = 11; // the configuration keys that have secret values. + string organization = 12; // the organization of the stack being deployed into. + google.protobuf.Struct configPropertyMap = 13; // the configuration variables to apply before running. + ProgramInfo info = 14; // the program info to use to execute the program. +} + +// RunResponse is the response back from the interpreter/source back to the monitor. +message RunResponse { + // An unhandled error if any occurred. + string error = 1; + + // An error happened. And it was reported to the user. Work should stop immediately + // with nothing further to print to the user. This corresponds to a "result.Bail()" + // value in the 'go' layer. + bool bail = 2; +} + +message InstallDependenciesRequest { + string directory = 1 [deprecated = true]; // the program's working directory. + bool is_terminal = 2; // if we are running in a terminal and should use ANSI codes + ProgramInfo info = 3; // the program info to use to execute the plugin. +} + +message InstallDependenciesResponse { + bytes stdout = 1; // a line of stdout text. + bytes stderr = 2; // a line of stderr text. +} + +message RunPluginRequest{ + string pwd = 1; // the program's working directory. + string program = 2 [deprecated = true]; // the path to the program to execute. + repeated string args = 3; // any arguments to pass to the program. + repeated string env = 4; // any environment variables to set as part of the program. + ProgramInfo info = 5; // the program info to use to execute the plugin. +} + +message RunPluginResponse { + oneof output { + bytes stdout = 1; // a line of stdout text. + bytes stderr = 2; // a line of stderr text. + int32 exitcode = 3; // the exit code of the provider. + } +} + +message GenerateProgramRequest { + // the PCL source of the project. + map source = 1; + // The target of a codegen.LoaderServer to use for loading schemas. + string loader_target = 2; +} + +message GenerateProgramResponse { + // any diagnostics from code generation. + repeated pulumirpc.codegen.Diagnostic diagnostics = 1; + // the generated program source code. + map source = 2; +} + +message GenerateProjectRequest { + // the directory to generate the project from. + string source_directory = 1; + // the directory to generate the project in. + string target_directory = 2; + // the JSON-encoded pulumi project file. + string project = 3; + // if PCL binding should be strict or not. + bool strict = 4; + // The target of a codegen.LoaderServer to use for loading schemas. + string loader_target = 5; + // local dependencies to use instead of using the package system. This is a map of package name to a local + // path of a language specific artifact to use for the SDK for that package. + map local_dependencies = 6; +} + +message GenerateProjectResponse { + // any diagnostics from code generation. + repeated pulumirpc.codegen.Diagnostic diagnostics = 1; +} + +message GeneratePackageRequest { + // the directory to generate the package in. + string directory = 1; + // the JSON-encoded schema. + string schema = 2; + // extra files to copy to the package output. + map extra_files = 3; + // The target of a codegen.LoaderServer to use for loading schemas. + string loader_target = 4; +} + +message GeneratePackageResponse { + // any diagnostics from code generation. + repeated pulumirpc.codegen.Diagnostic diagnostics = 1; +} + +message PackRequest { + // the directory of a package to pack. + string package_directory = 1; + // the version to tag the artifact with. + string version = 2; + // the directory to write the packed artifact to. + string destination_directory = 3; +} + +message PackResponse { + // the full path of the packed artifact. + string artifact_path = 1; +} diff --git a/scripts/Proto.scala b/scripts/Proto.scala index 259bbbe38..cfa0cb7e3 100644 --- a/scripts/Proto.scala +++ b/scripts/Proto.scala @@ -19,7 +19,7 @@ import os.* val protoPath = cwd / "proto" command match - case "fetch" => fetchProto(cwd, protoPath) + case "fetch" => fetchProto(cwd, protoPath) case "compile" => compileProto(cwd, protoPath) case "all" => fetchProto(cwd, protoPath) @@ -56,21 +56,31 @@ private def fetchProto(cwd: os.Path, targetPath: os.Path): Unit = private def copyProto(sourcePath: os.Path, targetPath: os.Path): Unit = println(s"copying from $sourcePath to $targetPath") - val allowDirList = List() - val allowFileList = List( - "alias.proto", - "engine.proto", - "plugin.proto", - "provider.proto", - "resource.proto", - "source.proto", - "status.proto" + os.rel / "pulumi" / "alias.proto", + os.rel / "pulumi" / "engine.proto", + os.rel / "pulumi" / "language.proto", + os.rel / "pulumi" / "plugin.proto", + os.rel / "pulumi" / "provider.proto", + os.rel / "pulumi" / "resource.proto", + os.rel / "pulumi" / "source.proto", + os.rel / "pulumi" / "status.proto", + os.rel / "pulumi" / "codegen" / "hcl.proto", + os.rel / "google" / "protobuf" / "status.proto" ) val allowExtensions = List("proto") - copyFilteredFiles(sourcePath, targetPath, allowDirList, allowFileList, allowExtensions) + os.makeDir.all(targetPath) + os.walk(sourcePath) + .filter(os.isFile(_)) + .filter(f => allowExtensions.contains(f.ext)) + .filter(f => allowFileList.exists(f.endsWith(_))) + .foreach { source => + val target = targetPath / source.relativeTo(sourcePath) + os.copy.over(source, target, createFolders = true, replaceExisting = true) + println(s"copied ${source.relativeTo(sourcePath)} into ${target.relativeTo(targetPath)}") + } private def compileProto(cwd: os.Path, protoPath: os.Path): Unit = if !isProtocInstalled then