import type { Square } from "square" import { defineSquareOperation } from "../lib" /** Bulk deletes bookings custom attributes. */ export const bulkDeleteSquareBookingCustomAttributes = defineSquareOperation< Square.bookings.BulkDeleteBookingCustomAttributesRequest, Square.BulkDeleteBookingCustomAttributesResponse >({ allowedKeys: ["values"], description: "Bulk deletes bookings custom attributes.", execute: (api, input) => api.bookings.customAttributes.batchDelete(input), name: "Bulk Square Delete Booking Custom Attributes", replaySafety: "unsafe", requiredKeys: ["values"], scopes: ["APPOINTMENTS_WRITE"], }) /** Bulk upserts bookings custom attributes. */ export const bulkUpsertSquareBookingCustomAttributes = defineSquareOperation< Square.bookings.BulkUpsertBookingCustomAttributesRequest, Square.BulkUpsertBookingCustomAttributesResponse >({ allowedKeys: ["values"], description: "Bulk upserts bookings custom attributes.", execute: (api, input) => api.bookings.customAttributes.batchUpsert(input), name: "Bulk Square Upsert Booking Custom Attributes", replaySafety: "unsafe", requiredKeys: ["values"], scopes: ["APPOINTMENTS_WRITE"], }) /** Creates a bookings custom attribute definition. */ export const createSquareBookingCustomAttributeDefinition = defineSquareOperation< Square.bookings.CreateBookingCustomAttributeDefinitionRequest, Square.CreateBookingCustomAttributeDefinitionResponse >({ allowedKeys: ["customAttributeDefinition", "idempotencyKey"], description: "Creates a bookings custom attribute definition.", execute: (api, input) => api.bookings.customAttributeDefinitions.create(input), name: "Create Square Booking Custom Attribute Definition", replaySafety: "unsafe", requiredKeys: ["customAttributeDefinition"], scopes: ["APPOINTMENTS_WRITE"], }) /** Deletes a bookings custom attribute. */ export const deleteSquareBookingCustomAttribute = defineSquareOperation< Square.bookings.DeleteCustomAttributesRequest, Square.DeleteBookingCustomAttributeResponse >({ allowedKeys: ["bookingId", "key"], description: "Deletes a bookings custom attribute.", execute: (api, input) => api.bookings.customAttributes.delete(input), name: "Delete Square Booking Custom Attribute", replaySafety: "safe", requiredKeys: ["bookingId", "key"], scopes: ["APPOINTMENTS_WRITE"], }) /** Deletes a bookings custom attribute definition. */ export const deleteSquareBookingCustomAttributeDefinition = defineSquareOperation< Square.bookings.DeleteCustomAttributeDefinitionsRequest, Square.DeleteBookingCustomAttributeDefinitionResponse >({ allowedKeys: ["key"], description: "Deletes a bookings custom attribute definition.", execute: (api, input) => api.bookings.customAttributeDefinitions.delete(input), name: "Delete Square Booking Custom Attribute Definition", replaySafety: "safe", requiredKeys: ["key"], scopes: ["APPOINTMENTS_WRITE"], }) /** Get all bookings custom attribute definitions. */ export const listSquareBookingCustomAttributeDefinitions = defineSquareOperation< Square.bookings.ListCustomAttributeDefinitionsRequest, Square.ListBookingCustomAttributeDefinitionsResponse >({ allowedKeys: ["limit", "cursor"], description: "Get all bookings custom attribute definitions.", execute: (api, input) => api.bookings.customAttributeDefinitions.list(input), name: "List Square Booking Custom Attribute Definitions", replaySafety: "safe", requiredKeys: [], scopes: ["APPOINTMENTS_READ"], }) /** Lists a booking's custom attributes. */ export const listSquareBookingCustomAttributes = defineSquareOperation< Square.bookings.ListCustomAttributesRequest, Square.ListBookingCustomAttributesResponse >({ allowedKeys: ["bookingId", "limit", "cursor", "withDefinitions"], description: "Lists a booking's custom attributes.", execute: (api, input) => api.bookings.customAttributes.list(input), name: "List Square Booking Custom Attributes", replaySafety: "safe", requiredKeys: ["bookingId"], scopes: ["APPOINTMENTS_READ"], }) /** Retrieves a bookings custom attribute. */ export const retrieveSquareBookingCustomAttribute = defineSquareOperation< Square.bookings.GetCustomAttributesRequest, Square.RetrieveBookingCustomAttributeResponse >({ allowedKeys: ["bookingId", "key", "withDefinition", "version"], description: "Retrieves a bookings custom attribute.", execute: (api, input) => api.bookings.customAttributes.get(input), name: "Retrieve Square Booking Custom Attribute", replaySafety: "safe", requiredKeys: ["bookingId", "key"], scopes: ["APPOINTMENTS_READ"], }) /** Retrieves a bookings custom attribute definition. */ export const retrieveSquareBookingCustomAttributeDefinition = defineSquareOperation< Square.bookings.GetCustomAttributeDefinitionsRequest, Square.RetrieveBookingCustomAttributeDefinitionResponse >({ allowedKeys: ["key", "version"], description: "Retrieves a bookings custom attribute definition.", execute: (api, input) => api.bookings.customAttributeDefinitions.get(input), name: "Retrieve Square Booking Custom Attribute Definition", replaySafety: "safe", requiredKeys: ["key"], scopes: ["APPOINTMENTS_READ"], }) /** Updates a bookings custom attribute definition. */ export const updateSquareBookingCustomAttributeDefinition = defineSquareOperation< Square.bookings.UpdateBookingCustomAttributeDefinitionRequest, Square.UpdateBookingCustomAttributeDefinitionResponse >({ allowedKeys: ["key", "customAttributeDefinition", "idempotencyKey"], description: "Updates a bookings custom attribute definition.", execute: (api, input) => api.bookings.customAttributeDefinitions.update(input), name: "Update Square Booking Custom Attribute Definition", replaySafety: "safe", requiredKeys: ["key", "customAttributeDefinition"], scopes: ["APPOINTMENTS_WRITE"], }) /** Upserts a bookings custom attribute. */ export const upsertSquareBookingCustomAttribute = defineSquareOperation< Square.bookings.UpsertBookingCustomAttributeRequest, Square.UpsertBookingCustomAttributeResponse >({ allowedKeys: ["bookingId", "key", "customAttribute", "idempotencyKey"], description: "Upserts a bookings custom attribute.", execute: (api, input) => api.bookings.customAttributes.upsert(input), name: "Upsert Square Booking Custom Attribute", replaySafety: "safe", requiredKeys: ["bookingId", "key", "customAttribute"], scopes: ["APPOINTMENTS_WRITE"], })