@iblai/iblai-api 4.266.0-core → 4.267.0-core

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/index.cjs.js +681 -41
  2. package/dist/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +681 -42
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/index.umd.js +681 -41
  6. package/dist/index.umd.js.map +1 -1
  7. package/dist/types/index.d.ts +5 -0
  8. package/dist/types/models/Deal.d.ts +12 -0
  9. package/dist/types/models/Organization.d.ts +12 -0
  10. package/dist/types/models/PaginatedTagList.d.ts +7 -0
  11. package/dist/types/models/PatchedDeal.d.ts +12 -0
  12. package/dist/types/models/PatchedOrganization.d.ts +12 -0
  13. package/dist/types/models/PatchedPerson.d.ts +12 -0
  14. package/dist/types/models/PatchedTag.d.ts +30 -0
  15. package/dist/types/models/Person.d.ts +12 -0
  16. package/dist/types/models/Tag.d.ts +30 -0
  17. package/dist/types/models/_TagAttachRequest.d.ts +6 -0
  18. package/dist/types/services/ActivitiesService.d.ts +1 -1
  19. package/dist/types/services/CrmService.d.ts +185 -10
  20. package/dist/types/services/DealsService.d.ts +34 -2
  21. package/dist/types/services/LeadSourcesService.d.ts +1 -1
  22. package/dist/types/services/OrganizationsService.d.ts +28 -2
  23. package/dist/types/services/PersonsService.d.ts +28 -2
  24. package/dist/types/services/PipelinesService.d.ts +2 -2
  25. package/dist/types/services/TagsService.d.ts +96 -0
  26. package/package.json +1 -1
  27. package/sdk_schema.yml +1484 -239
  28. package/src/core/OpenAPI.ts +1 -1
  29. package/src/index.ts +5 -0
  30. package/src/models/Deal.ts +12 -0
  31. package/src/models/Organization.ts +12 -0
  32. package/src/models/PaginatedTagList.ts +12 -0
  33. package/src/models/PatchedDeal.ts +12 -0
  34. package/src/models/PatchedOrganization.ts +12 -0
  35. package/src/models/PatchedPerson.ts +12 -0
  36. package/src/models/PatchedTag.ts +35 -0
  37. package/src/models/Person.ts +12 -0
  38. package/src/models/Tag.ts +35 -0
  39. package/src/models/_TagAttachRequest.ts +11 -0
  40. package/src/services/ActivitiesService.ts +2 -2
  41. package/src/services/CrmService.ts +399 -14
  42. package/src/services/DealsService.ts +71 -2
  43. package/src/services/LeadSourcesService.ts +2 -2
  44. package/src/services/OrganizationsService.ts +65 -2
  45. package/src/services/PersonsService.ts +65 -2
  46. package/src/services/PipelinesService.ts +4 -4
  47. package/src/services/TagsService.ts +201 -0
@@ -2,6 +2,7 @@
2
2
  /* istanbul ignore file */
3
3
  /* tslint:disable */
4
4
  /* eslint-disable */
5
+ import type { _TagAttachRequest } from '../models/_TagAttachRequest';
5
6
  import type { Activity } from '../models/Activity';
6
7
  import type { Deal } from '../models/Deal';
7
8
  import type { DealLostRequest } from '../models/DealLostRequest';
@@ -16,6 +17,7 @@ import type { PaginatedOrganizationList } from '../models/PaginatedOrganizationL
16
17
  import type { PaginatedPersonList } from '../models/PaginatedPersonList';
17
18
  import type { PaginatedPipelineList } from '../models/PaginatedPipelineList';
18
19
  import type { PaginatedPipelineStageList } from '../models/PaginatedPipelineStageList';
20
+ import type { PaginatedTagList } from '../models/PaginatedTagList';
19
21
  import type { PatchedActivity } from '../models/PatchedActivity';
20
22
  import type { PatchedDeal } from '../models/PatchedDeal';
21
23
  import type { PatchedLeadSource } from '../models/PatchedLeadSource';
@@ -23,6 +25,7 @@ import type { PatchedOrganization } from '../models/PatchedOrganization';
23
25
  import type { PatchedPerson } from '../models/PatchedPerson';
24
26
  import type { PatchedPipeline } from '../models/PatchedPipeline';
25
27
  import type { PatchedPipelineStage } from '../models/PatchedPipelineStage';
28
+ import type { PatchedTag } from '../models/PatchedTag';
26
29
  import type { Person } from '../models/Person';
27
30
  import type { PersonInviteRequest } from '../models/PersonInviteRequest';
28
31
  import type { PersonInviteResponse } from '../models/PersonInviteResponse';
@@ -31,6 +34,7 @@ import type { PersonMergeRequest } from '../models/PersonMergeRequest';
31
34
  import type { PersonMergeResponse } from '../models/PersonMergeResponse';
32
35
  import type { Pipeline } from '../models/Pipeline';
33
36
  import type { PipelineStage } from '../models/PipelineStage';
37
+ import type { Tag } from '../models/Tag';
34
38
  import type { CancelablePromise } from '../core/CancelablePromise';
35
39
  import { OpenAPI } from '../core/OpenAPI';
36
40
  import { request as __request } from '../core/request';
@@ -108,7 +112,7 @@ export class CrmService {
108
112
  * Create an activity
109
113
  * Creates an Activity. Either `deal` or `person` must be supplied; both must belong to your Platform.
110
114
  *
111
- * **Required permission:** `Ibl.CRM/Activities/write`.
115
+ * **Required permission:** `Ibl.CRM/Activities/action`.
112
116
  * @returns Activity
113
117
  * @throws ApiError
114
118
  */
@@ -124,7 +128,7 @@ export class CrmService {
124
128
  mediaType: 'application/json',
125
129
  errors: {
126
130
  400: `Validation error.`,
127
- 403: `Missing required permission \`Ibl.CRM/Activities/write\`.`,
131
+ 403: `Missing required permission \`Ibl.CRM/Activities/action\`.`,
128
132
  },
129
133
  });
130
134
  }
@@ -301,6 +305,7 @@ export class CrmService {
301
305
  source,
302
306
  stage,
303
307
  status,
308
+ tags,
304
309
  }: {
305
310
  createdAtGte?: string,
306
311
  createdAtLte?: string,
@@ -329,6 +334,7 @@ export class CrmService {
329
334
  * * `lost` - Lost
330
335
  */
331
336
  status?: 'lost' | 'open' | 'won',
337
+ tags?: string,
332
338
  }): CancelablePromise<PaginatedDealList> {
333
339
  return __request(OpenAPI, {
334
340
  method: 'GET',
@@ -348,6 +354,7 @@ export class CrmService {
348
354
  'source': source,
349
355
  'stage': stage,
350
356
  'status': status,
357
+ 'tags': tags,
351
358
  },
352
359
  errors: {
353
360
  401: `Authentication required.`,
@@ -359,7 +366,7 @@ export class CrmService {
359
366
  * Create a deal
360
367
  * Creates a new Deal. All FK targets (`person`, `organization`, `pipeline`, `stage`, `source`) must belong to your Platform; `stage` must belong to `pipeline`. `status` and `closed_at` are service-managed — passing them returns `400`.
361
368
  *
362
- * **Required permission:** `Ibl.CRM/Deals/write`.
369
+ * **Required permission:** `Ibl.CRM/Deals/action`.
363
370
  * @returns Deal
364
371
  * @throws ApiError
365
372
  */
@@ -375,7 +382,7 @@ export class CrmService {
375
382
  mediaType: 'application/json',
376
383
  errors: {
377
384
  400: `Validation error.`,
378
- 403: `Missing required permission \`Ibl.CRM/Deals/write\`.`,
385
+ 403: `Missing required permission \`Ibl.CRM/Deals/action\`.`,
379
386
  },
380
387
  });
381
388
  }
@@ -567,6 +574,71 @@ export class CrmService {
567
574
  },
568
575
  });
569
576
  }
577
+ /**
578
+ * Attach a tag to this record
579
+ * Attaches an existing Tag to this record. Both the Tag and the record must belong to your Platform. Returns `409 Conflict` with the existing `assignment_id` if the tag is already attached.
580
+ *
581
+ * **Required permission:** `Ibl.CRM/Tags/write`.
582
+ * @returns any No response body
583
+ * @throws ApiError
584
+ */
585
+ public static crmDealsTagsCreate({
586
+ id,
587
+ requestBody,
588
+ }: {
589
+ /**
590
+ * A unique integer value identifying this deal.
591
+ */
592
+ id: number,
593
+ requestBody: _TagAttachRequest,
594
+ }): CancelablePromise<any> {
595
+ return __request(OpenAPI, {
596
+ method: 'POST',
597
+ url: '/api/crm/deals/{id}/tags/',
598
+ path: {
599
+ 'id': id,
600
+ },
601
+ body: requestBody,
602
+ mediaType: 'application/json',
603
+ errors: {
604
+ 400: `No response body`,
605
+ 403: `No response body`,
606
+ 404: `No response body`,
607
+ 409: `No response body`,
608
+ },
609
+ });
610
+ }
611
+ /**
612
+ * Detach a tag from this record
613
+ * Removes the Tag with id `tag_id` from this record. Returns `404` if the tag was not attached.
614
+ *
615
+ * **Required permission:** `Ibl.CRM/Tags/write`.
616
+ * @returns void
617
+ * @throws ApiError
618
+ */
619
+ public static crmDealsTagsDestroy({
620
+ id,
621
+ tagId,
622
+ }: {
623
+ /**
624
+ * A unique integer value identifying this deal.
625
+ */
626
+ id: number,
627
+ tagId: string,
628
+ }): CancelablePromise<void> {
629
+ return __request(OpenAPI, {
630
+ method: 'DELETE',
631
+ url: '/api/crm/deals/{id}/tags/{tag_id}/',
632
+ path: {
633
+ 'id': id,
634
+ 'tag_id': tagId,
635
+ },
636
+ errors: {
637
+ 403: `No response body`,
638
+ 404: `No response body`,
639
+ },
640
+ });
641
+ }
570
642
  /**
571
643
  * Mark a deal as won
572
644
  * Moves the Deal into a closed-won stage and sets `status='won'`. If `stage_code` is omitted, the first `is_won=True` stage in the Deal's pipeline (by sort order) is used.
@@ -644,7 +716,7 @@ export class CrmService {
644
716
  * Create a lead source
645
717
  * Creates a new LeadSource in your Platform. `code` must be unique.
646
718
  *
647
- * **Required permission:** `Ibl.CRM/Pipelines/write`.
719
+ * **Required permission:** `Ibl.CRM/Pipelines/action`.
648
720
  * @returns LeadSource
649
721
  * @throws ApiError
650
722
  */
@@ -660,7 +732,7 @@ export class CrmService {
660
732
  mediaType: 'application/json',
661
733
  errors: {
662
734
  400: `Validation error.`,
663
- 403: `Missing required permission \`Ibl.CRM/Pipelines/write\`.`,
735
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/action\`.`,
664
736
  },
665
737
  });
666
738
  }
@@ -799,6 +871,7 @@ export class CrmService {
799
871
  owner,
800
872
  page,
801
873
  pageSize,
874
+ tags,
802
875
  }: {
803
876
  name?: string,
804
877
  owner?: number,
@@ -810,6 +883,7 @@ export class CrmService {
810
883
  * Number of results to return per page.
811
884
  */
812
885
  pageSize?: number,
886
+ tags?: string,
813
887
  }): CancelablePromise<PaginatedOrganizationList> {
814
888
  return __request(OpenAPI, {
815
889
  method: 'GET',
@@ -819,6 +893,7 @@ export class CrmService {
819
893
  'owner': owner,
820
894
  'page': page,
821
895
  'page_size': pageSize,
896
+ 'tags': tags,
822
897
  },
823
898
  errors: {
824
899
  401: `Authentication required.`,
@@ -830,7 +905,7 @@ export class CrmService {
830
905
  * Create an organization
831
906
  * Creates a new organization in your Platform. The Platform is inferred from your credentials. `name` must be unique within your Platform.
832
907
  *
833
- * **Required permission:** `Ibl.CRM/Organizations/write`.
908
+ * **Required permission:** `Ibl.CRM/Organizations/action`.
834
909
  * @returns Organization
835
910
  * @throws ApiError
836
911
  */
@@ -846,7 +921,7 @@ export class CrmService {
846
921
  mediaType: 'application/json',
847
922
  errors: {
848
923
  400: `Validation error (for example, duplicate name).`,
849
- 403: `Missing required permission \`Ibl.CRM/Organizations/write\`.`,
924
+ 403: `Missing required permission \`Ibl.CRM/Organizations/action\`.`,
850
925
  },
851
926
  });
852
927
  }
@@ -960,6 +1035,65 @@ export class CrmService {
960
1035
  },
961
1036
  });
962
1037
  }
1038
+ /**
1039
+ * Attach a tag to this record
1040
+ * Attaches an existing Tag to this record. Both the Tag and the record must belong to your Platform. Returns `409 Conflict` with the existing `assignment_id` if the tag is already attached.
1041
+ *
1042
+ * **Required permission:** `Ibl.CRM/Tags/write`.
1043
+ * @returns any No response body
1044
+ * @throws ApiError
1045
+ */
1046
+ public static crmOrganizationsTagsCreate({
1047
+ id,
1048
+ requestBody,
1049
+ }: {
1050
+ id: string,
1051
+ requestBody: _TagAttachRequest,
1052
+ }): CancelablePromise<any> {
1053
+ return __request(OpenAPI, {
1054
+ method: 'POST',
1055
+ url: '/api/crm/organizations/{id}/tags/',
1056
+ path: {
1057
+ 'id': id,
1058
+ },
1059
+ body: requestBody,
1060
+ mediaType: 'application/json',
1061
+ errors: {
1062
+ 400: `No response body`,
1063
+ 403: `No response body`,
1064
+ 404: `No response body`,
1065
+ 409: `No response body`,
1066
+ },
1067
+ });
1068
+ }
1069
+ /**
1070
+ * Detach a tag from this record
1071
+ * Removes the Tag with id `tag_id` from this record. Returns `404` if the tag was not attached.
1072
+ *
1073
+ * **Required permission:** `Ibl.CRM/Tags/write`.
1074
+ * @returns void
1075
+ * @throws ApiError
1076
+ */
1077
+ public static crmOrganizationsTagsDestroy({
1078
+ id,
1079
+ tagId,
1080
+ }: {
1081
+ id: string,
1082
+ tagId: string,
1083
+ }): CancelablePromise<void> {
1084
+ return __request(OpenAPI, {
1085
+ method: 'DELETE',
1086
+ url: '/api/crm/organizations/{id}/tags/{tag_id}/',
1087
+ path: {
1088
+ 'id': id,
1089
+ 'tag_id': tagId,
1090
+ },
1091
+ errors: {
1092
+ 403: `No response body`,
1093
+ 404: `No response body`,
1094
+ },
1095
+ });
1096
+ }
963
1097
  /**
964
1098
  * List persons
965
1099
  * Returns a paginated list of persons in your Platform. Supports filtering by `lifecycle_stage`, `owner`, `organization`, `created_at__gte`/`created_at__lte`, and `metadata__has_key`.
@@ -977,6 +1111,7 @@ export class CrmService {
977
1111
  owner,
978
1112
  page,
979
1113
  pageSize,
1114
+ tags,
980
1115
  }: {
981
1116
  createdAtGte?: string,
982
1117
  createdAtLte?: string,
@@ -1001,6 +1136,7 @@ export class CrmService {
1001
1136
  * Number of results to return per page.
1002
1137
  */
1003
1138
  pageSize?: number,
1139
+ tags?: string,
1004
1140
  }): CancelablePromise<PaginatedPersonList> {
1005
1141
  return __request(OpenAPI, {
1006
1142
  method: 'GET',
@@ -1014,6 +1150,7 @@ export class CrmService {
1014
1150
  'owner': owner,
1015
1151
  'page': page,
1016
1152
  'page_size': pageSize,
1153
+ 'tags': tags,
1017
1154
  },
1018
1155
  errors: {
1019
1156
  401: `Authentication required.`,
@@ -1025,7 +1162,7 @@ export class CrmService {
1025
1162
  * Create a person
1026
1163
  * Creates a new person in your Platform. The Platform is inferred from your credentials. If `organization` is supplied, it must reference an organization in your Platform.
1027
1164
  *
1028
- * **Required permission:** `Ibl.CRM/Persons/write`.
1165
+ * **Required permission:** `Ibl.CRM/Persons/action`.
1029
1166
  * @returns Person
1030
1167
  * @throws ApiError
1031
1168
  */
@@ -1041,7 +1178,7 @@ export class CrmService {
1041
1178
  mediaType: 'application/json',
1042
1179
  errors: {
1043
1180
  400: `Validation error.`,
1044
- 403: `Missing required permission \`Ibl.CRM/Persons/write\`.`,
1181
+ 403: `Missing required permission \`Ibl.CRM/Persons/action\`.`,
1045
1182
  },
1046
1183
  });
1047
1184
  }
@@ -1220,6 +1357,65 @@ export class CrmService {
1220
1357
  },
1221
1358
  });
1222
1359
  }
1360
+ /**
1361
+ * Attach a tag to this record
1362
+ * Attaches an existing Tag to this record. Both the Tag and the record must belong to your Platform. Returns `409 Conflict` with the existing `assignment_id` if the tag is already attached.
1363
+ *
1364
+ * **Required permission:** `Ibl.CRM/Tags/write`.
1365
+ * @returns any No response body
1366
+ * @throws ApiError
1367
+ */
1368
+ public static crmPersonsTagsCreate({
1369
+ id,
1370
+ requestBody,
1371
+ }: {
1372
+ id: string,
1373
+ requestBody: _TagAttachRequest,
1374
+ }): CancelablePromise<any> {
1375
+ return __request(OpenAPI, {
1376
+ method: 'POST',
1377
+ url: '/api/crm/persons/{id}/tags/',
1378
+ path: {
1379
+ 'id': id,
1380
+ },
1381
+ body: requestBody,
1382
+ mediaType: 'application/json',
1383
+ errors: {
1384
+ 400: `No response body`,
1385
+ 403: `No response body`,
1386
+ 404: `No response body`,
1387
+ 409: `No response body`,
1388
+ },
1389
+ });
1390
+ }
1391
+ /**
1392
+ * Detach a tag from this record
1393
+ * Removes the Tag with id `tag_id` from this record. Returns `404` if the tag was not attached.
1394
+ *
1395
+ * **Required permission:** `Ibl.CRM/Tags/write`.
1396
+ * @returns void
1397
+ * @throws ApiError
1398
+ */
1399
+ public static crmPersonsTagsDestroy({
1400
+ id,
1401
+ tagId,
1402
+ }: {
1403
+ id: string,
1404
+ tagId: string,
1405
+ }): CancelablePromise<void> {
1406
+ return __request(OpenAPI, {
1407
+ method: 'DELETE',
1408
+ url: '/api/crm/persons/{id}/tags/{tag_id}/',
1409
+ path: {
1410
+ 'id': id,
1411
+ 'tag_id': tagId,
1412
+ },
1413
+ errors: {
1414
+ 403: `No response body`,
1415
+ 404: `No response body`,
1416
+ },
1417
+ });
1418
+ }
1223
1419
  /**
1224
1420
  * Merge duplicate persons into a primary
1225
1421
  * Marks each person in `duplicate_ids` as inactive and reports how many related records (deals, activities, tags) were re-parented onto `primary_id`.
@@ -1294,7 +1490,7 @@ export class CrmService {
1294
1490
  * Create a pipeline
1295
1491
  * Creates a new Pipeline. `code` must be unique within your Platform. Promoting another Pipeline to `is_default=true` while one already exists will fail — unset the existing default first.
1296
1492
  *
1297
- * **Required permission:** `Ibl.CRM/Pipelines/write`.
1493
+ * **Required permission:** `Ibl.CRM/Pipelines/action`.
1298
1494
  * @returns Pipeline
1299
1495
  * @throws ApiError
1300
1496
  */
@@ -1310,7 +1506,7 @@ export class CrmService {
1310
1506
  mediaType: 'application/json',
1311
1507
  errors: {
1312
1508
  400: `Validation error.`,
1313
- 403: `Missing required permission \`Ibl.CRM/Pipelines/write\`.`,
1509
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/action\`.`,
1314
1510
  },
1315
1511
  });
1316
1512
  }
@@ -1366,7 +1562,7 @@ export class CrmService {
1366
1562
  * Create a stage
1367
1563
  * Creates a new PipelineStage in the URL Pipeline. `code` must be unique within that Pipeline. At most one of `is_won` / `is_lost` may be true.
1368
1564
  *
1369
- * **Required permission:** `Ibl.CRM/Pipelines/write`.
1565
+ * **Required permission:** `Ibl.CRM/Pipelines/action`.
1370
1566
  * @returns PipelineStage
1371
1567
  * @throws ApiError
1372
1568
  */
@@ -1387,7 +1583,7 @@ export class CrmService {
1387
1583
  mediaType: 'application/json',
1388
1584
  errors: {
1389
1585
  400: `Validation error.`,
1390
- 403: `Missing required permission \`Ibl.CRM/Pipelines/write\`.`,
1586
+ 403: `Missing required permission \`Ibl.CRM/Pipelines/action\`.`,
1391
1587
  404: `Pipeline not found.`,
1392
1588
  },
1393
1589
  });
@@ -1638,4 +1834,193 @@ export class CrmService {
1638
1834
  },
1639
1835
  });
1640
1836
  }
1837
+ /**
1838
+ * List tags
1839
+ * Returns a paginated list of Tags in your Platform. Supports filtering by `name` (case-insensitive substring) and `created_at__gte`/`created_at__lte` ISO timestamp ranges.
1840
+ *
1841
+ * **Required permission:** `Ibl.CRM/Tags/list`.
1842
+ * @returns PaginatedTagList
1843
+ * @throws ApiError
1844
+ */
1845
+ public static crmTagsList({
1846
+ createdAtGte,
1847
+ createdAtLte,
1848
+ name,
1849
+ page,
1850
+ pageSize,
1851
+ }: {
1852
+ createdAtGte?: string,
1853
+ createdAtLte?: string,
1854
+ name?: string,
1855
+ /**
1856
+ * A page number within the paginated result set.
1857
+ */
1858
+ page?: number,
1859
+ /**
1860
+ * Number of results to return per page.
1861
+ */
1862
+ pageSize?: number,
1863
+ }): CancelablePromise<PaginatedTagList> {
1864
+ return __request(OpenAPI, {
1865
+ method: 'GET',
1866
+ url: '/api/crm/tags/',
1867
+ query: {
1868
+ 'created_at__gte': createdAtGte,
1869
+ 'created_at__lte': createdAtLte,
1870
+ 'name': name,
1871
+ 'page': page,
1872
+ 'page_size': pageSize,
1873
+ },
1874
+ errors: {
1875
+ 401: `Authentication required.`,
1876
+ 403: `Missing required permission \`Ibl.CRM/Tags/list\`.`,
1877
+ },
1878
+ });
1879
+ }
1880
+ /**
1881
+ * Create a tag
1882
+ * Creates a new Tag in your Platform. `name` must be unique within your Platform; supply `color` as a `#RRGGBB` hex string (defaults to `#888888`).
1883
+ *
1884
+ * **Required permission:** `Ibl.CRM/Tags/action`.
1885
+ * @returns Tag
1886
+ * @throws ApiError
1887
+ */
1888
+ public static crmTagsCreate({
1889
+ requestBody,
1890
+ }: {
1891
+ requestBody: Tag,
1892
+ }): CancelablePromise<Tag> {
1893
+ return __request(OpenAPI, {
1894
+ method: 'POST',
1895
+ url: '/api/crm/tags/',
1896
+ body: requestBody,
1897
+ mediaType: 'application/json',
1898
+ errors: {
1899
+ 400: `Validation error (duplicate name, bad color, etc.).`,
1900
+ 403: `Missing required permission \`Ibl.CRM/Tags/action\`.`,
1901
+ },
1902
+ });
1903
+ }
1904
+ /**
1905
+ * Retrieve a tag
1906
+ * Returns a single Tag by id.
1907
+ *
1908
+ * **Required permission:** `Ibl.CRM/Tags/read`.
1909
+ * @returns Tag
1910
+ * @throws ApiError
1911
+ */
1912
+ public static crmTagsRetrieve({
1913
+ id,
1914
+ }: {
1915
+ /**
1916
+ * A unique integer value identifying this tag.
1917
+ */
1918
+ id: number,
1919
+ }): CancelablePromise<Tag> {
1920
+ return __request(OpenAPI, {
1921
+ method: 'GET',
1922
+ url: '/api/crm/tags/{id}/',
1923
+ path: {
1924
+ 'id': id,
1925
+ },
1926
+ errors: {
1927
+ 403: `Missing required permission \`Ibl.CRM/Tags/read\`.`,
1928
+ 404: `Tag not found.`,
1929
+ },
1930
+ });
1931
+ }
1932
+ /**
1933
+ * Replace a tag
1934
+ * Replaces all editable fields on the Tag.
1935
+ *
1936
+ * **Required permission:** `Ibl.CRM/Tags/write`.
1937
+ * @returns Tag
1938
+ * @throws ApiError
1939
+ */
1940
+ public static crmTagsUpdate({
1941
+ id,
1942
+ requestBody,
1943
+ }: {
1944
+ /**
1945
+ * A unique integer value identifying this tag.
1946
+ */
1947
+ id: number,
1948
+ requestBody: Tag,
1949
+ }): CancelablePromise<Tag> {
1950
+ return __request(OpenAPI, {
1951
+ method: 'PUT',
1952
+ url: '/api/crm/tags/{id}/',
1953
+ path: {
1954
+ 'id': id,
1955
+ },
1956
+ body: requestBody,
1957
+ mediaType: 'application/json',
1958
+ errors: {
1959
+ 400: `Validation error.`,
1960
+ 403: `Missing required permission \`Ibl.CRM/Tags/write\`.`,
1961
+ 404: `Tag not found.`,
1962
+ },
1963
+ });
1964
+ }
1965
+ /**
1966
+ * Update a tag
1967
+ * Updates only the supplied fields on the Tag (typically `name` or `color`).
1968
+ *
1969
+ * **Required permission:** `Ibl.CRM/Tags/write`.
1970
+ * @returns Tag
1971
+ * @throws ApiError
1972
+ */
1973
+ public static crmTagsPartialUpdate({
1974
+ id,
1975
+ requestBody,
1976
+ }: {
1977
+ /**
1978
+ * A unique integer value identifying this tag.
1979
+ */
1980
+ id: number,
1981
+ requestBody?: PatchedTag,
1982
+ }): CancelablePromise<Tag> {
1983
+ return __request(OpenAPI, {
1984
+ method: 'PATCH',
1985
+ url: '/api/crm/tags/{id}/',
1986
+ path: {
1987
+ 'id': id,
1988
+ },
1989
+ body: requestBody,
1990
+ mediaType: 'application/json',
1991
+ errors: {
1992
+ 400: `Validation error.`,
1993
+ 403: `Missing required permission \`Ibl.CRM/Tags/write\`.`,
1994
+ 404: `Tag not found.`,
1995
+ },
1996
+ });
1997
+ }
1998
+ /**
1999
+ * Delete a tag
2000
+ * Deletes the Tag. All attachments to Persons, Organizations, and Deals are removed atomically via cascade.
2001
+ *
2002
+ * **Required permission:** `Ibl.CRM/Tags/delete`.
2003
+ * @returns void
2004
+ * @throws ApiError
2005
+ */
2006
+ public static crmTagsDestroy({
2007
+ id,
2008
+ }: {
2009
+ /**
2010
+ * A unique integer value identifying this tag.
2011
+ */
2012
+ id: number,
2013
+ }): CancelablePromise<void> {
2014
+ return __request(OpenAPI, {
2015
+ method: 'DELETE',
2016
+ url: '/api/crm/tags/{id}/',
2017
+ path: {
2018
+ 'id': id,
2019
+ },
2020
+ errors: {
2021
+ 403: `Missing required permission \`Ibl.CRM/Tags/delete\`.`,
2022
+ 404: `Tag not found.`,
2023
+ },
2024
+ });
2025
+ }
1641
2026
  }