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

com.cognite.sdk.scala.v1.fdm.views.ViewDefinition.scala Maven / Gradle / Ivy

The newest version!
// Copyright 2020 Cognite AS
// SPDX-License-Identifier: Apache-2.0

package com.cognite.sdk.scala.v1.fdm.views

import com.cognite.sdk.scala.v1.fdm.common.Usage
import com.cognite.sdk.scala.v1.fdm.common.filters.FilterDefinition
import com.cognite.sdk.scala.v1.fdm.common.properties.PropertyDefinition.ViewPropertyDefinition
import com.cognite.sdk.scala.v1.fdm.common.sources.SourceDefinition
import com.cognite.sdk.scala.v1.fdm.datamodels.DataModelViewReference
import io.circe.generic.semiauto.{deriveDecoder, deriveEncoder}
import io.circe.{Decoder, Encoder}

final case class ViewDefinition(
    space: String,
    externalId: String,
    name: Option[String] = None,
    description: Option[String] = None,
    filter: Option[FilterDefinition] = None,
    implements: Option[Seq[ViewReference]] = None,
    version: String,
    createdTime: Long,
    lastUpdatedTime: Long,
    writable: Boolean,
    usedFor: Usage,
    properties: Map[String, ViewPropertyDefinition]
) extends SourceDefinition
    with DataModelViewReference {
  override def toSourceReference: ViewReference =
    ViewReference(space = space, externalId = externalId, version = version)
}

object ViewDefinition {
  implicit val viewDefinitionEncoder: Encoder[ViewDefinition] = deriveEncoder[ViewDefinition]
  implicit val viewDefinitionDecoder: Decoder[ViewDefinition] = deriveDecoder[ViewDefinition]
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy