import type { Square } from "square" import { defineSquareOperation } from "../lib" /** * Deletes [custom attributes](entity:CustomAttribute) for a merchant as a bulk * operation. */ export const bulkDeleteSquareMerchantCustomAttributes = defineSquareOperation< Square.merchants.BulkDeleteMerchantCustomAttributesRequest, Square.BulkDeleteMerchantCustomAttributesResponse >({ allowedKeys: ["values"], description: "Deletes [custom attributes](entity:CustomAttribute) for a merchant as a bulk operation.", execute: (api, input) => api.merchants.customAttributes.batchDelete(input), name: "Bulk Square Delete Merchant Custom Attributes", replaySafety: "unsafe", requiredKeys: ["values"], scopes: ["MERCHANT_PROFILE_WRITE"], }) /** * Creates or updates [custom attributes](entity:CustomAttribute) for a merchant * as a bulk operation. */ export const bulkUpsertSquareMerchantCustomAttributes = defineSquareOperation< Square.merchants.BulkUpsertMerchantCustomAttributesRequest, Square.BulkUpsertMerchantCustomAttributesResponse >({ allowedKeys: ["values"], description: "Creates or updates [custom attributes](entity:CustomAttribute) for a merchant as a bulk operation.", execute: (api, input) => api.merchants.customAttributes.batchUpsert(input), name: "Bulk Square Upsert Merchant Custom Attributes", replaySafety: "unsafe", requiredKeys: ["values"], scopes: ["MERCHANT_PROFILE_WRITE"], }) /** * Creates a merchant-related [custom attribute * definition](entity:CustomAttributeDefinition) for a Square seller account. */ export const createSquareMerchantCustomAttributeDefinition = defineSquareOperation< Square.merchants.CreateMerchantCustomAttributeDefinitionRequest, Square.CreateMerchantCustomAttributeDefinitionResponse >({ allowedKeys: ["customAttributeDefinition", "idempotencyKey"], description: "Creates a merchant-related [custom attribute definition](entity:CustomAttributeDefinition) for a Square seller account.", execute: (api, input) => api.merchants.customAttributeDefinitions.create(input), name: "Create Square Merchant Custom Attribute Definition", replaySafety: "unsafe", requiredKeys: ["customAttributeDefinition"], scopes: ["MERCHANT_PROFILE_WRITE"], }) /** * Deletes a [custom attribute](entity:CustomAttribute) associated with a * merchant. */ export const deleteSquareMerchantCustomAttribute = defineSquareOperation< Square.merchants.DeleteCustomAttributesRequest, Square.DeleteMerchantCustomAttributeResponse >({ allowedKeys: ["merchantId", "key"], description: "Deletes a [custom attribute](entity:CustomAttribute) associated with a merchant.", execute: (api, input) => api.merchants.customAttributes.delete(input), name: "Delete Square Merchant Custom Attribute", replaySafety: "safe", requiredKeys: ["merchantId", "key"], scopes: ["MERCHANT_PROFILE_WRITE"], }) /** * Deletes a merchant-related [custom attribute * definition](entity:CustomAttributeDefinition) from a Square seller account. */ export const deleteSquareMerchantCustomAttributeDefinition = defineSquareOperation< Square.merchants.DeleteCustomAttributeDefinitionsRequest, Square.DeleteMerchantCustomAttributeDefinitionResponse >({ allowedKeys: ["key"], description: "Deletes a merchant-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account.", execute: (api, input) => api.merchants.customAttributeDefinitions.delete(input), name: "Delete Square Merchant Custom Attribute Definition", replaySafety: "safe", requiredKeys: ["key"], scopes: ["MERCHANT_PROFILE_WRITE"], }) /** * Lists the merchant-related [custom attribute * definitions](entity:CustomAttributeDefinition) that belong to a Square seller * account. */ export const listSquareMerchantCustomAttributeDefinitions = defineSquareOperation< Square.merchants.ListCustomAttributeDefinitionsRequest, Square.ListMerchantCustomAttributeDefinitionsResponse >({ allowedKeys: ["visibilityFilter", "limit", "cursor"], description: "Lists the merchant-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account.", execute: (api, input) => api.merchants.customAttributeDefinitions.list(input), name: "List Square Merchant Custom Attribute Definitions", replaySafety: "safe", requiredKeys: [], scopes: ["MERCHANT_PROFILE_READ"], }) /** * Lists the [custom attributes](entity:CustomAttribute) associated with a * merchant. */ export const listSquareMerchantCustomAttributes = defineSquareOperation< Square.merchants.ListCustomAttributesRequest, Square.ListMerchantCustomAttributesResponse >({ allowedKeys: [ "merchantId", "visibilityFilter", "limit", "cursor", "withDefinitions", ], description: "Lists the [custom attributes](entity:CustomAttribute) associated with a merchant.", execute: (api, input) => api.merchants.customAttributes.list(input), name: "List Square Merchant Custom Attributes", replaySafety: "safe", requiredKeys: ["merchantId"], scopes: ["MERCHANT_PROFILE_READ"], }) /** * Retrieves a [custom attribute](entity:CustomAttribute) associated with a * merchant. */ export const retrieveSquareMerchantCustomAttribute = defineSquareOperation< Square.merchants.GetCustomAttributesRequest, Square.RetrieveMerchantCustomAttributeResponse >({ allowedKeys: ["merchantId", "key", "withDefinition", "version"], description: "Retrieves a [custom attribute](entity:CustomAttribute) associated with a merchant.", execute: (api, input) => api.merchants.customAttributes.get(input), name: "Retrieve Square Merchant Custom Attribute", replaySafety: "safe", requiredKeys: ["merchantId", "key"], scopes: ["MERCHANT_PROFILE_READ"], }) /** * Retrieves a merchant-related [custom attribute * definition](entity:CustomAttributeDefinition) from a Square seller account. */ export const retrieveSquareMerchantCustomAttributeDefinition = defineSquareOperation< Square.merchants.GetCustomAttributeDefinitionsRequest, Square.RetrieveMerchantCustomAttributeDefinitionResponse >({ allowedKeys: ["key", "version"], description: "Retrieves a merchant-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account.", execute: (api, input) => api.merchants.customAttributeDefinitions.get(input), name: "Retrieve Square Merchant Custom Attribute Definition", replaySafety: "safe", requiredKeys: ["key"], scopes: ["MERCHANT_PROFILE_READ"], }) /** * Updates a merchant-related [custom attribute * definition](entity:CustomAttributeDefinition) for a Square seller account. */ export const updateSquareMerchantCustomAttributeDefinition = defineSquareOperation< Square.merchants.UpdateMerchantCustomAttributeDefinitionRequest, Square.UpdateMerchantCustomAttributeDefinitionResponse >({ allowedKeys: ["key", "customAttributeDefinition", "idempotencyKey"], description: "Updates a merchant-related [custom attribute definition](entity:CustomAttributeDefinition) for a Square seller account.", execute: (api, input) => api.merchants.customAttributeDefinitions.update(input), name: "Update Square Merchant Custom Attribute Definition", replaySafety: "safe", requiredKeys: ["key", "customAttributeDefinition"], scopes: ["MERCHANT_PROFILE_WRITE"], }) /** * Creates or updates a [custom attribute](entity:CustomAttribute) for a * merchant. */ export const upsertSquareMerchantCustomAttribute = defineSquareOperation< Square.merchants.UpsertMerchantCustomAttributeRequest, Square.UpsertMerchantCustomAttributeResponse >({ allowedKeys: ["merchantId", "key", "customAttribute", "idempotencyKey"], description: "Creates or updates a [custom attribute](entity:CustomAttribute) for a merchant.", execute: (api, input) => api.merchants.customAttributes.upsert(input), name: "Upsert Square Merchant Custom Attribute", replaySafety: "unsafe", requiredKeys: ["merchantId", "key", "customAttribute"], scopes: ["MERCHANT_PROFILE_WRITE"], })