// To list all of the secret versions associated with a secret
//
// The following example shows how to retrieve a list of all of the versions of a secret,
// including those without any staging labels.
To list all of the secret versions associated with a secret

The following example shows how to retrieve a list of all of the versions of a secret,
including those without any staging labels.
// To list all of the secret versions associated with a secret // // The following example shows how to retrieve a list of all of the versions of a secret // including those without any staging labels .
func ExampleSecretsManager_ListSecretVersionIds_shared00() {
	svc := secretsmanager.New(session.New())
	input := &secretsmanager.ListSecretVersionIdsInput{
		IncludeDeprecated: aws.Bool(true),
		SecretId:          aws.String("MyTestDatabaseSecret"),
	}
	result, err := svc.ListSecretVersionIds(input)
	if err != nil {
		if aerr, ok := err.(awserr.Error); ok {
			switch aerr.Code() {
			case secretsmanager.ErrCodeInvalidNextTokenException:
				fmt.Println(secretsmanager.ErrCodeInvalidNextTokenException, aerr.Error())
			case secretsmanager.ErrCodeResourceNotFoundException:
				fmt.Println(secretsmanager.ErrCodeResourceNotFoundException, 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_ListSecretVersionIds_shared00 ( ) { svc := secretsmanager . New ( session . New ( ) ) input := & secretsmanager . ListSecretVersionIdsInput { IncludeDeprecated : aws . Bool ( true ) , SecretId : aws . String ( " " ) , } result , err := svc . ListSecretVersionIds ( input ) if err != nil { if aerr , ok := err . ( awserr . Error ) ; ok { switch aerr . Code ( ) { case secretsmanager . ErrCodeInvalidNextTokenException : fmt . Println ( secretsmanager . ErrCodeInvalidNextTokenException , aerr . Error ( ) ) case secretsmanager . ErrCodeResourceNotFoundException : fmt . Println ( secretsmanager . ErrCodeResourceNotFoundException , 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 all of the secret versions associated with a secret
To list all of the secret versions associated with a secret
// Print the error, cast err to awserr.Error to get the Code and // Message from an error.