errors/type.go
func fromString(str string) (Type, error) {
	enum := strings.ToLower(str)
	switch enum {
	case "unknown":
		return Unknown, nil
	case "internal":
		return Internal, nil
	case "invalid argument":
		return InvalidArgument, nil
	case "out of range":
		return OutOfRange, nil
	case "not found":
		return NotFound, nil
	case "conflict":
		return Conflict, nil
	case "already exists":
		return AlreadyExists, nil
	case "unauthorized":
		return Unauthorized, nil
	case "permission denied":
		return PermissionDenied, nil
	case "timeout":
		return Timeout, nil
	case "not implemented":
		return NotImplemented, nil
	case "temporarily unavailable":
		return TemporarilyUnavailable, nil
	case "permanently unavailable":
		return PermanentlyUnavailable, nil
	case "canceled":
		return Canceled, nil
	case "resource exhausted":
		return ResourceExhausted, nil
	default:
		return Unknown, fmt.Errorf("Invalid error type")
	}
}
func fromString(str string) (Type, error) {
	enum := strings.ToLower(str)
	switch enum {
	case "unknown":
		return Unknown, nil
	case "internal":
		return Internal, nil
	case "invalid argument":
		return InvalidArgument, nil
	case "out of range":
		return OutOfRange, nil
	case "not found":
		return NotFound, nil
	case "conflict":
		return Conflict, nil
	case "already exists":
		return AlreadyExists, nil
	case "unauthorized":
		return Unauthorized, nil
	case "permission denied":
		return PermissionDenied, nil
	case "timeout":
		return Timeout, nil
	case "not implemented":
		return NotImplemented, nil
	case "temporarily unavailable":
		return TemporarilyUnavailable, nil
	case "permanently unavailable":
		return PermanentlyUnavailable, nil
	case "canceled":
		return Canceled, nil
	case "resource exhausted":
		return ResourceExhausted, nil
	default:
		return Unknown, fmt.Errorf("Invalid error type")
	}
}
// fromString parses a string into an error type. If the type is invalid, the
// Unknown type will be returned as well as an error.