zio.aws.amplifybackend.model.SocialProviderSettings.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zio-aws-amplifybackend_3 Show documentation
Show all versions of zio-aws-amplifybackend_3 Show documentation
Low-level AWS wrapper for ZIO
package zio.aws.amplifybackend.model
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import scala.jdk.CollectionConverters.*
final case class SocialProviderSettings(
facebook: Optional[
zio.aws.amplifybackend.model.BackendAuthSocialProviderConfig
] = Optional.Absent,
google: Optional[
zio.aws.amplifybackend.model.BackendAuthSocialProviderConfig
] = Optional.Absent,
loginWithAmazon: Optional[
zio.aws.amplifybackend.model.BackendAuthSocialProviderConfig
] = Optional.Absent,
signInWithApple: Optional[
zio.aws.amplifybackend.model.BackendAuthAppleProviderConfig
] = Optional.Absent
) {
def buildAwsValue()
: software.amazon.awssdk.services.amplifybackend.model.SocialProviderSettings = {
import SocialProviderSettings.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.amplifybackend.model.SocialProviderSettings
.builder()
.optionallyWith(facebook.map(value => value.buildAwsValue()))(_.facebook)
.optionallyWith(google.map(value => value.buildAwsValue()))(_.google)
.optionallyWith(loginWithAmazon.map(value => value.buildAwsValue()))(
_.loginWithAmazon
)
.optionallyWith(signInWithApple.map(value => value.buildAwsValue()))(
_.signInWithApple
)
.build()
}
def asReadOnly: zio.aws.amplifybackend.model.SocialProviderSettings.ReadOnly =
zio.aws.amplifybackend.model.SocialProviderSettings.wrap(buildAwsValue())
}
object SocialProviderSettings {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.amplifybackend.model.SocialProviderSettings
] = BuilderHelper.apply
trait ReadOnly {
def asEditable: zio.aws.amplifybackend.model.SocialProviderSettings =
zio.aws.amplifybackend.model.SocialProviderSettings(
facebook.map(value => value.asEditable),
google.map(value => value.asEditable),
loginWithAmazon.map(value => value.asEditable),
signInWithApple.map(value => value.asEditable)
)
def facebook: Optional[
zio.aws.amplifybackend.model.BackendAuthSocialProviderConfig.ReadOnly
]
def google: Optional[
zio.aws.amplifybackend.model.BackendAuthSocialProviderConfig.ReadOnly
]
def loginWithAmazon: Optional[
zio.aws.amplifybackend.model.BackendAuthSocialProviderConfig.ReadOnly
]
def signInWithApple: Optional[
zio.aws.amplifybackend.model.BackendAuthAppleProviderConfig.ReadOnly
]
def getFacebook: ZIO[
Any,
AwsError,
zio.aws.amplifybackend.model.BackendAuthSocialProviderConfig.ReadOnly
] = AwsError.unwrapOptionField("facebook", facebook)
def getGoogle: ZIO[
Any,
AwsError,
zio.aws.amplifybackend.model.BackendAuthSocialProviderConfig.ReadOnly
] = AwsError.unwrapOptionField("google", google)
def getLoginWithAmazon: ZIO[
Any,
AwsError,
zio.aws.amplifybackend.model.BackendAuthSocialProviderConfig.ReadOnly
] = AwsError.unwrapOptionField("loginWithAmazon", loginWithAmazon)
def getSignInWithApple: ZIO[
Any,
AwsError,
zio.aws.amplifybackend.model.BackendAuthAppleProviderConfig.ReadOnly
] = AwsError.unwrapOptionField("signInWithApple", signInWithApple)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.amplifybackend.model.SocialProviderSettings
) extends zio.aws.amplifybackend.model.SocialProviderSettings.ReadOnly {
override val facebook: Optional[
zio.aws.amplifybackend.model.BackendAuthSocialProviderConfig.ReadOnly
] = zio.aws.core.internal
.optionalFromNullable(impl.facebook())
.map(value =>
zio.aws.amplifybackend.model.BackendAuthSocialProviderConfig.wrap(value)
)
override val google: Optional[
zio.aws.amplifybackend.model.BackendAuthSocialProviderConfig.ReadOnly
] = zio.aws.core.internal
.optionalFromNullable(impl.google())
.map(value =>
zio.aws.amplifybackend.model.BackendAuthSocialProviderConfig.wrap(value)
)
override val loginWithAmazon: Optional[
zio.aws.amplifybackend.model.BackendAuthSocialProviderConfig.ReadOnly
] = zio.aws.core.internal
.optionalFromNullable(impl.loginWithAmazon())
.map(value =>
zio.aws.amplifybackend.model.BackendAuthSocialProviderConfig.wrap(value)
)
override val signInWithApple: Optional[
zio.aws.amplifybackend.model.BackendAuthAppleProviderConfig.ReadOnly
] = zio.aws.core.internal
.optionalFromNullable(impl.signInWithApple())
.map(value =>
zio.aws.amplifybackend.model.BackendAuthAppleProviderConfig.wrap(value)
)
}
def wrap(
impl: software.amazon.awssdk.services.amplifybackend.model.SocialProviderSettings
): zio.aws.amplifybackend.model.SocialProviderSettings.ReadOnly = new Wrapper(
impl
)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy