zio.aws.codecatalyst.model.CreateSourceRepositoryRequest.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zio-aws-codecatalyst_3 Show documentation
Show all versions of zio-aws-codecatalyst_3 Show documentation
Low-level AWS wrapper for ZIO
The newest version!
package zio.aws.codecatalyst.model
import zio.aws.codecatalyst.model.primitives.{
SourceRepositoryDescriptionString,
SourceRepositoryNameString,
NameString
}
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import scala.jdk.CollectionConverters.*
final case class CreateSourceRepositoryRequest(
spaceName: NameString,
projectName: NameString,
name: SourceRepositoryNameString,
description: Optional[SourceRepositoryDescriptionString] = Optional.Absent
) {
def buildAwsValue()
: software.amazon.awssdk.services.codecatalyst.model.CreateSourceRepositoryRequest = {
import CreateSourceRepositoryRequest.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.codecatalyst.model.CreateSourceRepositoryRequest
.builder()
.spaceName(NameString.unwrap(spaceName): java.lang.String)
.projectName(NameString.unwrap(projectName): java.lang.String)
.name(SourceRepositoryNameString.unwrap(name): java.lang.String)
.optionallyWith(
description.map(value =>
SourceRepositoryDescriptionString.unwrap(value): java.lang.String
)
)(_.description)
.build()
}
def asReadOnly
: zio.aws.codecatalyst.model.CreateSourceRepositoryRequest.ReadOnly =
zio.aws.codecatalyst.model.CreateSourceRepositoryRequest
.wrap(buildAwsValue())
}
object CreateSourceRepositoryRequest {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.codecatalyst.model.CreateSourceRepositoryRequest
] = BuilderHelper.apply
trait ReadOnly {
def asEditable: zio.aws.codecatalyst.model.CreateSourceRepositoryRequest =
zio.aws.codecatalyst.model.CreateSourceRepositoryRequest(
spaceName,
projectName,
name,
description.map(value => value)
)
def spaceName: NameString
def projectName: NameString
def name: SourceRepositoryNameString
def description: Optional[SourceRepositoryDescriptionString]
def getSpaceName: ZIO[Any, Nothing, NameString] = ZIO.succeed(spaceName)
def getProjectName: ZIO[Any, Nothing, NameString] = ZIO.succeed(projectName)
def getName: ZIO[Any, Nothing, SourceRepositoryNameString] =
ZIO.succeed(name)
def getDescription: ZIO[Any, AwsError, SourceRepositoryDescriptionString] =
AwsError.unwrapOptionField("description", description)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.codecatalyst.model.CreateSourceRepositoryRequest
) extends zio.aws.codecatalyst.model.CreateSourceRepositoryRequest.ReadOnly {
override val spaceName: NameString =
zio.aws.codecatalyst.model.primitives.NameString(impl.spaceName())
override val projectName: NameString =
zio.aws.codecatalyst.model.primitives.NameString(impl.projectName())
override val name: SourceRepositoryNameString =
zio.aws.codecatalyst.model.primitives
.SourceRepositoryNameString(impl.name())
override val description: Optional[SourceRepositoryDescriptionString] =
zio.aws.core.internal
.optionalFromNullable(impl.description())
.map(value =>
zio.aws.codecatalyst.model.primitives
.SourceRepositoryDescriptionString(value)
)
}
def wrap(
impl: software.amazon.awssdk.services.codecatalyst.model.CreateSourceRepositoryRequest
): zio.aws.codecatalyst.model.CreateSourceRepositoryRequest.ReadOnly =
new Wrapper(impl)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy