// To update the description of a secret
//
// The following example shows how to modify the description of a secret.
To update the description of a secret

The following example shows how to modify the description of a secret.
// To update the description of a secret // // The following example shows how to modify the description of a secret .
func ExampleSecretsManager_UpdateSecret_shared00() {
	svc := secretsmanager.New(session.New())
	input := &secretsmanager.UpdateSecretInput{
		ClientRequestToken: aws.String("EXAMPLE1-90ab-cdef-fedc-ba987EXAMPLE"),
		Description:        aws.String("This is a new description for the secret."),
		SecretId:           aws.String("MyTestDatabaseSecret"),
	}
	result, err := svc.UpdateSecret(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.ErrCodeInvalidRequestException:
				fmt.Println(secretsmanager.ErrCodeInvalidRequestException, aerr.Error())
			case secretsmanager.ErrCodeLimitExceededException:
				fmt.Println(secretsmanager.ErrCodeLimitExceededException, aerr.Error())
			case secretsmanager.ErrCodeEncryptionFailure:
				fmt.Println(secretsmanager.ErrCodeEncryptionFailure, aerr.Error())
			case secretsmanager.ErrCodeResourceExistsException:
				fmt.Println(secretsmanager.ErrCodeResourceExistsException, aerr.Error())
			case secretsmanager.ErrCodeResourceNotFoundException:
				fmt.Println(secretsmanager.ErrCodeResourceNotFoundException, aerr.Error())
			case secretsmanager.ErrCodeMalformedPolicyDocumentException:
				fmt.Println(secretsmanager.ErrCodeMalformedPolicyDocumentException, aerr.Error())
			case secretsmanager.ErrCodeInternalServiceError:
				fmt.Println(secretsmanager.ErrCodeInternalServiceError, aerr.Error())
			case secretsmanager.ErrCodePreconditionNotMetException:
				fmt.Println(secretsmanager.ErrCodePreconditionNotMetException, aerr.Error())
			default:
				fmt.Println(aerr.Error())
			}
		} else {
			fmt.Println(err.Error())
		}
		return
	}
	fmt.Println(result)
}
func ExampleSecretsManager_UpdateSecret_shared00 ( ) { svc := secretsmanager . New ( session . New ( ) ) input := & secretsmanager . UpdateSecretInput { ClientRequestToken : aws . String ( " " ) , Description : aws . String ( " " ) , SecretId : aws . String ( " " ) , } result , err := svc . UpdateSecret ( 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 . ErrCodeInvalidRequestException : fmt . Println ( secretsmanager . ErrCodeInvalidRequestException , aerr . Error ( ) ) case secretsmanager . ErrCodeLimitExceededException : fmt . Println ( secretsmanager . ErrCodeLimitExceededException , aerr . Error ( ) ) case secretsmanager . ErrCodeEncryptionFailure : fmt . Println ( secretsmanager . ErrCodeEncryptionFailure , aerr . Error ( ) ) case secretsmanager . ErrCodeResourceExistsException : fmt . Println ( secretsmanager . ErrCodeResourceExistsException , aerr . Error ( ) ) case secretsmanager . ErrCodeResourceNotFoundException : fmt . Println ( secretsmanager . ErrCodeResourceNotFoundException , aerr . Error ( ) ) case secretsmanager . ErrCodeMalformedPolicyDocumentException : fmt . Println ( secretsmanager . ErrCodeMalformedPolicyDocumentException , aerr . Error ( ) ) case secretsmanager . ErrCodeInternalServiceError : fmt . Println ( secretsmanager . ErrCodeInternalServiceError , aerr . Error ( ) ) case secretsmanager . ErrCodePreconditionNotMetException : fmt . Println ( secretsmanager . ErrCodePreconditionNotMetException , aerr . Error ( ) ) default : fmt . Println ( aerr . Error ( ) ) } } else { fmt . Println ( err . Error ( ) ) } return } fmt . Println ( result ) }
To update the description of a secret
To update the description of a secret
// Print the error, cast err to awserr.Error to get the Code and // Message from an error.