zio.aws.workmail.model.DescribeUserResponse.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zio-aws-workmail_2.12 Show documentation
Show all versions of zio-aws-workmail_2.12 Show documentation
Low-level AWS wrapper for ZIO
package zio.aws.workmail.model
import java.time.Instant
import zio.prelude.data.Optional
import zio.aws.core.{AwsError, BuilderHelper}
import zio.ZIO
import zio.aws.workmail.model.primitives.{
EmailAddress,
Timestamp,
UserAttribute,
WorkMailIdentifier,
UserName
}
import scala.jdk.CollectionConverters._
final case class DescribeUserResponse(
userId: Optional[WorkMailIdentifier] = Optional.Absent,
name: Optional[UserName] = Optional.Absent,
email: Optional[EmailAddress] = Optional.Absent,
displayName: Optional[UserAttribute] = Optional.Absent,
state: Optional[zio.aws.workmail.model.EntityState] = Optional.Absent,
userRole: Optional[zio.aws.workmail.model.UserRole] = Optional.Absent,
enabledDate: Optional[Timestamp] = Optional.Absent,
disabledDate: Optional[Timestamp] = Optional.Absent,
mailboxProvisionedDate: Optional[Timestamp] = Optional.Absent,
mailboxDeprovisionedDate: Optional[Timestamp] = Optional.Absent,
firstName: Optional[UserAttribute] = Optional.Absent,
lastName: Optional[UserAttribute] = Optional.Absent,
hiddenFromGlobalAddressList: Optional[Boolean] = Optional.Absent,
initials: Optional[UserAttribute] = Optional.Absent,
telephone: Optional[UserAttribute] = Optional.Absent,
street: Optional[UserAttribute] = Optional.Absent,
jobTitle: Optional[UserAttribute] = Optional.Absent,
city: Optional[UserAttribute] = Optional.Absent,
company: Optional[UserAttribute] = Optional.Absent,
zipCode: Optional[UserAttribute] = Optional.Absent,
department: Optional[UserAttribute] = Optional.Absent,
country: Optional[UserAttribute] = Optional.Absent,
office: Optional[UserAttribute] = Optional.Absent
) {
def buildAwsValue()
: software.amazon.awssdk.services.workmail.model.DescribeUserResponse = {
import DescribeUserResponse.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.workmail.model.DescribeUserResponse
.builder()
.optionallyWith(
userId.map(value => WorkMailIdentifier.unwrap(value): java.lang.String)
)(_.userId)
.optionallyWith(
name.map(value => UserName.unwrap(value): java.lang.String)
)(_.name)
.optionallyWith(
email.map(value => EmailAddress.unwrap(value): java.lang.String)
)(_.email)
.optionallyWith(
displayName.map(value => UserAttribute.unwrap(value): java.lang.String)
)(_.displayName)
.optionallyWith(state.map(value => value.unwrap))(_.state)
.optionallyWith(userRole.map(value => value.unwrap))(_.userRole)
.optionallyWith(
enabledDate.map(value => Timestamp.unwrap(value): Instant)
)(_.enabledDate)
.optionallyWith(
disabledDate.map(value => Timestamp.unwrap(value): Instant)
)(_.disabledDate)
.optionallyWith(
mailboxProvisionedDate.map(value => Timestamp.unwrap(value): Instant)
)(_.mailboxProvisionedDate)
.optionallyWith(
mailboxDeprovisionedDate.map(value => Timestamp.unwrap(value): Instant)
)(_.mailboxDeprovisionedDate)
.optionallyWith(
firstName.map(value => UserAttribute.unwrap(value): java.lang.String)
)(_.firstName)
.optionallyWith(
lastName.map(value => UserAttribute.unwrap(value): java.lang.String)
)(_.lastName)
.optionallyWith(
hiddenFromGlobalAddressList.map(value => value: java.lang.Boolean)
)(_.hiddenFromGlobalAddressList)
.optionallyWith(
initials.map(value => UserAttribute.unwrap(value): java.lang.String)
)(_.initials)
.optionallyWith(
telephone.map(value => UserAttribute.unwrap(value): java.lang.String)
)(_.telephone)
.optionallyWith(
street.map(value => UserAttribute.unwrap(value): java.lang.String)
)(_.street)
.optionallyWith(
jobTitle.map(value => UserAttribute.unwrap(value): java.lang.String)
)(_.jobTitle)
.optionallyWith(
city.map(value => UserAttribute.unwrap(value): java.lang.String)
)(_.city)
.optionallyWith(
company.map(value => UserAttribute.unwrap(value): java.lang.String)
)(_.company)
.optionallyWith(
zipCode.map(value => UserAttribute.unwrap(value): java.lang.String)
)(_.zipCode)
.optionallyWith(
department.map(value => UserAttribute.unwrap(value): java.lang.String)
)(_.department)
.optionallyWith(
country.map(value => UserAttribute.unwrap(value): java.lang.String)
)(_.country)
.optionallyWith(
office.map(value => UserAttribute.unwrap(value): java.lang.String)
)(_.office)
.build()
}
def asReadOnly: zio.aws.workmail.model.DescribeUserResponse.ReadOnly =
zio.aws.workmail.model.DescribeUserResponse.wrap(buildAwsValue())
}
object DescribeUserResponse {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.workmail.model.DescribeUserResponse
] = BuilderHelper.apply
trait ReadOnly {
def asEditable: zio.aws.workmail.model.DescribeUserResponse =
zio.aws.workmail.model.DescribeUserResponse(
userId.map(value => value),
name.map(value => value),
email.map(value => value),
displayName.map(value => value),
state.map(value => value),
userRole.map(value => value),
enabledDate.map(value => value),
disabledDate.map(value => value),
mailboxProvisionedDate.map(value => value),
mailboxDeprovisionedDate.map(value => value),
firstName.map(value => value),
lastName.map(value => value),
hiddenFromGlobalAddressList.map(value => value),
initials.map(value => value),
telephone.map(value => value),
street.map(value => value),
jobTitle.map(value => value),
city.map(value => value),
company.map(value => value),
zipCode.map(value => value),
department.map(value => value),
country.map(value => value),
office.map(value => value)
)
def userId: Optional[WorkMailIdentifier]
def name: Optional[UserName]
def email: Optional[EmailAddress]
def displayName: Optional[UserAttribute]
def state: Optional[zio.aws.workmail.model.EntityState]
def userRole: Optional[zio.aws.workmail.model.UserRole]
def enabledDate: Optional[Timestamp]
def disabledDate: Optional[Timestamp]
def mailboxProvisionedDate: Optional[Timestamp]
def mailboxDeprovisionedDate: Optional[Timestamp]
def firstName: Optional[UserAttribute]
def lastName: Optional[UserAttribute]
def hiddenFromGlobalAddressList: Optional[Boolean]
def initials: Optional[UserAttribute]
def telephone: Optional[UserAttribute]
def street: Optional[UserAttribute]
def jobTitle: Optional[UserAttribute]
def city: Optional[UserAttribute]
def company: Optional[UserAttribute]
def zipCode: Optional[UserAttribute]
def department: Optional[UserAttribute]
def country: Optional[UserAttribute]
def office: Optional[UserAttribute]
def getUserId: ZIO[Any, AwsError, WorkMailIdentifier] =
AwsError.unwrapOptionField("userId", userId)
def getName: ZIO[Any, AwsError, UserName] =
AwsError.unwrapOptionField("name", name)
def getEmail: ZIO[Any, AwsError, EmailAddress] =
AwsError.unwrapOptionField("email", email)
def getDisplayName: ZIO[Any, AwsError, UserAttribute] =
AwsError.unwrapOptionField("displayName", displayName)
def getState: ZIO[Any, AwsError, zio.aws.workmail.model.EntityState] =
AwsError.unwrapOptionField("state", state)
def getUserRole: ZIO[Any, AwsError, zio.aws.workmail.model.UserRole] =
AwsError.unwrapOptionField("userRole", userRole)
def getEnabledDate: ZIO[Any, AwsError, Timestamp] =
AwsError.unwrapOptionField("enabledDate", enabledDate)
def getDisabledDate: ZIO[Any, AwsError, Timestamp] =
AwsError.unwrapOptionField("disabledDate", disabledDate)
def getMailboxProvisionedDate: ZIO[Any, AwsError, Timestamp] = AwsError
.unwrapOptionField("mailboxProvisionedDate", mailboxProvisionedDate)
def getMailboxDeprovisionedDate: ZIO[Any, AwsError, Timestamp] = AwsError
.unwrapOptionField("mailboxDeprovisionedDate", mailboxDeprovisionedDate)
def getFirstName: ZIO[Any, AwsError, UserAttribute] =
AwsError.unwrapOptionField("firstName", firstName)
def getLastName: ZIO[Any, AwsError, UserAttribute] =
AwsError.unwrapOptionField("lastName", lastName)
def getHiddenFromGlobalAddressList: ZIO[Any, AwsError, Boolean] =
AwsError.unwrapOptionField(
"hiddenFromGlobalAddressList",
hiddenFromGlobalAddressList
)
def getInitials: ZIO[Any, AwsError, UserAttribute] =
AwsError.unwrapOptionField("initials", initials)
def getTelephone: ZIO[Any, AwsError, UserAttribute] =
AwsError.unwrapOptionField("telephone", telephone)
def getStreet: ZIO[Any, AwsError, UserAttribute] =
AwsError.unwrapOptionField("street", street)
def getJobTitle: ZIO[Any, AwsError, UserAttribute] =
AwsError.unwrapOptionField("jobTitle", jobTitle)
def getCity: ZIO[Any, AwsError, UserAttribute] =
AwsError.unwrapOptionField("city", city)
def getCompany: ZIO[Any, AwsError, UserAttribute] =
AwsError.unwrapOptionField("company", company)
def getZipCode: ZIO[Any, AwsError, UserAttribute] =
AwsError.unwrapOptionField("zipCode", zipCode)
def getDepartment: ZIO[Any, AwsError, UserAttribute] =
AwsError.unwrapOptionField("department", department)
def getCountry: ZIO[Any, AwsError, UserAttribute] =
AwsError.unwrapOptionField("country", country)
def getOffice: ZIO[Any, AwsError, UserAttribute] =
AwsError.unwrapOptionField("office", office)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.workmail.model.DescribeUserResponse
) extends zio.aws.workmail.model.DescribeUserResponse.ReadOnly {
override val userId: Optional[WorkMailIdentifier] = zio.aws.core.internal
.optionalFromNullable(impl.userId())
.map(value => zio.aws.workmail.model.primitives.WorkMailIdentifier(value))
override val name: Optional[UserName] = zio.aws.core.internal
.optionalFromNullable(impl.name())
.map(value => zio.aws.workmail.model.primitives.UserName(value))
override val email: Optional[EmailAddress] = zio.aws.core.internal
.optionalFromNullable(impl.email())
.map(value => zio.aws.workmail.model.primitives.EmailAddress(value))
override val displayName: Optional[UserAttribute] = zio.aws.core.internal
.optionalFromNullable(impl.displayName())
.map(value => zio.aws.workmail.model.primitives.UserAttribute(value))
override val state: Optional[zio.aws.workmail.model.EntityState] =
zio.aws.core.internal
.optionalFromNullable(impl.state())
.map(value => zio.aws.workmail.model.EntityState.wrap(value))
override val userRole: Optional[zio.aws.workmail.model.UserRole] =
zio.aws.core.internal
.optionalFromNullable(impl.userRole())
.map(value => zio.aws.workmail.model.UserRole.wrap(value))
override val enabledDate: Optional[Timestamp] = zio.aws.core.internal
.optionalFromNullable(impl.enabledDate())
.map(value => zio.aws.workmail.model.primitives.Timestamp(value))
override val disabledDate: Optional[Timestamp] = zio.aws.core.internal
.optionalFromNullable(impl.disabledDate())
.map(value => zio.aws.workmail.model.primitives.Timestamp(value))
override val mailboxProvisionedDate: Optional[Timestamp] =
zio.aws.core.internal
.optionalFromNullable(impl.mailboxProvisionedDate())
.map(value => zio.aws.workmail.model.primitives.Timestamp(value))
override val mailboxDeprovisionedDate: Optional[Timestamp] =
zio.aws.core.internal
.optionalFromNullable(impl.mailboxDeprovisionedDate())
.map(value => zio.aws.workmail.model.primitives.Timestamp(value))
override val firstName: Optional[UserAttribute] = zio.aws.core.internal
.optionalFromNullable(impl.firstName())
.map(value => zio.aws.workmail.model.primitives.UserAttribute(value))
override val lastName: Optional[UserAttribute] = zio.aws.core.internal
.optionalFromNullable(impl.lastName())
.map(value => zio.aws.workmail.model.primitives.UserAttribute(value))
override val hiddenFromGlobalAddressList: Optional[Boolean] =
zio.aws.core.internal
.optionalFromNullable(impl.hiddenFromGlobalAddressList())
.map(value => value: Boolean)
override val initials: Optional[UserAttribute] = zio.aws.core.internal
.optionalFromNullable(impl.initials())
.map(value => zio.aws.workmail.model.primitives.UserAttribute(value))
override val telephone: Optional[UserAttribute] = zio.aws.core.internal
.optionalFromNullable(impl.telephone())
.map(value => zio.aws.workmail.model.primitives.UserAttribute(value))
override val street: Optional[UserAttribute] = zio.aws.core.internal
.optionalFromNullable(impl.street())
.map(value => zio.aws.workmail.model.primitives.UserAttribute(value))
override val jobTitle: Optional[UserAttribute] = zio.aws.core.internal
.optionalFromNullable(impl.jobTitle())
.map(value => zio.aws.workmail.model.primitives.UserAttribute(value))
override val city: Optional[UserAttribute] = zio.aws.core.internal
.optionalFromNullable(impl.city())
.map(value => zio.aws.workmail.model.primitives.UserAttribute(value))
override val company: Optional[UserAttribute] = zio.aws.core.internal
.optionalFromNullable(impl.company())
.map(value => zio.aws.workmail.model.primitives.UserAttribute(value))
override val zipCode: Optional[UserAttribute] = zio.aws.core.internal
.optionalFromNullable(impl.zipCode())
.map(value => zio.aws.workmail.model.primitives.UserAttribute(value))
override val department: Optional[UserAttribute] = zio.aws.core.internal
.optionalFromNullable(impl.department())
.map(value => zio.aws.workmail.model.primitives.UserAttribute(value))
override val country: Optional[UserAttribute] = zio.aws.core.internal
.optionalFromNullable(impl.country())
.map(value => zio.aws.workmail.model.primitives.UserAttribute(value))
override val office: Optional[UserAttribute] = zio.aws.core.internal
.optionalFromNullable(impl.office())
.map(value => zio.aws.workmail.model.primitives.UserAttribute(value))
}
def wrap(
impl: software.amazon.awssdk.services.workmail.model.DescribeUserResponse
): zio.aws.workmail.model.DescribeUserResponse.ReadOnly = new Wrapper(impl)
}