-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
W-12689952: add ibmmq channel binding in async21+
- add channel binding model, parser and emitter - add unit validation and cycle tests - add model to APIEntities and model.md
- Loading branch information
1 parent
72d3644
commit 45d903b
Showing
15 changed files
with
731 additions
and
19 deletions.
There are no files selected for viewing
132 changes: 132 additions & 0 deletions
132
...ala/amf/apicontract/client/platform/model/domain/bindings/ibmmq/IBMMQChannelBinding.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,132 @@ | ||
package amf.apicontract.client.platform.model.domain.bindings.ibmmq | ||
|
||
import amf.apicontract.client.platform.model.domain.bindings.{BindingVersion, ChannelBinding} | ||
import amf.apicontract.client.scala.model.domain.bindings.ibmmq.{ | ||
IBMMQChannelTopic => InternalIBMMQChannelTopic, | ||
IBMMQChannelBinding => InternalIBMMQChannelBinding, | ||
IBMMQChannelQueue => InternalIBMMQChannelQueue | ||
} | ||
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.{BoolField, IntField, StrField} | ||
|
||
import scala.scalajs.js.annotation.{JSExportAll, JSExportTopLevel} | ||
|
||
@JSExportAll | ||
case class IBMMQChannelBinding(override private[amf] val _internal: InternalIBMMQChannelBinding) | ||
extends ChannelBinding | ||
with BindingVersion { | ||
@JSExportTopLevel("IBMMQChannelBinding") | ||
def this() = this(InternalIBMMQChannelBinding()) | ||
|
||
def destinationType: StrField = _internal.destinationType | ||
def queue: IBMMQChannelQueue = _internal.queue | ||
def topic: IBMMQChannelTopic = _internal.topic | ||
def maxMsgLength: IntField = _internal.maxMsgLength | ||
|
||
def withDestinationType(destinationType: String): this.type = { | ||
_internal.withDestinationType(destinationType) | ||
this | ||
} | ||
|
||
def withQueue(queue: IBMMQChannelQueue): this.type = { | ||
_internal.withQueue(queue) | ||
this | ||
} | ||
|
||
def withTopic(topic: IBMMQChannelTopic): this.type = { | ||
_internal.withTopic(topic) | ||
this | ||
} | ||
|
||
def withMaxMsgLength(maxMsgLength: Int): this.type = { | ||
_internal.withMaxMsgLength(maxMsgLength) | ||
this | ||
} | ||
|
||
override protected def bindingVersion: model.StrField = _internal.bindingVersion | ||
|
||
override def withBindingVersion(bindingVersion: String): this.type = { | ||
_internal.withBindingVersion(bindingVersion) | ||
this | ||
} | ||
|
||
override def linkCopy(): IBMMQChannelBinding = _internal.linkCopy() | ||
} | ||
|
||
@JSExportAll | ||
case class IBMMQChannelQueue(override private[amf] val _internal: InternalIBMMQChannelQueue) | ||
extends DomainElement | ||
with NamedDomainElement { | ||
|
||
@JSExportTopLevel("IBMMQChannelQueue") | ||
def this() = this(InternalIBMMQChannelQueue()) | ||
|
||
def objectName: StrField = _internal.objectName | ||
def isPartitioned: BoolField = _internal.isPartitioned | ||
def exclusive: BoolField = _internal.exclusive | ||
|
||
def withObjectName(objectName: Boolean): this.type = { | ||
_internal.withObjectName(objectName) | ||
this | ||
} | ||
|
||
def withIsPartitioned(isPartitioned: Boolean): this.type = { | ||
_internal.withIsPartitioned(isPartitioned) | ||
this | ||
} | ||
|
||
def withExclusive(exclusive: Boolean): this.type = { | ||
_internal.withExclusive(exclusive) | ||
this | ||
} | ||
|
||
override def name: StrField = _internal.name | ||
|
||
override def withName(name: String): this.type = { | ||
_internal.withName(name) | ||
this | ||
} | ||
} | ||
|
||
@JSExportAll | ||
case class IBMMQChannelTopic(override private[amf] val _internal: InternalIBMMQChannelTopic) | ||
extends DomainElement | ||
with NamedDomainElement { | ||
|
||
@JSExportTopLevel("IBMMQChannelTopic") | ||
def this() = this(InternalIBMMQChannelTopic()) | ||
|
||
def string: BoolField = _internal.string | ||
def objectName: StrField = _internal.objectName | ||
def durablePermitted: BoolField = _internal.durablePermitted | ||
def lastMsgRetained: BoolField = _internal.lastMsgRetained | ||
|
||
def withString(string: Boolean): this.type = { | ||
_internal.withString(string) | ||
this | ||
} | ||
|
||
def withObjectName(objectName: Boolean): this.type = { | ||
_internal.withObjectName(objectName) | ||
this | ||
} | ||
|
||
def withDurablePermitted(durablePermitted: Boolean): this.type = { | ||
_internal.withDurablePermitted(durablePermitted) | ||
this | ||
} | ||
|
||
def withLastMsgRetained(lastMsgRetained: Boolean): this.type = { | ||
_internal.withLastMsgRetained(lastMsgRetained) | ||
this | ||
} | ||
|
||
override def name: StrField = _internal.name | ||
|
||
override def withName(name: String): this.type = { | ||
_internal.withName(name) | ||
this | ||
} | ||
} |
111 changes: 111 additions & 0 deletions
111
.../scala/amf/apicontract/client/scala/model/domain/bindings/ibmmq/IBMMQChannelBinding.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,111 @@ | ||
package amf.apicontract.client.scala.model.domain.bindings.ibmmq | ||
|
||
import amf.apicontract.client.scala.model.domain.bindings.{BindingVersion, ChannelBinding} | ||
import amf.apicontract.internal.metamodel.domain.bindings.{ | ||
IBMMQChannelBindingModel, | ||
IBMMQChannelQueueModel, | ||
IBMMQChannelTopicModel | ||
} | ||
import amf.apicontract.internal.metamodel.domain.bindings.IBMMQChannelBindingModel._ | ||
import amf.apicontract.internal.spec.async.parser.bindings.Bindings.IBMMQ | ||
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 IBMMQChannelBinding(override val fields: Fields, override val annotations: Annotations) | ||
extends ChannelBinding | ||
with BindingVersion | ||
with Key { | ||
|
||
override protected def bindingVersionField: Field = BindingVersion | ||
override def meta: IBMMQChannelBindingModel.type = IBMMQChannelBindingModel | ||
|
||
def destinationType: StrField = fields.field(DestinationType) | ||
def queue: IBMMQChannelQueue = fields.field(Queue) | ||
def topic: IBMMQChannelTopic = fields.field(Topic) | ||
def maxMsgLength: IntField = fields.field(MaxMsgLength) | ||
|
||
def withDestinationType(destinationType: String): this.type = set(DestinationType, destinationType) | ||
def withQueue(queue: IBMMQChannelQueue): this.type = set(Queue, queue) | ||
def withTopic(topic: IBMMQChannelTopic): this.type = set(Topic, topic) | ||
def withMaxMsgLength(maxMsgLength: Int): this.type = set(MaxMsgLength, maxMsgLength) | ||
|
||
override def key: StrField = fields.field(IBMMQChannelBindingModel.key) | ||
|
||
override def componentId: String = s"/$IBMMQ-channel" | ||
|
||
override def linkCopy(): IBMMQChannelBinding = IBMMQChannelBinding() | ||
|
||
override protected def classConstructor: (Fields, Annotations) => Linkable with DomainElement = | ||
IBMMQChannelBinding.apply | ||
} | ||
|
||
object IBMMQChannelBinding { | ||
|
||
def apply(): IBMMQChannelBinding = apply(Annotations()) | ||
|
||
def apply(annotations: Annotations): IBMMQChannelBinding = apply(Fields(), annotations) | ||
|
||
def apply(fields: Fields, annotations: Annotations): IBMMQChannelBinding = | ||
new IBMMQChannelBinding(fields, annotations) | ||
} | ||
|
||
class IBMMQChannelQueue(override val fields: Fields, override val annotations: Annotations) | ||
extends DomainElement | ||
with NamedDomainElement { | ||
override def meta: IBMMQChannelQueueModel.type = IBMMQChannelQueueModel | ||
|
||
override def nameField: Field = IBMMQChannelQueueModel.Name | ||
|
||
def objectName: StrField = fields.field(IBMMQChannelQueueModel.ObjectName) | ||
def isPartitioned: BoolField = fields.field(IBMMQChannelQueueModel.IsPartitioned) | ||
def exclusive: BoolField = fields.field(IBMMQChannelQueueModel.Exclusive) | ||
|
||
def withObjectName(objectName: Boolean): this.type = set(IBMMQChannelQueueModel.ObjectName, objectName) | ||
def withIsPartitioned(isPartitioned: Boolean): this.type = set(IBMMQChannelQueueModel.IsPartitioned, isPartitioned) | ||
def withExclusive(exclusive: Boolean): this.type = set(IBMMQChannelQueueModel.Exclusive, exclusive) | ||
|
||
override def componentId: String = s"/$IBMMQ-queue" | ||
} | ||
|
||
object IBMMQChannelQueue { | ||
|
||
def apply(): IBMMQChannelQueue = apply(Annotations()) | ||
|
||
def apply(annotations: Annotations): IBMMQChannelQueue = apply(Fields(), annotations) | ||
|
||
def apply(fields: Fields, annotations: Annotations): IBMMQChannelQueue = new IBMMQChannelQueue(fields, annotations) | ||
} | ||
|
||
class IBMMQChannelTopic(override val fields: Fields, override val annotations: Annotations) | ||
extends DomainElement | ||
with NamedDomainElement { | ||
override def meta: IBMMQChannelTopicModel.type = IBMMQChannelTopicModel | ||
|
||
override def nameField: Field = IBMMQChannelTopicModel.Name | ||
|
||
def string: BoolField = fields.field(IBMMQChannelTopicModel.String) | ||
def objectName: StrField = fields.field(IBMMQChannelTopicModel.ObjectName) | ||
def durablePermitted: BoolField = fields.field(IBMMQChannelTopicModel.DurablePermitted) | ||
def lastMsgRetained: BoolField = fields.field(IBMMQChannelTopicModel.LastMsgRetained) | ||
|
||
def withString(string: Boolean): this.type = set(IBMMQChannelTopicModel.String, string) | ||
def withObjectName(objectName: Boolean): this.type = set(IBMMQChannelTopicModel.ObjectName, objectName) | ||
def withDurablePermitted(durablePermitted: Boolean): this.type = | ||
set(IBMMQChannelTopicModel.DurablePermitted, durablePermitted) | ||
def withLastMsgRetained(lastMsgRetained: Boolean): this.type = | ||
set(IBMMQChannelTopicModel.LastMsgRetained, lastMsgRetained) | ||
|
||
override def componentId: String = s"/$IBMMQ-topic" | ||
} | ||
|
||
object IBMMQChannelTopic { | ||
|
||
def apply(): IBMMQChannelTopic = apply(Annotations()) | ||
|
||
def apply(annotations: Annotations): IBMMQChannelTopic = apply(Fields(), annotations) | ||
|
||
def apply(fields: Fields, annotations: Annotations): IBMMQChannelTopic = new IBMMQChannelTopic(fields, annotations) | ||
} |
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
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
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
Oops, something went wrong.