scala.googleapis.bigquery.PrivacyPolicy.scala Maven / Gradle / Ivy
package googleapis.bigquery
import io.circe._
import io.circe.syntax._
final case class PrivacyPolicy(
/** Optional. Policy used for aggregation thresholds.
*/
aggregationThresholdPolicy: Option[AggregationThresholdPolicy] = None,
/** Optional. Policy used for differential privacy.
*/
differentialPrivacyPolicy: Option[DifferentialPrivacyPolicy] = None,
/** Optional. Join restriction policy is outside of the one of policies, since this policy can be set along with other policies. This policy gives data providers the ability to enforce joins on the 'join_allowed_columns' when data is queried from a privacy protected view.
*/
joinRestrictionPolicy: Option[JoinRestrictionPolicy] = None,
)
object PrivacyPolicy {
implicit val encoder: Encoder[PrivacyPolicy] = Encoder.instance { x =>
Json.obj(
"aggregationThresholdPolicy" := x.aggregationThresholdPolicy,
"differentialPrivacyPolicy" := x.differentialPrivacyPolicy,
"joinRestrictionPolicy" := x.joinRestrictionPolicy,
)
}
implicit val decoder: Decoder[PrivacyPolicy] = Decoder.instance { c =>
for {
v0 <- c.get[Option[AggregationThresholdPolicy]]("aggregationThresholdPolicy")
v1 <- c.get[Option[DifferentialPrivacyPolicy]]("differentialPrivacyPolicy")
v2 <- c.get[Option[JoinRestrictionPolicy]]("joinRestrictionPolicy")
} yield PrivacyPolicy(v0, v1, v2)
}
}