Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

W-12689958: add Solace binding #1942

Merged
merged 3 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
package amf.apicontract.client.platform.model.domain.bindings.solace

import amf.apicontract.client.platform.model.domain.bindings.{BindingVersion, OperationBinding}
import amf.apicontract.client.scala.model.domain.bindings.solace.{
SolaceOperationBinding => InternalSolaceOperationBinding,
SolaceOperationDestination => InternalSolaceOperationDestination,
SolaceOperationQueue => InternalSolaceOperationQueue,
SolaceOperationTopic => InternalSolaceOperationTopic
}
import amf.apicontract.internal.convert.ApiClientConverters._
import amf.core.client.platform.model
import amf.core.client.platform.model.domain.{DomainElement, NamedDomainElement}
import amf.core.client.platform.model.StrField

import scala.scalajs.js.annotation.{JSExportAll, JSExportTopLevel}

@JSExportAll
case class SolaceOperationBinding(override private[amf] val _internal: InternalSolaceOperationBinding)
extends OperationBinding
with BindingVersion {
@JSExportTopLevel("SolaceOperationBinding")
def this() = this(InternalSolaceOperationBinding())

def destinations: ClientList[SolaceOperationDestination] = _internal.destinations.asClient

def withDestinations(destinations: ClientList[SolaceOperationDestination]): this.type = {
_internal.withDestinations(destinations.asInternal)
this
}

override protected def bindingVersion: model.StrField = _internal.bindingVersion

override def withBindingVersion(bindingVersion: String): this.type = {
_internal.withBindingVersion(bindingVersion)
this
}

override def linkCopy(): SolaceOperationBinding = _internal.linkCopy()
}

@JSExportAll
case class SolaceOperationDestination(override private[amf] val _internal: InternalSolaceOperationDestination)
extends DomainElement {

@JSExportTopLevel("SolaceOperationDestination")
def this() = this(InternalSolaceOperationDestination())

def destinationType: StrField = _internal.destinationType
def deliveryMode: StrField = _internal.deliveryMode

def withDestinationType(destinationType: String): this.type = {
_internal.withDestinationType(destinationType)
this
}
def withDeliveryMode(deliveryMode: String): this.type = {
_internal.withDeliveryMode(deliveryMode)
this
}

def queue: SolaceOperationQueue = _internal.queue
def topic: SolaceOperationTopic = _internal.topic

def withQueue(queue: SolaceOperationQueue): this.type = {
_internal.withQueue(queue)
this
}

def withTopic(topic: SolaceOperationTopic): this.type = {
_internal.withTopic(topic)
this
}
}

@JSExportAll
case class SolaceOperationQueue(override private[amf] val _internal: InternalSolaceOperationQueue)
extends DomainElement
with NamedDomainElement {

@JSExportTopLevel("SolaceOperationQueue")
def this() = this(InternalSolaceOperationQueue())

def topicSubscriptions: ClientList[StrField] = _internal.topicSubscriptions.asClient
def accessType: StrField = _internal.accessType
def maxMsgSpoolSize: StrField = _internal.maxMsgSpoolSize
def maxTtl: StrField = _internal.maxTtl

def withTopicSubscriptions(topicSubscriptions: ClientList[String]): this.type = {
_internal.withTopicSubscriptions(topicSubscriptions.asInternal)
this
}

def withAccessType(accessType: String): this.type = {
_internal.withAccessType(accessType)
this
}

def withMaxMsgSpoolSize(maxMsgSpoolSize: String): this.type = {
_internal.withMaxMsgSpoolSize(maxMsgSpoolSize)
this
}

def withMaxTtl(maxTtl: String): this.type = {
_internal.withMaxTtl(maxTtl)
this
}

override def name: StrField = _internal.name

override def withName(name: String): this.type = {
_internal.withName(name)
this
}
}

@JSExportAll
case class SolaceOperationTopic(override private[amf] val _internal: InternalSolaceOperationTopic)
extends DomainElement {

@JSExportTopLevel("SolaceOperationTopic")
def this() = this(InternalSolaceOperationTopic())

def topicSubscriptions: ClientList[StrField] = _internal.topicSubscriptions.asClient

def withTopicSubscriptions(topicSubscriptions: ClientList[String]): this.type = {
_internal.withTopicSubscriptions(topicSubscriptions.asInternal)
this
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package amf.apicontract.client.platform.model.domain.bindings.solace

import amf.apicontract.client.platform.model.domain.bindings.{BindingVersion, ServerBinding}
import amf.apicontract.client.scala.model.domain.bindings.solace.{SolaceServerBinding => InternalSolaceServerBinding}
import amf.apicontract.internal.convert.ApiClientConverters._
import amf.core.client.platform.model
import amf.core.client.platform.model.StrField

import scala.scalajs.js.annotation.{JSExportAll, JSExportTopLevel}

@JSExportAll
case class SolaceServerBinding(override private[amf] val _internal: InternalSolaceServerBinding)
extends ServerBinding
with BindingVersion {
@JSExportTopLevel("SolaceServerBinding")
def this() = this(InternalSolaceServerBinding())

def msgVpn: StrField = _internal.msgVpn

def withMsgVpn(msgVpn: String): this.type = {
_internal.withMsgVpn(msgVpn)
this
}

override protected def bindingVersion: model.StrField = _internal.bindingVersion

override def withBindingVersion(bindingVersion: String): this.type = {
_internal.withBindingVersion(bindingVersion)
this
}

override def linkCopy(): SolaceServerBinding = _internal.linkCopy()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
package amf.apicontract.client.scala.model.domain.bindings.solace

import amf.apicontract.client.scala.model.domain.bindings.{BindingVersion, OperationBinding}
import amf.apicontract.internal.metamodel.domain.bindings.{
SolaceOperationBindingModel,
SolaceOperationDestinationModel,
SolaceOperationQueueModel,
SolaceOperationTopicModel
}
import amf.apicontract.internal.metamodel.domain.bindings.SolaceOperationBindingModel._
import amf.apicontract.internal.spec.async.parser.bindings.Bindings.Solace
import amf.core.client.scala.model.domain.{DomainElement, Linkable, NamedDomainElement}
import amf.core.client.scala.model.{BoolField, IntField, StrField}
import amf.core.internal.metamodel.Field
import amf.core.internal.parser.domain.{Annotations, Fields}
import amf.shapes.client.scala.model.domain.Key

class SolaceOperationBinding(override val fields: Fields, override val annotations: Annotations)
extends OperationBinding
with BindingVersion
with Key {
override protected def bindingVersionField: Field = BindingVersion
override def meta: SolaceOperationBindingModel.type = SolaceOperationBindingModel

def destinations: Seq[SolaceOperationDestination] = fields.field(Destinations)

def withDestinations(destinations: Seq[SolaceOperationDestination]): this.type = setArray(Destinations, destinations)

override def key: StrField = fields.field(SolaceOperationBindingModel.key)

override def componentId: String = s"/$Solace-operation"
override def linkCopy(): SolaceOperationBinding = SolaceOperationBinding().withId(id)

override protected def classConstructor: (Fields, Annotations) => Linkable with DomainElement =
SolaceOperationBinding.apply
}

object SolaceOperationBinding {

def apply(): SolaceOperationBinding = apply(Annotations())

def apply(annotations: Annotations): SolaceOperationBinding = apply(Fields(), annotations)

def apply(fields: Fields, annotations: Annotations): SolaceOperationBinding =
new SolaceOperationBinding(fields, annotations)
}

class SolaceOperationDestination(override val fields: Fields, override val annotations: Annotations)
extends DomainElement {
override def meta: SolaceOperationDestinationModel.type = SolaceOperationDestinationModel

def destinationType: StrField = fields.field(SolaceOperationDestinationModel.DestinationType)
def deliveryMode: StrField = fields.field(SolaceOperationDestinationModel.DeliveryMode)
def queue: SolaceOperationQueue = fields.field(SolaceOperationDestinationModel.Queue)
def topic: SolaceOperationTopic = fields.field(SolaceOperationDestinationModel.Topic)

def withDestinationType(destinationType: String): this.type =
set(SolaceOperationDestinationModel.DestinationType, destinationType)
def withDeliveryMode(deliveryMode: String): this.type =
set(SolaceOperationDestinationModel.DeliveryMode, deliveryMode)
def withQueue(queue: SolaceOperationQueue): this.type = set(SolaceOperationDestinationModel.Queue, queue)
def withTopic(topic: SolaceOperationTopic): this.type = set(SolaceOperationDestinationModel.Topic, topic)

override def componentId: String = s"/$Solace-destination"
}

object SolaceOperationDestination {

def apply(): SolaceOperationDestination = apply(Annotations())

def apply(annotations: Annotations): SolaceOperationDestination = apply(Fields(), annotations)

def apply(fields: Fields, annotations: Annotations): SolaceOperationDestination =
new SolaceOperationDestination(fields, annotations)
}

class SolaceOperationQueue(override val fields: Fields, override val annotations: Annotations)
extends DomainElement
with NamedDomainElement {
override def meta: SolaceOperationQueueModel.type = SolaceOperationQueueModel

override def nameField: Field = SolaceOperationQueueModel.Name

def topicSubscriptions: Seq[StrField] = fields.field(SolaceOperationQueueModel.TopicSubscriptions)
def accessType: StrField = fields.field(SolaceOperationQueueModel.AccessType)
def maxMsgSpoolSize: StrField = fields.field(SolaceOperationQueueModel.MaxMsgSpoolSize)
def maxTtl: StrField = fields.field(SolaceOperationQueueModel.MaxTtl)

def withTopicSubscriptions(topicSubscriptions: Seq[String]): this.type =
set(SolaceOperationQueueModel.TopicSubscriptions, topicSubscriptions)
def withAccessType(accessType: String): this.type = set(SolaceOperationQueueModel.AccessType, accessType)
def withMaxMsgSpoolSize(maxMsgSpoolSize: String): this.type =
set(SolaceOperationQueueModel.MaxMsgSpoolSize, maxMsgSpoolSize)
def withMaxTtl(maxTtl: String): this.type = set(SolaceOperationQueueModel.MaxTtl, maxTtl)

override def componentId: String = s"/$Solace-queue"
}

object SolaceOperationQueue {

def apply(): SolaceOperationQueue = apply(Annotations())

def apply(annotations: Annotations): SolaceOperationQueue = apply(Fields(), annotations)

def apply(fields: Fields, annotations: Annotations): SolaceOperationQueue =
new SolaceOperationQueue(fields, annotations)
}

class SolaceOperationTopic(override val fields: Fields, override val annotations: Annotations) extends DomainElement {
override def meta: SolaceOperationTopicModel.type = SolaceOperationTopicModel

def topicSubscriptions: Seq[StrField] = fields.field(SolaceOperationQueueModel.TopicSubscriptions)

def withTopicSubscriptions(topicSubscriptions: Seq[String]): this.type =
set(SolaceOperationQueueModel.TopicSubscriptions, topicSubscriptions)

override def componentId: String = s"/$Solace-topic"
}

object SolaceOperationTopic {

def apply(): SolaceOperationTopic = apply(Annotations())

def apply(annotations: Annotations): SolaceOperationTopic = apply(Fields(), annotations)

def apply(fields: Fields, annotations: Annotations): SolaceOperationTopic =
new SolaceOperationTopic(fields, annotations)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package amf.apicontract.client.scala.model.domain.bindings.solace

import amf.apicontract.client.scala.model.domain.bindings.{BindingVersion, ServerBinding}
import amf.apicontract.internal.metamodel.domain.bindings.SolaceServerBindingModel._
import amf.apicontract.internal.metamodel.domain.bindings.SolaceServerBindingModel
import amf.apicontract.internal.spec.async.parser.bindings.Bindings.Solace
import amf.core.client.scala.model.domain.{DomainElement, Linkable}
import amf.core.client.scala.model.StrField
import amf.core.internal.metamodel.Field
import amf.core.internal.parser.domain.{Annotations, Fields}
import amf.shapes.client.scala.model.domain.Key

class SolaceServerBinding(override val fields: Fields, override val annotations: Annotations)
extends ServerBinding
with BindingVersion
with Key {
override protected def bindingVersionField: Field = BindingVersion
override def meta: SolaceServerBindingModel.type = SolaceServerBindingModel

def msgVpn: StrField = fields.field(MsgVpn)
def withMsgVpn(msgVpn: String): this.type = set(MsgVpn, msgVpn)

override def componentId: String = s"/$Solace-server"
override def linkCopy(): SolaceServerBinding = SolaceServerBinding().withId(id)

override protected def classConstructor: (Fields, Annotations) => Linkable with DomainElement =
SolaceServerBinding.apply

override def key: StrField = fields.field(SolaceServerBindingModel.key)
}

object SolaceServerBinding {

def apply(): SolaceServerBinding = apply(Annotations())

def apply(annotations: Annotations): SolaceServerBinding = apply(Fields(), annotations)

def apply(fields: Fields, annotations: Annotations): SolaceServerBinding =
new SolaceServerBinding(fields, annotations)
}
Loading