Skip to content
Merged
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
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,21 @@ String html = lettermint.messages().html("message-id");
| `suppressions()` | `list`, `iterate`, `create`, `delete` |
| `team()` | `retrieve`, `update`, `usage`, `roles` |
| `team().members()` | `list`, `iterate`, `retrieve`, `updateAssignment` |
| `team().invites()` | `list`, `iterate`, `retrieve`, `create`, `update`, `revoke` |
| `webhooks()` | `list`, `iterate`, `create`, `retrieve`, `update`, `delete`, `test`, `regenerateSecret` |
| `webhooks().deliveries()` | `list(webhookId)`, `iterate(webhookId)`, `retrieve(webhookId, deliveryId)`, `retry(webhookId, deliveryId)` |
| (root) | `ping`, `analytics`, `analyticsPages`, `blockedFileTypes` |

`webhooks().deliveries().retry(webhookId, deliveryId)` sends a delivery's original payload to the webhook again now; it throws a `ConflictException` when the webhook is disabled, the delivery cannot be retried, or a retry is already in progress.

`team().invites().create(...)` invites a person and sends the invitation email; the team needs a free seat, and the Owner role can't be assigned. `update(inviteId, ...)` replaces a pending invitation's email, role and project access, and sends a new email only when the address changes:

```java
TeamInviteData invite = lettermint.team().invites().create(new CreateTeamInviteData("ada@acme.com", roleId,
new CreateTeamInviteDataProjectAccess(ProjectAccessScope.of("selected"), List.of(projectId))));
lettermint.team().invites().revoke(invite.id());
```

Request and response types are immutable records in `co.lettermint.types`. Build requests with their builder (`UpdateRouteData.builder().name("Main").build()`) or, for small ones, the constructor (`new StoreDomainData("acme.com")`). In update requests, a field that is optional and nullable is an `OptionalNullable`: leave it unset to keep the current value, or pass `null` to the builder to clear it:

```java
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/co/lettermint/Team.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
public final class Team {
private final Transport transport;
private final TeamMembers members;
private final TeamInvites invites;

Team(Transport transport) {
this.transport = transport;
this.members = new TeamMembers(transport);
this.invites = new TeamInvites(transport);
}

/**
Expand All @@ -25,6 +27,13 @@ public TeamMembers members() {
return members;
}

/**
* @return pending team invitations
*/
public TeamInvites invites() {
return invites;
}

/**
* Retrieves the team; {@code include} can add its features.
*
Expand Down
173 changes: 173 additions & 0 deletions src/main/java/co/lettermint/TeamInvites.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
package co.lettermint;

import co.lettermint.types.CreateTeamInviteData;
import co.lettermint.types.CursorPage;
import co.lettermint.types.ListTeamInvitesQuery;
import co.lettermint.types.MessageResponse;
import co.lettermint.types.Operations;
import co.lettermint.types.TeamInviteData;
import co.lettermint.types.UpdateTeamInviteData;

/** Pending team invitations. Needs the team token. Thread-safe. */
public final class TeamInvites {
private final Transport transport;

TeamInvites(Transport transport) {
this.transport = transport;
}

/**
* Lists pending team invitations, one page at a time.
*
* @return the response
*/
public CursorPage<TeamInviteData> list() {
return list(null, null);
}

/**
* Lists pending team invitations, one page at a time.
*
* @param query the query parameters, or null
* @return the response
*/
public CursorPage<TeamInviteData> list(ListTeamInvitesQuery query) {
return list(query, null);
}

/**
* Lists pending team invitations, one page at a time.
*
* @param query the query parameters, or null
* @param options per-call options, or null
* @return the response
*/
public CursorPage<TeamInviteData> list(ListTeamInvitesQuery query, RequestOptions options) {
return transport.call(Operations.LIST_TEAM_INVITES, Transport.call("team.invites.list").query(query).options(options));
}

/**
* Iterates over every pending team invitation, following {@code next_cursor}.
*
* @return every item, fetched page by page as you iterate
*/
public CursorIterable<TeamInviteData> iterate() {
return iterate(null, null);
}

/**
* Iterates over every pending team invitation, following {@code next_cursor}.
*
* @param query the query parameters, or null
* @return every item, fetched page by page as you iterate
*/
public CursorIterable<TeamInviteData> iterate(ListTeamInvitesQuery query) {
return iterate(query, null);
}

/**
* Iterates over every pending team invitation, following {@code next_cursor}.
*
* @param query the query parameters, or null
* @param options per-call options, or null
* @return every item, fetched page by page as you iterate
*/
public CursorIterable<TeamInviteData> iterate(ListTeamInvitesQuery query, RequestOptions options) {
return transport.paginate(Operations.LIST_TEAM_INVITES, Transport.call("team.invites.iterate").query(query).options(options));
}

/**
* Retrieves a pending team invitation.
*
* @param inviteId the invite id
* @return the response
*/
public TeamInviteData retrieve(String inviteId) {
return retrieve(inviteId, null);
}

/**
* Retrieves a pending team invitation.
*
* @param inviteId the invite id
* @param options per-call options, or null
* @return the response
*/
public TeamInviteData retrieve(String inviteId, RequestOptions options) {
return transport.call(Operations.GET_TEAM_INVITE, Transport.call("team.invites.retrieve").path(inviteId).options(options));
}

/**
* Invites a person to the team and sends the invitation email. The team needs a free seat, and the
* Owner role can't be assigned.
*
* @param body the request body
* @return the response
*/
public TeamInviteData create(CreateTeamInviteData body) {
return create(body, null);
}

/**
* Invites a person to the team and sends the invitation email. The team needs a free seat, and the
* Owner role can't be assigned.
*
* @param body the request body
* @param options per-call options, or null
* @return the response
*/
public TeamInviteData create(CreateTeamInviteData body, RequestOptions options) {
return transport.call(Operations.CREATE_TEAM_INVITE, Transport.call("team.invites.create").body(body).options(options));
}

/**
* Replaces a pending invitation's email, role and project access. A new invitation email is sent
* only when the address changes.
*
* @param inviteId the invite id
* @param body the request body
* @return the response
*/
public TeamInviteData update(String inviteId, UpdateTeamInviteData body) {
return update(inviteId, body, null);
}

/**
* Replaces a pending invitation's email, role and project access. A new invitation email is sent
* only when the address changes.
*
* @param inviteId the invite id
* @param body the request body
* @param options per-call options, or null
* @return the response
*/
public TeamInviteData update(String inviteId, UpdateTeamInviteData body, RequestOptions options) {
return transport.call(Operations.UPDATE_TEAM_INVITE, Transport.call("team.invites.update").path(inviteId).body(body).options(options));
}

/**
* Revokes a pending team invitation.
*
* @param inviteId the invite id
* @return the response
*/
public MessageResponse revoke(String inviteId) {
return revoke(inviteId, null);
}

/**
* Revokes a pending team invitation.
*
* @param inviteId the invite id
* @param options per-call options, or null
* @return the response
*/
public MessageResponse revoke(String inviteId, RequestOptions options) {
return transport.call(Operations.DELETE_TEAM_INVITE, Transport.call("team.invites.revoke").path(inviteId).options(options));
}

@Override
public String toString() {
return "TeamInvites{}";
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Generated by lettermint/sdk-generator — do not edit.
// Spec: lettermint/lettermint@6ef4036dede6326ad2200b945e689e319faf4c0a (main)
// Spec: lettermint/lettermint@a14a098fd3173b67bc366163127ee3715457cd59 (main)
// sending-openapi.json SHA-256: 8d5e962e57d79ab08be52147c094657b681768f06940a76c8eec1b1e03df54cc
// team-openapi.json SHA-256: 4ba5b65756faa9db79e5b95e06414899af0a6e97766eed04656c1b778f28aef7
// team-openapi.json SHA-256: da4398ead370c9b61eadb4007087a6da945df3c609801325fd38fc780cc0e707
// Naming profile: next

package co.lettermint.types;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Generated by lettermint/sdk-generator — do not edit.
// Spec: lettermint/lettermint@6ef4036dede6326ad2200b945e689e319faf4c0a (main)
// Spec: lettermint/lettermint@a14a098fd3173b67bc366163127ee3715457cd59 (main)
// sending-openapi.json SHA-256: 8d5e962e57d79ab08be52147c094657b681768f06940a76c8eec1b1e03df54cc
// team-openapi.json SHA-256: 4ba5b65756faa9db79e5b95e06414899af0a6e97766eed04656c1b778f28aef7
// team-openapi.json SHA-256: da4398ead370c9b61eadb4007087a6da945df3c609801325fd38fc780cc0e707
// Naming profile: next

package co.lettermint.types;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Generated by lettermint/sdk-generator — do not edit.
// Spec: lettermint/lettermint@6ef4036dede6326ad2200b945e689e319faf4c0a (main)
// Spec: lettermint/lettermint@a14a098fd3173b67bc366163127ee3715457cd59 (main)
// sending-openapi.json SHA-256: 8d5e962e57d79ab08be52147c094657b681768f06940a76c8eec1b1e03df54cc
// team-openapi.json SHA-256: 4ba5b65756faa9db79e5b95e06414899af0a6e97766eed04656c1b778f28aef7
// team-openapi.json SHA-256: da4398ead370c9b61eadb4007087a6da945df3c609801325fd38fc780cc0e707
// Naming profile: next

package co.lettermint.types;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/co/lettermint/types/AnalyticsComparison.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Generated by lettermint/sdk-generator — do not edit.
// Spec: lettermint/lettermint@6ef4036dede6326ad2200b945e689e319faf4c0a (main)
// Spec: lettermint/lettermint@a14a098fd3173b67bc366163127ee3715457cd59 (main)
// sending-openapi.json SHA-256: 8d5e962e57d79ab08be52147c094657b681768f06940a76c8eec1b1e03df54cc
// team-openapi.json SHA-256: 4ba5b65756faa9db79e5b95e06414899af0a6e97766eed04656c1b778f28aef7
// team-openapi.json SHA-256: da4398ead370c9b61eadb4007087a6da945df3c609801325fd38fc780cc0e707
// Naming profile: next

package co.lettermint.types;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Generated by lettermint/sdk-generator — do not edit.
// Spec: lettermint/lettermint@6ef4036dede6326ad2200b945e689e319faf4c0a (main)
// Spec: lettermint/lettermint@a14a098fd3173b67bc366163127ee3715457cd59 (main)
// sending-openapi.json SHA-256: 8d5e962e57d79ab08be52147c094657b681768f06940a76c8eec1b1e03df54cc
// team-openapi.json SHA-256: 4ba5b65756faa9db79e5b95e06414899af0a6e97766eed04656c1b778f28aef7
// team-openapi.json SHA-256: da4398ead370c9b61eadb4007087a6da945df3c609801325fd38fc780cc0e707
// Naming profile: next

package co.lettermint.types;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/co/lettermint/types/AnalyticsDimension.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Generated by lettermint/sdk-generator — do not edit.
// Spec: lettermint/lettermint@6ef4036dede6326ad2200b945e689e319faf4c0a (main)
// Spec: lettermint/lettermint@a14a098fd3173b67bc366163127ee3715457cd59 (main)
// sending-openapi.json SHA-256: 8d5e962e57d79ab08be52147c094657b681768f06940a76c8eec1b1e03df54cc
// team-openapi.json SHA-256: 4ba5b65756faa9db79e5b95e06414899af0a6e97766eed04656c1b778f28aef7
// team-openapi.json SHA-256: da4398ead370c9b61eadb4007087a6da945df3c609801325fd38fc780cc0e707
// Naming profile: next

package co.lettermint.types;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/co/lettermint/types/AnalyticsFilter.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Generated by lettermint/sdk-generator — do not edit.
// Spec: lettermint/lettermint@6ef4036dede6326ad2200b945e689e319faf4c0a (main)
// Spec: lettermint/lettermint@a14a098fd3173b67bc366163127ee3715457cd59 (main)
// sending-openapi.json SHA-256: 8d5e962e57d79ab08be52147c094657b681768f06940a76c8eec1b1e03df54cc
// team-openapi.json SHA-256: 4ba5b65756faa9db79e5b95e06414899af0a6e97766eed04656c1b778f28aef7
// team-openapi.json SHA-256: da4398ead370c9b61eadb4007087a6da945df3c609801325fd38fc780cc0e707
// Naming profile: next

package co.lettermint.types;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Generated by lettermint/sdk-generator — do not edit.
// Spec: lettermint/lettermint@6ef4036dede6326ad2200b945e689e319faf4c0a (main)
// Spec: lettermint/lettermint@a14a098fd3173b67bc366163127ee3715457cd59 (main)
// sending-openapi.json SHA-256: 8d5e962e57d79ab08be52147c094657b681768f06940a76c8eec1b1e03df54cc
// team-openapi.json SHA-256: 4ba5b65756faa9db79e5b95e06414899af0a6e97766eed04656c1b778f28aef7
// team-openapi.json SHA-256: da4398ead370c9b61eadb4007087a6da945df3c609801325fd38fc780cc0e707
// Naming profile: next

package co.lettermint.types;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Generated by lettermint/sdk-generator — do not edit.
// Spec: lettermint/lettermint@6ef4036dede6326ad2200b945e689e319faf4c0a (main)
// Spec: lettermint/lettermint@a14a098fd3173b67bc366163127ee3715457cd59 (main)
// sending-openapi.json SHA-256: 8d5e962e57d79ab08be52147c094657b681768f06940a76c8eec1b1e03df54cc
// team-openapi.json SHA-256: 4ba5b65756faa9db79e5b95e06414899af0a6e97766eed04656c1b778f28aef7
// team-openapi.json SHA-256: da4398ead370c9b61eadb4007087a6da945df3c609801325fd38fc780cc0e707
// Naming profile: next

package co.lettermint.types;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/co/lettermint/types/AnalyticsInterval.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Generated by lettermint/sdk-generator — do not edit.
// Spec: lettermint/lettermint@6ef4036dede6326ad2200b945e689e319faf4c0a (main)
// Spec: lettermint/lettermint@a14a098fd3173b67bc366163127ee3715457cd59 (main)
// sending-openapi.json SHA-256: 8d5e962e57d79ab08be52147c094657b681768f06940a76c8eec1b1e03df54cc
// team-openapi.json SHA-256: 4ba5b65756faa9db79e5b95e06414899af0a6e97766eed04656c1b778f28aef7
// team-openapi.json SHA-256: da4398ead370c9b61eadb4007087a6da945df3c609801325fd38fc780cc0e707
// Naming profile: next

package co.lettermint.types;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/co/lettermint/types/AnalyticsMeta.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Generated by lettermint/sdk-generator — do not edit.
// Spec: lettermint/lettermint@6ef4036dede6326ad2200b945e689e319faf4c0a (main)
// Spec: lettermint/lettermint@a14a098fd3173b67bc366163127ee3715457cd59 (main)
// sending-openapi.json SHA-256: 8d5e962e57d79ab08be52147c094657b681768f06940a76c8eec1b1e03df54cc
// team-openapi.json SHA-256: 4ba5b65756faa9db79e5b95e06414899af0a6e97766eed04656c1b778f28aef7
// team-openapi.json SHA-256: da4398ead370c9b61eadb4007087a6da945df3c609801325fd38fc780cc0e707
// Naming profile: next

package co.lettermint.types;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Generated by lettermint/sdk-generator — do not edit.
// Spec: lettermint/lettermint@6ef4036dede6326ad2200b945e689e319faf4c0a (main)
// Spec: lettermint/lettermint@a14a098fd3173b67bc366163127ee3715457cd59 (main)
// sending-openapi.json SHA-256: 8d5e962e57d79ab08be52147c094657b681768f06940a76c8eec1b1e03df54cc
// team-openapi.json SHA-256: 4ba5b65756faa9db79e5b95e06414899af0a6e97766eed04656c1b778f28aef7
// team-openapi.json SHA-256: da4398ead370c9b61eadb4007087a6da945df3c609801325fd38fc780cc0e707
// Naming profile: next

package co.lettermint.types;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Generated by lettermint/sdk-generator — do not edit.
// Spec: lettermint/lettermint@6ef4036dede6326ad2200b945e689e319faf4c0a (main)
// Spec: lettermint/lettermint@a14a098fd3173b67bc366163127ee3715457cd59 (main)
// sending-openapi.json SHA-256: 8d5e962e57d79ab08be52147c094657b681768f06940a76c8eec1b1e03df54cc
// team-openapi.json SHA-256: 4ba5b65756faa9db79e5b95e06414899af0a6e97766eed04656c1b778f28aef7
// team-openapi.json SHA-256: da4398ead370c9b61eadb4007087a6da945df3c609801325fd38fc780cc0e707
// Naming profile: next

package co.lettermint.types;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Generated by lettermint/sdk-generator — do not edit.
// Spec: lettermint/lettermint@6ef4036dede6326ad2200b945e689e319faf4c0a (main)
// Spec: lettermint/lettermint@a14a098fd3173b67bc366163127ee3715457cd59 (main)
// sending-openapi.json SHA-256: 8d5e962e57d79ab08be52147c094657b681768f06940a76c8eec1b1e03df54cc
// team-openapi.json SHA-256: 4ba5b65756faa9db79e5b95e06414899af0a6e97766eed04656c1b778f28aef7
// team-openapi.json SHA-256: da4398ead370c9b61eadb4007087a6da945df3c609801325fd38fc780cc0e707
// Naming profile: next

package co.lettermint.types;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Generated by lettermint/sdk-generator — do not edit.
// Spec: lettermint/lettermint@6ef4036dede6326ad2200b945e689e319faf4c0a (main)
// Spec: lettermint/lettermint@a14a098fd3173b67bc366163127ee3715457cd59 (main)
// sending-openapi.json SHA-256: 8d5e962e57d79ab08be52147c094657b681768f06940a76c8eec1b1e03df54cc
// team-openapi.json SHA-256: 4ba5b65756faa9db79e5b95e06414899af0a6e97766eed04656c1b778f28aef7
// team-openapi.json SHA-256: da4398ead370c9b61eadb4007087a6da945df3c609801325fd38fc780cc0e707
// Naming profile: next

package co.lettermint.types;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/co/lettermint/types/AnalyticsMetric.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Generated by lettermint/sdk-generator — do not edit.
// Spec: lettermint/lettermint@6ef4036dede6326ad2200b945e689e319faf4c0a (main)
// Spec: lettermint/lettermint@a14a098fd3173b67bc366163127ee3715457cd59 (main)
// sending-openapi.json SHA-256: 8d5e962e57d79ab08be52147c094657b681768f06940a76c8eec1b1e03df54cc
// team-openapi.json SHA-256: 4ba5b65756faa9db79e5b95e06414899af0a6e97766eed04656c1b778f28aef7
// team-openapi.json SHA-256: da4398ead370c9b61eadb4007087a6da945df3c609801325fd38fc780cc0e707
// Naming profile: next

package co.lettermint.types;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Generated by lettermint/sdk-generator — do not edit.
// Spec: lettermint/lettermint@6ef4036dede6326ad2200b945e689e319faf4c0a (main)
// Spec: lettermint/lettermint@a14a098fd3173b67bc366163127ee3715457cd59 (main)
// sending-openapi.json SHA-256: 8d5e962e57d79ab08be52147c094657b681768f06940a76c8eec1b1e03df54cc
// team-openapi.json SHA-256: 4ba5b65756faa9db79e5b95e06414899af0a6e97766eed04656c1b778f28aef7
// team-openapi.json SHA-256: da4398ead370c9b61eadb4007087a6da945df3c609801325fd38fc780cc0e707
// Naming profile: next

package co.lettermint.types;
Expand Down
Loading
Loading