import type { Square } from "square" import { defineSquareOperation } from "../lib" /** * Deletes [custom attributes](entity:CustomAttribute) for locations as a bulk * operation. */ export const bulkDeleteSquareLocationCustomAttributes = defineSquareOperation< Square.locations.BulkDeleteLocationCustomAttributesRequest, Square.BulkDeleteLocationCustomAttributesResponse >({ allowedKeys: ["values"], description: "Deletes [custom attributes](entity:CustomAttribute) for locations as a bulk operation.", execute: (api, input) => api.locations.customAttributes.batchDelete(input), name: "Bulk Square Delete Location Custom Attributes", replaySafety: "unsafe", requiredKeys: ["values"], scopes: ["MERCHANT_PROFILE_WRITE"], }) /** * Creates or updates [custom attributes](entity:CustomAttribute) for locations * as a bulk operation. */ export const bulkUpsertSquareLocationCustomAttributes = defineSquareOperation< Square.locations.BulkUpsertLocationCustomAttributesRequest, Square.BulkUpsertLocationCustomAttributesResponse >({ allowedKeys: ["values"], description: "Creates or updates [custom attributes](entity:CustomAttribute) for locations as a bulk operation.", execute: (api, input) => api.locations.customAttributes.batchUpsert(input), name: "Bulk Square Upsert Location Custom Attributes", replaySafety: "unsafe", requiredKeys: ["values"], scopes: ["MERCHANT_PROFILE_WRITE"], }) /** * Creates a location-related [custom attribute * definition](entity:CustomAttributeDefinition) for a Square seller account. */ export const createSquareLocationCustomAttributeDefinition = defineSquareOperation< Square.locations.CreateLocationCustomAttributeDefinitionRequest, Square.CreateLocationCustomAttributeDefinitionResponse >({ allowedKeys: ["customAttributeDefinition", "idempotencyKey"], description: "Creates a location-related [custom attribute definition](entity:CustomAttributeDefinition) for a Square seller account.", execute: (api, input) => api.locations.customAttributeDefinitions.create(input), name: "Create Square Location Custom Attribute Definition", replaySafety: "unsafe", requiredKeys: ["customAttributeDefinition"], scopes: ["MERCHANT_PROFILE_WRITE"], }) /** * Deletes a [custom attribute](entity:CustomAttribute) associated with a * location. */ export const deleteSquareLocationCustomAttribute = defineSquareOperation< Square.locations.DeleteCustomAttributesRequest, Square.DeleteLocationCustomAttributeResponse >({ allowedKeys: ["locationId", "key"], description: "Deletes a [custom attribute](entity:CustomAttribute) associated with a location.", execute: (api, input) => api.locations.customAttributes.delete(input), name: "Delete Square Location Custom Attribute", replaySafety: "safe", requiredKeys: ["locationId", "key"], scopes: ["MERCHANT_PROFILE_WRITE"], }) /** * Deletes a location-related [custom attribute * definition](entity:CustomAttributeDefinition) from a Square seller account. */ export const deleteSquareLocationCustomAttributeDefinition = defineSquareOperation< Square.locations.DeleteCustomAttributeDefinitionsRequest, Square.DeleteLocationCustomAttributeDefinitionResponse >({ allowedKeys: ["key"], description: "Deletes a location-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account.", execute: (api, input) => api.locations.customAttributeDefinitions.delete(input), name: "Delete Square Location Custom Attribute Definition", replaySafety: "safe", requiredKeys: ["key"], scopes: ["MERCHANT_PROFILE_WRITE"], }) /** * Lists the location-related [custom attribute * definitions](entity:CustomAttributeDefinition) that belong to a Square seller * account. */ export const listSquareLocationCustomAttributeDefinitions = defineSquareOperation< Square.locations.ListCustomAttributeDefinitionsRequest, Square.ListLocationCustomAttributeDefinitionsResponse >({ allowedKeys: ["visibilityFilter", "limit", "cursor"], description: "Lists the location-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account.", execute: (api, input) => api.locations.customAttributeDefinitions.list(input), name: "List Square Location Custom Attribute Definitions", replaySafety: "safe", requiredKeys: [], scopes: ["MERCHANT_PROFILE_READ"], }) /** * Lists the [custom attributes](entity:CustomAttribute) associated with a * location. */ export const listSquareLocationCustomAttributes = defineSquareOperation< Square.locations.ListCustomAttributesRequest, Square.ListLocationCustomAttributesResponse >({ allowedKeys: [ "locationId", "visibilityFilter", "limit", "cursor", "withDefinitions", ], description: "Lists the [custom attributes](entity:CustomAttribute) associated with a location.", execute: (api, input) => api.locations.customAttributes.list(input), name: "List Square Location Custom Attributes", replaySafety: "safe", requiredKeys: ["locationId"], scopes: ["MERCHANT_PROFILE_READ"], }) /** * Retrieves a [custom attribute](entity:CustomAttribute) associated with a * location. */ export const retrieveSquareLocationCustomAttribute = defineSquareOperation< Square.locations.GetCustomAttributesRequest, Square.RetrieveLocationCustomAttributeResponse >({ allowedKeys: ["locationId", "key", "withDefinition", "version"], description: "Retrieves a [custom attribute](entity:CustomAttribute) associated with a location.", execute: (api, input) => api.locations.customAttributes.get(input), name: "Retrieve Square Location Custom Attribute", replaySafety: "safe", requiredKeys: ["locationId", "key"], scopes: ["MERCHANT_PROFILE_READ"], }) /** * Retrieves a location-related [custom attribute * definition](entity:CustomAttributeDefinition) from a Square seller account. */ export const retrieveSquareLocationCustomAttributeDefinition = defineSquareOperation< Square.locations.GetCustomAttributeDefinitionsRequest, Square.RetrieveLocationCustomAttributeDefinitionResponse >({ allowedKeys: ["key", "version"], description: "Retrieves a location-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account.", execute: (api, input) => api.locations.customAttributeDefinitions.get(input), name: "Retrieve Square Location Custom Attribute Definition", replaySafety: "safe", requiredKeys: ["key"], scopes: ["MERCHANT_PROFILE_READ"], }) /** * Updates a location-related [custom attribute * definition](entity:CustomAttributeDefinition) for a Square seller account. */ export const updateSquareLocationCustomAttributeDefinition = defineSquareOperation< Square.locations.UpdateLocationCustomAttributeDefinitionRequest, Square.UpdateLocationCustomAttributeDefinitionResponse >({ allowedKeys: ["key", "customAttributeDefinition", "idempotencyKey"], description: "Updates a location-related [custom attribute definition](entity:CustomAttributeDefinition) for a Square seller account.", execute: (api, input) => api.locations.customAttributeDefinitions.update(input), name: "Update Square Location Custom Attribute Definition", replaySafety: "safe", requiredKeys: ["key", "customAttributeDefinition"], scopes: ["MERCHANT_PROFILE_WRITE"], }) /** * Creates or updates a [custom attribute](entity:CustomAttribute) for a * location. */ export const upsertSquareLocationCustomAttribute = defineSquareOperation< Square.locations.UpsertLocationCustomAttributeRequest, Square.UpsertLocationCustomAttributeResponse >({ allowedKeys: ["locationId", "key", "customAttribute", "idempotencyKey"], description: "Creates or updates a [custom attribute](entity:CustomAttribute) for a location.", execute: (api, input) => api.locations.customAttributes.upsert(input), name: "Upsert Square Location Custom Attribute", replaySafety: "unsafe", requiredKeys: ["locationId", "key", "customAttribute"], scopes: ["MERCHANT_PROFILE_WRITE"], })