listPolicies
inline suspend fun OrganizationsClient.listPolicies(crossinline block: ListPoliciesRequest.Builder.() -> Unit): ListPoliciesResponse
Retrieves the list of all policies in an organization of a specified type.
Always check the NextToken
response parameter for a null
value when calling a List*
operation. These operations can occasionally return an empty set of results even when there are more results available. The NextToken
response parameter value is null
only when there are no more results to display.
This operation can be called only from the organization's management account or by a member account that is a delegated administrator for an Amazon Web Services service.
Samples
fun main() {
//sampleStart
// The following example shows how to get a list of service control policies (SCPs) n n
val resp = organizationsClient.listPolicies {
filter = PolicyType.fromValue("SERVICE_CONTROL_POLICY")
}
//sampleEnd
}