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

Update business_service.go to accept a context.Context #297

Merged
merged 1 commit into from
Mar 15, 2021

Conversation

theckman
Copy link
Collaborator

This also updates the new methods to not return the *http.Response, as it
doesn't seem needed.

Updates #267

@theckman theckman added this to the v1.4.0 milestone Feb 27, 2021
}

// CreateBusinessServiceWithContext creates a new business service.
func (c *Client) CreateBusinessServiceWithContext(ctx context.Context, b *BusinessService) (*BusinessService, error) {
Copy link
Collaborator Author

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.

Copy link
Contributor

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) {
Copy link
Collaborator Author

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.

Copy link
Contributor

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
Copy link
Contributor

@stmcallister stmcallister left a 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) {
Copy link
Contributor

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) {
Copy link
Contributor

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.

@stmcallister stmcallister merged commit fdccb8d into master Mar 15, 2021
@theckman theckman deleted the ctx_business_service branch April 23, 2021 07:50
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

Successfully merging this pull request may close these issues.

2 participants