All Downloads are FREE. Search and download functionalities are using the official Maven repository.

defs.main-tests.source.izumi.test.domain01.domain Maven / Gradle / Ivy

The newest version!
domain izumi.test.domain01

include "model01.model"
include "model02.model"

/** docstring
  */
id TestValIdentifier {
  userId: str
}

/** docstring
  */
id TestIdentifier {
  /** field doc
    */
  @FieldAnno(a=1)
  userId: str
  context: str
  userType: i08
}

/** docstring
  */
mixin TestInterface {
  userId: UserId
  accountBalance: i32
  latestLogin: i64
  keys: map[str, str]
  nicknames: list[str]
}

/** docstring
  */
@TestAnno()
@AnotherAnno(a=1, b="str", c=[1,2,3], d={x=true, y=1}, e=lst[str]([1,2,3]))
data TestObject {
  & TestInterface
}


/** docstring
  */
data GoTimeImportOptional {
    o: opt[tsl]
}

/** docstring
  */
mixin GoAliasTest {
    a: str
}

/** docstring
  */
enum GoAliasEnumTest {
    Val1
    Val2
}

/** docstring
  */
alias GoAlias2 = GoAliasTest

/** docstring
  */
mixin AllTypes {
  b       : bool
  s       : str
  int8    : i08
  int16   : i16
  int32   : i32
  int64   : i64
  f       : flt
  d       : dbl
  uuid    : uid
  ts      : tsz
  tslocal : tsl
  tsuni   : tsu
  time    : time
  date    : date

  uint8   : u08
  uint16  : u16
  uint32  : u32
  uint64  : u64

  list    : list[AllTypes]
  another : lst[AllTypes]
  selfMap : map[str, AllTypes]
  enumMap : map[str, GoAliasEnumTest]
  option  : opt[AllTypes]
  selfSet : set[AllTypes]


  optionDate: opt[tsl]
  optionTime: opt[time]
}

/** docstring
  */
adt AnAdt {
  AllTypes
  /** adt member doc
    */
  @AdtMemberAnno(a=1)
  TestObject

  /** adt member doc
    */
  @AdtMemberAnno(a=1)
  AnyValTest as AnotherMember
}

/** docstring
  */
data AllTypesObject {
  & AllTypes
}

/** docstring
  */
mixin AnyValTest {
  boolField: bool
}

/** docstring
  */
mixin PrivateMixinParent {
  parent: str
}

/** docstring
  */
mixin PrivateMixinPrivateParent {
  parent_embedded: str
}

/** docstring
  */
mixin PrivateMixin {
  & PrivateMixinParent
  + PrivateMixinPrivateParent

  embedded: bool
}

/** docstring
  */
mixin ExtendedMixin {
  + PrivateMixin
  own: i08
}

/** docstring
  */
data PrivateTestObject {
  & ExtendedMixin
}

/** docstring
  */
data AnotherTestObject {
  + ExtendedMixin
}

/** docstring
  */
enum RTestEnum {
  /** enum member doc
    */
  @EnumMemberAnno(a=1)
  A
}

/** docstring
  */
mixin RTestMixin {
  a: RTestEnum
}

mixin RtestMixin2 {
  b:  RTestMixin
}

data RTestObject1 {
 & RtestMixin2
}

data RTestObject2 {
 & RtestMixin2
}

mixin AnyValTest2 {
 field: AnyValTest
}

/*
service TestService {
    def createUser(RtestMixin2, RTestMixin): (RtestMixin2)
}
service UserService {
  def createUser(TestInterface): (TestInterface)
  def anyvalTest(AnyValTest): (AnyValTest)
}
*/


data TsuData {
    since: tsu
}

mixin CommonFailure {
    code: i32
}

data BasicFailure {
    &CommonFailure
}

id IDForDomain2 {
    a: i32
}

data NestedClass {
    c: opt[NestedClass]
}

service OptionalService {
  /** method doc
    */
  @MethodMemberAnno(a=1)
  def optionalMethod(a: opt[NestedClass], b: opt[i32], c: opt[NestedClass]) => i32
}

id ImportAppId {
    id: uid
}



// generic failure
data OffsetLimit {
    offset: i32
    limit: i16
}

enum GenericFailureCode {
    EntityNotFound
    EntityAlreadyExists
    ExpirationFailure
    ConditionNotMet
    AccessDenied
    AssertionFailed
    UnexpectedException
    CodecFailed
    Unknown
}

mixin GenericFailureData {
    message: str
    diagnostics: opt[str]

    /* This should not be used normally.
    Only in case when we need to pass some additional data in a minor release keeping compatibility
    */
    reserved: map[str, str]
}

data GenericFailure {
    + GenericFailureData
    code: GenericFailureCode
}
//
////
//id TokenId {
//    id: uid
//}
//
//data TokenD {
//    data: str
//}
//




© 2015 - 2025 Weber Informatics LLC | Privacy Policy