attio-js
Version:
Developer-friendly & type-safe JS/TS SDK based on the official OpenAPI spec of Attio.
144 lines • 6.81 kB
JavaScript
"use strict";
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetV2TasksResponse$ = exports.GetV2TasksResponse$outboundSchema = exports.GetV2TasksResponse$inboundSchema = exports.GetV2TasksRequest$ = exports.GetV2TasksRequest$outboundSchema = exports.GetV2TasksRequest$inboundSchema = exports.GetV2TasksSort$ = exports.GetV2TasksSort$outboundSchema = exports.GetV2TasksSort$inboundSchema = exports.GetV2TasksSort = void 0;
exports.getV2TasksRequestToJSON = getV2TasksRequestToJSON;
exports.getV2TasksRequestFromJSON = getV2TasksRequestFromJSON;
exports.getV2TasksResponseToJSON = getV2TasksResponseToJSON;
exports.getV2TasksResponseFromJSON = getV2TasksResponseFromJSON;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
const task_js_1 = require("../components/task.js");
/**
* Optionally sort the results. "created_at:asc" returns oldest results first, "created_at:desc" returns the newest results first. If unspecified, defaults to "created_at:asc" (oldest results first).
*/
exports.GetV2TasksSort = {
CreatedAtAsc: "created_at:asc",
CreatedAtDesc: "created_at:desc",
};
/** @internal */
exports.GetV2TasksSort$inboundSchema = z.nativeEnum(exports.GetV2TasksSort);
/** @internal */
exports.GetV2TasksSort$outboundSchema = exports.GetV2TasksSort$inboundSchema;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
var GetV2TasksSort$;
(function (GetV2TasksSort$) {
/** @deprecated use `GetV2TasksSort$inboundSchema` instead. */
GetV2TasksSort$.inboundSchema = exports.GetV2TasksSort$inboundSchema;
/** @deprecated use `GetV2TasksSort$outboundSchema` instead. */
GetV2TasksSort$.outboundSchema = exports.GetV2TasksSort$outboundSchema;
})(GetV2TasksSort$ || (exports.GetV2TasksSort$ = GetV2TasksSort$ = {}));
/** @internal */
exports.GetV2TasksRequest$inboundSchema = z.object({
limit: z.number().int().optional(),
offset: z.number().int().optional(),
sort: exports.GetV2TasksSort$inboundSchema.optional(),
linked_object: z.string().optional(),
linked_record_id: z.string().optional(),
assignee: z.nullable(z.string()).optional(),
is_completed: z.boolean().optional(),
}).transform((v) => {
return (0, primitives_js_1.remap)(v, {
"linked_object": "linkedObject",
"linked_record_id": "linkedRecordId",
"is_completed": "isCompleted",
});
});
/** @internal */
exports.GetV2TasksRequest$outboundSchema = z.object({
limit: z.number().int().optional(),
offset: z.number().int().optional(),
sort: exports.GetV2TasksSort$outboundSchema.optional(),
linkedObject: z.string().optional(),
linkedRecordId: z.string().optional(),
assignee: z.nullable(z.string()).optional(),
isCompleted: z.boolean().optional(),
}).transform((v) => {
return (0, primitives_js_1.remap)(v, {
linkedObject: "linked_object",
linkedRecordId: "linked_record_id",
isCompleted: "is_completed",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
var GetV2TasksRequest$;
(function (GetV2TasksRequest$) {
/** @deprecated use `GetV2TasksRequest$inboundSchema` instead. */
GetV2TasksRequest$.inboundSchema = exports.GetV2TasksRequest$inboundSchema;
/** @deprecated use `GetV2TasksRequest$outboundSchema` instead. */
GetV2TasksRequest$.outboundSchema = exports.GetV2TasksRequest$outboundSchema;
})(GetV2TasksRequest$ || (exports.GetV2TasksRequest$ = GetV2TasksRequest$ = {}));
function getV2TasksRequestToJSON(getV2TasksRequest) {
return JSON.stringify(exports.GetV2TasksRequest$outboundSchema.parse(getV2TasksRequest));
}
function getV2TasksRequestFromJSON(jsonString) {
return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.GetV2TasksRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV2TasksRequest' from JSON`);
}
/** @internal */
exports.GetV2TasksResponse$inboundSchema = z.object({
data: z.array(task_js_1.Task$inboundSchema),
});
/** @internal */
exports.GetV2TasksResponse$outboundSchema = z.object({
data: z.array(task_js_1.Task$outboundSchema),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
var GetV2TasksResponse$;
(function (GetV2TasksResponse$) {
/** @deprecated use `GetV2TasksResponse$inboundSchema` instead. */
GetV2TasksResponse$.inboundSchema = exports.GetV2TasksResponse$inboundSchema;
/** @deprecated use `GetV2TasksResponse$outboundSchema` instead. */
GetV2TasksResponse$.outboundSchema = exports.GetV2TasksResponse$outboundSchema;
})(GetV2TasksResponse$ || (exports.GetV2TasksResponse$ = GetV2TasksResponse$ = {}));
function getV2TasksResponseToJSON(getV2TasksResponse) {
return JSON.stringify(exports.GetV2TasksResponse$outboundSchema.parse(getV2TasksResponse));
}
function getV2TasksResponseFromJSON(jsonString) {
return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.GetV2TasksResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetV2TasksResponse' from JSON`);
}
//# sourceMappingURL=getv2tasks.js.map