Add ListAnswersByUser to CheckinsService#276
Draft
robzolkos wants to merge 1 commit intobasecamp:mainfrom
Draft
Conversation
Spec Change Impact
SDKs needing updates:
|
Wraps the existing GetAnswersByPersonWithResponse generated endpoint with
a proper service method, following the same pagination pattern as ListAnswers.
The BC3 API has supported GET /questions/{id}/answers/by/{personId}.json
but the Go SDK had no service-layer wrapper for it.
15fed52 to
2fe5be2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The BC3 API supports
GET /questions/{id}/answers/by/{personId}.jsonto fetch a specific person's answers to a check-in question, and the generated Go client already exposesGetAnswersByPersonWithResponse. However, theCheckinsServicehad no service-layer wrapper for it.This PR adds
ListAnswersByUser(ctx, questionID, personID int64, opts *AnswerListOptions) (*AnswerListResult, error)toCheckinsService, following the same pagination pattern as the existingListAnswersmethod.Changes
go/pkg/basecamp/checkins.go— newListAnswersByUsermethod onCheckinsServicego/pkg/basecamp/checkins_test.go—TestCheckinsService_ListAnswersByUserverifying the correct API path is called and results are parsedspec/fixtures/checkins/answers_by_person.json— fixture for single-user answer listOther languages
Ruby, Python, TypeScript, Kotlin, and Swift all already expose this endpoint — their SDKs are fully generated from the OpenAPI spec so
byPerson/by_personwas included from the start. The Go SDK is unique in having a hand-written service layer on top of the generated client, which is why only Go needed this change.Context
This unblocks basecamp/basecamp-cli#443, which requests a
--byfilter onbasecamp checkins answers. The CLI PR depends on this SDK method being available.