-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
W-12689958: add Solace binding model and interfaces
- Loading branch information
1 parent
588f8fc
commit 6e82511
Showing
10 changed files
with
678 additions
and
16 deletions.
There are no files selected for viewing
128 changes: 128 additions & 0 deletions
128
...amf/apicontract/client/platform/model/domain/bindings/solace/SolaceOperationBinding.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...la/amf/apicontract/client/platform/model/domain/bindings/solace/SolaceServerBinding.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} |
128 changes: 128 additions & 0 deletions
128
...la/amf/apicontract/client/scala/model/domain/bindings/solace/SolaceOperationBinding.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} |
40 changes: 40 additions & 0 deletions
40
...scala/amf/apicontract/client/scala/model/domain/bindings/solace/SolaceServerBinding.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} |
Oops, something went wrong.