// To list the secrets in your account
//
// The following example shows how to list all of the secrets in your account.
To list the secrets in your account

The following example shows how to list all of the secrets in your account.
// To list the secrets in your account // // The following example shows how to list all of the secrets in your account .
func ExampleSecretsManager_ListSecrets_shared00() {
	svc := secretsmanager.New(session.New())
	input := &secretsmanager.ListSecretsInput{}
	result, err := svc.ListSecrets(input)
	if err != nil {
		if aerr, ok := err.(awserr.Error); ok {
			switch aerr.Code() {
			case secretsmanager.ErrCodeInvalidParameterException:
				fmt.Println(secretsmanager.ErrCodeInvalidParameterException, aerr.Error())
			case secretsmanager.ErrCodeInvalidNextTokenException:
				fmt.Println(secretsmanager.ErrCodeInvalidNextTokenException, aerr.Error())
			case secretsmanager.ErrCodeInternalServiceError:
				fmt.Println(secretsmanager.ErrCodeInternalServiceError, aerr.Error())
			default:
				fmt.Println(aerr.Error())
			}
		} else {
			fmt.Println(err.Error())
		}
		return
	}
	fmt.Println(result)
}
func ExampleSecretsManager_ListSecrets_shared00 ( ) { svc := secretsmanager . New ( session . New ( ) ) input := & secretsmanager . ListSecretsInput { } result , err := svc . ListSecrets ( input ) if err != nil { if aerr , ok := err . ( awserr . Error ) ; ok { switch aerr . Code ( ) { case secretsmanager . ErrCodeInvalidParameterException : fmt . Println ( secretsmanager . ErrCodeInvalidParameterException , aerr . Error ( ) ) case secretsmanager . ErrCodeInvalidNextTokenException : fmt . Println ( secretsmanager . ErrCodeInvalidNextTokenException , aerr . Error ( ) ) case secretsmanager . ErrCodeInternalServiceError : fmt . Println ( secretsmanager . ErrCodeInternalServiceError , aerr . Error ( ) ) default : fmt . Println ( aerr . Error ( ) ) } } else { fmt . Println ( err . Error ( ) ) } return } fmt . Println ( result ) }
To list the secrets in your account
To list the secrets in your account
// Print the error, cast err to awserr.Error to get the Code and // Message from an error.