zio.aws.amplify.model.UpdateBranchRequest.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zio-aws-amplify_2.12 Show documentation
Show all versions of zio-aws-amplify_2.12 Show documentation
Low-level AWS wrapper for ZIO
package zio.aws.amplify.model
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.aws.amplify.model.primitives.{
EnableBasicAuth,
EnableNotification,
EnableAutoBuild,
DisplayName,
PullRequestEnvironmentName,
TTL,
BuildSpec,
EnablePullRequestPreview,
BasicAuthCredentials,
Description,
EnablePerformanceMode,
AppId,
EnvValue,
EnvKey,
BackendEnvironmentArn,
Framework,
BranchName
}
import zio.prelude.data.Optional
import scala.jdk.CollectionConverters._
final case class UpdateBranchRequest(
appId: AppId,
branchName: BranchName,
description: Optional[Description] = Optional.Absent,
framework: Optional[Framework] = Optional.Absent,
stage: Optional[zio.aws.amplify.model.Stage] = Optional.Absent,
enableNotification: Optional[EnableNotification] = Optional.Absent,
enableAutoBuild: Optional[EnableAutoBuild] = Optional.Absent,
environmentVariables: Optional[Map[EnvKey, EnvValue]] = Optional.Absent,
basicAuthCredentials: Optional[BasicAuthCredentials] = Optional.Absent,
enableBasicAuth: Optional[EnableBasicAuth] = Optional.Absent,
enablePerformanceMode: Optional[EnablePerformanceMode] = Optional.Absent,
buildSpec: Optional[BuildSpec] = Optional.Absent,
ttl: Optional[TTL] = Optional.Absent,
displayName: Optional[DisplayName] = Optional.Absent,
enablePullRequestPreview: Optional[EnablePullRequestPreview] =
Optional.Absent,
pullRequestEnvironmentName: Optional[PullRequestEnvironmentName] =
Optional.Absent,
backendEnvironmentArn: Optional[BackendEnvironmentArn] = Optional.Absent,
backend: Optional[zio.aws.amplify.model.Backend] = Optional.Absent
) {
def buildAwsValue()
: software.amazon.awssdk.services.amplify.model.UpdateBranchRequest = {
import UpdateBranchRequest.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.amplify.model.UpdateBranchRequest
.builder()
.appId(AppId.unwrap(appId): java.lang.String)
.branchName(BranchName.unwrap(branchName): java.lang.String)
.optionallyWith(
description.map(value => Description.unwrap(value): java.lang.String)
)(_.description)
.optionallyWith(
framework.map(value => Framework.unwrap(value): java.lang.String)
)(_.framework)
.optionallyWith(stage.map(value => value.unwrap))(_.stage)
.optionallyWith(
enableNotification.map(value =>
EnableNotification.unwrap(value): java.lang.Boolean
)
)(_.enableNotification)
.optionallyWith(
enableAutoBuild.map(value =>
EnableAutoBuild.unwrap(value): java.lang.Boolean
)
)(_.enableAutoBuild)
.optionallyWith(
environmentVariables.map(value =>
value
.map({ case (key, value) =>
(EnvKey.unwrap(key): java.lang.String) -> (EnvValue.unwrap(
value
): java.lang.String)
})
.asJava
)
)(_.environmentVariables)
.optionallyWith(
basicAuthCredentials.map(value =>
BasicAuthCredentials.unwrap(value): java.lang.String
)
)(_.basicAuthCredentials)
.optionallyWith(
enableBasicAuth.map(value =>
EnableBasicAuth.unwrap(value): java.lang.Boolean
)
)(_.enableBasicAuth)
.optionallyWith(
enablePerformanceMode.map(value =>
EnablePerformanceMode.unwrap(value): java.lang.Boolean
)
)(_.enablePerformanceMode)
.optionallyWith(
buildSpec.map(value => BuildSpec.unwrap(value): java.lang.String)
)(_.buildSpec)
.optionallyWith(ttl.map(value => TTL.unwrap(value): java.lang.String))(
_.ttl
)
.optionallyWith(
displayName.map(value => DisplayName.unwrap(value): java.lang.String)
)(_.displayName)
.optionallyWith(
enablePullRequestPreview.map(value =>
EnablePullRequestPreview.unwrap(value): java.lang.Boolean
)
)(_.enablePullRequestPreview)
.optionallyWith(
pullRequestEnvironmentName.map(value =>
PullRequestEnvironmentName.unwrap(value): java.lang.String
)
)(_.pullRequestEnvironmentName)
.optionallyWith(
backendEnvironmentArn.map(value =>
BackendEnvironmentArn.unwrap(value): java.lang.String
)
)(_.backendEnvironmentArn)
.optionallyWith(backend.map(value => value.buildAwsValue()))(_.backend)
.build()
}
def asReadOnly: zio.aws.amplify.model.UpdateBranchRequest.ReadOnly =
zio.aws.amplify.model.UpdateBranchRequest.wrap(buildAwsValue())
}
object UpdateBranchRequest {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.amplify.model.UpdateBranchRequest
] = BuilderHelper.apply
trait ReadOnly {
def asEditable: zio.aws.amplify.model.UpdateBranchRequest =
zio.aws.amplify.model.UpdateBranchRequest(
appId,
branchName,
description.map(value => value),
framework.map(value => value),
stage.map(value => value),
enableNotification.map(value => value),
enableAutoBuild.map(value => value),
environmentVariables.map(value => value),
basicAuthCredentials.map(value => value),
enableBasicAuth.map(value => value),
enablePerformanceMode.map(value => value),
buildSpec.map(value => value),
ttl.map(value => value),
displayName.map(value => value),
enablePullRequestPreview.map(value => value),
pullRequestEnvironmentName.map(value => value),
backendEnvironmentArn.map(value => value),
backend.map(value => value.asEditable)
)
def appId: AppId
def branchName: BranchName
def description: Optional[Description]
def framework: Optional[Framework]
def stage: Optional[zio.aws.amplify.model.Stage]
def enableNotification: Optional[EnableNotification]
def enableAutoBuild: Optional[EnableAutoBuild]
def environmentVariables: Optional[Map[EnvKey, EnvValue]]
def basicAuthCredentials: Optional[BasicAuthCredentials]
def enableBasicAuth: Optional[EnableBasicAuth]
def enablePerformanceMode: Optional[EnablePerformanceMode]
def buildSpec: Optional[BuildSpec]
def ttl: Optional[TTL]
def displayName: Optional[DisplayName]
def enablePullRequestPreview: Optional[EnablePullRequestPreview]
def pullRequestEnvironmentName: Optional[PullRequestEnvironmentName]
def backendEnvironmentArn: Optional[BackendEnvironmentArn]
def backend: Optional[zio.aws.amplify.model.Backend.ReadOnly]
def getAppId: ZIO[Any, Nothing, AppId] = ZIO.succeed(appId)
def getBranchName: ZIO[Any, Nothing, BranchName] = ZIO.succeed(branchName)
def getDescription: ZIO[Any, AwsError, Description] =
AwsError.unwrapOptionField("description", description)
def getFramework: ZIO[Any, AwsError, Framework] =
AwsError.unwrapOptionField("framework", framework)
def getStage: ZIO[Any, AwsError, zio.aws.amplify.model.Stage] =
AwsError.unwrapOptionField("stage", stage)
def getEnableNotification: ZIO[Any, AwsError, EnableNotification] =
AwsError.unwrapOptionField("enableNotification", enableNotification)
def getEnableAutoBuild: ZIO[Any, AwsError, EnableAutoBuild] =
AwsError.unwrapOptionField("enableAutoBuild", enableAutoBuild)
def getEnvironmentVariables: ZIO[Any, AwsError, Map[EnvKey, EnvValue]] =
AwsError.unwrapOptionField("environmentVariables", environmentVariables)
def getBasicAuthCredentials: ZIO[Any, AwsError, BasicAuthCredentials] =
AwsError.unwrapOptionField("basicAuthCredentials", basicAuthCredentials)
def getEnableBasicAuth: ZIO[Any, AwsError, EnableBasicAuth] =
AwsError.unwrapOptionField("enableBasicAuth", enableBasicAuth)
def getEnablePerformanceMode: ZIO[Any, AwsError, EnablePerformanceMode] =
AwsError.unwrapOptionField("enablePerformanceMode", enablePerformanceMode)
def getBuildSpec: ZIO[Any, AwsError, BuildSpec] =
AwsError.unwrapOptionField("buildSpec", buildSpec)
def getTtl: ZIO[Any, AwsError, TTL] = AwsError.unwrapOptionField("ttl", ttl)
def getDisplayName: ZIO[Any, AwsError, DisplayName] =
AwsError.unwrapOptionField("displayName", displayName)
def getEnablePullRequestPreview
: ZIO[Any, AwsError, EnablePullRequestPreview] = AwsError
.unwrapOptionField("enablePullRequestPreview", enablePullRequestPreview)
def getPullRequestEnvironmentName
: ZIO[Any, AwsError, PullRequestEnvironmentName] =
AwsError.unwrapOptionField(
"pullRequestEnvironmentName",
pullRequestEnvironmentName
)
def getBackendEnvironmentArn: ZIO[Any, AwsError, BackendEnvironmentArn] =
AwsError.unwrapOptionField("backendEnvironmentArn", backendEnvironmentArn)
def getBackend: ZIO[Any, AwsError, zio.aws.amplify.model.Backend.ReadOnly] =
AwsError.unwrapOptionField("backend", backend)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.amplify.model.UpdateBranchRequest
) extends zio.aws.amplify.model.UpdateBranchRequest.ReadOnly {
override val appId: AppId =
zio.aws.amplify.model.primitives.AppId(impl.appId())
override val branchName: BranchName =
zio.aws.amplify.model.primitives.BranchName(impl.branchName())
override val description: Optional[Description] = zio.aws.core.internal
.optionalFromNullable(impl.description())
.map(value => zio.aws.amplify.model.primitives.Description(value))
override val framework: Optional[Framework] = zio.aws.core.internal
.optionalFromNullable(impl.framework())
.map(value => zio.aws.amplify.model.primitives.Framework(value))
override val stage: Optional[zio.aws.amplify.model.Stage] =
zio.aws.core.internal
.optionalFromNullable(impl.stage())
.map(value => zio.aws.amplify.model.Stage.wrap(value))
override val enableNotification: Optional[EnableNotification] =
zio.aws.core.internal
.optionalFromNullable(impl.enableNotification())
.map(value =>
zio.aws.amplify.model.primitives.EnableNotification(value)
)
override val enableAutoBuild: Optional[EnableAutoBuild] =
zio.aws.core.internal
.optionalFromNullable(impl.enableAutoBuild())
.map(value => zio.aws.amplify.model.primitives.EnableAutoBuild(value))
override val environmentVariables: Optional[Map[EnvKey, EnvValue]] =
zio.aws.core.internal
.optionalFromNullable(impl.environmentVariables())
.map(value =>
value.asScala
.map({ case (key, value) =>
zio.aws.amplify.model.primitives
.EnvKey(key) -> zio.aws.amplify.model.primitives.EnvValue(value)
})
.toMap
)
override val basicAuthCredentials: Optional[BasicAuthCredentials] =
zio.aws.core.internal
.optionalFromNullable(impl.basicAuthCredentials())
.map(value =>
zio.aws.amplify.model.primitives.BasicAuthCredentials(value)
)
override val enableBasicAuth: Optional[EnableBasicAuth] =
zio.aws.core.internal
.optionalFromNullable(impl.enableBasicAuth())
.map(value => zio.aws.amplify.model.primitives.EnableBasicAuth(value))
override val enablePerformanceMode: Optional[EnablePerformanceMode] =
zio.aws.core.internal
.optionalFromNullable(impl.enablePerformanceMode())
.map(value =>
zio.aws.amplify.model.primitives.EnablePerformanceMode(value)
)
override val buildSpec: Optional[BuildSpec] = zio.aws.core.internal
.optionalFromNullable(impl.buildSpec())
.map(value => zio.aws.amplify.model.primitives.BuildSpec(value))
override val ttl: Optional[TTL] = zio.aws.core.internal
.optionalFromNullable(impl.ttl())
.map(value => zio.aws.amplify.model.primitives.TTL(value))
override val displayName: Optional[DisplayName] = zio.aws.core.internal
.optionalFromNullable(impl.displayName())
.map(value => zio.aws.amplify.model.primitives.DisplayName(value))
override val enablePullRequestPreview: Optional[EnablePullRequestPreview] =
zio.aws.core.internal
.optionalFromNullable(impl.enablePullRequestPreview())
.map(value =>
zio.aws.amplify.model.primitives.EnablePullRequestPreview(value)
)
override val pullRequestEnvironmentName
: Optional[PullRequestEnvironmentName] = zio.aws.core.internal
.optionalFromNullable(impl.pullRequestEnvironmentName())
.map(value =>
zio.aws.amplify.model.primitives.PullRequestEnvironmentName(value)
)
override val backendEnvironmentArn: Optional[BackendEnvironmentArn] =
zio.aws.core.internal
.optionalFromNullable(impl.backendEnvironmentArn())
.map(value =>
zio.aws.amplify.model.primitives.BackendEnvironmentArn(value)
)
override val backend: Optional[zio.aws.amplify.model.Backend.ReadOnly] =
zio.aws.core.internal
.optionalFromNullable(impl.backend())
.map(value => zio.aws.amplify.model.Backend.wrap(value))
}
def wrap(
impl: software.amazon.awssdk.services.amplify.model.UpdateBranchRequest
): zio.aws.amplify.model.UpdateBranchRequest.ReadOnly = new Wrapper(impl)
}