zio.aws.emrcontainers.model.StartJobRunRequest.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.{
IAMRoleArn,
String1024,
TemplateParameterName,
ResourceIdString,
StringEmpty256,
String128,
ClientToken,
ReleaseLabel,
ResourceNameString
}
import scala.jdk.CollectionConverters._
final case class StartJobRunRequest(
name: Optional[ResourceNameString] = Optional.Absent,
virtualClusterId: ResourceIdString,
clientToken: ClientToken,
executionRoleArn: Optional[IAMRoleArn] = Optional.Absent,
releaseLabel: Optional[ReleaseLabel] = Optional.Absent,
jobDriver: Optional[zio.aws.emrcontainers.model.JobDriver] =
Optional.Absent,
configurationOverrides: Optional[
zio.aws.emrcontainers.model.ConfigurationOverrides
] = Optional.Absent,
tags: Optional[Map[String128, StringEmpty256]] = Optional.Absent,
jobTemplateId: Optional[ResourceIdString] = Optional.Absent,
jobTemplateParameters: Optional[Map[TemplateParameterName, String1024]] =
Optional.Absent,
retryPolicyConfiguration: Optional[
zio.aws.emrcontainers.model.RetryPolicyConfiguration
] = Optional.Absent
) {
def buildAwsValue()
: software.amazon.awssdk.services.emrcontainers.model.StartJobRunRequest = {
import StartJobRunRequest.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.emrcontainers.model.StartJobRunRequest
.builder()
.optionallyWith(
name.map(value => ResourceNameString.unwrap(value): java.lang.String)
)(_.name)
.virtualClusterId(
ResourceIdString.unwrap(virtualClusterId): java.lang.String
)
.clientToken(ClientToken.unwrap(clientToken): java.lang.String)
.optionallyWith(
executionRoleArn.map(value =>
IAMRoleArn.unwrap(value): java.lang.String
)
)(_.executionRoleArn)
.optionallyWith(
releaseLabel.map(value => ReleaseLabel.unwrap(value): java.lang.String)
)(_.releaseLabel)
.optionallyWith(jobDriver.map(value => value.buildAwsValue()))(
_.jobDriver
)
.optionallyWith(
configurationOverrides.map(value => value.buildAwsValue())
)(_.configurationOverrides)
.optionallyWith(
tags.map(value =>
value
.map({ case (key, value) =>
(String128.unwrap(key): java.lang.String) -> (StringEmpty256
.unwrap(value): java.lang.String)
})
.asJava
)
)(_.tags)
.optionallyWith(
jobTemplateId.map(value =>
ResourceIdString.unwrap(value): java.lang.String
)
)(_.jobTemplateId)
.optionallyWith(
jobTemplateParameters.map(value =>
value
.map({ case (key, value) =>
(TemplateParameterName
.unwrap(key): java.lang.String) -> (String1024
.unwrap(value): java.lang.String)
})
.asJava
)
)(_.jobTemplateParameters)
.optionallyWith(
retryPolicyConfiguration.map(value => value.buildAwsValue())
)(_.retryPolicyConfiguration)
.build()
}
def asReadOnly: zio.aws.emrcontainers.model.StartJobRunRequest.ReadOnly =
zio.aws.emrcontainers.model.StartJobRunRequest.wrap(buildAwsValue())
}
object StartJobRunRequest {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.emrcontainers.model.StartJobRunRequest
] = BuilderHelper.apply
trait ReadOnly {
def asEditable: zio.aws.emrcontainers.model.StartJobRunRequest =
zio.aws.emrcontainers.model.StartJobRunRequest(
name.map(value => value),
virtualClusterId,
clientToken,
executionRoleArn.map(value => value),
releaseLabel.map(value => value),
jobDriver.map(value => value.asEditable),
configurationOverrides.map(value => value.asEditable),
tags.map(value => value),
jobTemplateId.map(value => value),
jobTemplateParameters.map(value => value),
retryPolicyConfiguration.map(value => value.asEditable)
)
def name: Optional[ResourceNameString]
def virtualClusterId: ResourceIdString
def clientToken: ClientToken
def executionRoleArn: Optional[IAMRoleArn]
def releaseLabel: Optional[ReleaseLabel]
def jobDriver: Optional[zio.aws.emrcontainers.model.JobDriver.ReadOnly]
def configurationOverrides
: Optional[zio.aws.emrcontainers.model.ConfigurationOverrides.ReadOnly]
def tags: Optional[Map[String128, StringEmpty256]]
def jobTemplateId: Optional[ResourceIdString]
def jobTemplateParameters: Optional[Map[TemplateParameterName, String1024]]
def retryPolicyConfiguration: Optional[
zio.aws.emrcontainers.model.RetryPolicyConfiguration.ReadOnly
]
def getName: ZIO[Any, AwsError, ResourceNameString] =
AwsError.unwrapOptionField("name", name)
def getVirtualClusterId: ZIO[Any, Nothing, ResourceIdString] =
ZIO.succeed(virtualClusterId)
def getClientToken: ZIO[Any, Nothing, ClientToken] =
ZIO.succeed(clientToken)
def getExecutionRoleArn: ZIO[Any, AwsError, IAMRoleArn] =
AwsError.unwrapOptionField("executionRoleArn", executionRoleArn)
def getReleaseLabel: ZIO[Any, AwsError, ReleaseLabel] =
AwsError.unwrapOptionField("releaseLabel", releaseLabel)
def getJobDriver
: ZIO[Any, AwsError, zio.aws.emrcontainers.model.JobDriver.ReadOnly] =
AwsError.unwrapOptionField("jobDriver", jobDriver)
def getConfigurationOverrides: ZIO[
Any,
AwsError,
zio.aws.emrcontainers.model.ConfigurationOverrides.ReadOnly
] = AwsError.unwrapOptionField(
"configurationOverrides",
configurationOverrides
)
def getTags: ZIO[Any, AwsError, Map[String128, StringEmpty256]] =
AwsError.unwrapOptionField("tags", tags)
def getJobTemplateId: ZIO[Any, AwsError, ResourceIdString] =
AwsError.unwrapOptionField("jobTemplateId", jobTemplateId)
def getJobTemplateParameters
: ZIO[Any, AwsError, Map[TemplateParameterName, String1024]] =
AwsError.unwrapOptionField("jobTemplateParameters", jobTemplateParameters)
def getRetryPolicyConfiguration: ZIO[
Any,
AwsError,
zio.aws.emrcontainers.model.RetryPolicyConfiguration.ReadOnly
] = AwsError.unwrapOptionField(
"retryPolicyConfiguration",
retryPolicyConfiguration
)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.emrcontainers.model.StartJobRunRequest
) extends zio.aws.emrcontainers.model.StartJobRunRequest.ReadOnly {
override val name: Optional[ResourceNameString] = zio.aws.core.internal
.optionalFromNullable(impl.name())
.map(value =>
zio.aws.emrcontainers.model.primitives.ResourceNameString(value)
)
override val virtualClusterId: ResourceIdString =
zio.aws.emrcontainers.model.primitives
.ResourceIdString(impl.virtualClusterId())
override val clientToken: ClientToken =
zio.aws.emrcontainers.model.primitives.ClientToken(impl.clientToken())
override val executionRoleArn: Optional[IAMRoleArn] = zio.aws.core.internal
.optionalFromNullable(impl.executionRoleArn())
.map(value => zio.aws.emrcontainers.model.primitives.IAMRoleArn(value))
override val releaseLabel: Optional[ReleaseLabel] = zio.aws.core.internal
.optionalFromNullable(impl.releaseLabel())
.map(value => zio.aws.emrcontainers.model.primitives.ReleaseLabel(value))
override val jobDriver
: Optional[zio.aws.emrcontainers.model.JobDriver.ReadOnly] =
zio.aws.core.internal
.optionalFromNullable(impl.jobDriver())
.map(value => zio.aws.emrcontainers.model.JobDriver.wrap(value))
override val configurationOverrides: Optional[
zio.aws.emrcontainers.model.ConfigurationOverrides.ReadOnly
] = zio.aws.core.internal
.optionalFromNullable(impl.configurationOverrides())
.map(value =>
zio.aws.emrcontainers.model.ConfigurationOverrides.wrap(value)
)
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
)
override val jobTemplateId: Optional[ResourceIdString] =
zio.aws.core.internal
.optionalFromNullable(impl.jobTemplateId())
.map(value =>
zio.aws.emrcontainers.model.primitives.ResourceIdString(value)
)
override val jobTemplateParameters
: Optional[Map[TemplateParameterName, String1024]] =
zio.aws.core.internal
.optionalFromNullable(impl.jobTemplateParameters())
.map(value =>
value.asScala
.map({ case (key, value) =>
zio.aws.emrcontainers.model.primitives.TemplateParameterName(
key
) -> zio.aws.emrcontainers.model.primitives.String1024(value)
})
.toMap
)
override val retryPolicyConfiguration: Optional[
zio.aws.emrcontainers.model.RetryPolicyConfiguration.ReadOnly
] = zio.aws.core.internal
.optionalFromNullable(impl.retryPolicyConfiguration())
.map(value =>
zio.aws.emrcontainers.model.RetryPolicyConfiguration.wrap(value)
)
}
def wrap(
impl: software.amazon.awssdk.services.emrcontainers.model.StartJobRunRequest
): zio.aws.emrcontainers.model.StartJobRunRequest.ReadOnly = new Wrapper(impl)
}