Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Generated where it should be. Hand-shaped where it matters.
| --- | --- |
| **Idiomatic Go API** | Use focused services such as `client.Admins.Me(ctx)`, `client.Contacts.Search(ctx, ...)`, and `client.Conversations.Reply(ctx, ...)` instead of generated operation names and unions. |
| **Production-minded** | Opt into conservative retries, inspect request IDs and rate limits, customize individual requests, and verify webhook signatures. |
| **Complete and current** | Public services account for every operation in the pinned Intercom API `2.15` specification, with an automated coverage audit. |
| **Complete and current** | Public services account for every operation in the pinned Intercom API `2.16` specification, with an automated coverage audit. |
| **Stable public surface** | Generated OpenAPI code stays internal while compatibility checks protect the SDK API your application imports. |
| **Easy to test** | The public [`intercomtest`](https://pkg.go.dev/github.com/uffejaeger/intercom-go/intercomtest) package scripts local Intercom responses and captures outgoing requests without calling Intercom. |

Expand Down Expand Up @@ -223,7 +223,7 @@ application already owns the raw payload bytes.

## API Coverage

The SDK targets Intercom API version `2.15`, pinned in
The SDK targets Intercom API version `2.16`, pinned in
[`spec/intercom.openapi.yaml`](spec/intercom.openapi.yaml). Public root-package
services cover the pinned specification while generated client code stays
internal under [`internal/generated/intercom`](internal/generated/intercom).
Comment thread
uffejaeger marked this conversation as resolved.
Expand Down
30 changes: 30 additions & 0 deletions admins.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ type AdminList = gen.AdminListSchema
// AdminActivityLogs is a page of admin activity log entries.
type AdminActivityLogs = gen.ActivityLogListSchema

// AdminActivityLogEventTypes is the list of supported admin activity-log event types.
type AdminActivityLogEventTypes = gen.ActivityLogEventTypeListSchema

// AdminActivityLogEventTypesParams configures an activity-log event-type request.
type AdminActivityLogEventTypesParams = gen.ListActivityLogEventTypesParams

// AdminActivityLogSearchParams configures an activity-log search request.
type AdminActivityLogSearchParams = gen.SearchActivityLogsParams

// AdminActivityLogSearch is the body for an activity-log search request.
type AdminActivityLogSearch = gen.SearchActivityLogsJSONRequestBody

// AdminSetAway holds the fields for setting an admin's away status.
type AdminSetAway = gen.SetAwayAdminJSONRequestBody

Expand All @@ -28,6 +40,24 @@ type AdminsService struct {
client *Client
}

// ListActivityLogEventTypes returns available admin activity-log event types.
func (s *AdminsService) ListActivityLogEventTypes(ctx context.Context, params *AdminActivityLogEventTypesParams) (*AdminActivityLogEventTypes, error) {
res, err := s.client.generated.ListActivityLogEventTypesWithResponse(ctx, params)
if err != nil {
return nil, err
}
return requireOK("list activity-log event types", res.StatusCode(), res.Body, res.JSON200, responseHeaders(res.HTTPResponse))
}

// SearchActivityLogs searches admin activity logs.
func (s *AdminsService) SearchActivityLogs(ctx context.Context, params *AdminActivityLogSearchParams, request AdminActivityLogSearch) (*AdminActivityLogs, error) {
res, err := s.client.generated.SearchActivityLogsWithResponse(ctx, params, request)
if err != nil {
return nil, err
}
return requireOK("search activity logs", res.StatusCode(), res.Body, res.JSON200, responseHeaders(res.HTTPResponse))
}

// Me identifies the currently authenticated admin.
func (s *AdminsService) Me(ctx context.Context) (*Admin, error) {
res, err := s.client.generated.IdentifyAdminWithResponse(ctx, nil)
Expand Down
Loading