-
Notifications
You must be signed in to change notification settings - Fork 243
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
Update business_service.go to accept a context.Context #297
Conversation
} | ||
|
||
// CreateBusinessServiceWithContext creates a new business service. | ||
func (c *Client) CreateBusinessServiceWithContext(ctx context.Context, b *BusinessService) (*BusinessService, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stmcallister similar to #293, I'm curious of your thoughts around removing the *http.Response
from these methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned in #293, as long as we can get the same information from somewhere--in this case, from the APIError
object--we should be okay with this change.
|
||
// ListBusinessServicesPaginated lists existing business services, automatically | ||
// handling pagination and returning the full collection. | ||
func (c *Client) ListBusinessServicesPaginated(ctx context.Context, o ListBusinessServiceOptions) ([]*BusinessService, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This takes naming inspiration from #295.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call.
This also updates the new methods to not return the `*http.Response`, as it doesn't seem needed. Updates #267
d6a955c
to
a697638
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! 👍
|
||
// ListBusinessServicesPaginated lists existing business services, automatically | ||
// handling pagination and returning the full collection. | ||
func (c *Client) ListBusinessServicesPaginated(ctx context.Context, o ListBusinessServiceOptions) ([]*BusinessService, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call.
} | ||
|
||
// CreateBusinessServiceWithContext creates a new business service. | ||
func (c *Client) CreateBusinessServiceWithContext(ctx context.Context, b *BusinessService) (*BusinessService, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned in #293, as long as we can get the same information from somewhere--in this case, from the APIError
object--we should be okay with this change.
This also updates the new methods to not return the
*http.Response
, as itdoesn't seem needed.
Updates #267