import type { Square } from "square" import { defineSquareOperation } from "../lib" /** * Deletes order [custom attributes](entity:CustomAttribute) as a bulk * operation. */ export const bulkDeleteSquareOrderCustomAttributes = defineSquareOperation< Square.orders.BulkDeleteOrderCustomAttributesRequest, Square.BulkDeleteOrderCustomAttributesResponse >({ allowedKeys: ["values"], description: "Deletes order [custom attributes](entity:CustomAttribute) as a bulk operation.", execute: (api, input) => api.orders.customAttributes.batchDelete(input), name: "Bulk Square Delete Order Custom Attributes", replaySafety: "unsafe", requiredKeys: ["values"], scopes: ["ORDERS_WRITE"], }) /** * Creates or updates order [custom attributes](entity:CustomAttribute) as a * bulk operation. */ export const bulkUpsertSquareOrderCustomAttributes = defineSquareOperation< Square.orders.BulkUpsertOrderCustomAttributesRequest, Square.BulkUpsertOrderCustomAttributesResponse >({ allowedKeys: ["values"], description: "Creates or updates order [custom attributes](entity:CustomAttribute) as a bulk operation.", execute: (api, input) => api.orders.customAttributes.batchUpsert(input), name: "Bulk Square Upsert Order Custom Attributes", replaySafety: "unsafe", requiredKeys: ["values"], scopes: ["ORDERS_WRITE"], }) /** Creates an order-related custom attribute definition. */ export const createSquareOrderCustomAttributeDefinition = defineSquareOperation< Square.orders.CreateOrderCustomAttributeDefinitionRequest, Square.CreateOrderCustomAttributeDefinitionResponse >({ allowedKeys: ["customAttributeDefinition", "idempotencyKey"], description: "Creates an order-related custom attribute definition.", execute: (api, input) => api.orders.customAttributeDefinitions.create(input), name: "Create Square Order Custom Attribute Definition", replaySafety: "unsafe", requiredKeys: ["customAttributeDefinition"], scopes: ["ORDERS_WRITE"], }) /** * Deletes a [custom attribute](entity:CustomAttribute) associated with a * customer profile. */ export const deleteSquareOrderCustomAttribute = defineSquareOperation< Square.orders.DeleteCustomAttributesRequest, Square.DeleteOrderCustomAttributeResponse >({ allowedKeys: ["orderId", "customAttributeKey"], description: "Deletes a [custom attribute](entity:CustomAttribute) associated with a customer profile.", execute: (api, input) => api.orders.customAttributes.delete(input), name: "Delete Square Order Custom Attribute", replaySafety: "safe", requiredKeys: ["orderId", "customAttributeKey"], scopes: ["ORDERS_WRITE"], }) /** * Deletes an order-related [custom attribute * definition](entity:CustomAttributeDefinition) from a Square seller account. */ export const deleteSquareOrderCustomAttributeDefinition = defineSquareOperation< Square.orders.DeleteCustomAttributeDefinitionsRequest, Square.DeleteOrderCustomAttributeDefinitionResponse >({ allowedKeys: ["key"], description: "Deletes an order-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account.", execute: (api, input) => api.orders.customAttributeDefinitions.delete(input), name: "Delete Square Order Custom Attribute Definition", replaySafety: "safe", requiredKeys: ["key"], scopes: ["ORDERS_WRITE"], }) /** * Lists the order-related [custom attribute * definitions](entity:CustomAttributeDefinition) that belong to a Square seller * account. */ export const listSquareOrderCustomAttributeDefinitions = defineSquareOperation< Square.orders.ListCustomAttributeDefinitionsRequest, Square.ListOrderCustomAttributeDefinitionsResponse >({ allowedKeys: ["visibilityFilter", "cursor", "limit"], description: "Lists the order-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account.", execute: (api, input) => api.orders.customAttributeDefinitions.list(input), name: "List Square Order Custom Attribute Definitions", replaySafety: "safe", requiredKeys: [], scopes: ["ORDERS_READ"], }) /** * Lists the [custom attributes](entity:CustomAttribute) associated with an * order. */ export const listSquareOrderCustomAttributes = defineSquareOperation< Square.orders.ListCustomAttributesRequest, Square.ListOrderCustomAttributesResponse >({ allowedKeys: [ "orderId", "visibilityFilter", "cursor", "limit", "withDefinitions", ], description: "Lists the [custom attributes](entity:CustomAttribute) associated with an order.", execute: (api, input) => api.orders.customAttributes.list(input), name: "List Square Order Custom Attributes", replaySafety: "safe", requiredKeys: ["orderId"], scopes: ["ORDERS_READ"], }) /** * Retrieves a [custom attribute](entity:CustomAttribute) associated with an * order. */ export const retrieveSquareOrderCustomAttribute = defineSquareOperation< Square.orders.GetCustomAttributesRequest, Square.RetrieveOrderCustomAttributeResponse >({ allowedKeys: ["orderId", "customAttributeKey", "version", "withDefinition"], description: "Retrieves a [custom attribute](entity:CustomAttribute) associated with an order.", execute: (api, input) => api.orders.customAttributes.get(input), name: "Retrieve Square Order Custom Attribute", replaySafety: "safe", requiredKeys: ["orderId", "customAttributeKey"], scopes: ["ORDERS_READ"], }) /** * Retrieves an order-related [custom attribute * definition](entity:CustomAttributeDefinition) from a Square seller account. */ export const retrieveSquareOrderCustomAttributeDefinition = defineSquareOperation< Square.orders.GetCustomAttributeDefinitionsRequest, Square.RetrieveOrderCustomAttributeDefinitionResponse >({ allowedKeys: ["key", "version"], description: "Retrieves an order-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account.", execute: (api, input) => api.orders.customAttributeDefinitions.get(input), name: "Retrieve Square Order Custom Attribute Definition", replaySafety: "safe", requiredKeys: ["key"], scopes: ["ORDERS_READ"], }) /** * Updates an order-related custom attribute definition for a Square seller * account. */ export const updateSquareOrderCustomAttributeDefinition = defineSquareOperation< Square.orders.UpdateOrderCustomAttributeDefinitionRequest, Square.UpdateOrderCustomAttributeDefinitionResponse >({ allowedKeys: ["key", "customAttributeDefinition", "idempotencyKey"], description: "Updates an order-related custom attribute definition for a Square seller account.", execute: (api, input) => api.orders.customAttributeDefinitions.update(input), name: "Update Square Order Custom Attribute Definition", replaySafety: "safe", requiredKeys: ["key", "customAttributeDefinition"], scopes: ["ORDERS_WRITE"], }) /** Creates or updates a [custom attribute](entity:CustomAttribute) for an order. */ export const upsertSquareOrderCustomAttribute = defineSquareOperation< Square.orders.UpsertOrderCustomAttributeRequest, Square.UpsertOrderCustomAttributeResponse >({ allowedKeys: [ "orderId", "customAttributeKey", "customAttribute", "idempotencyKey", ], description: "Creates or updates a [custom attribute](entity:CustomAttribute) for an order.", execute: (api, input) => api.orders.customAttributes.upsert(input), name: "Upsert Square Order Custom Attribute", replaySafety: "unsafe", requiredKeys: ["orderId", "customAttributeKey", "customAttribute"], scopes: ["ORDERS_WRITE"], })