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

zio.aws.snowdevicemanagement.model.PhysicalNetworkInterface.scala Maven / Gradle / Ivy

The newest version!
package zio.aws.snowdevicemanagement.model
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import scala.jdk.CollectionConverters._
final case class PhysicalNetworkInterface(
    defaultGateway: Optional[String] = Optional.Absent,
    ipAddress: Optional[String] = Optional.Absent,
    ipAddressAssignment: Optional[
      zio.aws.snowdevicemanagement.model.IpAddressAssignment
    ] = Optional.Absent,
    macAddress: Optional[String] = Optional.Absent,
    netmask: Optional[String] = Optional.Absent,
    physicalConnectorType: Optional[
      zio.aws.snowdevicemanagement.model.PhysicalConnectorType
    ] = Optional.Absent,
    physicalNetworkInterfaceId: Optional[String] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.snowdevicemanagement.model.PhysicalNetworkInterface = {
    import PhysicalNetworkInterface.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.snowdevicemanagement.model.PhysicalNetworkInterface
      .builder()
      .optionallyWith(defaultGateway.map(value => value: java.lang.String))(
        _.defaultGateway
      )
      .optionallyWith(ipAddress.map(value => value: java.lang.String))(
        _.ipAddress
      )
      .optionallyWith(ipAddressAssignment.map(value => value.unwrap))(
        _.ipAddressAssignment
      )
      .optionallyWith(macAddress.map(value => value: java.lang.String))(
        _.macAddress
      )
      .optionallyWith(netmask.map(value => value: java.lang.String))(_.netmask)
      .optionallyWith(physicalConnectorType.map(value => value.unwrap))(
        _.physicalConnectorType
      )
      .optionallyWith(
        physicalNetworkInterfaceId.map(value => value: java.lang.String)
      )(_.physicalNetworkInterfaceId)
      .build()
  }
  def asReadOnly
      : zio.aws.snowdevicemanagement.model.PhysicalNetworkInterface.ReadOnly =
    zio.aws.snowdevicemanagement.model.PhysicalNetworkInterface
      .wrap(buildAwsValue())
}
object PhysicalNetworkInterface {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.snowdevicemanagement.model.PhysicalNetworkInterface
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable
        : zio.aws.snowdevicemanagement.model.PhysicalNetworkInterface =
      zio.aws.snowdevicemanagement.model.PhysicalNetworkInterface(
        defaultGateway.map(value => value),
        ipAddress.map(value => value),
        ipAddressAssignment.map(value => value),
        macAddress.map(value => value),
        netmask.map(value => value),
        physicalConnectorType.map(value => value),
        physicalNetworkInterfaceId.map(value => value)
      )
    def defaultGateway: Optional[String]
    def ipAddress: Optional[String]
    def ipAddressAssignment
        : Optional[zio.aws.snowdevicemanagement.model.IpAddressAssignment]
    def macAddress: Optional[String]
    def netmask: Optional[String]
    def physicalConnectorType
        : Optional[zio.aws.snowdevicemanagement.model.PhysicalConnectorType]
    def physicalNetworkInterfaceId: Optional[String]
    def getDefaultGateway: ZIO[Any, AwsError, String] =
      AwsError.unwrapOptionField("defaultGateway", defaultGateway)
    def getIpAddress: ZIO[Any, AwsError, String] =
      AwsError.unwrapOptionField("ipAddress", ipAddress)
    def getIpAddressAssignment: ZIO[
      Any,
      AwsError,
      zio.aws.snowdevicemanagement.model.IpAddressAssignment
    ] = AwsError.unwrapOptionField("ipAddressAssignment", ipAddressAssignment)
    def getMacAddress: ZIO[Any, AwsError, String] =
      AwsError.unwrapOptionField("macAddress", macAddress)
    def getNetmask: ZIO[Any, AwsError, String] =
      AwsError.unwrapOptionField("netmask", netmask)
    def getPhysicalConnectorType: ZIO[
      Any,
      AwsError,
      zio.aws.snowdevicemanagement.model.PhysicalConnectorType
    ] =
      AwsError.unwrapOptionField("physicalConnectorType", physicalConnectorType)
    def getPhysicalNetworkInterfaceId: ZIO[Any, AwsError, String] =
      AwsError.unwrapOptionField(
        "physicalNetworkInterfaceId",
        physicalNetworkInterfaceId
      )
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.snowdevicemanagement.model.PhysicalNetworkInterface
  ) extends zio.aws.snowdevicemanagement.model.PhysicalNetworkInterface.ReadOnly {
    override val defaultGateway: Optional[String] = zio.aws.core.internal
      .optionalFromNullable(impl.defaultGateway())
      .map(value => value: String)
    override val ipAddress: Optional[String] = zio.aws.core.internal
      .optionalFromNullable(impl.ipAddress())
      .map(value => value: String)
    override val ipAddressAssignment
        : Optional[zio.aws.snowdevicemanagement.model.IpAddressAssignment] =
      zio.aws.core.internal
        .optionalFromNullable(impl.ipAddressAssignment())
        .map(value =>
          zio.aws.snowdevicemanagement.model.IpAddressAssignment.wrap(value)
        )
    override val macAddress: Optional[String] = zio.aws.core.internal
      .optionalFromNullable(impl.macAddress())
      .map(value => value: String)
    override val netmask: Optional[String] = zio.aws.core.internal
      .optionalFromNullable(impl.netmask())
      .map(value => value: String)
    override val physicalConnectorType
        : Optional[zio.aws.snowdevicemanagement.model.PhysicalConnectorType] =
      zio.aws.core.internal
        .optionalFromNullable(impl.physicalConnectorType())
        .map(value =>
          zio.aws.snowdevicemanagement.model.PhysicalConnectorType.wrap(value)
        )
    override val physicalNetworkInterfaceId: Optional[String] =
      zio.aws.core.internal
        .optionalFromNullable(impl.physicalNetworkInterfaceId())
        .map(value => value: String)
  }
  def wrap(
      impl: software.amazon.awssdk.services.snowdevicemanagement.model.PhysicalNetworkInterface
  ): zio.aws.snowdevicemanagement.model.PhysicalNetworkInterface.ReadOnly =
    new Wrapper(impl)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy