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-14887698: fix scala and Platform interfaces for async 2.x #1954

Merged
merged 1 commit into from
Mar 26, 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
Expand Up @@ -34,6 +34,7 @@ class Message(override private[amf] val _internal: InternalMessage)
def summary: StrField = _internal.summary
def bindings: MessageBindings = _internal.bindings
def headerSchema: NodeShape = _internal.headerSchema
def messageId: StrField = _internal.messageId

/** Set name property of this Response. */
override def withName(name: String): this.type = {
Expand Down Expand Up @@ -95,6 +96,10 @@ class Message(override private[amf] val _internal: InternalMessage)
_internal.withHeaderSchema(schema)
this
}
def withMessageId(messageId: String): this.type = {
_internal.withMessageId(messageId)
this
}

def withPayload(mediaType: ClientOption[String]): Payload = _internal.withPayload(mediaType.toScala)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ case class IBMMQChannelQueue(override private[amf] val _internal: InternalIBMMQC
def isPartitioned: BoolField = _internal.isPartitioned
def exclusive: BoolField = _internal.exclusive

def withObjectName(objectName: Boolean): this.type = {
def withObjectName(objectName: String): this.type = {
_internal.withObjectName(objectName)
this
}
Expand Down Expand Up @@ -98,17 +98,17 @@ case class IBMMQChannelTopic(override private[amf] val _internal: InternalIBMMQC
@JSExportTopLevel("IBMMQChannelTopic")
def this() = this(InternalIBMMQChannelTopic())

def string: BoolField = _internal.string
def string: StrField = _internal.string
def objectName: StrField = _internal.objectName
def durablePermitted: BoolField = _internal.durablePermitted
def lastMsgRetained: BoolField = _internal.lastMsgRetained

def withString(string: Boolean): this.type = {
def withString(string: String): this.type = {
_internal.withString(string)
this
}

def withObjectName(objectName: Boolean): this.type = {
def withObjectName(objectName: String): this.type = {
_internal.withObjectName(objectName)
this
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ case class PulsarChannelBinding(override private[amf] val _internal: InternalPul
this
}

def withCompaction(compaction: Integer): this.type = {
def withCompaction(compaction: Int): this.type = {
_internal.withCompaction(compaction)
this
}
Expand All @@ -52,7 +52,7 @@ case class PulsarChannelBinding(override private[amf] val _internal: InternalPul
this
}

def withTtl(ttl: Integer): this.type = {
def withTtl(ttl: Int): this.type = {
_internal.withTtl(ttl)
this
}
Expand Down Expand Up @@ -82,11 +82,11 @@ case class PulsarChannelRetention(override private[amf] val _internal: InternalP
def time: IntField = _internal.time
def size: IntField = _internal.size

def withTime(time: Integer): this.type = {
def withTime(time: Int): this.type = {
_internal.withTime(time)
this
}
def withSize(size: Integer): this.type = {
def withSize(size: Int): this.type = {
_internal.withSize(size)
this
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class Message(override val fields: Fields, override val annotations: Annotations
def headerExamples: Seq[Example] = fields.field(HeaderExamples)
def headers: Seq[Parameter] = fields.field(Headers)
def headerSchema: NodeShape = fields.field(HeaderSchema)
def messageId: StrField = fields.field(MessageId)

def withDescription(description: String): this.type = set(Description, description)
def isAbstract(isAbstract: Boolean): this.type = set(IsAbstract, isAbstract)
Expand All @@ -43,6 +44,7 @@ class Message(override val fields: Fields, override val annotations: Annotations
def withHeaders(headers: Seq[Parameter]): this.type = setArray(Headers, headers)
def withHeaderExamples(examples: Seq[Example]): this.type = setArray(HeaderExamples, examples)
def withHeaderSchema(obj: NodeShape): this.type = set(HeaderSchema, obj)
def withMessageId(messageId: String): this.type = set(MessageId, messageId)

def withPayload(mediaType: Option[String] = None): Payload = {
val result = Payload()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ 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
import amf.core.client.scala.model.domain._

class IBMMQChannelBinding(override val fields: Fields, override val annotations: Annotations)
extends ChannelBinding
Expand Down Expand Up @@ -63,7 +64,7 @@ class IBMMQChannelQueue(override val fields: Fields, override val annotations: A
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 withObjectName(objectName: String): 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)

Expand All @@ -86,13 +87,13 @@ class IBMMQChannelTopic(override val fields: Fields, override val annotations: A

override def nameField: Field = IBMMQChannelTopicModel.Name

def string: BoolField = fields.field(IBMMQChannelTopicModel.String)
def string: StrField = 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 withString(string: String): this.type = set(IBMMQChannelTopicModel.String, string)
def withObjectName(objectName: String): this.type = set(IBMMQChannelTopicModel.ObjectName, objectName)
def withDurablePermitted(durablePermitted: Boolean): this.type =
set(IBMMQChannelTopicModel.DurablePermitted, durablePermitted)
def withLastMsgRetained(lastMsgRetained: Boolean): this.type =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ class PulsarChannelBinding(override val fields: Fields, override val annotations

def withNamespace(namespace: String): this.type = set(Namespace, namespace)
def withPersistence(persistence: String): this.type = set(Persistence, persistence)
def withCompaction(compaction: Integer): this.type = set(Compaction, compaction)
def withCompaction(compaction: Int): this.type = set(Compaction, compaction)
def withGeoReplication(geoReplication: Seq[String]): this.type = set(GeoReplication, geoReplication)
def withRetention(retention: PulsarChannelRetention): this.type = set(Retention, retention)
def withTtl(ttl: Integer): this.type = set(Ttl, ttl)
def withTtl(ttl: Int): this.type = set(Ttl, ttl)
def withDeduplication(deduplication: Boolean): this.type = set(Deduplication, deduplication)

override def key: StrField = fields.field(PulsarChannelBindingModel.key)
Expand Down Expand Up @@ -58,8 +58,8 @@ class PulsarChannelRetention(override val fields: Fields, override val annotatio
def time: IntField = fields.field(PulsarChannelRetentionModel.Time)
def size: IntField = fields.field(PulsarChannelRetentionModel.Size)

def withTime(time: Integer): this.type = set(PulsarChannelRetentionModel.Time, time)
def withSize(size: Integer): this.type = set(PulsarChannelRetentionModel.Size, size)
def withTime(time: Int): this.type = set(PulsarChannelRetentionModel.Time, time)
def withSize(size: Int): this.type = set(PulsarChannelRetentionModel.Size, size)

override def componentId: String = s"/$Pulsar-retention"
}
Expand Down