Skip to content

Adopt Intercom API 2.16 - #73

Open
uffejaeger wants to merge 1 commit into
mainfrom
codex/adopt-intercom-api-2-16
Open

Adopt Intercom API 2.16#73
uffejaeger wants to merge 1 commit into
mainfrom
codex/adopt-intercom-api-2-16

Conversation

@uffejaeger

Copy link
Copy Markdown
Owner

Summary

Adopts Intercom API 2.16 and regenerates the pinned OpenAPI client.

  • Adds public service wrappers for every newly available 2.16 operation, including audiences, content snippets, conversation attributes, data connectors, help-center redirects, macros, office hours, and WhatsApp status.
  • Updates existing wrappers for changed 2.16 endpoint contracts and response shapes.
  • Normalizes the upstream spec where needed for deterministic Go generation, and adds coverage that verifies every generated operation is surfaced by the SDK.
  • Keeps the compatibility audit focused on the importable public SDK API; the private generated client remains enforced by reproducible-generation checks.

Validation

  • make pre-push
    • go vet ./...
    • Staticcheck
    • 99.9% coverage
    • make generate-check
    • public API compatibility against v0.2.0
    • govulncheck (no vulnerabilities found)
  • go test ./...
  • go test -run TestGeneratedOperationsAreAccountedFor .

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c51bf713b9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread admins.go
}

// SearchActivityLogs searches admin activity logs.
func (s *AdminsService) SearchActivityLogs(ctx context.Context, params *gen.SearchActivityLogsParams, request gen.SearchActivityLogsJSONRequestBody) (*gen.SearchActivityLogsResponse, error) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep internal generated types out of public signatures

For downstream module users, SearchActivityLogs cannot be called normally because both its request parameters are types from internal/generated/intercom, which Go's internal-package rule prevents consumers from importing or constructing directly. The same leak affects the newly added conversation, ticket, Fin, team, WhatsApp, and other wrappers; expose root-package aliases or hand-shaped SDK types instead so these operations form a usable public API.

AGENTS.md reference: AGENTS.md:L24-L26

Useful? React with 👍 / 👎.

Comment thread admins.go
Comment on lines +32 to +33
func (s *AdminsService) ListActivityLogEventTypes(ctx context.Context, params *gen.ListActivityLogEventTypesParams) (*gen.ListActivityLogEventTypesResponse, error) {
return s.client.generated.ListActivityLogEventTypesWithResponse(ctx, params)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Convert HTTP failure responses into SDK errors

When Intercom returns a valid 401, 429, or 5xx response, ListActivityLogEventTypesWithResponse returns the generated response with a nil Go error, so this public method also reports nil error instead of applying the SDK's normal error mapping. This forwarding pattern is repeated across several newly added methods; parse the success payload and pass non-success statuses through parseErrorResponse/the response helpers rather than exposing the generated response directly.

AGENTS.md reference: AGENTS.md:L24-L26

Useful? React with 👍 / 👎.

Comment thread custom_objects.go
}
params := &gen.GetCustomObjectInstancesByExternalIdParams{ExternalId: externalID}
res, err := s.client.generated.GetCustomObjectInstancesByExternalIdWithResponse(ctx, customObjectType, params)
res, err := s.client.generated.GetCustomObjectInstancesByIdWithResponse(ctx, customObjectType, externalID, nil)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve external-ID lookup semantics

When an external ID differs from the Intercom-assigned instance ID, this now sends it to the by-ID route (/custom_object_instances/{type}/{id}), whose operation is explicitly defined as fetching by ID in spec/intercom.openapi.yaml:14576-14577. Existing GetByExternalID callers will therefore receive a 404 or potentially retrieve an unrelated instance instead of querying by external_id; retain an external-ID lookup request independently of the removed generated helper.

Useful? React with 👍 / 👎.

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.

1 participant