syllable-sdk 0.1.0-alpha.163 → 0.1.0-alpha.168

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 (139) hide show
  1. package/README.md +13 -0
  2. package/docs/sdks/agents/README.md +16 -0
  3. package/docs/sdks/batches/README.md +4 -4
  4. package/docs/sdks/roles/README.md +445 -0
  5. package/docs/sdks/takeouts/README.md +1 -1
  6. package/docs/sdks/workflows/README.md +8 -8
  7. package/funcs/rolesCreate.d.ts +16 -0
  8. package/funcs/rolesCreate.d.ts.map +1 -0
  9. package/funcs/rolesCreate.js +102 -0
  10. package/funcs/rolesCreate.js.map +1 -0
  11. package/funcs/rolesDelete.d.ts +16 -0
  12. package/funcs/rolesDelete.d.ts.map +1 -0
  13. package/funcs/rolesDelete.js +112 -0
  14. package/funcs/rolesDelete.js.map +1 -0
  15. package/funcs/rolesGetById.d.ts +17 -0
  16. package/funcs/rolesGetById.d.ts.map +1 -0
  17. package/funcs/rolesGetById.js +108 -0
  18. package/funcs/rolesGetById.js.map +1 -0
  19. package/funcs/rolesList.d.ts +17 -0
  20. package/funcs/rolesList.d.ts.map +1 -0
  21. package/funcs/rolesList.js +114 -0
  22. package/funcs/rolesList.js.map +1 -0
  23. package/funcs/rolesUpdate.d.ts +16 -0
  24. package/funcs/rolesUpdate.d.ts.map +1 -0
  25. package/funcs/rolesUpdate.js +102 -0
  26. package/funcs/rolesUpdate.js.map +1 -0
  27. package/funcs/takeoutsTakeoutsGetFile.d.ts +1 -1
  28. package/funcs/takeoutsTakeoutsGetFile.d.ts.map +1 -1
  29. package/funcs/takeoutsTakeoutsGetFile.js +3 -1
  30. package/funcs/takeoutsTakeoutsGetFile.js.map +1 -1
  31. package/jsr.json +1 -1
  32. package/lib/config.d.ts +2 -2
  33. package/lib/config.js +2 -2
  34. package/models/components/agentcreate.d.ts +8 -1
  35. package/models/components/agentcreate.d.ts.map +1 -1
  36. package/models/components/agentcreate.js +2 -0
  37. package/models/components/agentcreate.js.map +1 -1
  38. package/models/components/agentproperties.d.ts +3 -0
  39. package/models/components/agentproperties.d.ts.map +1 -1
  40. package/models/components/agentproperties.js +1 -0
  41. package/models/components/agentproperties.js.map +1 -1
  42. package/models/components/agentresponse.d.ts +8 -1
  43. package/models/components/agentresponse.d.ts.map +1 -1
  44. package/models/components/agentresponse.js +2 -0
  45. package/models/components/agentresponse.js.map +1 -1
  46. package/models/components/agentupdate.d.ts +8 -1
  47. package/models/components/agentupdate.d.ts.map +1 -1
  48. package/models/components/agentupdate.js +2 -0
  49. package/models/components/agentupdate.js.map +1 -1
  50. package/models/components/index.d.ts +5 -1
  51. package/models/components/index.d.ts.map +1 -1
  52. package/models/components/index.js +5 -1
  53. package/models/components/index.js.map +1 -1
  54. package/models/components/listresponseroleresponse.d.ts +53 -0
  55. package/models/components/listresponseroleresponse.d.ts.map +1 -0
  56. package/models/components/listresponseroleresponse.js +81 -0
  57. package/models/components/listresponseroleresponse.js.map +1 -0
  58. package/models/components/permissionresponse.d.ts +4 -2
  59. package/models/components/permissionresponse.d.ts.map +1 -1
  60. package/models/components/permissionresponse.js +2 -3
  61. package/models/components/permissionresponse.js.map +1 -1
  62. package/models/components/rolecreaterequest.d.ts +45 -0
  63. package/models/components/rolecreaterequest.d.ts.map +1 -0
  64. package/models/components/rolecreaterequest.js +63 -0
  65. package/models/components/rolecreaterequest.js.map +1 -0
  66. package/models/components/roleproperties.d.ts +40 -0
  67. package/models/components/roleproperties.d.ts.map +1 -0
  68. package/models/components/roleproperties.js +55 -0
  69. package/models/components/roleproperties.js.map +1 -0
  70. package/models/components/roleresponse.d.ts +70 -0
  71. package/models/components/roleresponse.d.ts.map +1 -0
  72. package/models/components/roleresponse.js +88 -0
  73. package/models/components/roleresponse.js.map +1 -0
  74. package/models/components/roleupdaterequest.d.ts +55 -0
  75. package/models/components/roleupdaterequest.d.ts.map +1 -0
  76. package/models/components/roleupdaterequest.js +76 -0
  77. package/models/components/roleupdaterequest.js.map +1 -0
  78. package/models/components/tooldetailresponse.d.ts +1 -1
  79. package/models/components/toolresponse.d.ts +1 -1
  80. package/models/operations/index.d.ts +3 -0
  81. package/models/operations/index.d.ts.map +1 -1
  82. package/models/operations/index.js +3 -0
  83. package/models/operations/index.js.map +1 -1
  84. package/models/operations/rolesdelete.d.ts +31 -0
  85. package/models/operations/rolesdelete.d.ts.map +1 -0
  86. package/models/operations/rolesdelete.js +70 -0
  87. package/models/operations/rolesdelete.js.map +1 -0
  88. package/models/operations/rolesgetbyid.d.ts +29 -0
  89. package/models/operations/rolesgetbyid.d.ts.map +1 -0
  90. package/models/operations/rolesgetbyid.js +68 -0
  91. package/models/operations/rolesgetbyid.js.map +1 -0
  92. package/models/operations/roleslist.d.ts +73 -0
  93. package/models/operations/roleslist.d.ts.map +1 -0
  94. package/models/operations/roleslist.js +99 -0
  95. package/models/operations/roleslist.js.map +1 -0
  96. package/openapi.json +826 -108
  97. package/package.json +1 -1
  98. package/sdk/roles.d.ts +41 -0
  99. package/sdk/roles.d.ts.map +1 -0
  100. package/sdk/roles.js +62 -0
  101. package/sdk/roles.js.map +1 -0
  102. package/sdk/sdk.d.ts +3 -0
  103. package/sdk/sdk.d.ts.map +1 -1
  104. package/sdk/sdk.js +4 -0
  105. package/sdk/sdk.js.map +1 -1
  106. package/sdk/takeouts.d.ts +1 -1
  107. package/sdk/takeouts.d.ts.map +1 -1
  108. package/src/funcs/rolesCreate.ts +135 -0
  109. package/src/funcs/rolesDelete.ts +147 -0
  110. package/src/funcs/rolesGetById.ts +142 -0
  111. package/src/funcs/rolesList.ts +148 -0
  112. package/src/funcs/rolesUpdate.ts +135 -0
  113. package/src/funcs/takeoutsTakeoutsGetFile.ts +5 -3
  114. package/src/lib/config.ts +2 -2
  115. package/src/models/components/agentcreate.ts +10 -1
  116. package/src/models/components/agentproperties.ts +1 -0
  117. package/src/models/components/agentresponse.ts +10 -1
  118. package/src/models/components/agentupdate.ts +10 -1
  119. package/src/models/components/index.ts +5 -1
  120. package/src/models/components/listresponseroleresponse.ts +116 -0
  121. package/src/models/components/permissionresponse.ts +6 -8
  122. package/src/models/components/rolecreaterequest.ts +86 -0
  123. package/src/models/components/roleproperties.ts +41 -0
  124. package/src/models/components/roleresponse.ts +134 -0
  125. package/src/models/components/roleupdaterequest.ts +109 -0
  126. package/src/models/components/tooldetailresponse.ts +1 -1
  127. package/src/models/components/toolresponse.ts +1 -1
  128. package/src/models/operations/index.ts +3 -0
  129. package/src/models/operations/rolesdelete.ts +79 -0
  130. package/src/models/operations/rolesgetbyid.ts +75 -0
  131. package/src/models/operations/roleslist.ts +149 -0
  132. package/src/sdk/roles.ts +100 -0
  133. package/src/sdk/sdk.ts +6 -0
  134. package/src/sdk/takeouts.ts +1 -1
  135. package/models/components/permissions.d.ts +0 -199
  136. package/models/components/permissions.d.ts.map +0 -1
  137. package/models/components/permissions.js +0 -108
  138. package/models/components/permissions.js.map +0 -1
  139. package/src/models/components/permissions.ts +0 -88
@@ -0,0 +1,86 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+
10
+ /**
11
+ * Request model to create a role.
12
+ */
13
+ export type RoleCreateRequest = {
14
+ /**
15
+ * The name of the role.
16
+ */
17
+ name: string;
18
+ /**
19
+ * The description of the role.
20
+ */
21
+ description?: string | null | undefined;
22
+ /**
23
+ * The permissions associated with the role. Available permissions can be found by calling `GET /permissions`.
24
+ */
25
+ permissions: Array<string>;
26
+ };
27
+
28
+ /** @internal */
29
+ export const RoleCreateRequest$inboundSchema: z.ZodType<
30
+ RoleCreateRequest,
31
+ z.ZodTypeDef,
32
+ unknown
33
+ > = z.object({
34
+ name: z.string(),
35
+ description: z.nullable(z.string()).optional(),
36
+ permissions: z.array(z.string()),
37
+ });
38
+
39
+ /** @internal */
40
+ export type RoleCreateRequest$Outbound = {
41
+ name: string;
42
+ description?: string | null | undefined;
43
+ permissions: Array<string>;
44
+ };
45
+
46
+ /** @internal */
47
+ export const RoleCreateRequest$outboundSchema: z.ZodType<
48
+ RoleCreateRequest$Outbound,
49
+ z.ZodTypeDef,
50
+ RoleCreateRequest
51
+ > = z.object({
52
+ name: z.string(),
53
+ description: z.nullable(z.string()).optional(),
54
+ permissions: z.array(z.string()),
55
+ });
56
+
57
+ /**
58
+ * @internal
59
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
60
+ */
61
+ export namespace RoleCreateRequest$ {
62
+ /** @deprecated use `RoleCreateRequest$inboundSchema` instead. */
63
+ export const inboundSchema = RoleCreateRequest$inboundSchema;
64
+ /** @deprecated use `RoleCreateRequest$outboundSchema` instead. */
65
+ export const outboundSchema = RoleCreateRequest$outboundSchema;
66
+ /** @deprecated use `RoleCreateRequest$Outbound` instead. */
67
+ export type Outbound = RoleCreateRequest$Outbound;
68
+ }
69
+
70
+ export function roleCreateRequestToJSON(
71
+ roleCreateRequest: RoleCreateRequest,
72
+ ): string {
73
+ return JSON.stringify(
74
+ RoleCreateRequest$outboundSchema.parse(roleCreateRequest),
75
+ );
76
+ }
77
+
78
+ export function roleCreateRequestFromJSON(
79
+ jsonString: string,
80
+ ): SafeParseResult<RoleCreateRequest, SDKValidationError> {
81
+ return safeParse(
82
+ jsonString,
83
+ (x) => RoleCreateRequest$inboundSchema.parse(JSON.parse(x)),
84
+ `Failed to parse 'RoleCreateRequest' from JSON`,
85
+ );
86
+ }
@@ -0,0 +1,41 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { ClosedEnum } from "../../types/enums.js";
7
+
8
+ /**
9
+ * Names of role fields supported for filtering/sorting on list endpoint.
10
+ */
11
+ export const RoleProperties = {
12
+ Name: "name",
13
+ Description: "description",
14
+ UpdatedAt: "updated_at",
15
+ LastUpdatedBy: "last_updated_by",
16
+ } as const;
17
+ /**
18
+ * Names of role fields supported for filtering/sorting on list endpoint.
19
+ */
20
+ export type RoleProperties = ClosedEnum<typeof RoleProperties>;
21
+
22
+ /** @internal */
23
+ export const RoleProperties$inboundSchema: z.ZodNativeEnum<
24
+ typeof RoleProperties
25
+ > = z.nativeEnum(RoleProperties);
26
+
27
+ /** @internal */
28
+ export const RoleProperties$outboundSchema: z.ZodNativeEnum<
29
+ typeof RoleProperties
30
+ > = RoleProperties$inboundSchema;
31
+
32
+ /**
33
+ * @internal
34
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
35
+ */
36
+ export namespace RoleProperties$ {
37
+ /** @deprecated use `RoleProperties$inboundSchema` instead. */
38
+ export const inboundSchema = RoleProperties$inboundSchema;
39
+ /** @deprecated use `RoleProperties$outboundSchema` instead. */
40
+ export const outboundSchema = RoleProperties$outboundSchema;
41
+ }
@@ -0,0 +1,134 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ /**
12
+ * Information about a role.
13
+ */
14
+ export type RoleResponse = {
15
+ /**
16
+ * The name of the role.
17
+ */
18
+ name: string;
19
+ /**
20
+ * The description of the role.
21
+ */
22
+ description?: string | null | undefined;
23
+ /**
24
+ * The permissions associated with the role. Available permissions can be found by calling `GET /permissions`.
25
+ */
26
+ permissions: Array<string>;
27
+ /**
28
+ * The internal ID of the role.
29
+ */
30
+ id: number;
31
+ /**
32
+ * Comments for the most recent edit to the role.
33
+ */
34
+ lastUpdatedComments?: string | null | undefined;
35
+ /**
36
+ * Whether this is a built-in system role that cannot be updated or deleted
37
+ */
38
+ isSystemRole: boolean;
39
+ /**
40
+ * The timestamp of the most recent update to the role
41
+ */
42
+ lastUpdated: Date;
43
+ /**
44
+ * The email of the user who last updated the role
45
+ */
46
+ lastUpdatedBy: string;
47
+ };
48
+
49
+ /** @internal */
50
+ export const RoleResponse$inboundSchema: z.ZodType<
51
+ RoleResponse,
52
+ z.ZodTypeDef,
53
+ unknown
54
+ > = z.object({
55
+ name: z.string(),
56
+ description: z.nullable(z.string()).optional(),
57
+ permissions: z.array(z.string()),
58
+ id: z.number().int(),
59
+ last_updated_comments: z.nullable(z.string()).optional(),
60
+ is_system_role: z.boolean(),
61
+ last_updated: z.string().datetime({ offset: true }).transform(v =>
62
+ new Date(v)
63
+ ),
64
+ last_updated_by: z.string(),
65
+ }).transform((v) => {
66
+ return remap$(v, {
67
+ "last_updated_comments": "lastUpdatedComments",
68
+ "is_system_role": "isSystemRole",
69
+ "last_updated": "lastUpdated",
70
+ "last_updated_by": "lastUpdatedBy",
71
+ });
72
+ });
73
+
74
+ /** @internal */
75
+ export type RoleResponse$Outbound = {
76
+ name: string;
77
+ description?: string | null | undefined;
78
+ permissions: Array<string>;
79
+ id: number;
80
+ last_updated_comments?: string | null | undefined;
81
+ is_system_role: boolean;
82
+ last_updated: string;
83
+ last_updated_by: string;
84
+ };
85
+
86
+ /** @internal */
87
+ export const RoleResponse$outboundSchema: z.ZodType<
88
+ RoleResponse$Outbound,
89
+ z.ZodTypeDef,
90
+ RoleResponse
91
+ > = z.object({
92
+ name: z.string(),
93
+ description: z.nullable(z.string()).optional(),
94
+ permissions: z.array(z.string()),
95
+ id: z.number().int(),
96
+ lastUpdatedComments: z.nullable(z.string()).optional(),
97
+ isSystemRole: z.boolean(),
98
+ lastUpdated: z.date().transform(v => v.toISOString()),
99
+ lastUpdatedBy: z.string(),
100
+ }).transform((v) => {
101
+ return remap$(v, {
102
+ lastUpdatedComments: "last_updated_comments",
103
+ isSystemRole: "is_system_role",
104
+ lastUpdated: "last_updated",
105
+ lastUpdatedBy: "last_updated_by",
106
+ });
107
+ });
108
+
109
+ /**
110
+ * @internal
111
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
112
+ */
113
+ export namespace RoleResponse$ {
114
+ /** @deprecated use `RoleResponse$inboundSchema` instead. */
115
+ export const inboundSchema = RoleResponse$inboundSchema;
116
+ /** @deprecated use `RoleResponse$outboundSchema` instead. */
117
+ export const outboundSchema = RoleResponse$outboundSchema;
118
+ /** @deprecated use `RoleResponse$Outbound` instead. */
119
+ export type Outbound = RoleResponse$Outbound;
120
+ }
121
+
122
+ export function roleResponseToJSON(roleResponse: RoleResponse): string {
123
+ return JSON.stringify(RoleResponse$outboundSchema.parse(roleResponse));
124
+ }
125
+
126
+ export function roleResponseFromJSON(
127
+ jsonString: string,
128
+ ): SafeParseResult<RoleResponse, SDKValidationError> {
129
+ return safeParse(
130
+ jsonString,
131
+ (x) => RoleResponse$inboundSchema.parse(JSON.parse(x)),
132
+ `Failed to parse 'RoleResponse' from JSON`,
133
+ );
134
+ }
@@ -0,0 +1,109 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ /**
12
+ * Request model to update an existing role.
13
+ */
14
+ export type RoleUpdateRequest = {
15
+ /**
16
+ * The name of the role.
17
+ */
18
+ name: string;
19
+ /**
20
+ * The description of the role.
21
+ */
22
+ description?: string | null | undefined;
23
+ /**
24
+ * The permissions associated with the role. Available permissions can be found by calling `GET /permissions`.
25
+ */
26
+ permissions: Array<string>;
27
+ /**
28
+ * The internal ID of the role.
29
+ */
30
+ id: number;
31
+ /**
32
+ * Comments for the most recent edit to the role.
33
+ */
34
+ lastUpdatedComments?: string | null | undefined;
35
+ };
36
+
37
+ /** @internal */
38
+ export const RoleUpdateRequest$inboundSchema: z.ZodType<
39
+ RoleUpdateRequest,
40
+ z.ZodTypeDef,
41
+ unknown
42
+ > = z.object({
43
+ name: z.string(),
44
+ description: z.nullable(z.string()).optional(),
45
+ permissions: z.array(z.string()),
46
+ id: z.number().int(),
47
+ last_updated_comments: z.nullable(z.string()).optional(),
48
+ }).transform((v) => {
49
+ return remap$(v, {
50
+ "last_updated_comments": "lastUpdatedComments",
51
+ });
52
+ });
53
+
54
+ /** @internal */
55
+ export type RoleUpdateRequest$Outbound = {
56
+ name: string;
57
+ description?: string | null | undefined;
58
+ permissions: Array<string>;
59
+ id: number;
60
+ last_updated_comments?: string | null | undefined;
61
+ };
62
+
63
+ /** @internal */
64
+ export const RoleUpdateRequest$outboundSchema: z.ZodType<
65
+ RoleUpdateRequest$Outbound,
66
+ z.ZodTypeDef,
67
+ RoleUpdateRequest
68
+ > = z.object({
69
+ name: z.string(),
70
+ description: z.nullable(z.string()).optional(),
71
+ permissions: z.array(z.string()),
72
+ id: z.number().int(),
73
+ lastUpdatedComments: z.nullable(z.string()).optional(),
74
+ }).transform((v) => {
75
+ return remap$(v, {
76
+ lastUpdatedComments: "last_updated_comments",
77
+ });
78
+ });
79
+
80
+ /**
81
+ * @internal
82
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
83
+ */
84
+ export namespace RoleUpdateRequest$ {
85
+ /** @deprecated use `RoleUpdateRequest$inboundSchema` instead. */
86
+ export const inboundSchema = RoleUpdateRequest$inboundSchema;
87
+ /** @deprecated use `RoleUpdateRequest$outboundSchema` instead. */
88
+ export const outboundSchema = RoleUpdateRequest$outboundSchema;
89
+ /** @deprecated use `RoleUpdateRequest$Outbound` instead. */
90
+ export type Outbound = RoleUpdateRequest$Outbound;
91
+ }
92
+
93
+ export function roleUpdateRequestToJSON(
94
+ roleUpdateRequest: RoleUpdateRequest,
95
+ ): string {
96
+ return JSON.stringify(
97
+ RoleUpdateRequest$outboundSchema.parse(roleUpdateRequest),
98
+ );
99
+ }
100
+
101
+ export function roleUpdateRequestFromJSON(
102
+ jsonString: string,
103
+ ): SafeParseResult<RoleUpdateRequest, SDKValidationError> {
104
+ return safeParse(
105
+ jsonString,
106
+ (x) => RoleUpdateRequest$inboundSchema.parse(JSON.parse(x)),
107
+ `Failed to parse 'RoleUpdateRequest' from JSON`,
108
+ );
109
+ }
@@ -69,7 +69,7 @@ export type ToolDetailResponse = {
69
69
  */
70
70
  agentsInfo?: Array<ToolAgentInfo> | null | undefined;
71
71
  /**
72
- * The timestamp of the most recent update to the service
72
+ * The timestamp of the most recent update to the tool
73
73
  */
74
74
  lastUpdated: Date;
75
75
  /**
@@ -69,7 +69,7 @@ export type ToolResponse = {
69
69
  */
70
70
  agentsInfo?: Array<ToolAgentInfo> | null | undefined;
71
71
  /**
72
- * The timestamp of the most recent update to the service
72
+ * The timestamp of the most recent update to the tool
73
73
  */
74
74
  lastUpdated: Date;
75
75
  /**
@@ -68,6 +68,9 @@ export * from "./promptsdelete.js";
68
68
  export * from "./promptsgetbyid.js";
69
69
  export * from "./promptshistory.js";
70
70
  export * from "./promptslist.js";
71
+ export * from "./rolesdelete.js";
72
+ export * from "./rolesgetbyid.js";
73
+ export * from "./roleslist.js";
71
74
  export * from "./servicedelete.js";
72
75
  export * from "./servicelist.js";
73
76
  export * from "./servicesgetbyid.js";
@@ -0,0 +1,79 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ export type RolesDeleteRequest = {
12
+ roleId: number;
13
+ reason: string;
14
+ };
15
+
16
+ /** @internal */
17
+ export const RolesDeleteRequest$inboundSchema: z.ZodType<
18
+ RolesDeleteRequest,
19
+ z.ZodTypeDef,
20
+ unknown
21
+ > = z.object({
22
+ role_id: z.number().int(),
23
+ reason: z.string(),
24
+ }).transform((v) => {
25
+ return remap$(v, {
26
+ "role_id": "roleId",
27
+ });
28
+ });
29
+
30
+ /** @internal */
31
+ export type RolesDeleteRequest$Outbound = {
32
+ role_id: number;
33
+ reason: string;
34
+ };
35
+
36
+ /** @internal */
37
+ export const RolesDeleteRequest$outboundSchema: z.ZodType<
38
+ RolesDeleteRequest$Outbound,
39
+ z.ZodTypeDef,
40
+ RolesDeleteRequest
41
+ > = z.object({
42
+ roleId: z.number().int(),
43
+ reason: z.string(),
44
+ }).transform((v) => {
45
+ return remap$(v, {
46
+ roleId: "role_id",
47
+ });
48
+ });
49
+
50
+ /**
51
+ * @internal
52
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
53
+ */
54
+ export namespace RolesDeleteRequest$ {
55
+ /** @deprecated use `RolesDeleteRequest$inboundSchema` instead. */
56
+ export const inboundSchema = RolesDeleteRequest$inboundSchema;
57
+ /** @deprecated use `RolesDeleteRequest$outboundSchema` instead. */
58
+ export const outboundSchema = RolesDeleteRequest$outboundSchema;
59
+ /** @deprecated use `RolesDeleteRequest$Outbound` instead. */
60
+ export type Outbound = RolesDeleteRequest$Outbound;
61
+ }
62
+
63
+ export function rolesDeleteRequestToJSON(
64
+ rolesDeleteRequest: RolesDeleteRequest,
65
+ ): string {
66
+ return JSON.stringify(
67
+ RolesDeleteRequest$outboundSchema.parse(rolesDeleteRequest),
68
+ );
69
+ }
70
+
71
+ export function rolesDeleteRequestFromJSON(
72
+ jsonString: string,
73
+ ): SafeParseResult<RolesDeleteRequest, SDKValidationError> {
74
+ return safeParse(
75
+ jsonString,
76
+ (x) => RolesDeleteRequest$inboundSchema.parse(JSON.parse(x)),
77
+ `Failed to parse 'RolesDeleteRequest' from JSON`,
78
+ );
79
+ }
@@ -0,0 +1,75 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ export type RolesGetByIdRequest = {
12
+ roleId: number;
13
+ };
14
+
15
+ /** @internal */
16
+ export const RolesGetByIdRequest$inboundSchema: z.ZodType<
17
+ RolesGetByIdRequest,
18
+ z.ZodTypeDef,
19
+ unknown
20
+ > = z.object({
21
+ role_id: z.number().int(),
22
+ }).transform((v) => {
23
+ return remap$(v, {
24
+ "role_id": "roleId",
25
+ });
26
+ });
27
+
28
+ /** @internal */
29
+ export type RolesGetByIdRequest$Outbound = {
30
+ role_id: number;
31
+ };
32
+
33
+ /** @internal */
34
+ export const RolesGetByIdRequest$outboundSchema: z.ZodType<
35
+ RolesGetByIdRequest$Outbound,
36
+ z.ZodTypeDef,
37
+ RolesGetByIdRequest
38
+ > = z.object({
39
+ roleId: z.number().int(),
40
+ }).transform((v) => {
41
+ return remap$(v, {
42
+ roleId: "role_id",
43
+ });
44
+ });
45
+
46
+ /**
47
+ * @internal
48
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
49
+ */
50
+ export namespace RolesGetByIdRequest$ {
51
+ /** @deprecated use `RolesGetByIdRequest$inboundSchema` instead. */
52
+ export const inboundSchema = RolesGetByIdRequest$inboundSchema;
53
+ /** @deprecated use `RolesGetByIdRequest$outboundSchema` instead. */
54
+ export const outboundSchema = RolesGetByIdRequest$outboundSchema;
55
+ /** @deprecated use `RolesGetByIdRequest$Outbound` instead. */
56
+ export type Outbound = RolesGetByIdRequest$Outbound;
57
+ }
58
+
59
+ export function rolesGetByIdRequestToJSON(
60
+ rolesGetByIdRequest: RolesGetByIdRequest,
61
+ ): string {
62
+ return JSON.stringify(
63
+ RolesGetByIdRequest$outboundSchema.parse(rolesGetByIdRequest),
64
+ );
65
+ }
66
+
67
+ export function rolesGetByIdRequestFromJSON(
68
+ jsonString: string,
69
+ ): SafeParseResult<RolesGetByIdRequest, SDKValidationError> {
70
+ return safeParse(
71
+ jsonString,
72
+ (x) => RolesGetByIdRequest$inboundSchema.parse(JSON.parse(x)),
73
+ `Failed to parse 'RolesGetByIdRequest' from JSON`,
74
+ );
75
+ }