There are more AWS SDK examples available in the AWS Doc SDK Examples
Policy to grant full access to Compute Optimizer Automation for standalone AWS accounts
The following code example shows how to This permission-based policy grant full access to Compute Optimizer Automation for standalone AWS accounts