Skip to content

Commit 9822663

Browse files
Added support for updateThreadTenant (#125)
* Update a threads tenant * Changeset
1 parent 4ffaa69 commit 9822663

File tree

4 files changed

+80
-8
lines changed

4 files changed

+80
-8
lines changed

.changeset/five-tables-sniff.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@team-plain/typescript-sdk': patch
3+
---
4+
5+
Added updateThreadTenant

src/client.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ import {
7979
UpdateCustomerCardConfigDocument,
8080
UpdateCustomerCompanyDocument,
8181
UpdateTenantTierDocument,
82+
UpdateThreadTenantDocument,
8283
UpdateWebhookTargetDocument,
8384
UpsertCustomerDocument,
8485
type UpsertResult,
@@ -613,6 +614,22 @@ export class PlainClient {
613614
return unwrapData(res, (q) => nonNullable(q.changeThreadPriority.thread));
614615
}
615616

617+
/**
618+
* Update a thread's tenant
619+
*/
620+
async updateThreadTenant(
621+
input: VariablesOf<typeof UpdateThreadTenantDocument>['input']
622+
): SDKResult<ThreadPartsFragment> {
623+
const res = await request(this.#ctx, {
624+
query: UpdateThreadTenantDocument,
625+
variables: {
626+
input,
627+
},
628+
});
629+
630+
return unwrapData(res, (q) => nonNullable(q.updateThreadTenant.thread));
631+
}
632+
616633
/**
617634
* Add labels to a thread
618635
*/
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
mutation updateThreadTenant($input: UpdateThreadTenantInput!) {
2+
updateThreadTenant(input: $input) {
3+
thread {
4+
...ThreadParts
5+
}
6+
error {
7+
...MutationErrorParts
8+
}
9+
}
10+
}

0 commit comments

Comments
 (0)