// Code generated by op-codegen - DO NOT EDIT

package onepassword

import (
	"encoding/json"
	"errors"
)

type RateLimitExceededError struct {
	message string
}

func (e *RateLimitExceededError) Error() string {
	return e.message
}

func unmarshalError(err string) error {
	v := struct {
		Name    string `json:"name"`
		Message string `json:"message"`
	}{}
	if e := json.Unmarshal([]byte(err), &v); e != nil {
		return errors.New(err)
	}
	switch v.Name {
	case "RateLimitExceeded":
		return &RateLimitExceededError{
			message: v.Message,
		}
	default:
		return errors.New(v.Message)
	}
}
