zio.aws.verifiedpermissions.model.ListIdentitySourcesRequest.scala Maven / Gradle / Ivy
package zio.aws.verifiedpermissions.model
import zio.prelude.data.Optional
import zio.aws.core.{AwsError, BuilderHelper}
import zio.ZIO
import java.lang.Integer
import zio.aws.verifiedpermissions.model.primitives.{
ListIdentitySourcesMaxResults,
NextToken,
PolicyStoreId
}
import scala.jdk.CollectionConverters._
final case class ListIdentitySourcesRequest(
policyStoreId: PolicyStoreId,
nextToken: Optional[NextToken] = Optional.Absent,
maxResults: Optional[ListIdentitySourcesMaxResults] = Optional.Absent,
filters: Optional[
Iterable[zio.aws.verifiedpermissions.model.IdentitySourceFilter]
] = Optional.Absent
) {
def buildAwsValue()
: software.amazon.awssdk.services.verifiedpermissions.model.ListIdentitySourcesRequest = {
import ListIdentitySourcesRequest.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.verifiedpermissions.model.ListIdentitySourcesRequest
.builder()
.policyStoreId(PolicyStoreId.unwrap(policyStoreId): java.lang.String)
.optionallyWith(
nextToken.map(value => NextToken.unwrap(value): java.lang.String)
)(_.nextToken)
.optionallyWith(
maxResults.map(value =>
ListIdentitySourcesMaxResults.unwrap(value): Integer
)
)(_.maxResults)
.optionallyWith(
filters.map(value =>
value.map { item =>
item.buildAwsValue()
}.asJavaCollection
)
)(_.filters)
.build()
}
def asReadOnly
: zio.aws.verifiedpermissions.model.ListIdentitySourcesRequest.ReadOnly =
zio.aws.verifiedpermissions.model.ListIdentitySourcesRequest
.wrap(buildAwsValue())
}
object ListIdentitySourcesRequest {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.verifiedpermissions.model.ListIdentitySourcesRequest
] = BuilderHelper.apply
trait ReadOnly {
def asEditable
: zio.aws.verifiedpermissions.model.ListIdentitySourcesRequest =
zio.aws.verifiedpermissions.model.ListIdentitySourcesRequest(
policyStoreId,
nextToken.map(value => value),
maxResults.map(value => value),
filters.map(value =>
value.map { item =>
item.asEditable
}
)
)
def policyStoreId: PolicyStoreId
def nextToken: Optional[NextToken]
def maxResults: Optional[ListIdentitySourcesMaxResults]
def filters: Optional[
List[zio.aws.verifiedpermissions.model.IdentitySourceFilter.ReadOnly]
]
def getPolicyStoreId: ZIO[Any, Nothing, PolicyStoreId] =
ZIO.succeed(policyStoreId)
def getNextToken: ZIO[Any, AwsError, NextToken] =
AwsError.unwrapOptionField("nextToken", nextToken)
def getMaxResults: ZIO[Any, AwsError, ListIdentitySourcesMaxResults] =
AwsError.unwrapOptionField("maxResults", maxResults)
def getFilters: ZIO[Any, AwsError, List[
zio.aws.verifiedpermissions.model.IdentitySourceFilter.ReadOnly
]] = AwsError.unwrapOptionField("filters", filters)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.verifiedpermissions.model.ListIdentitySourcesRequest
) extends zio.aws.verifiedpermissions.model.ListIdentitySourcesRequest.ReadOnly {
override val policyStoreId: PolicyStoreId =
zio.aws.verifiedpermissions.model.primitives
.PolicyStoreId(impl.policyStoreId())
override val nextToken: Optional[NextToken] = zio.aws.core.internal
.optionalFromNullable(impl.nextToken())
.map(value =>
zio.aws.verifiedpermissions.model.primitives.NextToken(value)
)
override val maxResults: Optional[ListIdentitySourcesMaxResults] =
zio.aws.core.internal
.optionalFromNullable(impl.maxResults())
.map(value =>
zio.aws.verifiedpermissions.model.primitives
.ListIdentitySourcesMaxResults(value)
)
override val filters: Optional[
List[zio.aws.verifiedpermissions.model.IdentitySourceFilter.ReadOnly]
] = zio.aws.core.internal
.optionalFromNullable(impl.filters())
.map(value =>
value.asScala.map { item =>
zio.aws.verifiedpermissions.model.IdentitySourceFilter.wrap(item)
}.toList
)
}
def wrap(
impl: software.amazon.awssdk.services.verifiedpermissions.model.ListIdentitySourcesRequest
): zio.aws.verifiedpermissions.model.ListIdentitySourcesRequest.ReadOnly =
new Wrapper(impl)
}