import type { Square } from "square" import { defineSquareOperation } from "../lib" /** * Creates or updates [custom attributes](entity:CustomAttribute) for customer * profiles as a bulk operation. */ export const bulkUpsertSquareCustomerCustomAttributes = defineSquareOperation< Square.customers.BatchUpsertCustomerCustomAttributesRequest, Square.BatchUpsertCustomerCustomAttributesResponse >({ allowedKeys: ["values"], description: "Creates or updates [custom attributes](entity:CustomAttribute) for customer profiles as a bulk operation.", execute: (api, input) => api.customers.customAttributeDefinitions.batchUpsert(input), name: "Bulk Square Upsert Customer Custom Attributes", replaySafety: "unsafe", requiredKeys: ["values"], scopes: ["CUSTOMERS_WRITE"], }) /** * Creates a customer-related [custom attribute * definition](entity:CustomAttributeDefinition) for a Square seller account. */ export const createSquareCustomerCustomAttributeDefinition = defineSquareOperation< Square.customers.CreateCustomerCustomAttributeDefinitionRequest, Square.CreateCustomerCustomAttributeDefinitionResponse >({ allowedKeys: ["customAttributeDefinition", "idempotencyKey"], description: "Creates a customer-related [custom attribute definition](entity:CustomAttributeDefinition) for a Square seller account.", execute: (api, input) => api.customers.customAttributeDefinitions.create(input), name: "Create Square Customer Custom Attribute Definition", replaySafety: "unsafe", requiredKeys: ["customAttributeDefinition"], scopes: ["CUSTOMERS_WRITE"], }) /** * Deletes a [custom attribute](entity:CustomAttribute) associated with a * customer profile. */ export const deleteSquareCustomerCustomAttribute = defineSquareOperation< Square.customers.DeleteCustomAttributesRequest, Square.DeleteCustomerCustomAttributeResponse >({ allowedKeys: ["customerId", "key"], description: "Deletes a [custom attribute](entity:CustomAttribute) associated with a customer profile.", execute: (api, input) => api.customers.customAttributes.delete(input), name: "Delete Square Customer Custom Attribute", replaySafety: "safe", requiredKeys: ["customerId", "key"], scopes: ["CUSTOMERS_WRITE"], }) /** * Deletes a customer-related [custom attribute * definition](entity:CustomAttributeDefinition) from a Square seller account. */ export const deleteSquareCustomerCustomAttributeDefinition = defineSquareOperation< Square.customers.DeleteCustomAttributeDefinitionsRequest, Square.DeleteCustomerCustomAttributeDefinitionResponse >({ allowedKeys: ["key"], description: "Deletes a customer-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account.", execute: (api, input) => api.customers.customAttributeDefinitions.delete(input), name: "Delete Square Customer Custom Attribute Definition", replaySafety: "safe", requiredKeys: ["key"], scopes: ["CUSTOMERS_WRITE"], }) /** * Lists the customer-related [custom attribute * definitions](entity:CustomAttributeDefinition) that belong to a Square seller * account. */ export const listSquareCustomerCustomAttributeDefinitions = defineSquareOperation< Square.customers.ListCustomAttributeDefinitionsRequest, Square.ListCustomerCustomAttributeDefinitionsResponse >({ allowedKeys: ["limit", "cursor"], description: "Lists the customer-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account.", execute: (api, input) => api.customers.customAttributeDefinitions.list(input), name: "List Square Customer Custom Attribute Definitions", replaySafety: "safe", requiredKeys: [], scopes: ["CUSTOMERS_READ"], }) /** * Lists the [custom attributes](entity:CustomAttribute) associated with a * customer profile. */ export const listSquareCustomerCustomAttributes = defineSquareOperation< Square.customers.ListCustomAttributesRequest, Square.ListCustomerCustomAttributesResponse >({ allowedKeys: ["customerId", "limit", "cursor", "withDefinitions"], description: "Lists the [custom attributes](entity:CustomAttribute) associated with a customer profile.", execute: (api, input) => api.customers.customAttributes.list(input), name: "List Square Customer Custom Attributes", replaySafety: "safe", requiredKeys: ["customerId"], scopes: ["CUSTOMERS_READ"], }) /** * Retrieves a [custom attribute](entity:CustomAttribute) associated with a * customer profile. */ export const retrieveSquareCustomerCustomAttribute = defineSquareOperation< Square.customers.GetCustomAttributesRequest, Square.GetCustomerCustomAttributeResponse >({ allowedKeys: ["customerId", "key", "withDefinition", "version"], description: "Retrieves a [custom attribute](entity:CustomAttribute) associated with a customer profile.", execute: (api, input) => api.customers.customAttributes.get(input), name: "Retrieve Square Customer Custom Attribute", replaySafety: "safe", requiredKeys: ["customerId", "key"], scopes: ["CUSTOMERS_READ"], }) /** * Retrieves a customer-related [custom attribute * definition](entity:CustomAttributeDefinition) from a Square seller account. */ export const retrieveSquareCustomerCustomAttributeDefinition = defineSquareOperation< Square.customers.GetCustomAttributeDefinitionsRequest, Square.GetCustomerCustomAttributeDefinitionResponse >({ allowedKeys: ["key", "version"], description: "Retrieves a customer-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account.", execute: (api, input) => api.customers.customAttributeDefinitions.get(input), name: "Retrieve Square Customer Custom Attribute Definition", replaySafety: "safe", requiredKeys: ["key"], scopes: ["CUSTOMERS_READ"], }) /** * Updates a customer-related [custom attribute * definition](entity:CustomAttributeDefinition) for a Square seller account. */ export const updateSquareCustomerCustomAttributeDefinition = defineSquareOperation< Square.customers.UpdateCustomerCustomAttributeDefinitionRequest, Square.UpdateCustomerCustomAttributeDefinitionResponse >({ allowedKeys: ["key", "customAttributeDefinition", "idempotencyKey"], description: "Updates a customer-related [custom attribute definition](entity:CustomAttributeDefinition) for a Square seller account.", execute: (api, input) => api.customers.customAttributeDefinitions.update(input), name: "Update Square Customer Custom Attribute Definition", replaySafety: "safe", requiredKeys: ["key", "customAttributeDefinition"], scopes: ["CUSTOMERS_WRITE"], }) /** * Creates or updates a [custom attribute](entity:CustomAttribute) for a * customer profile. */ export const upsertSquareCustomerCustomAttribute = defineSquareOperation< Square.customers.UpsertCustomerCustomAttributeRequest, Square.UpsertCustomerCustomAttributeResponse >({ allowedKeys: ["customerId", "key", "customAttribute", "idempotencyKey"], description: "Creates or updates a [custom attribute](entity:CustomAttribute) for a customer profile.", execute: (api, input) => api.customers.customAttributes.upsert(input), name: "Upsert Square Customer Custom Attribute", replaySafety: "unsafe", requiredKeys: ["customerId", "key", "customAttribute"], scopes: ["CUSTOMERS_WRITE"], })