zio.aws.emrcontainers.model.GetManagedEndpointSessionCredentialsResponse.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zio-aws-emrcontainers_2.12 Show documentation
Show all versions of zio-aws-emrcontainers_2.12 Show documentation
Low-level AWS wrapper for ZIO
The newest version!
package zio.aws.emrcontainers.model
import zio.aws.emrcontainers.model.primitives.{Date, ResourceIdString}
import java.time.Instant
import zio.prelude.data.Optional
import zio.aws.core.{AwsError, BuilderHelper}
import zio.ZIO
import scala.jdk.CollectionConverters._
final case class GetManagedEndpointSessionCredentialsResponse(
id: Optional[ResourceIdString] = Optional.Absent,
credentials: Optional[zio.aws.emrcontainers.model.Credentials] =
Optional.Absent,
expiresAt: Optional[Date] = Optional.Absent
) {
def buildAwsValue()
: software.amazon.awssdk.services.emrcontainers.model.GetManagedEndpointSessionCredentialsResponse = {
import GetManagedEndpointSessionCredentialsResponse.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.emrcontainers.model.GetManagedEndpointSessionCredentialsResponse
.builder()
.optionallyWith(
id.map(value => ResourceIdString.unwrap(value): java.lang.String)
)(_.id)
.optionallyWith(credentials.map(value => value.buildAwsValue()))(
_.credentials
)
.optionallyWith(expiresAt.map(value => Date.unwrap(value): Instant))(
_.expiresAt
)
.build()
}
def asReadOnly
: zio.aws.emrcontainers.model.GetManagedEndpointSessionCredentialsResponse.ReadOnly =
zio.aws.emrcontainers.model.GetManagedEndpointSessionCredentialsResponse
.wrap(buildAwsValue())
}
object GetManagedEndpointSessionCredentialsResponse {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.emrcontainers.model.GetManagedEndpointSessionCredentialsResponse
] = BuilderHelper.apply
trait ReadOnly {
def asEditable
: zio.aws.emrcontainers.model.GetManagedEndpointSessionCredentialsResponse =
zio.aws.emrcontainers.model.GetManagedEndpointSessionCredentialsResponse(
id.map(value => value),
credentials.map(value => value.asEditable),
expiresAt.map(value => value)
)
def id: Optional[ResourceIdString]
def credentials: Optional[zio.aws.emrcontainers.model.Credentials.ReadOnly]
def expiresAt: Optional[Date]
def getId: ZIO[Any, AwsError, ResourceIdString] =
AwsError.unwrapOptionField("id", id)
def getCredentials
: ZIO[Any, AwsError, zio.aws.emrcontainers.model.Credentials.ReadOnly] =
AwsError.unwrapOptionField("credentials", credentials)
def getExpiresAt: ZIO[Any, AwsError, Date] =
AwsError.unwrapOptionField("expiresAt", expiresAt)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.emrcontainers.model.GetManagedEndpointSessionCredentialsResponse
) extends zio.aws.emrcontainers.model.GetManagedEndpointSessionCredentialsResponse.ReadOnly {
override val id: Optional[ResourceIdString] = zio.aws.core.internal
.optionalFromNullable(impl.id())
.map(value =>
zio.aws.emrcontainers.model.primitives.ResourceIdString(value)
)
override val credentials
: Optional[zio.aws.emrcontainers.model.Credentials.ReadOnly] =
zio.aws.core.internal
.optionalFromNullable(impl.credentials())
.map(value => zio.aws.emrcontainers.model.Credentials.wrap(value))
override val expiresAt: Optional[Date] = zio.aws.core.internal
.optionalFromNullable(impl.expiresAt())
.map(value => zio.aws.emrcontainers.model.primitives.Date(value))
}
def wrap(
impl: software.amazon.awssdk.services.emrcontainers.model.GetManagedEndpointSessionCredentialsResponse
): zio.aws.emrcontainers.model.GetManagedEndpointSessionCredentialsResponse.ReadOnly =
new Wrapper(impl)
}