import type { Square } from "square" import { defineSquareOperation } from "../lib" /** * Creates one or more [Vendor](entity:Vendor) objects to represent suppliers to * a seller. */ export const bulkCreateSquareVendors = defineSquareOperation< Square.BatchCreateVendorsRequest, Square.BatchCreateVendorsResponse >({ allowedKeys: ["vendors"], description: "Creates one or more [Vendor](entity:Vendor) objects to represent suppliers to a seller.", execute: (api, input) => api.vendors.batchCreate(input), name: "Bulk Square Create Vendors", replaySafety: "unsafe", requiredKeys: ["vendors"], scopes: ["VENDOR_WRITE"], }) /** Retrieves one or more vendors of specified [Vendor](entity:Vendor) IDs. */ export const bulkRetrieveSquareVendors = defineSquareOperation< Square.BatchGetVendorsRequest, Square.BatchGetVendorsResponse >({ allowedKeys: ["vendorIds"], description: "Retrieves one or more vendors of specified [Vendor](entity:Vendor) IDs.", execute: (api, input) => api.vendors.batchGet(input), name: "Bulk Square Retrieve Vendors", replaySafety: "safe", requiredKeys: [], scopes: ["VENDOR_READ"], }) /** * Updates one or more of existing [Vendor](entity:Vendor) objects as suppliers * to a seller. */ export const bulkUpdateSquareVendors = defineSquareOperation< Square.BatchUpdateVendorsRequest, Square.BatchUpdateVendorsResponse >({ allowedKeys: ["vendors"], description: "Updates one or more of existing [Vendor](entity:Vendor) objects as suppliers to a seller.", execute: (api, input) => api.vendors.batchUpdate(input), name: "Bulk Square Update Vendors", replaySafety: "safe", requiredKeys: ["vendors"], scopes: ["VENDOR_WRITE"], }) /** * Creates a single [Vendor](entity:Vendor) object to represent a supplier to a * seller. */ export const createSquareVendor = defineSquareOperation< Square.CreateVendorRequest, Square.CreateVendorResponse >({ allowedKeys: ["idempotencyKey", "vendor"], description: "Creates a single [Vendor](entity:Vendor) object to represent a supplier to a seller.", execute: (api, input) => api.vendors.create(input), name: "Create Square Vendor", replaySafety: "safe", requiredKeys: ["idempotencyKey"], scopes: ["VENDOR_WRITE"], }) /** Retrieves the vendor of a specified [Vendor](entity:Vendor) ID. */ export const retrieveSquareVendor = defineSquareOperation< Square.GetVendorsRequest, Square.GetVendorResponse >({ allowedKeys: ["vendorId"], description: "Retrieves the vendor of a specified [Vendor](entity:Vendor) ID.", execute: (api, input) => api.vendors.get(input), name: "Retrieve Square Vendor", replaySafety: "safe", requiredKeys: ["vendorId"], scopes: ["VENDOR_READ"], }) /** * Searches for vendors using a filter against supported [Vendor](entity:Vendor) * properties and a supported sorter. */ export const searchSquareVendors = defineSquareOperation< Square.SearchVendorsRequest, Square.SearchVendorsResponse >({ allowedKeys: ["filter", "sort", "cursor"], description: "Searches for vendors using a filter against supported [Vendor](entity:Vendor) properties and a supported sorter.", execute: (api, input) => api.vendors.search(input), name: "Search Square Vendors", replaySafety: "safe", requiredKeys: [], scopes: ["VENDOR_READ"], }) /** Updates an existing [Vendor](entity:Vendor) object as a supplier to a seller. */ export const updateSquareVendor = defineSquareOperation< Square.UpdateVendorsRequest, Square.UpdateVendorResponse >({ allowedKeys: ["vendorId", "body"], description: "Updates an existing [Vendor](entity:Vendor) object as a supplier to a seller.", execute: (api, input) => api.vendors.update(input), name: "Update Square Vendor", replaySafety: "safe", requiredKeys: ["vendorId", "body"], scopes: ["VENDOR_WRITE"], })