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-12689952: add ibmmq binding in async21+ #1926

Merged
merged 11 commits into from
Feb 15, 2024
Merged
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
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package amf.apicontract.client.platform.model.domain.bindings.ibmmq

import amf.apicontract.client.platform.model.domain.bindings.{BindingVersion, MessageBinding}
arielmirra marked this conversation as resolved.
Show resolved Hide resolved
import amf.apicontract.client.scala.model.domain.bindings.ibmmq.{IBMMQMessageBinding => InternalIBMMQMessageBinding}
import amf.apicontract.internal.convert.ApiClientConverters._
import amf.core.client.platform.model
import amf.core.client.platform.model.{IntField, StrField}

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

@JSExportAll
case class IBMMQMessageBinding(override private[amf] val _internal: InternalIBMMQMessageBinding)
extends MessageBinding
with BindingVersion {
@JSExportTopLevel("IBMMQMessageBinding")
def this() = this(InternalIBMMQMessageBinding())

def messageType: StrField = _internal.messageType
def headers: StrField = _internal.headers
def description: StrField = _internal.description
def expiry: IntField = _internal.expiry

def withType(messageType: String): this.type = {
_internal.withMessageType(messageType)
this
}

def withHeaders(headers: String): this.type = {
_internal.withHeaders(headers)
this
}

def withDescription(description: String): this.type = {
_internal.withDescription(description)
this
}

def withExpiry(expiry: Int): this.type = {
_internal.withExpiry(expiry)
this
}

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

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

override def linkCopy(): IBMMQMessageBinding = _internal.linkCopy()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package amf.apicontract.client.platform.model.domain.bindings.ibmmq

import amf.apicontract.client.platform.model.domain.bindings.{BindingVersion, ServerBinding}
import amf.apicontract.client.scala.model.domain.bindings.ibmmq.{IBMMQServerBinding => InternalIBMMQServerBinding}
import amf.apicontract.internal.convert.ApiClientConverters._
import amf.core.client.platform.model
import amf.core.client.platform.model.{BoolField, IntField, StrField}

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

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

def groupId: StrField = _internal.groupId
def ccdtQueueManagerName: StrField = _internal.ccdtQueueManagerName
def cipherSpec: StrField = _internal.cipherSpec
def multiEndpointServer: BoolField = _internal.multiEndpointServer
def heartBeatInterval: IntField = _internal.heartBeatInterval

def withGroupId(groupId: String): this.type = {
_internal.withGroupId(groupId)
this
}

def withCcdtQueueManagerName(ccdtQueueManagerName: String): this.type = {
_internal.withCcdtQueueManagerName(ccdtQueueManagerName)
this
}

def withCipherSpec(cipherSpec: String): this.type = {
_internal.withCipherSpec(cipherSpec)
this
}

def withMultiEndpointServer(multiEndpointServer: Boolean): this.type = {
_internal.withMultiEndpointServer(multiEndpointServer)
this
}

def withHeartBeatInterval(heartBeatInterval: Int): this.type = {
_internal.withHeartBeatInterval(heartBeatInterval)
this
}

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

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

override def linkCopy(): IBMMQServerBinding = _internal.linkCopy()
}
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)
}
Loading