My request is as follows:
const listCompartmentsRequest: identity.requests.ListCompartmentsRequest = {
compartmentId: id,
compartmentIdInSubtree: true,
}
I want to shorten the long line
identity.requests.ListCompartmentsRequest
.
I'm looking for something like this:
const { ListCompartmentsRequest } = identity.requests
const listCompartmentsRequest: ListCompartmentsRequest = {
compartmentId: id,
compartmentIdInSubtree: true,
}
Even though I have tried it, I'm encountering this error:
ListCompartmentsRequest
refers to a value, but is being used as a type here. Did you meantypeof ListCompartmentsRequest
?"