zio.aws.emrcontainers.model.CreateSecurityConfigurationRequest.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.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import zio.aws.emrcontainers.model.primitives.{
StringEmpty256,
String128,
ResourceNameString,
ClientToken
}
import scala.jdk.CollectionConverters._
final case class CreateSecurityConfigurationRequest(
clientToken: ClientToken,
name: ResourceNameString,
securityConfigurationData: zio.aws.emrcontainers.model.SecurityConfigurationData,
tags: Optional[Map[String128, StringEmpty256]] = Optional.Absent
) {
def buildAwsValue()
: software.amazon.awssdk.services.emrcontainers.model.CreateSecurityConfigurationRequest = {
import CreateSecurityConfigurationRequest.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.emrcontainers.model.CreateSecurityConfigurationRequest
.builder()
.clientToken(ClientToken.unwrap(clientToken): java.lang.String)
.name(ResourceNameString.unwrap(name): java.lang.String)
.securityConfigurationData(securityConfigurationData.buildAwsValue())
.optionallyWith(
tags.map(value =>
value
.map({ case (key, value) =>
(String128.unwrap(key): java.lang.String) -> (StringEmpty256
.unwrap(value): java.lang.String)
})
.asJava
)
)(_.tags)
.build()
}
def asReadOnly
: zio.aws.emrcontainers.model.CreateSecurityConfigurationRequest.ReadOnly =
zio.aws.emrcontainers.model.CreateSecurityConfigurationRequest
.wrap(buildAwsValue())
}
object CreateSecurityConfigurationRequest {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.emrcontainers.model.CreateSecurityConfigurationRequest
] = BuilderHelper.apply
trait ReadOnly {
def asEditable
: zio.aws.emrcontainers.model.CreateSecurityConfigurationRequest =
zio.aws.emrcontainers.model.CreateSecurityConfigurationRequest(
clientToken,
name,
securityConfigurationData.asEditable,
tags.map(value => value)
)
def clientToken: ClientToken
def name: ResourceNameString
def securityConfigurationData
: zio.aws.emrcontainers.model.SecurityConfigurationData.ReadOnly
def tags: Optional[Map[String128, StringEmpty256]]
def getClientToken: ZIO[Any, Nothing, ClientToken] =
ZIO.succeed(clientToken)
def getName: ZIO[Any, Nothing, ResourceNameString] = ZIO.succeed(name)
def getSecurityConfigurationData: ZIO[
Any,
Nothing,
zio.aws.emrcontainers.model.SecurityConfigurationData.ReadOnly
] = ZIO.succeed(securityConfigurationData)
def getTags: ZIO[Any, AwsError, Map[String128, StringEmpty256]] =
AwsError.unwrapOptionField("tags", tags)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.emrcontainers.model.CreateSecurityConfigurationRequest
) extends zio.aws.emrcontainers.model.CreateSecurityConfigurationRequest.ReadOnly {
override val clientToken: ClientToken =
zio.aws.emrcontainers.model.primitives.ClientToken(impl.clientToken())
override val name: ResourceNameString =
zio.aws.emrcontainers.model.primitives.ResourceNameString(impl.name())
override val securityConfigurationData
: zio.aws.emrcontainers.model.SecurityConfigurationData.ReadOnly =
zio.aws.emrcontainers.model.SecurityConfigurationData
.wrap(impl.securityConfigurationData())
override val tags: Optional[Map[String128, StringEmpty256]] =
zio.aws.core.internal
.optionalFromNullable(impl.tags())
.map(value =>
value.asScala
.map({ case (key, value) =>
zio.aws.emrcontainers.model.primitives.String128(
key
) -> zio.aws.emrcontainers.model.primitives.StringEmpty256(value)
})
.toMap
)
}
def wrap(
impl: software.amazon.awssdk.services.emrcontainers.model.CreateSecurityConfigurationRequest
): zio.aws.emrcontainers.model.CreateSecurityConfigurationRequest.ReadOnly =
new Wrapper(impl)
}