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

io.github.vigoo.zioaws.datasync.model.DescribeAgentResponse.scala Maven / Gradle / Ivy

package io.github.vigoo.zioaws.datasync.model
import zio.ZIO
import java.time.Instant
import io.github.vigoo.zioaws.core.{AwsError, BuilderHelper}
import io.github.vigoo.zioaws.datasync.model.primitives.{
  Time,
  TagValue,
  AgentArn
}
import scala.jdk.CollectionConverters._
final case class DescribeAgentResponse(
    agentArn: Option[AgentArn] = None,
    name: Option[TagValue] = None,
    status: Option[io.github.vigoo.zioaws.datasync.model.AgentStatus] = None,
    lastConnectionTime: Option[Time] = None,
    creationTime: Option[Time] = None,
    endpointType: Option[io.github.vigoo.zioaws.datasync.model.EndpointType] =
      None,
    privateLinkConfig: Option[
      io.github.vigoo.zioaws.datasync.model.PrivateLinkConfig
    ] = None
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.datasync.model.DescribeAgentResponse = {
    import DescribeAgentResponse.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.datasync.model.DescribeAgentResponse
      .builder()
      .optionallyWith(agentArn.map(value => value: java.lang.String))(
        _.agentArn
      )
      .optionallyWith(name.map(value => value: java.lang.String))(_.name)
      .optionallyWith(status.map(value => value.unwrap))(_.status)
      .optionallyWith(lastConnectionTime.map(value => value: Instant))(
        _.lastConnectionTime
      )
      .optionallyWith(creationTime.map(value => value: Instant))(_.creationTime)
      .optionallyWith(endpointType.map(value => value.unwrap))(_.endpointType)
      .optionallyWith(privateLinkConfig.map(value => value.buildAwsValue()))(
        _.privateLinkConfig
      )
      .build()
  }
  def asReadOnly
      : io.github.vigoo.zioaws.datasync.model.DescribeAgentResponse.ReadOnly =
    io.github.vigoo.zioaws.datasync.model.DescribeAgentResponse
      .wrap(buildAwsValue())
}
object DescribeAgentResponse {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.datasync.model.DescribeAgentResponse
  ] = BuilderHelper.apply
  trait ReadOnly {
    def editable: io.github.vigoo.zioaws.datasync.model.DescribeAgentResponse =
      io.github.vigoo.zioaws.datasync.model.DescribeAgentResponse(
        agentArnValue.map(value => value),
        nameValue.map(value => value),
        statusValue.map(value => value),
        lastConnectionTimeValue.map(value => value),
        creationTimeValue.map(value => value),
        endpointTypeValue.map(value => value),
        privateLinkConfigValue.map(value => value.editable)
      )
    def agentArnValue: Option[AgentArn]
    def nameValue: Option[TagValue]
    def statusValue: Option[io.github.vigoo.zioaws.datasync.model.AgentStatus]
    def lastConnectionTimeValue: Option[Time]
    def creationTimeValue: Option[Time]
    def endpointTypeValue
        : Option[io.github.vigoo.zioaws.datasync.model.EndpointType]
    def privateLinkConfigValue: Option[
      io.github.vigoo.zioaws.datasync.model.PrivateLinkConfig.ReadOnly
    ]
    def agentArn: ZIO[Any, AwsError, AgentArn] =
      AwsError.unwrapOptionField("agentArn", agentArnValue)
    def name: ZIO[Any, AwsError, TagValue] =
      AwsError.unwrapOptionField("name", nameValue)
    def status: ZIO[
      Any,
      AwsError,
      io.github.vigoo.zioaws.datasync.model.AgentStatus
    ] = AwsError.unwrapOptionField("status", statusValue)
    def lastConnectionTime: ZIO[Any, AwsError, Time] =
      AwsError.unwrapOptionField("lastConnectionTime", lastConnectionTimeValue)
    def creationTime: ZIO[Any, AwsError, Time] =
      AwsError.unwrapOptionField("creationTime", creationTimeValue)
    def endpointType: ZIO[
      Any,
      AwsError,
      io.github.vigoo.zioaws.datasync.model.EndpointType
    ] = AwsError.unwrapOptionField("endpointType", endpointTypeValue)
    def privateLinkConfig: ZIO[
      Any,
      AwsError,
      io.github.vigoo.zioaws.datasync.model.PrivateLinkConfig.ReadOnly
    ] = AwsError.unwrapOptionField("privateLinkConfig", privateLinkConfigValue)
  }
  private class Wrapper(
      impl: software.amazon.awssdk.services.datasync.model.DescribeAgentResponse
  ) extends io.github.vigoo.zioaws.datasync.model.DescribeAgentResponse.ReadOnly {
    override def agentArnValue: Option[AgentArn] =
      scala.Option(impl.agentArn()).map(value => value: AgentArn)
    override def nameValue: Option[TagValue] =
      scala.Option(impl.name()).map(value => value: TagValue)
    override def statusValue
        : Option[io.github.vigoo.zioaws.datasync.model.AgentStatus] = scala
      .Option(impl.status())
      .map(value =>
        io.github.vigoo.zioaws.datasync.model.AgentStatus.wrap(value)
      )
    override def lastConnectionTimeValue: Option[Time] =
      scala.Option(impl.lastConnectionTime()).map(value => value: Time)
    override def creationTimeValue: Option[Time] =
      scala.Option(impl.creationTime()).map(value => value: Time)
    override def endpointTypeValue
        : Option[io.github.vigoo.zioaws.datasync.model.EndpointType] = scala
      .Option(impl.endpointType())
      .map(value =>
        io.github.vigoo.zioaws.datasync.model.EndpointType.wrap(value)
      )
    override def privateLinkConfigValue: Option[
      io.github.vigoo.zioaws.datasync.model.PrivateLinkConfig.ReadOnly
    ] = scala
      .Option(impl.privateLinkConfig())
      .map(value =>
        io.github.vigoo.zioaws.datasync.model.PrivateLinkConfig.wrap(value)
      )
  }
  def wrap(
      impl: software.amazon.awssdk.services.datasync.model.DescribeAgentResponse
  ): io.github.vigoo.zioaws.datasync.model.DescribeAgentResponse.ReadOnly =
    new Wrapper(impl)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy