zio.aws.verifiedpermissions.model.UpdateIdentitySourceRequest.scala Maven / Gradle / Ivy
package zio.aws.verifiedpermissions.model
import zio.aws.verifiedpermissions.model.primitives.{
PrincipalEntityType,
IdentitySourceId,
PolicyStoreId
}
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import scala.jdk.CollectionConverters._
final case class UpdateIdentitySourceRequest(
policyStoreId: PolicyStoreId,
identitySourceId: IdentitySourceId,
updateConfiguration: zio.aws.verifiedpermissions.model.UpdateConfiguration,
principalEntityType: Optional[PrincipalEntityType] = Optional.Absent
) {
def buildAwsValue()
: software.amazon.awssdk.services.verifiedpermissions.model.UpdateIdentitySourceRequest = {
import UpdateIdentitySourceRequest.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.verifiedpermissions.model.UpdateIdentitySourceRequest
.builder()
.policyStoreId(PolicyStoreId.unwrap(policyStoreId): java.lang.String)
.identitySourceId(
IdentitySourceId.unwrap(identitySourceId): java.lang.String
)
.updateConfiguration(updateConfiguration.buildAwsValue())
.optionallyWith(
principalEntityType.map(value =>
PrincipalEntityType.unwrap(value): java.lang.String
)
)(_.principalEntityType)
.build()
}
def asReadOnly
: zio.aws.verifiedpermissions.model.UpdateIdentitySourceRequest.ReadOnly =
zio.aws.verifiedpermissions.model.UpdateIdentitySourceRequest
.wrap(buildAwsValue())
}
object UpdateIdentitySourceRequest {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.verifiedpermissions.model.UpdateIdentitySourceRequest
] = BuilderHelper.apply
trait ReadOnly {
def asEditable
: zio.aws.verifiedpermissions.model.UpdateIdentitySourceRequest =
zio.aws.verifiedpermissions.model.UpdateIdentitySourceRequest(
policyStoreId,
identitySourceId,
updateConfiguration.asEditable,
principalEntityType.map(value => value)
)
def policyStoreId: PolicyStoreId
def identitySourceId: IdentitySourceId
def updateConfiguration
: zio.aws.verifiedpermissions.model.UpdateConfiguration.ReadOnly
def principalEntityType: Optional[PrincipalEntityType]
def getPolicyStoreId: ZIO[Any, Nothing, PolicyStoreId] =
ZIO.succeed(policyStoreId)
def getIdentitySourceId: ZIO[Any, Nothing, IdentitySourceId] =
ZIO.succeed(identitySourceId)
def getUpdateConfiguration: ZIO[
Any,
Nothing,
zio.aws.verifiedpermissions.model.UpdateConfiguration.ReadOnly
] = ZIO.succeed(updateConfiguration)
def getPrincipalEntityType: ZIO[Any, AwsError, PrincipalEntityType] =
AwsError.unwrapOptionField("principalEntityType", principalEntityType)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.verifiedpermissions.model.UpdateIdentitySourceRequest
) extends zio.aws.verifiedpermissions.model.UpdateIdentitySourceRequest.ReadOnly {
override val policyStoreId: PolicyStoreId =
zio.aws.verifiedpermissions.model.primitives
.PolicyStoreId(impl.policyStoreId())
override val identitySourceId: IdentitySourceId =
zio.aws.verifiedpermissions.model.primitives
.IdentitySourceId(impl.identitySourceId())
override val updateConfiguration
: zio.aws.verifiedpermissions.model.UpdateConfiguration.ReadOnly =
zio.aws.verifiedpermissions.model.UpdateConfiguration
.wrap(impl.updateConfiguration())
override val principalEntityType: Optional[PrincipalEntityType] =
zio.aws.core.internal
.optionalFromNullable(impl.principalEntityType())
.map(value =>
zio.aws.verifiedpermissions.model.primitives
.PrincipalEntityType(value)
)
}
def wrap(
impl: software.amazon.awssdk.services.verifiedpermissions.model.UpdateIdentitySourceRequest
): zio.aws.verifiedpermissions.model.UpdateIdentitySourceRequest.ReadOnly =
new Wrapper(impl)
}