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

xyz.stratalab.sdk.models.EventValidator.scala Maven / Gradle / Ivy

The newest version!
package xyz.stratalab.sdk.models

object EventValidator extends scalapb.validate.Validator[xyz.stratalab.sdk.models.Event] {
  def validate(input: xyz.stratalab.sdk.models.Event): scalapb.validate.Result =
    scalapb.validate.Result.optional(input.value.eon) { _value =>
      xyz.stratalab.sdk.models.EventValidator.EonValidator.validate(_value)
    } &&
    scalapb.validate.Result.optional(input.value.era) { _value =>
      xyz.stratalab.sdk.models.EventValidator.EraValidator.validate(_value)
    } &&
    scalapb.validate.Result.optional(input.value.epoch) { _value =>
      xyz.stratalab.sdk.models.EventValidator.EpochValidator.validate(_value)
    } &&
    scalapb.validate.Result.optional(input.value.header) { _value =>
      xyz.stratalab.sdk.models.EventValidator.HeaderValidator.validate(_value)
    } &&
    scalapb.validate.Result.optional(input.value.ioTransaction) { _value =>
      xyz.stratalab.sdk.models.EventValidator.IoTransactionValidator.validate(_value)
    } &&
    scalapb.validate.Result.optional(input.value.groupPolicy) { _value =>
      xyz.stratalab.sdk.models.EventValidator.GroupPolicyValidator.validate(_value)
    } &&
    scalapb.validate.Result.optional(input.value.seriesPolicy) { _value =>
      xyz.stratalab.sdk.models.EventValidator.SeriesPolicyValidator.validate(_value)
    }
  
  object EonValidator extends scalapb.validate.Validator[xyz.stratalab.sdk.models.Event.Eon] {
    def validate(input: xyz.stratalab.sdk.models.Event.Eon): scalapb.validate.Result =
      scalapb.validate.Success
    
  }
  object EraValidator extends scalapb.validate.Validator[xyz.stratalab.sdk.models.Event.Era] {
    def validate(input: xyz.stratalab.sdk.models.Event.Era): scalapb.validate.Result =
      scalapb.validate.Success
    
  }
  object EpochValidator extends scalapb.validate.Validator[xyz.stratalab.sdk.models.Event.Epoch] {
    def validate(input: xyz.stratalab.sdk.models.Event.Epoch): scalapb.validate.Result =
      scalapb.validate.Success
    
  }
  object HeaderValidator extends scalapb.validate.Validator[xyz.stratalab.sdk.models.Event.Header] {
    def validate(input: xyz.stratalab.sdk.models.Event.Header): scalapb.validate.Result =
      scalapb.validate.Success
    
  }
  object IoTransactionValidator extends scalapb.validate.Validator[xyz.stratalab.sdk.models.Event.IoTransaction] {
    def validate(input: xyz.stratalab.sdk.models.Event.IoTransaction): scalapb.validate.Result =
      xyz.stratalab.sdk.models.transaction.ScheduleValidator.validate(input.schedule) &&
      quivr.models.SmallDataValidator.validate(input.metadata)
    
  }
  object GroupPolicyValidator extends scalapb.validate.Validator[xyz.stratalab.sdk.models.Event.GroupPolicy] {
    def validate(input: xyz.stratalab.sdk.models.Event.GroupPolicy): scalapb.validate.Result =
      xyz.stratalab.sdk.models.TransactionOutputAddressValidator.validate(input.registrationUtxo) &&
      scalapb.validate.Result.optional(input.fixedSeries) { _value =>
        xyz.stratalab.sdk.models.SeriesIdValidator.validate(_value)
      }
    
  }
  object SeriesPolicyValidator extends scalapb.validate.Validator[xyz.stratalab.sdk.models.Event.SeriesPolicy] {
    def validate(input: xyz.stratalab.sdk.models.Event.SeriesPolicy): scalapb.validate.Result =
      xyz.stratalab.sdk.models.TransactionOutputAddressValidator.validate(input.registrationUtxo)
    
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy