Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement proposal feedback #62

Open
olsio opened this issue Jan 30, 2018 · 1 comment
Open

Enhancement proposal feedback #62

olsio opened this issue Jan 30, 2018 · 1 comment

Comments

@olsio
Copy link

olsio commented Jan 30, 2018

I think the project could be improved adding convenience methods to the objects instead of passing id's through the relevant services.

Examples would be:

func (r *Room) History(opt *HistoryOptions)
func (r *Room) Message(msgReq *RoomMessageRequest) (*http.Response, error)

With a flow like:

room := client.Room.get("123")
room.History(&hipchat.HistoryOptions{})

This could be achieved by adding the service to the struct and then create some wrapper methods.

type Room struct {
	...
	GuestAccessURL    string         `json:"guest_access_url"`
	roomService       *RoomService
}
func (r *Room) History(opt *HistoryOptions) (*History, *http.Response, error) {
	return r.roomService.History(strconv.Itoa(r.ID), opt)
}
@olsio
Copy link
Author

olsio commented Jan 30, 2018

I would like to work on a PR for that but I can understand if that doesn't fit the projects vision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant