import type { Square } from "square" import { defineSquareOperation } from "../lib" /** Creates a new customer group for a business. */ export const createSquareCustomerGroup = defineSquareOperation< Square.customers.CreateCustomerGroupRequest, Square.CreateCustomerGroupResponse >({ allowedKeys: ["idempotencyKey", "group"], description: "Creates a new customer group for a business.", execute: (api, input) => api.customers.groups.create(input), name: "Create Square Customer Group", replaySafety: "unsafe", requiredKeys: ["group"], scopes: ["CUSTOMERS_WRITE"], }) /** Deletes a customer group as identified by the `group_id` value. */ export const deleteSquareCustomerGroup = defineSquareOperation< Square.customers.DeleteGroupsRequest, Square.DeleteCustomerGroupResponse >({ allowedKeys: ["groupId"], description: "Deletes a customer group as identified by the `group_id` value.", execute: (api, input) => api.customers.groups.delete(input), name: "Delete Square Customer Group", replaySafety: "safe", requiredKeys: ["groupId"], scopes: ["CUSTOMERS_WRITE"], }) /** Retrieves the list of customer groups of a business. */ export const listSquareCustomerGroups = defineSquareOperation< Square.customers.ListGroupsRequest, Square.ListCustomerGroupsResponse >({ allowedKeys: ["cursor", "limit"], description: "Retrieves the list of customer groups of a business.", execute: (api, input) => api.customers.groups.list(input), name: "List Square Customer Groups", replaySafety: "safe", requiredKeys: [], scopes: ["CUSTOMERS_READ"], }) /** Retrieves a specific customer group as identified by the `group_id` value. */ export const retrieveSquareCustomerGroup = defineSquareOperation< Square.customers.GetGroupsRequest, Square.GetCustomerGroupResponse >({ allowedKeys: ["groupId"], description: "Retrieves a specific customer group as identified by the `group_id` value.", execute: (api, input) => api.customers.groups.get(input), name: "Retrieve Square Customer Group", replaySafety: "safe", requiredKeys: ["groupId"], scopes: ["CUSTOMERS_READ"], }) /** Updates a customer group as identified by the `group_id` value. */ export const updateSquareCustomerGroup = defineSquareOperation< Square.customers.UpdateCustomerGroupRequest, Square.UpdateCustomerGroupResponse >({ allowedKeys: ["groupId", "group"], description: "Updates a customer group as identified by the `group_id` value.", execute: (api, input) => api.customers.groups.update(input), name: "Update Square Customer Group", replaySafety: "safe", requiredKeys: ["groupId", "group"], scopes: ["CUSTOMERS_WRITE"], })